Skip to content

Conversation

@ekraffmiller
Copy link
Contributor

@ekraffmiller ekraffmiller commented Sep 9, 2025

What this PR does / why we need it:

Implements the Notifications tab of the Account Page.

Which issue(s) this PR closes:

Special notes for your reviewer:

This implementation uses a NotificationContext, and polling to get notification updates. I didn't add the icons next to the messages because I don't think they add much value, but if it's wanted I can add them.

Note that a

Suggestions on how to test this:

Do some actions in the SPA to trigger notifications. For example, create a new account, publish a dataset, upload a .csv file, or assign a role. The actions should update the Header to show the new unread notifications. Go to the Notifications tab to view them.

Note that a follow up PR will introduce paging, so that will handle the performance issues currently seen in JSF when there is a large amount of notifications.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Yes, rather than showing new notifications highlighted until the page is refreshed, as done in JSF, the SPA version of the page removes the highlight of the new notifications after a 2 second delay. After two seconds, the new notifications are marked as read, and the highlights are removed, and also the unread notifications badge is removed from the Header.

JSF Version

Screenshot 2025-09-24 at 2 39 29 PM

SPA Version

Screenshot 2025-09-24 at 2 38 49 PM

Is there a release notes update needed for this change?:

Additional documentation:

@coveralls
Copy link

coveralls commented Sep 9, 2025

Coverage Status

coverage: 97.786% (-0.04%) from 97.83%
when pulling 9899302 on 775-account-page-notifications
into 212fa23 on develop.

@g-saracca g-saracca removed their assignment Oct 15, 2025
@g-saracca g-saracca moved this from In Review 🔎 to In Progress 💻 in IQSS Dataverse Project Oct 15, 2025
@ekraffmiller ekraffmiller moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Oct 20, 2025
@ekraffmiller ekraffmiller removed their assignment Oct 21, 2025
@cmbz cmbz added the FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) label Oct 23, 2025
@g-saracca g-saracca moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Oct 27, 2025
@g-saracca g-saracca self-assigned this Oct 27, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments below, and are we good to switch to an alpha version of js-dataverse?


export function useNeedsUpdate() {
return useSyncExternalStore(needsUpdateStore.subscribe, needsUpdateStore.getSnapshot)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about including the needsUpdateStore.ts logic in this same file?
Just saying to avoid one more extra file..

const [notifications, setNotifications] = useState<Notification[]>([])
const [isLoading, setIsLoading] = useState(true)
const [error, setError] = useState<string | null>(null)
const { user } = useContext(SessionContext)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a hook to access session context -> const { user } = useSession()


getUnreadNotificationsCount(): Promise<number> {
return getUnreadNotificationsCount.execute().then((count) => {
console.log('Unread notifications count:', count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log

package.json Outdated
"i18next-browser-languagedetector": "7.0.1",
"i18next-http-backend": "2.1.1",
"js-md5": "0.8.3",
"lodash-es": "^4.17.21",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you remove the caret? to install fixed dependencies versions following the same way as other dependencies you need to run:
npm i --save --save-exact lodash-es.
Same for @types, but those should be npm i -D --save --save-exact @types/lodash (-D from devDependency)

@ekraffmiller
Copy link
Contributor Author

Thanks for the review @g-saracca! I made the suggested changes. I have to keep the PR version of js-dataverse because it is relying on a PR image of dataverse that hasn't been reviewed yet. So maybe best to keep it waiting until the PRs it depends on are ready.

@g-saracca
Copy link
Contributor

Thanks for addressing the changes ellen, approving PR!

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Oct 31, 2025
@g-saracca g-saracca removed their assignment Oct 31, 2025
@ofahimIQSS
Copy link
Contributor

merge conflicts :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 7 FY26 Sprint 7 (2025-09-24 - 2025-10-08) FY26 Sprint 8 FY26 Sprint 8 (2025-10-08 - 2025-10-22) FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q3.2025.6 Account Page: Notifications

Projects

Status: Ready for QA ⏩

Development

Successfully merging this pull request may close these issues.

Account Page: Notifications - UI Integration

6 participants