-
Notifications
You must be signed in to change notification settings - Fork 20
881 notifications with paging #901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 775-base
Are you sure you want to change the base?
Conversation
… cause 'isLoading' to flash on the NotificationsSection
jp-tosca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some comments, we also discussed that in the future we probably should create a mechanism for when a component makes an operation that may generate a notification it should trigger a refresh to check the most recent number of notifications, otherwise the user won't see the notifications until next update, not a big deal but probably would improve the user experience.
| "userGuideLinkText": "User Guide", | ||
| "demoServerLinkText": "Demo Site", | ||
| "clearAll": "Clear All", | ||
| "clearAllOnThisPage": "Clear Notifications", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this may make sense in the context it is used but do you think it would be good to have a key: "description" that is closer in meaning? "Clear notifications" is specific, while "clearAllOnThisPage" is very vague. 🤔
| import { PaginationInfo } from '../../../shared/pagination/domain/models/PaginationInfo' | ||
|
|
||
| export class NotificationsPaginationInfo extends PaginationInfo<NotificationsPaginationInfo> { | ||
| constructor(page = 1, pageSize = 10, totalItems = 0, itemName = 'result') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to have these parameters configurable somewhere outside the functions 😅
| <div>{t('notifications.displayingNotifications', { start, end, total })}</div> | ||
|
|
||
| {notifications.length > 0 && ( | ||
| <Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like the button’s behavior could be confusing. When there are multiple pages, the button says “Clear notifications”. The first time I saw that, I wasn’t sure—does it clear all notifications or just the ones on this page? After testing, I realized it only clears the current page, but that wasn’t obvious at first.
If there’s only one page, the text changes to “Clear all”, and in that case, it does clear everything.
This difference in wording and behavior feels inconsistent. I’d suggest making it static—something like “Clear all notifications”—and have it clear everything across all pages. We can chat more about this in standup.
| void (async () => { | ||
| await markAsRead(unreadIds) | ||
| setReadIds((prev) => [...prev, ...unreadIds]) | ||
| console.log('calling refetch after marking as read') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console log.
| .filter((n) => !n.displayAsRead && !readIds.includes(n.id)) | ||
| .map((n) => n.id) | ||
|
|
||
| console.log('in useEffect, unreadIds:', unreadIds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console log.
What this PR does / why we need it:
Adds paging to Notifications UI
Which issue(s) this PR closes:
Special notes for your reviewer:
I created a separate "base branch" because 775 actually has all the commits for 775 and 881.
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes or changelog update needed for this change?:
Additional documentation: