This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request adds functionality for users to follow or mute comments at the dataset level or for a specific comment thread of a dataset.
Comment notifications (via email) are managed by opt-in. This gives users full control over which comments they will receive notifications for (or none).
When a user adds a new comment, or replies to an existing comment, they will automatically follow that thread.
Approach
Added a new setting in CKAN
.ini
fileckan.comments.follow_mute_enabled
to enable follow/mute UI (default: False).A new database model (
comment_notification_recipient
) was added to the extension. A paster command is also added to initialise the database table in the CKAN postgres database.Comment follow and mute routes were added to the extension, along with a controller class to handle requests via those routes.
A helper function file was created to isolate required functionality and enable reuse of those functions.
The comment list template was adjusted to add follow/mute related markup via template snippets, along with the necessary CSS, Javascript code and email notification templates.