@memberjunction/ng-explorer-core 0.9.169 → 0.9.170
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ElementRef, AfterViewInit } from '@angular/core';
|
|
2
2
|
import { SharedService } from '@memberjunction/ng-shared';
|
|
3
3
|
import { UserNotificationEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import { TransactionGroupBase } from '@memberjunction/core';
|
|
4
5
|
import { Router } from '@angular/router';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class UserNotificationsComponent implements AfterViewInit {
|
|
@@ -20,12 +21,17 @@ export declare class UserNotificationsComponent implements AfterViewInit {
|
|
|
20
21
|
queryString: string;
|
|
21
22
|
};
|
|
22
23
|
get AllNotifications(): UserNotificationEntity[];
|
|
24
|
+
get UnreadNotifications(): UserNotificationEntity[];
|
|
25
|
+
get ReadNotifications(): UserNotificationEntity[];
|
|
23
26
|
selectReadOption(option: string): void;
|
|
24
27
|
onReadRadioChanged(event: Event): void;
|
|
25
28
|
onFilterChanged(value: string): void;
|
|
26
29
|
getItemTitleClass(notification: UserNotificationEntity): "notification-title notification-title-unread" | "notification-title";
|
|
27
30
|
getItemWrapperClass(notification: UserNotificationEntity): string;
|
|
28
|
-
markAsRead(notification: UserNotificationEntity, bRead: boolean): Promise<
|
|
31
|
+
markAsRead(notification: UserNotificationEntity, bRead: boolean, transGroup: TransactionGroupBase | null): Promise<boolean>;
|
|
32
|
+
markAllAsRead(): Promise<void>;
|
|
33
|
+
markAllAsUnread(): Promise<void>;
|
|
34
|
+
markAll(bRead: boolean): Promise<void>;
|
|
29
35
|
notificationClicked(notification: UserNotificationEntity): void;
|
|
30
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserNotificationsComponent, never>;
|
|
31
37
|
static ɵcmp: i0.ɵɵComponentDeclaration<UserNotificationsComponent, "app-user-notifications", never, {}, {}, never, never, false, never>;
|
|
@@ -21,57 +21,110 @@ import * as i7 from "@progress/kendo-angular-listview";
|
|
|
21
21
|
const _c0 = ["allRadio"];
|
|
22
22
|
const _c1 = ["unreadRadio"];
|
|
23
23
|
const _c2 = ["readRadio"];
|
|
24
|
-
function
|
|
25
|
-
i0.ɵɵ
|
|
24
|
+
function UserNotificationsComponent_button_5_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
const _r11 = i0.ɵɵgetCurrentView();
|
|
26
|
+
i0.ɵɵelementStart(0, "button", 12);
|
|
27
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.markAllAsRead()); });
|
|
28
|
+
i0.ɵɵtext(1, "Mark All as Read");
|
|
29
|
+
i0.ɵɵelementEnd();
|
|
30
|
+
} }
|
|
31
|
+
function UserNotificationsComponent_button_6_Template(rf, ctx) { if (rf & 1) {
|
|
32
|
+
const _r13 = i0.ɵɵgetCurrentView();
|
|
33
|
+
i0.ɵɵelementStart(0, "button", 12);
|
|
34
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.markAllAsUnread()); });
|
|
35
|
+
i0.ɵɵtext(1, "Mark All as Unread");
|
|
36
|
+
i0.ɵɵelementEnd();
|
|
37
|
+
} }
|
|
38
|
+
function UserNotificationsComponent_input_7_Template(rf, ctx) { if (rf & 1) {
|
|
39
|
+
const _r16 = i0.ɵɵgetCurrentView();
|
|
40
|
+
i0.ɵɵelementStart(0, "input", 13, 14);
|
|
41
|
+
i0.ɵɵlistener("change", function UserNotificationsComponent_input_7_Template_input_change_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onReadRadioChanged($event)); });
|
|
42
|
+
i0.ɵɵelementEnd();
|
|
26
43
|
} }
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
i0.ɵɵelementStart(0, "
|
|
30
|
-
i0.ɵɵlistener("click", function
|
|
44
|
+
function UserNotificationsComponent_span_8_Template(rf, ctx) { if (rf & 1) {
|
|
45
|
+
const _r18 = i0.ɵɵgetCurrentView();
|
|
46
|
+
i0.ɵɵelementStart(0, "span", 15);
|
|
47
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_span_8_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r18); const ctx_r17 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r17.selectReadOption("All")); });
|
|
48
|
+
i0.ɵɵtext(1, "All");
|
|
49
|
+
i0.ɵɵelementEnd();
|
|
50
|
+
} }
|
|
51
|
+
function UserNotificationsComponent_input_9_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
const _r21 = i0.ɵɵgetCurrentView();
|
|
53
|
+
i0.ɵɵelementStart(0, "input", 16, 17);
|
|
54
|
+
i0.ɵɵlistener("change", function UserNotificationsComponent_input_9_Template_input_change_0_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.onReadRadioChanged($event)); });
|
|
55
|
+
i0.ɵɵelementEnd();
|
|
56
|
+
} }
|
|
57
|
+
function UserNotificationsComponent_span_10_Template(rf, ctx) { if (rf & 1) {
|
|
58
|
+
const _r23 = i0.ɵɵgetCurrentView();
|
|
59
|
+
i0.ɵɵelementStart(0, "span", 15);
|
|
60
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_span_10_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r23); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.selectReadOption("Unread")); });
|
|
61
|
+
i0.ɵɵtext(1, "Unread");
|
|
62
|
+
i0.ɵɵelementEnd();
|
|
63
|
+
} }
|
|
64
|
+
function UserNotificationsComponent_input_11_Template(rf, ctx) { if (rf & 1) {
|
|
65
|
+
const _r26 = i0.ɵɵgetCurrentView();
|
|
66
|
+
i0.ɵɵelementStart(0, "input", 18, 19);
|
|
67
|
+
i0.ɵɵlistener("change", function UserNotificationsComponent_input_11_Template_input_change_0_listener($event) { i0.ɵɵrestoreView(_r26); const ctx_r25 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r25.onReadRadioChanged($event)); });
|
|
68
|
+
i0.ɵɵelementEnd();
|
|
69
|
+
} }
|
|
70
|
+
function UserNotificationsComponent_span_12_Template(rf, ctx) { if (rf & 1) {
|
|
71
|
+
const _r28 = i0.ɵɵgetCurrentView();
|
|
72
|
+
i0.ɵɵelementStart(0, "span", 15);
|
|
73
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_span_12_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r28); const ctx_r27 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r27.selectReadOption("Read")); });
|
|
74
|
+
i0.ɵɵtext(1, "Read");
|
|
75
|
+
i0.ɵɵelementEnd();
|
|
76
|
+
} }
|
|
77
|
+
function UserNotificationsComponent_ng_template_14_Template(rf, ctx) { if (rf & 1) {
|
|
78
|
+
i0.ɵɵelement(0, "span", 20);
|
|
79
|
+
} }
|
|
80
|
+
function UserNotificationsComponent_ng_template_16_button_10_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
+
const _r34 = i0.ɵɵgetCurrentView();
|
|
82
|
+
i0.ɵɵelementStart(0, "button", 12);
|
|
83
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_16_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r34); const dataItem_r29 = i0.ɵɵnextContext().dataItem; const ctx_r32 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r32.markAsRead(dataItem_r29, true, null)); });
|
|
31
84
|
i0.ɵɵtext(1, "Mark as Read");
|
|
32
85
|
i0.ɵɵelementEnd();
|
|
33
86
|
} }
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
i0.ɵɵelementStart(0, "button",
|
|
37
|
-
i0.ɵɵlistener("click", function
|
|
87
|
+
function UserNotificationsComponent_ng_template_16_button_11_Template(rf, ctx) { if (rf & 1) {
|
|
88
|
+
const _r37 = i0.ɵɵgetCurrentView();
|
|
89
|
+
i0.ɵɵelementStart(0, "button", 12);
|
|
90
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_16_button_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r37); const dataItem_r29 = i0.ɵɵnextContext().dataItem; const ctx_r35 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r35.markAsRead(dataItem_r29, false, null)); });
|
|
38
91
|
i0.ɵɵtext(1, "Mark as Unread");
|
|
39
92
|
i0.ɵɵelementEnd();
|
|
40
93
|
} }
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
i0.ɵɵelementStart(0, "div")(1, "div",
|
|
44
|
-
i0.ɵɵlistener("click", function
|
|
94
|
+
function UserNotificationsComponent_ng_template_16_Template(rf, ctx) { if (rf & 1) {
|
|
95
|
+
const _r39 = i0.ɵɵgetCurrentView();
|
|
96
|
+
i0.ɵɵelementStart(0, "div")(1, "div", 21);
|
|
97
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_16_Template_div_click_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r39); const dataItem_r29 = restoredCtx.dataItem; const ctx_r38 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r38.notificationClicked(dataItem_r29)); });
|
|
45
98
|
i0.ɵɵtext(2);
|
|
46
99
|
i0.ɵɵelementEnd();
|
|
47
|
-
i0.ɵɵelementStart(3, "div",
|
|
48
|
-
i0.ɵɵlistener("click", function
|
|
49
|
-
i0.ɵɵelementStart(4, "div",
|
|
100
|
+
i0.ɵɵelementStart(3, "div", 22);
|
|
101
|
+
i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_16_Template_div_click_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r39); const dataItem_r29 = restoredCtx.dataItem; const ctx_r40 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r40.notificationClicked(dataItem_r29)); });
|
|
102
|
+
i0.ɵɵelementStart(4, "div", 23);
|
|
50
103
|
i0.ɵɵtext(5);
|
|
51
104
|
i0.ɵɵpipe(6, "date");
|
|
52
105
|
i0.ɵɵelementEnd();
|
|
53
|
-
i0.ɵɵelementStart(7, "div",
|
|
106
|
+
i0.ɵɵelementStart(7, "div", 24);
|
|
54
107
|
i0.ɵɵtext(8);
|
|
55
108
|
i0.ɵɵelementEnd()();
|
|
56
109
|
i0.ɵɵelementStart(9, "div");
|
|
57
|
-
i0.ɵɵtemplate(10,
|
|
110
|
+
i0.ɵɵtemplate(10, UserNotificationsComponent_ng_template_16_button_10_Template, 2, 0, "button", 3)(11, UserNotificationsComponent_ng_template_16_button_11_Template, 2, 0, "button", 3);
|
|
58
111
|
i0.ɵɵelementEnd()();
|
|
59
112
|
} if (rf & 2) {
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
i0.ɵɵclassMap(
|
|
113
|
+
const dataItem_r29 = ctx.dataItem;
|
|
114
|
+
const ctx_r9 = i0.ɵɵnextContext();
|
|
115
|
+
i0.ɵɵclassMap(ctx_r9.getItemWrapperClass(dataItem_r29));
|
|
63
116
|
i0.ɵɵadvance();
|
|
64
|
-
i0.ɵɵclassMap(
|
|
117
|
+
i0.ɵɵclassMap(ctx_r9.getItemTitleClass(dataItem_r29));
|
|
65
118
|
i0.ɵɵadvance();
|
|
66
|
-
i0.ɵɵtextInterpolate(
|
|
119
|
+
i0.ɵɵtextInterpolate(dataItem_r29.Title);
|
|
67
120
|
i0.ɵɵadvance(3);
|
|
68
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(6, 9,
|
|
121
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(6, 9, dataItem_r29.CreatedAt, "long"));
|
|
69
122
|
i0.ɵɵadvance(3);
|
|
70
|
-
i0.ɵɵtextInterpolate(
|
|
123
|
+
i0.ɵɵtextInterpolate(dataItem_r29.Message);
|
|
71
124
|
i0.ɵɵadvance(2);
|
|
72
|
-
i0.ɵɵproperty("ngIf",
|
|
125
|
+
i0.ɵɵproperty("ngIf", dataItem_r29.Unread);
|
|
73
126
|
i0.ɵɵadvance();
|
|
74
|
-
i0.ɵɵproperty("ngIf", !
|
|
127
|
+
i0.ɵɵproperty("ngIf", !dataItem_r29.Unread);
|
|
75
128
|
} }
|
|
76
129
|
export class UserNotificationsComponent {
|
|
77
130
|
constructor(sharedService, router) {
|
|
@@ -151,6 +204,12 @@ export class UserNotificationsComponent {
|
|
|
151
204
|
get AllNotifications() {
|
|
152
205
|
return SharedService.UserNotifications;
|
|
153
206
|
}
|
|
207
|
+
get UnreadNotifications() {
|
|
208
|
+
return this.AllNotifications.filter(n => n.Unread);
|
|
209
|
+
}
|
|
210
|
+
get ReadNotifications() {
|
|
211
|
+
return this.AllNotifications.filter(n => !n.Unread);
|
|
212
|
+
}
|
|
154
213
|
selectReadOption(option) {
|
|
155
214
|
this.radioSelected = option;
|
|
156
215
|
// now update the radio button group in the UI
|
|
@@ -190,7 +249,7 @@ export class UserNotificationsComponent {
|
|
|
190
249
|
classInfo += ' notification-wrap-unread';
|
|
191
250
|
return classInfo;
|
|
192
251
|
}
|
|
193
|
-
markAsRead(notification, bRead) {
|
|
252
|
+
markAsRead(notification, bRead, transGroup) {
|
|
194
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
195
254
|
if (notification) {
|
|
196
255
|
notification.Unread = !bRead;
|
|
@@ -198,17 +257,65 @@ export class UserNotificationsComponent {
|
|
|
198
257
|
const notificationEntity = yield md.GetEntityObject('User Notifications');
|
|
199
258
|
yield notificationEntity.Load(notification.ID);
|
|
200
259
|
notificationEntity.Unread = notification.Unread; //copy from local object
|
|
201
|
-
if
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
260
|
+
// part of a transaction group, if so, add it as that will defer the actual network traffic/save
|
|
261
|
+
if (transGroup) {
|
|
262
|
+
notificationEntity.TransactionGroup = transGroup;
|
|
263
|
+
notificationEntity.Save(); // no await when using a transaction group
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
if (yield notificationEntity.Save()) {
|
|
268
|
+
SharedService.RefreshUserNotifications();
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this.sharedService.CreateSimpleNotification('Unable to mark notification as read', 'error', 5000);
|
|
273
|
+
return false; // let caller do notifications
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
markAllAsRead() {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
this.markAll(true);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
markAllAsUnread() {
|
|
288
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
289
|
+
this.markAll(false);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
markAll(bRead) {
|
|
293
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
294
|
+
// do a transaction group, not so much for ATOMICITY but for performance in terms of latency to/from the server
|
|
295
|
+
const md = new Metadata();
|
|
296
|
+
const transGroup = yield md.CreateTransactionGroup();
|
|
297
|
+
for (const notification of this.AllNotifications) {
|
|
298
|
+
if (notification.Unread && bRead || !notification.Unread && !bRead) {
|
|
299
|
+
// don't await, we want to just keep going, the backgorund DB stuff happens when it happens but we can update the UI right away
|
|
300
|
+
if (!(yield this.markAsRead(notification, bRead, transGroup))) {
|
|
301
|
+
// failed
|
|
302
|
+
this.sharedService.CreateSimpleNotification('Unable to mark all notifications as read', 'error', 5000);
|
|
303
|
+
// bail out here
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
205
307
|
}
|
|
308
|
+
// if we get here, that means all the saves worked...
|
|
309
|
+
if (!(yield transGroup.Submit()))
|
|
310
|
+
this.sharedService.CreateSimpleNotification('Unable to mark all notifications as read', 'error', 5000);
|
|
311
|
+
else
|
|
312
|
+
SharedService.RefreshUserNotifications();
|
|
206
313
|
});
|
|
207
314
|
}
|
|
208
315
|
notificationClicked(notification) {
|
|
209
316
|
if (this.isNotificationClickable(notification)) {
|
|
210
317
|
// also mark this as read when we click it
|
|
211
|
-
this.markAsRead(notification, true);
|
|
318
|
+
this.markAsRead(notification, true, null);
|
|
212
319
|
const info = this.notificationUrl(notification);
|
|
213
320
|
if (info.queryString && info.queryString.trim().length > 0) {
|
|
214
321
|
const fullUrl = `${info.urlParts.join('/')}${info.queryString ? '?' + info.queryString : ''}`;
|
|
@@ -229,46 +336,43 @@ UserNotificationsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
|
229
336
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.allRadio = _t.first);
|
|
230
337
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.unreadRadio = _t.first);
|
|
231
338
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.readRadio = _t.first);
|
|
232
|
-
} }, decls:
|
|
339
|
+
} }, decls: 17, vars: 10, consts: [["mjFillContainer", "", 1, "notification-list-wrap", 3, "bottomMargin"], [1, "header"], [1, "title"], ["kendoButton", "", 3, "click", 4, "ngIf"], ["checked", "", "type", "radio", "name", "UnreadStatus", "value", "All", 3, "change", 4, "ngIf"], ["class", "radio-label", 3, "click", 4, "ngIf"], ["type", "radio", "name", "UnreadStatus", "value", "Unread", 3, "change", 4, "ngIf"], ["type", "radio", "name", "UnreadStatus", "value", "Read", 3, "change", 4, "ngIf"], ["placeholder", "Filter items...", 1, "filter-input", 3, "valueChange"], ["kendoTextBoxSuffixTemplate", ""], [3, "data"], ["kendoListViewItemTemplate", ""], ["kendoButton", "", 3, "click"], ["checked", "", "type", "radio", "name", "UnreadStatus", "value", "All", 3, "change"], ["allRadio", ""], [1, "radio-label", 3, "click"], ["type", "radio", "name", "UnreadStatus", "value", "Unread", 3, "change"], ["unreadRadio", ""], ["type", "radio", "name", "UnreadStatus", "value", "Read", 3, "change"], ["readRadio", ""], [1, "k-icon", "k-i-search"], [3, "click"], [1, "notification-body", 3, "click"], [1, "notification-date"], [1, "notification-message"]], template: function UserNotificationsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
233
340
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
|
|
234
341
|
i0.ɵɵtext(3, " Notifications ");
|
|
235
342
|
i0.ɵɵelementEnd();
|
|
236
|
-
i0.ɵɵelementStart(4, "div")
|
|
237
|
-
i0.ɵɵ
|
|
238
|
-
i0.ɵɵ
|
|
239
|
-
i0.ɵɵ
|
|
240
|
-
i0.ɵɵ
|
|
241
|
-
i0.ɵɵtext(8, "All");
|
|
242
|
-
i0.ɵɵelementEnd();
|
|
243
|
-
i0.ɵɵelementStart(9, "input", 6, 7);
|
|
244
|
-
i0.ɵɵlistener("change", function UserNotificationsComponent_Template_input_change_9_listener($event) { return ctx.onReadRadioChanged($event); });
|
|
245
|
-
i0.ɵɵelementEnd();
|
|
246
|
-
i0.ɵɵelementStart(11, "span", 5);
|
|
247
|
-
i0.ɵɵlistener("click", function UserNotificationsComponent_Template_span_click_11_listener() { return ctx.selectReadOption("Unread"); });
|
|
248
|
-
i0.ɵɵtext(12, "Unread");
|
|
249
|
-
i0.ɵɵelementEnd();
|
|
250
|
-
i0.ɵɵelementStart(13, "input", 8, 9);
|
|
251
|
-
i0.ɵɵlistener("change", function UserNotificationsComponent_Template_input_change_13_listener($event) { return ctx.onReadRadioChanged($event); });
|
|
252
|
-
i0.ɵɵelementEnd();
|
|
253
|
-
i0.ɵɵelementStart(15, "span", 5);
|
|
254
|
-
i0.ɵɵlistener("click", function UserNotificationsComponent_Template_span_click_15_listener() { return ctx.selectReadOption("Read"); });
|
|
255
|
-
i0.ɵɵtext(16, "Read");
|
|
256
|
-
i0.ɵɵelementEnd();
|
|
257
|
-
i0.ɵɵelementStart(17, "kendo-textbox", 10);
|
|
258
|
-
i0.ɵɵlistener("valueChange", function UserNotificationsComponent_Template_kendo_textbox_valueChange_17_listener($event) { return ctx.onFilterChanged($event); });
|
|
259
|
-
i0.ɵɵtemplate(18, UserNotificationsComponent_ng_template_18_Template, 1, 0, "ng-template", 11);
|
|
343
|
+
i0.ɵɵelementStart(4, "div");
|
|
344
|
+
i0.ɵɵtemplate(5, UserNotificationsComponent_button_5_Template, 2, 0, "button", 3)(6, UserNotificationsComponent_button_6_Template, 2, 0, "button", 3)(7, UserNotificationsComponent_input_7_Template, 2, 0, "input", 4)(8, UserNotificationsComponent_span_8_Template, 2, 0, "span", 5)(9, UserNotificationsComponent_input_9_Template, 2, 0, "input", 6)(10, UserNotificationsComponent_span_10_Template, 2, 0, "span", 5)(11, UserNotificationsComponent_input_11_Template, 2, 0, "input", 7)(12, UserNotificationsComponent_span_12_Template, 2, 0, "span", 5);
|
|
345
|
+
i0.ɵɵelementStart(13, "kendo-textbox", 8);
|
|
346
|
+
i0.ɵɵlistener("valueChange", function UserNotificationsComponent_Template_kendo_textbox_valueChange_13_listener($event) { return ctx.onFilterChanged($event); });
|
|
347
|
+
i0.ɵɵtemplate(14, UserNotificationsComponent_ng_template_14_Template, 1, 0, "ng-template", 9);
|
|
260
348
|
i0.ɵɵelementEnd()()();
|
|
261
|
-
i0.ɵɵelementStart(
|
|
262
|
-
i0.ɵɵtemplate(
|
|
349
|
+
i0.ɵɵelementStart(15, "kendo-listview", 10);
|
|
350
|
+
i0.ɵɵtemplate(16, UserNotificationsComponent_ng_template_16_Template, 12, 12, "ng-template", 11);
|
|
263
351
|
i0.ɵɵelementEnd()();
|
|
264
352
|
} if (rf & 2) {
|
|
265
353
|
i0.ɵɵproperty("bottomMargin", 5);
|
|
266
|
-
i0.ɵɵadvance(
|
|
354
|
+
i0.ɵɵadvance(5);
|
|
355
|
+
i0.ɵɵproperty("ngIf", ctx.UnreadNotifications.length > 0);
|
|
356
|
+
i0.ɵɵadvance();
|
|
357
|
+
i0.ɵɵproperty("ngIf", ctx.ReadNotifications.length > 0);
|
|
358
|
+
i0.ɵɵadvance();
|
|
359
|
+
i0.ɵɵproperty("ngIf", ctx.AllNotifications.length > 0);
|
|
360
|
+
i0.ɵɵadvance();
|
|
361
|
+
i0.ɵɵproperty("ngIf", ctx.AllNotifications.length > 0);
|
|
362
|
+
i0.ɵɵadvance();
|
|
363
|
+
i0.ɵɵproperty("ngIf", ctx.UnreadNotifications.length > 0 && ctx.ReadNotifications.length > 0);
|
|
364
|
+
i0.ɵɵadvance();
|
|
365
|
+
i0.ɵɵproperty("ngIf", ctx.UnreadNotifications.length > 0 && ctx.ReadNotifications.length > 0);
|
|
366
|
+
i0.ɵɵadvance();
|
|
367
|
+
i0.ɵɵproperty("ngIf", ctx.ReadNotifications.length > 0 && ctx.UnreadNotifications.length > 0);
|
|
368
|
+
i0.ɵɵadvance();
|
|
369
|
+
i0.ɵɵproperty("ngIf", ctx.ReadNotifications.length > 0 && ctx.UnreadNotifications.length > 0);
|
|
370
|
+
i0.ɵɵadvance(3);
|
|
267
371
|
i0.ɵɵproperty("data", ctx.NotificationsToShow);
|
|
268
|
-
} }, dependencies: [i3.NgIf, i4.ButtonComponent, i5.TextBoxComponent, i5.TextBoxSuffixTemplateDirective, i6.FillContainer, i7.ItemTemplateDirective, i7.ListViewComponent, i3.DatePipe], styles: [".notification-list-wrap[_ngcontent-%COMP%] {\r\n height: 800px;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n border: solid 1px lightgray;\r\n}\r\n\r\n.k-listview[_ngcontent-%COMP%] {\r\n font-family: sans-serif;\r\n border: 0;\r\n}\r\n.product[_ngcontent-%COMP%] {\r\n width: 100%;\r\n}\r\n.header[_ngcontent-%COMP%] {\r\n display: flex;\r\n background-color: lightgray;\r\n padding: 12px;\r\n height: 24px;\r\n}\r\n.title[_ngcontent-%COMP%] {\r\n flex: 1;\r\n font-size: 22px;\r\n font-weight: bold;\r\n}\r\n.filter-input[_ngcontent-%COMP%] {\r\n width: 200px;\r\n}\r\n.radio-label[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n margin-right: 10px;\r\n}\r\n\r\n.notification-wrap[_ngcontent-%COMP%] {\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n border-bottom: dashed 1px lightgray;\r\n background-color: white;\r\n}\r\n\r\n.notification-wrap-unread[_ngcontent-%COMP%] {\r\n background-color: aliceblue;\r\n}\r\n\r\n.notification-wrap-clickable[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n}\r\n\r\n.notification-title[_ngcontent-%COMP%] {\r\n font-size: 16px;\r\n}\r\n.notification-wrap-clickable[_ngcontent-%COMP%] > .notification-title[_ngcontent-%COMP%] {\r\n color: blue;\r\n text-decoration: underline;\r\n}\r\n.notification-title-unread[_ngcontent-%COMP%] {\r\n font-weight: bold;\r\n}\r\n\r\n.notification-body[_ngcontent-%COMP%] {\r\n font-size: 14px;\r\n}\r\n\r\n.notification-date[_ngcontent-%COMP%] {\r\n margin-left: 1px;\r\n font-size: 12px;\r\n color: gray;\r\n font-style: italic;\r\n}"] });
|
|
372
|
+
} }, dependencies: [i3.NgIf, i4.ButtonComponent, i5.TextBoxComponent, i5.TextBoxSuffixTemplateDirective, i6.FillContainer, i7.ItemTemplateDirective, i7.ListViewComponent, i3.DatePipe], styles: [".notification-list-wrap[_ngcontent-%COMP%] {\r\n height: 800px;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n border: solid 1px lightgray;\r\n}\r\n\r\n.k-listview[_ngcontent-%COMP%] {\r\n font-family: sans-serif;\r\n border: 0;\r\n}\r\n.product[_ngcontent-%COMP%] {\r\n width: 100%;\r\n}\r\n.header[_ngcontent-%COMP%] {\r\n display: flex;\r\n background-color: lightgray;\r\n padding: 12px;\r\n height: 24px;\r\n}\r\n\r\n.header[_ngcontent-%COMP%] button[_ngcontent-%COMP%] { \n\r\n margin-right: 10px; \r\n}\r\n\r\n.title[_ngcontent-%COMP%] {\r\n flex: 1;\r\n font-size: 22px;\r\n font-weight: bold;\r\n}\r\n.filter-input[_ngcontent-%COMP%] {\r\n width: 200px;\r\n}\r\n.radio-label[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n margin-right: 10px;\r\n}\r\n\r\n.notification-wrap[_ngcontent-%COMP%] {\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n border-bottom: dashed 1px lightgray;\r\n background-color: white;\r\n}\r\n\r\n.notification-wrap-unread[_ngcontent-%COMP%] {\r\n background-color: aliceblue;\r\n}\r\n\r\n.notification-wrap-clickable[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n}\r\n\r\n.notification-title[_ngcontent-%COMP%] {\r\n font-size: 16px;\r\n}\r\n.notification-wrap-clickable[_ngcontent-%COMP%] > .notification-title[_ngcontent-%COMP%] {\r\n color: blue;\r\n text-decoration: underline;\r\n}\r\n.notification-title-unread[_ngcontent-%COMP%] {\r\n font-weight: bold;\r\n}\r\n\r\n.notification-body[_ngcontent-%COMP%] {\r\n font-size: 14px;\r\n}\r\n\r\n.notification-date[_ngcontent-%COMP%] {\r\n margin-left: 1px;\r\n font-size: 12px;\r\n color: gray;\r\n font-style: italic;\r\n}"] });
|
|
269
373
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserNotificationsComponent, [{
|
|
270
374
|
type: Component,
|
|
271
|
-
args: [{ selector: 'app-user-notifications', template: "<div class=\"notification-list-wrap\" mjFillContainer [bottomMargin]=\"5\"> \n <div class=\"header\">\n <div class=\"title\">\n Notifications\n </div>\n <div>\n <input #allRadio checked type=\"radio\" name=\"UnreadStatus\" value=\"All\" (change)=\"onReadRadioChanged($event)\" /><span class=\"radio-label\" \n (click)=\"selectReadOption('All')\">All</span>\n <input #unreadRadio type=\"radio\" name=\"UnreadStatus\" value=\"Unread\" (change)=\"onReadRadioChanged($event)\" /><span class=\"radio-label\" \n (click)=\"selectReadOption('Unread')\">Unread</span>\n <input #readRadio type=\"radio\" name=\"UnreadStatus\" value=\"Read\" (change)=\"onReadRadioChanged($event)\" /><span class=\"radio-label\" \n (click)=\"selectReadOption('Read')\">Read</span>\n <kendo-textbox\n class=\"filter-input\"\n placeholder=\"Filter items...\"\n (valueChange)=\"onFilterChanged($event)\"\n >\n <ng-template kendoTextBoxSuffixTemplate>\n <span class=\"k-icon k-i-search\"></span>\n </ng-template>\n </kendo-textbox> \n </div>\n </div> \n\n <kendo-listview [data]=\"NotificationsToShow\">\n <ng-template kendoListViewItemTemplate let-dataItem=\"dataItem\">\n <div [class]=\"getItemWrapperClass(dataItem)\">\n <div [class]=\"getItemTitleClass(dataItem)\" (click)=\"notificationClicked(dataItem)\">{{dataItem.Title}}</div>\n <div class=\"notification-body\" (click)=\"notificationClicked(dataItem)\">\n <div class=\"notification-date\">{{dataItem.CreatedAt | date:'long'}}</div>\n <div class=\"notification-message\">{{dataItem.Message}}</div>\n </div>\n <div>\n <button kendoButton *ngIf=\"dataItem.Unread\" (click)=\"markAsRead(dataItem, true)\">Mark as Read</button>\n <button kendoButton *ngIf=\"!dataItem.Unread\" (click)=\"markAsRead(dataItem, false)\">Mark as Unread</button>\n </div> \n </div>\n </ng-template>\n </kendo-listview>\n</div>\n", styles: [".notification-list-wrap {\r\n height: 800px;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n border: solid 1px lightgray;\r\n}\r\n\r\n.k-listview {\r\n font-family: sans-serif;\r\n border: 0;\r\n}\r\n.product {\r\n width: 100%;\r\n}\r\n.header {\r\n display: flex;\r\n background-color: lightgray;\r\n padding: 12px;\r\n height: 24px;\r\n}\r\n.title {\r\n flex: 1;\r\n font-size: 22px;\r\n font-weight: bold;\r\n}\r\n.filter-input {\r\n width: 200px;\r\n}\r\n.radio-label {\r\n cursor: pointer;\r\n margin-right: 10px;\r\n}\r\n\r\n.notification-wrap {\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n border-bottom: dashed 1px lightgray;\r\n background-color: white;\r\n}\r\n\r\n.notification-wrap-unread {\r\n background-color: aliceblue;\r\n}\r\n\r\n.notification-wrap-clickable {\r\n cursor: pointer;\r\n}\r\n\r\n.notification-title {\r\n font-size: 16px;\r\n}\r\n.notification-wrap-clickable > .notification-title {\r\n color: blue;\r\n text-decoration: underline;\r\n}\r\n.notification-title-unread {\r\n font-weight: bold;\r\n}\r\n\r\n.notification-body {\r\n font-size: 14px;\r\n}\r\n\r\n.notification-date {\r\n margin-left: 1px;\r\n font-size: 12px;\r\n color: gray;\r\n font-style: italic;\r\n}"] }]
|
|
375
|
+
args: [{ selector: 'app-user-notifications', template: "<div class=\"notification-list-wrap\" mjFillContainer [bottomMargin]=\"5\"> \n <div class=\"header\">\n <div class=\"title\">\n Notifications\n </div>\n <div>\n <button *ngIf=\"UnreadNotifications.length > 0\" kendoButton (click)=\"markAllAsRead()\">Mark All as Read</button>\n <button *ngIf=\"ReadNotifications.length > 0\" kendoButton (click)=\"markAllAsUnread()\">Mark All as Unread</button>\n <input *ngIf=\"AllNotifications.length > 0\" #allRadio checked type=\"radio\" name=\"UnreadStatus\" value=\"All\" (change)=\"onReadRadioChanged($event)\" /><span *ngIf=\"AllNotifications.length > 0\" class=\"radio-label\" \n (click)=\"selectReadOption('All')\">All</span>\n <input *ngIf=\"UnreadNotifications.length > 0 && ReadNotifications.length > 0\" #unreadRadio type=\"radio\" name=\"UnreadStatus\" value=\"Unread\" (change)=\"onReadRadioChanged($event)\" /><span *ngIf=\"UnreadNotifications.length > 0 && ReadNotifications.length > 0\" class=\"radio-label\" \n (click)=\"selectReadOption('Unread')\">Unread</span>\n <input *ngIf=\"ReadNotifications.length > 0 && UnreadNotifications.length > 0\" #readRadio type=\"radio\" name=\"UnreadStatus\" value=\"Read\" (change)=\"onReadRadioChanged($event)\" /><span *ngIf=\"ReadNotifications.length > 0 && UnreadNotifications.length > 0\" class=\"radio-label\" \n (click)=\"selectReadOption('Read')\">Read</span>\n <kendo-textbox\n class=\"filter-input\"\n placeholder=\"Filter items...\"\n (valueChange)=\"onFilterChanged($event)\"\n >\n <ng-template kendoTextBoxSuffixTemplate>\n <span class=\"k-icon k-i-search\"></span>\n </ng-template>\n </kendo-textbox> \n </div>\n </div> \n\n <kendo-listview [data]=\"NotificationsToShow\">\n <ng-template kendoListViewItemTemplate let-dataItem=\"dataItem\">\n <div [class]=\"getItemWrapperClass(dataItem)\">\n <div [class]=\"getItemTitleClass(dataItem)\" (click)=\"notificationClicked(dataItem)\">{{dataItem.Title}}</div>\n <div class=\"notification-body\" (click)=\"notificationClicked(dataItem)\">\n <div class=\"notification-date\">{{dataItem.CreatedAt | date:'long'}}</div>\n <div class=\"notification-message\">{{dataItem.Message}}</div>\n </div>\n <div>\n <button kendoButton *ngIf=\"dataItem.Unread\" (click)=\"markAsRead(dataItem, true, null)\">Mark as Read</button>\n <button kendoButton *ngIf=\"!dataItem.Unread\" (click)=\"markAsRead(dataItem, false, null)\">Mark as Unread</button>\n </div> \n </div>\n </ng-template>\n </kendo-listview>\n</div>\n", styles: [".notification-list-wrap {\r\n height: 800px;\r\n overflow-y: auto;\r\n overflow-x: hidden;\r\n border: solid 1px lightgray;\r\n}\r\n\r\n.k-listview {\r\n font-family: sans-serif;\r\n border: 0;\r\n}\r\n.product {\r\n width: 100%;\r\n}\r\n.header {\r\n display: flex;\r\n background-color: lightgray;\r\n padding: 12px;\r\n height: 24px;\r\n}\r\n\r\n.header button { /*buttons within the header*/\r\n margin-right: 10px; \r\n}\r\n\r\n.title {\r\n flex: 1;\r\n font-size: 22px;\r\n font-weight: bold;\r\n}\r\n.filter-input {\r\n width: 200px;\r\n}\r\n.radio-label {\r\n cursor: pointer;\r\n margin-right: 10px;\r\n}\r\n\r\n.notification-wrap {\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n padding-top: 10px;\r\n padding-bottom: 10px;\r\n border-bottom: dashed 1px lightgray;\r\n background-color: white;\r\n}\r\n\r\n.notification-wrap-unread {\r\n background-color: aliceblue;\r\n}\r\n\r\n.notification-wrap-clickable {\r\n cursor: pointer;\r\n}\r\n\r\n.notification-title {\r\n font-size: 16px;\r\n}\r\n.notification-wrap-clickable > .notification-title {\r\n color: blue;\r\n text-decoration: underline;\r\n}\r\n.notification-title-unread {\r\n font-weight: bold;\r\n}\r\n\r\n.notification-body {\r\n font-size: 14px;\r\n}\r\n\r\n.notification-date {\r\n margin-left: 1px;\r\n font-size: 12px;\r\n color: gray;\r\n font-style: italic;\r\n}"] }]
|
|
272
376
|
}], () => [{ type: i1.SharedService }, { type: i2.Router }], { allRadio: [{
|
|
273
377
|
type: ViewChild,
|
|
274
378
|
args: ['allRadio']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-explorer-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.170",
|
|
4
4
|
"description": "MemberJunction Explorer: Core Angular Components",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@memberjunction/global": "^0.9.142",
|
|
40
|
-
"@memberjunction/core": "^0.9.
|
|
41
|
-
"@memberjunction/ng-compare-records": "^0.9.
|
|
42
|
-
"@memberjunction/ng-record-changes": "^0.9.
|
|
43
|
-
"@memberjunction/ng-container-directives": "^0.9.
|
|
44
|
-
"@memberjunction/ng-user-view-grid": "^0.9.
|
|
45
|
-
"@memberjunction/ng-query-grid": "^0.9.
|
|
40
|
+
"@memberjunction/core": "^0.9.158",
|
|
41
|
+
"@memberjunction/ng-compare-records": "^0.9.160",
|
|
42
|
+
"@memberjunction/ng-record-changes": "^0.9.94",
|
|
43
|
+
"@memberjunction/ng-container-directives": "^0.9.128",
|
|
44
|
+
"@memberjunction/ng-user-view-grid": "^0.9.184",
|
|
45
|
+
"@memberjunction/ng-query-grid": "^0.9.40",
|
|
46
46
|
"@memberjunction/ng-shared": "^0.9.15",
|
|
47
|
-
"@memberjunction/ng-ask-skip": "^0.9.
|
|
47
|
+
"@memberjunction/ng-ask-skip": "^0.9.55",
|
|
48
48
|
"tslib": "^2.3.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false
|