Add a "watch" button to add/change notifications for datasets#2819
Open
robyngit wants to merge 11 commits into
Open
Add a "watch" button to add/change notifications for datasets#2819robyngit wants to merge 11 commits into
robyngit wants to merge 11 commits into
Conversation
- Install the current WIP notificationService package & add npm action to update in the future - Add config options to AppModel to enable/disable the notification service, set url, and set resource types Issue #2252
- Update to the current version of notification-service-js, which aligns with the new backend API. - Neither JS client nor backend are versioned yet Issue #2252
- Align view to use the recently updated notification-service-js library - Also fix a small bug where the client const was missing Issue #2252
- Configure notification resource types with labels and descriptions - Add Watch button wiring from dataset controls to NotificationServiceView - Implement modal loading, checkbox state, save diffing, unsubscribe handling, and cancel reset - Require a user email address before managing notification subscriptions - Fix user token promise handling for notification service requests Issue #2252
- Add BEM styling for the modal via MetacatUI.appModel.addCSS - Make signing and missing email errors more user-friendly and informative Issue #2252
- emit a saved event from NotificationServiceView after subscription changes are successfully saved - make DatasetControlsView briefly switch the Watch button to a checkmarked "Saved" state before restoring to normal Issue #2252
- Rename NotificationServiceView to NotificationModalView, remove model logic - Rename modal CSS to match the new modal view name - Add ObjectNotification model for setup checks, client creation, load/save state, and subscription diffs - Update DatasetControlsView to use the renamed modal view - Add unit tests Issue #2252
- Prevent the modal from updating itself with old data when a request finishes after auth/config has changed - Ignore outdated load and save results so they don't overwrite the current state - Add tests to cover stale loads and save success/failure cases Issue #2252
- Move notification model, view, specs, and screenshots into `notifications/` directories and update refs - In modal header, separate the "Manage notifications for" prefix from the dataset title, truncate long titles, & pin the close button to the upper-right (for consistency with other views) - Increase checkbox size, make full notification type rows clickable, and put modal sizing values in CSS custom properties Issue #2757
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a notification subscription modal for managing object-level notification subscriptions. It adds a "Watch" button from the dataset landing page that allows users open the modal for a dataset, review their current subscriptions, select or clear supported notification types, and save changes through the updated
notification-service-jslibrary.Changes
ObjectNotificationmodel to handle notification state, setup checks, current subscriptions, and save/unsubscribe logic.NotificationModalViewfor the dataset notification subscription UI.DatasetControlsView(conditionally, if the appModel has notifications turned on.)getTokenPromisemethod in UserModelObjectNotificationandNotificationModalView.Testing
The WIP notification service is available at
https://notifications.test.dataone.org/notifications. This demo expects tokens fromhttps://metacat-dev.test.dataone.org/. So the following app model options should be added for testing this modal:Note the full
notification-service-jslibrary that wraps all of thenotification-serviceAPI can be tested here: https://dataoneorg.github.io/notification-service-js/Closes #2757