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 3925/in app notifications #954

Merged
merged 73 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
00be44d
feat: pull in sqlutils changes from POC
StevenWadeOddball Feb 12, 2024
9432183
feat: pull in sqlqueries from poc branch
StevenWadeOddball Feb 12, 2024
66abf97
feat: pull data migration from poc branch
StevenWadeOddball Feb 12, 2024
e79e424
feat: gql changes from POC branch
StevenWadeOddball Feb 12, 2024
5469fcb
feat: pull in notification_preferences file from poc branch
StevenWadeOddball Feb 12, 2024
a621993
feat: pull in notification package as is from POC branch. It will be …
StevenWadeOddball Feb 12, 2024
030f8a2
feat: working prototype from POC to refactor
StevenWadeOddball Feb 12, 2024
6e21a62
feat: correct spelling errors in comments
StevenWadeOddball Feb 13, 2024
4f53760
feat: add some more notification types
StevenWadeOddball Feb 13, 2024
508dba3
feat: first pass at creating an activity and tag for taggged users in…
StevenWadeOddball Feb 13, 2024
6acb1d7
feat: tagged plan discussion now creates one activity, and a notifica…
StevenWadeOddball Feb 13, 2024
ad5999f
feat: expand the notification preference table
StevenWadeOddball Feb 14, 2024
be3d3e9
feat: user notification preferences SQL
StevenWadeOddball Feb 14, 2024
7aed347
feat: user notification preferences storage methods
StevenWadeOddball Feb 14, 2024
272ae81
feat: connect notifiation preferences resolver to GQL
StevenWadeOddball Feb 14, 2024
b8b59f9
feat: first pass at updateing userNotification Preferences
StevenWadeOddball Feb 14, 2024
8302844
feat: create a user notification preferences object whenever you crea…
StevenWadeOddball Feb 14, 2024
0583e0c
feat: set notification preferences to true by default
StevenWadeOddball Feb 14, 2024
408ebdb
feat: fetchable user notification preferences object in the schema
StevenWadeOddball Feb 14, 2024
905cd50
chore: correct syntax in comment issue in sql statement. : incorrectl…
StevenWadeOddball Feb 15, 2024
dcb8ede
feat: get notification preference before creating notification. add i…
StevenWadeOddball Feb 15, 2024
f054508
feat: first pass at discussion reply activity and notifications
StevenWadeOddball Feb 15, 2024
1f41e30
feat: postman collection for notifications
StevenWadeOddball Feb 15, 2024
a43857d
chore: add comment about transactions
StevenWadeOddball Feb 15, 2024
9c1b100
feat: notification preferences as an enum
StevenWadeOddball Feb 16, 2024
0cb1ad4
chore: remove new plan discussion meta type, since it is not required…
StevenWadeOddball Feb 16, 2024
f227008
chore: remove new plan discussion from preferences, since it is not r…
StevenWadeOddball Feb 16, 2024
34af7b7
Merge branch 'main' into EASI-3925/in_app_notifications
StevenWadeOddball Feb 16, 2024
5b9a37b
chore: remove reference to new discussion in sql
StevenWadeOddball Feb 16, 2024
7bf958d
feat: update GQL schema
StevenWadeOddball Feb 16, 2024
5c516ad
feat: user notification preferences to its own GQL files
StevenWadeOddball Feb 16, 2024
f79190e
feat: user notification to its own GQL file
StevenWadeOddball Feb 16, 2024
2bf8531
feat: move activity to its own file
StevenWadeOddball Feb 16, 2024
272e704
feat: current_user to its own GQL file
StevenWadeOddball Feb 16, 2024
f4a65d8
feat: first pass at activity dataloader
StevenWadeOddball Feb 19, 2024
c9ab7bf
more todo notes added
StevenWadeOddball Feb 19, 2024
afa561e
feat: activity and notification to the models pacakge
StevenWadeOddball Feb 19, 2024
0cf49cc
feat: isArchived --> inAppSent
StevenWadeOddball Feb 19, 2024
cb5678e
feat: first pass respect user preference to not send an email if thei…
StevenWadeOddball Feb 19, 2024
0fd65e9
feat: add query to tag current user in postman to test notification p…
StevenWadeOddball Feb 19, 2024
cc35345
feat queryable selectable actor in activity with data loader
StevenWadeOddball Feb 19, 2024
bb52b11
feat: add auditing for notifiation preferences. Add notification pref…
StevenWadeOddball Feb 19, 2024
6cad8c2
feat: remove unused user notification and remove notifications from g…
StevenWadeOddball Feb 19, 2024
c20df4d
feat: ability to query discusion or reply for the tagged in discussio…
StevenWadeOddball Feb 19, 2024
a5e85ef
feat: add comments to the new postgres tables
StevenWadeOddball Feb 20, 2024
cb14db8
feat: remove old todos, renable old commented out unit test
StevenWadeOddball Feb 20, 2024
8fdb4b6
feat: notification preferences data loader
StevenWadeOddball Feb 20, 2024
2b455df
feat: remove duplicated embedded structs in notification pacakage
StevenWadeOddball Feb 20, 2024
6b26da9
feat: clean up databaseCalls structure to have a store structcure per…
StevenWadeOddball Feb 20, 2024
9634216
feat: update references to the user preference store methods to refer…
StevenWadeOddball Feb 20, 2024
04a654b
feat: tagged in plan discussion notifications cause transaction rollback
StevenWadeOddball Feb 20, 2024
5b4ada3
feat: discussion reply as a transaction
StevenWadeOddball Feb 20, 2024
fbecb3a
feat: discussion reply emails as part of the with transaction block
StevenWadeOddball Feb 20, 2024
8c67424
feat: tag collection create doesnt require the store
StevenWadeOddball Feb 21, 2024
114ddc2
feat: user account by username not a receiver method now
StevenWadeOddball Feb 21, 2024
09bf501
feat: user account update by username not a receiver
StevenWadeOddball Feb 21, 2024
abaec02
feat: GetOrCreateUserAccount always wraps creation of account and pre…
StevenWadeOddball Feb 21, 2024
243bb03
feat: note about np and user account and preparer to rely on TX inste…
StevenWadeOddball Feb 21, 2024
2776797
feat: handle error converting ids for activity data loader
StevenWadeOddball Feb 21, 2024
a7868d8
feat: user_notification_preferences unit tests
StevenWadeOddball Feb 21, 2024
963d66b
feat: remove storage dependency from notifications package, enabling …
StevenWadeOddball Feb 21, 2024
dc685bc
feat: reusable test suite helpers, stub notification unit tests
StevenWadeOddball Feb 21, 2024
4c8579a
feat: user notificaiton create unit test
StevenWadeOddball Feb 21, 2024
01e3b93
feat: rename activity_resolver to activity
StevenWadeOddball Feb 21, 2024
c2213c6
feat: activity create unit test
StevenWadeOddball Feb 21, 2024
12de748
feat: notificaiton mark as read unit test
StevenWadeOddball Feb 21, 2024
f66c860
feat: mark all notifications as read
StevenWadeOddball Feb 21, 2024
2b6bd1b
feat: tagged in discussion unit tests
StevenWadeOddball Feb 21, 2024
45a39bc
feat: assert valid meta data
StevenWadeOddball Feb 21, 2024
be7f1ea
feat: tagged in discussion reply unit test
StevenWadeOddball Feb 21, 2024
484fe1d
chore: remove all outstanding todos
StevenWadeOddball Feb 21, 2024
16af931
Merge branch 'main' into EASI-3925/in_app_notifications
StevenWadeOddball Feb 23, 2024
9050555
chore: remove unnecessary commented out code
StevenWadeOddball Feb 23, 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
283 changes: 281 additions & 2 deletions MINT.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info": {
"_postman_id": "ee2ccc00-fbb9-4598-ac85-34095be5a1bd",
"_postman_id": "32329f70-986e-430d-8a0b-4509ca71dab1",
"name": "MINT",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "20435042"
"_exporter_id": "20320964"
},
"item": [
{
Expand Down Expand Up @@ -667,6 +667,50 @@
}
},
"response": []
},
{
"name": "PlanDiscussionCreate TAG CURRENT USER ONLY",
"event": [
{
"listen": "test",
"script": {
"exec": [
"let responseData = pm.response.json().data.createPlanDiscussion",
"",
"discussionID = responseData.id",
"",
"",
"pm.collectionVariables.set(\"discussionID\", discussionID);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation createPlanDiscussion{\n createPlanDiscussion(input:{\n modelPlanID: \"{{modelPlanID}}\"\n content: \" <span data-type=\\\"mention\\\" tag-type=\\\"USER_ACCOUNT\\\" class=\\\"mention\\\" data-id=\\\"{{EUAID}}\\\" data-label=\\\"{{EUAID}}\\\">@{{EUAID}}</span>\"\n userRole:SHARED_SYSTEM_MAINTAINER\n } ){\n \n id\n modelPlanID\n \n content{\n rawContent\n tags{\n id\n taggedField\n taggedContentTable\n taggedContentID\n entityUUID\n entityIntID\n entity{\n __typename\n ... on UserAccount{\n id\n commonName\n email\n }\n ... on PossibleOperationalSolution {\n name\n key\n }\n }\n }\n }\n \n createdBy\n createdByUserAccount{\n commonName\n email\n username\n }\n\n }\n \n \n}",
"variables": ""
}
},
"url": {
"raw": "http://localhost:8085/api/graph/query",
"protocol": "http",
"host": [
"localhost"
],
"port": "8085",
"path": [
"api",
"graph",
"query"
]
}
},
"response": []
}
]
},
Expand Down Expand Up @@ -2022,6 +2066,237 @@
"response": []
}
]
},
{
"name": "Notfications",
"item": [
{
"name": "GetNotifications",
"event": [
{
"listen": "test",
"script": {
"exec": [
"let notifications = pm.response.json().data.currentUser.notifications.notifications",
"if (notifications.length > 0) {",
" userNotificationID = notifications[0].id",
" pm.collectionVariables.set(\"userNotificationID\", userNotificationID);",
"}",
"",
"",
"// for (let i =0; i< notifications.length; i++){",
"// subtaskID = notifications[i].id",
"// pm.collectionVariables.set(\"operationalSolutionSubtaskID\"+i, subtaskID);",
"// }"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"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",
"variables": ""
}
},
"url": {
"raw": "http://localhost:8085/api/graph/query",
"protocol": "http",
"host": [
"localhost"
],
"port": "8085",
"path": [
"api",
"graph",
"query"
]
}
},
"response": []
},
{
"name": "GetNotificationPreferences",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "query currentUser {\n currentUser {\n notificationPreferences {\n dailyDigestComplete\n\n addedAsCollaborator\n\n taggedInDiscussion\n\n taggedInDiscussionReply\n\n newDiscussionReply\n\n modelPlanShared\n\n }\n }\n }\n\n",
"variables": ""
}
},
"url": {
"raw": "http://localhost:8085/api/graph/query",
"protocol": "http",
"host": [
"localhost"
],
"port": "8085",
"path": [
"api",
"graph",
"query"
]
}
},
"response": []
},
{
"name": "MarkNotificationAsRead",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation notifications {\n markNotificationAsRead(notificationID: \"{{userNotificationID}}\")\n {\n id\n isRead\n activity {\n activityType\n entityID\n actorID\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n}\n",
"variables": ""
}
},
"url": {
"raw": "http://localhost:8085/api/graph/query",
"protocol": "http",
"host": [
"localhost"
],
"port": "8085",
"path": [
"api",
"graph",
"query"
]
}
},
"response": []
},
{
"name": "MarkAllNotificationAsRead",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation notifications {\n markAllNotificationsAsRead\n {\n id\n isRead\n activity {\n activityType\n entityID\n actorID\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n}\n",
"variables": ""
}
},
"url": {
"raw": "http://localhost:8085/api/graph/query",
"protocol": "http",
"host": [
"localhost"
],
"port": "8085",
"path": [
"api",
"graph",
"query"
]
}
},
"response": []
},
{
"name": "Get CurrentUser",
"request": {
"method": "POST",
"header": [],
"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",
"variables": "{}"
}
},
"url": {
"raw": "{{url}}",
"host": [
"{{url}}"
]
}
},
"response": []
},
{
"name": "NotificationPreferencesUpdate",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation NotificationUpdate {\nupdateUserNotificationPreferences( changes:{\n dailyDigestComplete: IN_APP_ONLY\n \n addedAsCollaborator: ALL\n\n taggedInDiscussion: ALL\n\n taggedInDiscussionReply: ALL\n\n newDiscussionReply: ALL\n\n modelPlanShared: ALL\n\n \n\n}) {\n\n dailyDigestComplete\n\n addedAsCollaborator\n\n taggedInDiscussion\n\n taggedInDiscussionReply\n\n newDiscussionReply\n\n modelPlanShared\n\n \n }\n}\n",
"variables": ""
}
},
"url": {
"raw": "http://localhost:8085/api/graph/query",
"protocol": "http",
"host": [
"localhost"
],
"port": "8085",
"path": [
"api",
"graph",
"query"
]
}
},
"response": []
}
]
}
],
"auth": {
Expand Down Expand Up @@ -2143,6 +2418,10 @@
{
"key": "userID",
"value": ""
},
{
"key": "userNotificationID",
"value": ""
}
]
}
1 change: 0 additions & 1 deletion cmd/test_email/solution_selected_emails.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func sendSolutionSelectedForUseByModelEmail(
modelLeadNames []string,
filterView string,
) error {
// TODO: SW, extract the logic from func sendPlanDiscussionTagEmails to obfuscu

if emailService == nil || emailTemplateService == nil {
return nil
Expand Down
Loading