-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/system notifications #228
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
Changes from all commits
ed79692
769d78b
d6c734d
ffcc5fc
c598ab9
3af638f
59b7b1f
7a2f7ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,14 +45,29 @@ describe('LeftSideNav', () => { | |
|
|
||
| const systemUsersIndex = linkTexts.indexOf('System Users'); | ||
| const agentsIndex = linkTexts.indexOf('Agents'); | ||
| const notificationsIndex = linkTexts.indexOf('Notifications'); | ||
| const risksIndex = linkTexts.indexOf('Risks'); | ||
| const subjectTemplatesIndex = linkTexts.indexOf('Subject Templates'); | ||
| const riskTemplatesIndex = linkTexts.indexOf('Risk Templates'); | ||
| const importIndex = linkTexts.indexOf('Import'); | ||
|
|
||
| for (const index of [ | ||
| systemUsersIndex, | ||
| agentsIndex, | ||
| notificationsIndex, | ||
| risksIndex, | ||
| subjectTemplatesIndex, | ||
| riskTemplatesIndex, | ||
| importIndex, | ||
| ]) { | ||
| expect(index).toBeGreaterThanOrEqual(0); | ||
| } | ||
|
|
||
| expect(systemUsersIndex).toBeGreaterThanOrEqual(0); | ||
| expect(agentsIndex).toBeGreaterThan(systemUsersIndex); | ||
| expect(risksIndex).toBeGreaterThan(agentsIndex); | ||
| expect(subjectTemplatesIndex).toBeGreaterThan(risksIndex); | ||
| expect(riskTemplatesIndex).toBeGreaterThan(subjectTemplatesIndex); | ||
| expect(notificationsIndex).toBeGreaterThan(riskTemplatesIndex); | ||
| expect(importIndex).toBeGreaterThan(notificationsIndex); | ||
|
Comment on lines
46
to
+71
|
||
| }); | ||
| }); | ||
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.
loadUserData()now usesPromise.all([... , axios.get('/api/notifications/providers')]), so any failure in the providers request will throw and setloadError, preventing the preferences page from loading even if/api/users/meand/api/users/me/subscriptionssucceeded. To avoid making preferences availability depend on this auxiliary endpoint, consider fetching providers withPromise.allSettledor a nested try/catch and falling back to a safe default (e.g. keep channels enabled / keep existing selections) when the providers call fails.