Skip to content
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

[EASI-3918] Notification Page 🎉 #988

Merged
merged 61 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
efaed70
Notification Center init
garyjzhao Feb 28, 2024
3346464
wip
garyjzhao Feb 28, 2024
e0c1746
add Notificiations to i18n files
garyjzhao Feb 28, 2024
998d9fa
add GetNotification and UpdateAllMessagesAsRead
garyjzhao Feb 28, 2024
da7f72b
Add queries loading data error
garyjzhao Feb 28, 2024
9d082ea
moved
garyjzhao Feb 28, 2024
4ac7972
working through building out the indiviidual notifications
garyjzhao Feb 29, 2024
f2c4755
clean up rebase confusion
garyjzhao Feb 29, 2024
bac4c8a
Add option to bold username
garyjzhao Feb 29, 2024
482ba05
Add more translation
garyjzhao Feb 29, 2024
8e0cd22
add InitialIcon
garyjzhao Feb 29, 2024
c678ce2
added a few thigns
garyjzhao Feb 29, 2024
59d8937
feat: add model plan id to tagged in discussion meta data
StevenWadeOddball Feb 29, 2024
f4eb759
feat: add discussion reply modelPlanID and modelPlan to resolver
StevenWadeOddball Feb 29, 2024
7eb9a92
feat: update postman collection
StevenWadeOddball Feb 29, 2024
bcf08e8
udpated gql
garyjzhao Mar 1, 2024
8df50c3
add more a few more gql
garyjzhao Mar 1, 2024
499eb88
Adding in the Content
garyjzhao Mar 1, 2024
d23900b
add more translations
garyjzhao Mar 1, 2024
2739c75
Filling out more of the tagged in discussion notificaiton
garyjzhao Mar 1, 2024
a43bdd9
add date to the query
garyjzhao Mar 1, 2024
88fc53f
add date
garyjzhao Mar 1, 2024
7bc48f2
add gray color for read notifications
garyjzhao Mar 1, 2024
a3a1f65
using other icons
garyjzhao Mar 1, 2024
4a8fe5c
hide content when mobile
garyjzhao Mar 1, 2024
a622e1d
adjust some flex
garyjzhao Mar 1, 2024
d26f768
feat: order notifications from newest to oldest
StevenWadeOddball Mar 1, 2024
897cebc
working on individual mark as read
garyjzhao Mar 1, 2024
dae0909
clean up code
garyjzhao Mar 1, 2024
8f5ba30
add new mutation
garyjzhao Mar 4, 2024
e733996
Rename mutation from update messages to update notifications
garyjzhao Mar 4, 2024
6019a17
add handling mark individual notifcations as read
garyjzhao Mar 4, 2024
8f25536
Pagination is now working
garyjzhao Mar 4, 2024
46484ab
wrap margin around notificatoins
garyjzhao Mar 4, 2024
1cd658d
code clean up
garyjzhao Mar 4, 2024
e89e14f
reran sd gql
garyjzhao Mar 4, 2024
6120c9b
updated notifcation settings test name
garyjzhao Mar 4, 2024
169dd1c
export porops
garyjzhao Mar 4, 2024
77bb734
udpate snaps
garyjzhao Mar 4, 2024
290b2bd
Notifications Home test
garyjzhao Mar 4, 2024
26dfbb0
added notification e2e -- wip
garyjzhao Mar 4, 2024
85ba37b
adding different test ids to help with cypress test
garyjzhao Mar 5, 2024
aa27d61
wip cypres test
garyjzhao Mar 5, 2024
9ba87bf
typoed the file name
garyjzhao Mar 5, 2024
be983c6
adding different test ids to help with cypress test
garyjzhao Mar 5, 2024
f0e20f9
notification cypress test
garyjzhao Mar 5, 2024
0771be2
log in as JTTC, instead of MINT
garyjzhao Mar 5, 2024
472f9c9
adjust some mobile margins
garyjzhao Mar 5, 2024
4b17f21
this is better
garyjzhao Mar 5, 2024
dbfd4fe
using columns
garyjzhao Mar 5, 2024
cdceb21
color of tagged names are gray in notification center
garyjzhao Mar 5, 2024
8b4e4d2
style updates
garyjzhao Mar 5, 2024
3e8f51b
remove unused code
garyjzhao Mar 5, 2024
e5cd30a
update snaps
garyjzhao Mar 5, 2024
6cd7a9b
adjust some padding
garyjzhao Mar 6, 2024
0996762
adjustments made to account for responsiveness
garyjzhao Mar 6, 2024
d25f928
temporarily do not render tagged in discussion reply
garyjzhao Mar 6, 2024
a8be7ed
update snaps
garyjzhao Mar 6, 2024
d157d15
making some adjustments for future version
garyjzhao Mar 6, 2024
fabd849
making some adjustments for future version
garyjzhao Mar 6, 2024
56acd69
update snaps
garyjzhao Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MINT.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@
"body": {
"mode": "graphql",
"graphql": {
"query": "query currentUser {\n currentUser {\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"query": "query currentUser {\n currentUser {\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"variables": ""
}
},
Expand Down Expand Up @@ -2244,7 +2244,7 @@
"body": {
"mode": "graphql",
"graphql": {
"query": "query currentUser {\n currentUser {\n launchDarkly {\n userKey\n }\n account {\n commonName\n email\n }\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"query": "query currentUser {\n currentUser {\n launchDarkly {\n userKey\n }\n account {\n commonName\n email\n }\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"variables": "{}"
}
},
Expand Down
112 changes: 112 additions & 0 deletions cypress/e2e/notification.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
describe('Notification Center', () => {
beforeEach(() => {
cy.localLogin({ name: 'JTTC', role: 'MINT_ASSESSMENT_NONPROD' });
});

it('navigates through the Notification page', () => {
cy.clickPlanTableByName('Empty Plan');

cy.contains('button', 'Start a discussion').click();

// Preliminarily creating two notifications before testing notifications
// First notification
cy.contains('h1', 'Start a discussion');

cy.contains('button', 'Save discussion').should('be.disabled');

cy.get('#user-role').should('not.be.disabled');

cy.get('#user-role').select('None of the above');

cy.get('#user-role-description')
.type('Designer')
.should('have.value', 'Designer');

cy.get('#mention-editor').type('@ana');
cy.get('#JTTC').contains('Anabelle Jerde (JTTC)').click();
cy.get('#mention-editor').type('First Notification');
cy.get('#mention-editor').should(
'have.text',
'@Anabelle Jerde (JTTC) First Notification'
);

cy.contains('button', 'Save discussion').click();

// Second notification
cy.contains('button', 'Start a discussion').click();

cy.get('#user-role').should('not.be.disabled');

cy.get('#user-role').select('None of the above');

cy.get('#user-role-description').should('have.value', 'Designer');

cy.get('#mention-editor').type('@ana');
cy.get('#JTTC').contains('Anabelle Jerde (JTTC)').click();
cy.get('#mention-editor').type('Second Notification');
cy.get('#mention-editor').should(
'have.text',
'@Anabelle Jerde (JTTC) Second Notification'
);

cy.contains('button', 'Save discussion').click();

cy.visit('/notifications');

// Actual Notification Test
cy.get('[data-testid="navmenu__notification"]')
.should('have.attr', 'href')
.and('equal', '/notifications');

// Check to see if Notification Nav Button has the red dot
cy.get('[data-testid="navmenu__notifications--yesNotification"').should(
'exist'
);

cy.get('[data-testid="individual-notification"]').should('have.length', 2);

cy.get('[data-testid="individual-notification"]')
.first()
.find('button', 'View Discussion')
.click();

cy.visit('/notifications');

// Check to see first entry should no longer have red dot
cy.get('[data-testid="individual-notification"]')
.first()
.find('[data-testid="notification-red-dot"]')
.should('not.exist');

// Mark all as read
cy.contains('button', 'Mark all as read').click();

// No more red dots
cy.get('[data-testid="navmenu__notifications--noNotification"').should(
'exist'
);
cy.get('[data-testid="notification-red-dot"]').should('have.length', 0);

// Notification Settings Test
cy.contains('a', 'Notification settings').click();

cy.location().should(loc => {
expect(loc.pathname).to.match(/settings/);
});

// Uncheck first checkbox and save
cy.get('form').within(() => {
cy.get('#notification-setting-email-dailyDigestComplete').uncheck({
force: true
});
cy.root().submit();
});

cy.contains('a', 'Notification settings').click();

// Unchecked first box persists
cy.get('#notification-setting-email-dailyDigestComplete').should(
'not.be.checked'
);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*********
* Delete all notifications and activities since they are not currently in use, and we changed the meta data structure for tagged activities
**********/
DELETE FROM user_notification;

DELETE FROM activity;
Loading