@plusscommunities/pluss-core-aws 2.1.2-beta.0 → 2.1.4-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/notification/prepNotification.js +30 -29
- package/package.json +1 -1
|
@@ -4,27 +4,28 @@ const { getConfig } = require("../config");
|
|
|
4
4
|
module.exports = (noti) => {
|
|
5
5
|
const thisNoti = { ...noti };
|
|
6
6
|
const type = noti.Type ?? "";
|
|
7
|
-
|
|
7
|
+
console.log("prepNotification - core", { type });
|
|
8
|
+
if (type.startsWith("MaintenanceJobStatusChanged")) {
|
|
8
9
|
thisNoti.Text = `Your request is ${noti.Data.status}`;
|
|
9
10
|
thisNoti.Subtext = noti.Data.title || noti.Data.description;
|
|
10
11
|
thisNoti.Icon = "wrench";
|
|
11
|
-
} else if (type.startsWith(
|
|
12
|
+
} else if (type.startsWith("MaintenanceJobAssigned")) {
|
|
12
13
|
thisNoti.Text = `You have been assigned a request`;
|
|
13
14
|
thisNoti.Subtext = noti.Data.title || noti.Data.description;
|
|
14
15
|
thisNoti.Icon = "wrench";
|
|
15
|
-
} else if (type.startsWith(
|
|
16
|
+
} else if (type.startsWith("MaintenanceJobUnassigned")) {
|
|
16
17
|
thisNoti.Text = `A request you were assigned has been reassigned`;
|
|
17
18
|
thisNoti.Subtext = noti.Data.title || noti.Data.description;
|
|
18
19
|
thisNoti.Icon = "wrench";
|
|
19
|
-
} else if (type.startsWith(
|
|
20
|
+
} else if (type.startsWith("MaintenanceJobCommented")) {
|
|
20
21
|
thisNoti.Text = noti.Data.comment;
|
|
21
22
|
thisNoti.Subtext = noti.Data.title || noti.Data.description;
|
|
22
23
|
thisNoti.Icon = "wrench";
|
|
23
|
-
} else if (type.startsWith(
|
|
24
|
+
} else if (type.startsWith("EntityCommented")) {
|
|
24
25
|
thisNoti.Text = noti.Data.comment;
|
|
25
26
|
thisNoti.Subtext = noti.Data.title || noti.Data.description;
|
|
26
27
|
thisNoti.Icon = "commenting";
|
|
27
|
-
} else if (type.startsWith(
|
|
28
|
+
} else if (type.startsWith("EventRepChange")) {
|
|
28
29
|
let eventChangeText = "";
|
|
29
30
|
if (noti.Data.LocationChanged && noti.Data.TimeChanged) {
|
|
30
31
|
eventChangeText = "time and location";
|
|
@@ -36,87 +37,87 @@ module.exports = (noti) => {
|
|
|
36
37
|
thisNoti.Text = `An event you are attending has changed ${eventChangeText}`;
|
|
37
38
|
thisNoti.Subtext = noti.Data.Title;
|
|
38
39
|
thisNoti.Icon = "calendar";
|
|
39
|
-
} else if (type.startsWith(
|
|
40
|
+
} else if (type.startsWith("EventRepRemoved")) {
|
|
40
41
|
thisNoti.Text = "An event you are attending has been cancelled";
|
|
41
42
|
thisNoti.Subtext = noti.Data.Title;
|
|
42
43
|
thisNoti.TimeText = noti.Data.Time;
|
|
43
44
|
thisNoti.Icon = "calendar-times-o";
|
|
44
|
-
} else if (type.startsWith(
|
|
45
|
+
} else if (type.startsWith("ApproveNewsSubmission")) {
|
|
45
46
|
thisNoti.Text = "A story you submitted has been approved";
|
|
46
47
|
thisNoti.Subtext = noti.Data.Title;
|
|
47
48
|
thisNoti.Icon = "newspaper-o";
|
|
48
|
-
} else if (type.startsWith(
|
|
49
|
+
} else if (type.startsWith("ApproveEventSubmission")) {
|
|
49
50
|
thisNoti.Text = "An event you submitted has been approved";
|
|
50
51
|
thisNoti.Subtext = noti.Data.Title;
|
|
51
52
|
thisNoti.Icon = "calendar-check-o";
|
|
52
|
-
} else if (type.startsWith(
|
|
53
|
+
} else if (type.startsWith("EventRegisterFromWaitlist")) {
|
|
53
54
|
thisNoti.Text =
|
|
54
55
|
"A spot has opened up on an event you were on the waitlist for";
|
|
55
56
|
thisNoti.Subtext = noti.Data.Title;
|
|
56
57
|
thisNoti.Icon = "calendar-plus-o";
|
|
57
|
-
} else if (type.startsWith(
|
|
58
|
+
} else if (type.startsWith("NewsletterPublished")) {
|
|
58
59
|
thisNoti.Text = `News: ${noti.Data.Title}`;
|
|
59
60
|
thisNoti.Subtext =
|
|
60
61
|
!_.isEmpty(noti.Data.Text) && noti.Data.Text.length > 100
|
|
61
62
|
? `${noti.Data.Text.substring(0, 100)}...`
|
|
62
63
|
: noti.Data.Text;
|
|
63
64
|
thisNoti.Icon = "newspaper-o";
|
|
64
|
-
} else if (type.startsWith(
|
|
65
|
+
} else if (type.startsWith("FormLockoutFailure")) {
|
|
65
66
|
thisNoti.Text =
|
|
66
67
|
"Someone answered yes to a question on the kiosk and was denied access";
|
|
67
68
|
thisNoti.Icon = "exclamation-triangle";
|
|
68
|
-
} else if (type.startsWith(
|
|
69
|
+
} else if (type.startsWith("FormLockoutSuccess")) {
|
|
69
70
|
thisNoti.Text =
|
|
70
71
|
"Someone answered no to all questions on the kiosk and was granted access";
|
|
71
72
|
thisNoti.Icon = "check";
|
|
72
|
-
} else if (type.startsWith(
|
|
73
|
+
} else if (type.startsWith("InformationAdded")) {
|
|
73
74
|
thisNoti.Text = `There is new important information available: ${noti.Data.title}`;
|
|
74
75
|
thisNoti.Icon = "info";
|
|
75
|
-
} else if (type.startsWith(
|
|
76
|
+
} else if (type.startsWith("InformationUpdated")) {
|
|
76
77
|
thisNoti.Text = `Important information updated: ${noti.Data.title}`;
|
|
77
78
|
thisNoti.Icon = "info";
|
|
78
|
-
} else if (type.startsWith(
|
|
79
|
+
} else if (type.startsWith("PollAdded")) {
|
|
79
80
|
thisNoti.Text = `There is a new survey available: ${noti.Data.Title}`;
|
|
80
81
|
thisNoti.Icon = "pie-chart";
|
|
81
|
-
} else if (type.startsWith(
|
|
82
|
+
} else if (type.startsWith("OfferAdded")) {
|
|
82
83
|
thisNoti.Text = `There is a new offer available: ${noti.Data.Title}`;
|
|
83
84
|
thisNoti.Icon = "shopping-bag";
|
|
84
|
-
} else if (type.startsWith(
|
|
85
|
+
} else if (type.startsWith("ServiceAdded")) {
|
|
85
86
|
thisNoti.Text = `There is a new service available: ${noti.Data.Title}`;
|
|
86
87
|
thisNoti.Icon = "stethoscope";
|
|
87
|
-
} else if (type.startsWith(
|
|
88
|
+
} else if (type.startsWith("EventAdded")) {
|
|
88
89
|
thisNoti.Text = `There is a new event: ${noti.Data.Title}`;
|
|
89
90
|
thisNoti.Icon = "calendar-plus-o";
|
|
90
|
-
} else if (type.startsWith(
|
|
91
|
+
} else if (type.startsWith("FacilityAdded")) {
|
|
91
92
|
thisNoti.Text = `There is a new ${getConfig().strings.FACILITY}: ${
|
|
92
93
|
noti.Data.Title
|
|
93
94
|
}`;
|
|
94
95
|
thisNoti.Icon = "building";
|
|
95
|
-
} else if (type.startsWith(
|
|
96
|
+
} else if (type.startsWith("MapAdded")) {
|
|
96
97
|
thisNoti.Text = `There is a new map: ${noti.Data.title}`;
|
|
97
98
|
thisNoti.Icon = "map-marker";
|
|
98
|
-
} else if (type.startsWith(
|
|
99
|
+
} else if (type.startsWith("ImportantContactAdded")) {
|
|
99
100
|
thisNoti.Text = `There is a new contact: ${noti.Data.title}`;
|
|
100
101
|
thisNoti.Icon = "address-card-o";
|
|
101
|
-
} else if (type.startsWith(
|
|
102
|
+
} else if (type.startsWith("PersonalDocumentAdded")) {
|
|
102
103
|
thisNoti.Text = `There is a new document: ${noti.Data.Name}`;
|
|
103
104
|
thisNoti.Icon = "file-o";
|
|
104
|
-
} else if (type.startsWith(
|
|
105
|
+
} else if (type.startsWith("AppointmentAdded")) {
|
|
105
106
|
thisNoti.Text = noti.Data.message;
|
|
106
107
|
thisNoti.Icon = "calendar-plus-o";
|
|
107
|
-
} else if (type.startsWith(
|
|
108
|
+
} else if (type.startsWith("AppointmentUpdated")) {
|
|
108
109
|
thisNoti.Text = noti.Data.message;
|
|
109
110
|
thisNoti.Icon = "calendar-check-o";
|
|
110
|
-
} else if (type.startsWith(
|
|
111
|
+
} else if (type.startsWith("AppointmentCancelled")) {
|
|
111
112
|
thisNoti.Text = noti.Data.message;
|
|
112
113
|
thisNoti.Icon = "calendar-times-o";
|
|
113
|
-
} else if (type.startsWith(
|
|
114
|
+
} else if (type.startsWith("AppointmentReminder")) {
|
|
114
115
|
thisNoti.Text = noti.Data.message;
|
|
115
116
|
thisNoti.Icon = "bell-o";
|
|
116
|
-
} else if (type.startsWith(
|
|
117
|
+
} else if (type.startsWith("AppointmentFollowup")) {
|
|
117
118
|
thisNoti.Text = noti.Data.message;
|
|
118
119
|
thisNoti.Icon = "calendar-check-o";
|
|
119
|
-
} else if (type.startsWith(
|
|
120
|
+
} else if (type.startsWith("ScheduledAction")) {
|
|
120
121
|
thisNoti.Text = noti.Data.message;
|
|
121
122
|
thisNoti.Icon = "bell-o";
|
|
122
123
|
} else {
|
package/package.json
CHANGED