Skip to content

Commit 329d3d4

Browse files
committed
redis notification handling
1 parent 3271998 commit 329d3d4

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

services/static-webserver/client/source/class/osparc/notification/Notification.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ qx.Class.define("osparc.notification.Notification", {
5454
"NEW_ORGANIZATION",
5555
"STUDY_SHARED",
5656
"TEMPLATE_SHARED",
57+
"CONVERSION_NOTIFICATION",
5758
"ANNOTATION_NOTE",
5859
"WALLET_SHARED"
5960
],

services/static-webserver/client/source/class/osparc/notification/NotificationUI.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ qx.Class.define("osparc.notification.NotificationUI", {
184184
}
185185
}
186186
break;
187+
case "CONVERSATION_NOTIFICATION":
188+
// OM TODO
189+
break;
187190
case "ANNOTATION_NOTE":
188191
icon.setSource("@FontAwesome5Solid/file/14");
189192
if (resourceId) {
@@ -250,6 +253,7 @@ qx.Class.define("osparc.notification.NotificationUI", {
250253
break;
251254
case "TEMPLATE_SHARED":
252255
case "STUDY_SHARED":
256+
case "CONVERSATION_NOTIFICATION":
253257
case "ANNOTATION_NOTE":
254258
this.__openStudyDetails(resourceId, notification);
255259
break;

services/static-webserver/client/source/class/osparc/notification/Notifications.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ qx.Class.define("osparc.notification.Notifications", {
8585
};
8686
},
8787

88+
__newConversationNotificationObj: function(userId, studyId) {
89+
const baseNotification = this.__newNotificationBase(userId);
90+
const specNotification = {
91+
"category": "CONVERSATION_NOTIFICATION",
92+
"actionable_path": "study/"+studyId,
93+
"resource_id": studyId,
94+
"title": "New notification",
95+
"text": "You were notified in a conversation"
96+
};
97+
return {
98+
...baseNotification,
99+
...specNotification
100+
};
101+
},
102+
88103
__newAnnotationNoteObj: function(userId, studyId) {
89104
const baseNotification = this.__newNotificationBase(userId);
90105
const specNotification = {
@@ -136,7 +151,14 @@ qx.Class.define("osparc.notification.Notifications", {
136151
return osparc.data.Resources.fetch("notifications", "post", params);
137152
},
138153

139-
postNewAnnotationNote: function(userId, studyId) {
154+
pushConversationNotification: function(userId, studyId) {
155+
const params = {
156+
data: this.__newConversationNotificationObj(userId, studyId)
157+
};
158+
return osparc.data.Resources.fetch("notifications", "post", params);
159+
},
160+
161+
pushNewAnnotationNote: function(userId, studyId) {
140162
const params = {
141163
data: this.__newAnnotationNoteObj(userId, studyId)
142164
};

services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,7 @@ qx.Class.define("osparc.workbench.WorkbenchUI", {
19351935
serializeData.attributes.text = noteEditor.getNote();
19361936
const user = osparc.store.Groups.getInstance().getUserByGroupId(gid)
19371937
if (user) {
1938-
osparc.notification.Notifications.postNewAnnotationNote(user.getUserId(), this.getStudy().getUuid());
1938+
osparc.notification.Notifications.pushNewAnnotationNote(user.getUserId(), this.getStudy().getUuid());
19391939
}
19401940
this.__addAnnotation(serializeData);
19411941
win.close();

0 commit comments

Comments
 (0)