@memberjunction/ng-explorer-core 0.9.78 → 0.9.96

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.
Files changed (105) hide show
  1. package/dist/lib/ask-skip/ask-skip.component.d.ts +87 -86
  2. package/dist/lib/ask-skip/ask-skip.component.js +615 -580
  3. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +12 -12
  4. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +40 -39
  5. package/dist/lib/auth-button/auth-button.component.d.ts +12 -12
  6. package/dist/lib/auth-button/auth-button.component.js +44 -43
  7. package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts +18 -18
  8. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +117 -117
  9. package/dist/lib/data-browser-component/data-browser.component.d.ts +16 -14
  10. package/dist/lib/data-browser-component/data-browser.component.js +96 -91
  11. package/dist/lib/favorites/favorites.component.d.ts +14 -14
  12. package/dist/lib/favorites/favorites.component.js +114 -114
  13. package/dist/lib/generic/base-form-component.d.ts +76 -76
  14. package/dist/lib/generic/base-form-component.js +436 -436
  15. package/dist/lib/generic/base-form-section-component.d.ts +6 -6
  16. package/dist/lib/generic/base-form-section-component.js +9 -9
  17. package/dist/lib/generic/base-record-component.d.ts +6 -6
  18. package/dist/lib/generic/base-record-component.js +15 -15
  19. package/dist/lib/generic/base-resource-component.d.ts +34 -34
  20. package/dist/lib/generic/base-resource-component.js +75 -75
  21. package/dist/lib/generic/dynamic-chart.d.ts +33 -33
  22. package/dist/lib/generic/dynamic-chart.js +236 -235
  23. package/dist/lib/generic/dynamic-grid.d.ts +25 -25
  24. package/dist/lib/generic/dynamic-grid.js +120 -119
  25. package/dist/lib/generic/dynamic-report.d.ts +38 -38
  26. package/dist/lib/generic/dynamic-report.js +353 -347
  27. package/dist/lib/generic/form-toolbar.d.ts +7 -7
  28. package/dist/lib/generic/form-toolbar.js +85 -89
  29. package/dist/lib/generic/resource-container-component.d.ts +25 -25
  30. package/dist/lib/generic/resource-container-component.js +104 -103
  31. package/dist/lib/generic/section-loader-component.d.ts +17 -17
  32. package/dist/lib/generic/section-loader-component.js +66 -65
  33. package/dist/lib/generic-browse-list/generic-browse-list.component.d.ts +26 -24
  34. package/dist/lib/generic-browse-list/generic-browse-list.component.js +145 -143
  35. package/dist/lib/guards/auth-guard.service.d.ts +11 -11
  36. package/dist/lib/guards/auth-guard.service.js +24 -24
  37. package/dist/lib/guards/entities.guard.d.ts +3 -3
  38. package/dist/lib/guards/entities.guard.js +38 -38
  39. package/dist/lib/header/MSFT_UserImageService.d.ts +11 -11
  40. package/dist/lib/header/MSFT_UserImageService.js +23 -23
  41. package/dist/lib/header/header.component.d.ts +51 -51
  42. package/dist/lib/header/header.component.js +220 -208
  43. package/dist/lib/home-component/home.component.d.ts +11 -9
  44. package/dist/lib/home-component/home.component.js +77 -54
  45. package/dist/lib/join-grid/join-grid.component.d.ts +30 -30
  46. package/dist/lib/join-grid/join-grid.component.js +222 -225
  47. package/dist/lib/navigation/navigation.component.d.ts +104 -103
  48. package/dist/lib/navigation/navigation.component.js +1026 -1004
  49. package/dist/lib/query-browser-component/query-browser.component.d.ts +14 -0
  50. package/dist/lib/query-browser-component/query-browser.component.js +55 -0
  51. package/dist/lib/report-browser-component/report-browser.component.d.ts +14 -14
  52. package/dist/lib/report-browser-component/report-browser.component.js +55 -55
  53. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +8 -8
  54. package/dist/lib/resource-wrappers/dashboard-resource.component.js +51 -50
  55. package/dist/lib/resource-wrappers/query-resource.component.d.ts +10 -0
  56. package/dist/lib/resource-wrappers/query-resource.component.js +55 -0
  57. package/dist/lib/resource-wrappers/record-resource.component.d.ts +10 -10
  58. package/dist/lib/resource-wrappers/record-resource.component.js +71 -70
  59. package/dist/lib/resource-wrappers/report-resource.component.d.ts +10 -10
  60. package/dist/lib/resource-wrappers/report-resource.component.js +55 -54
  61. package/dist/lib/resource-wrappers/resource-wrappers-loader.d.ts +1 -1
  62. package/dist/lib/resource-wrappers/resource-wrappers-loader.js +14 -12
  63. package/dist/lib/resource-wrappers/search-results-resource.component.d.ts +10 -10
  64. package/dist/lib/resource-wrappers/search-results-resource.component.js +52 -51
  65. package/dist/lib/resource-wrappers/view-resource.component.d.ts +8 -8
  66. package/dist/lib/resource-wrappers/view-resource.component.js +61 -60
  67. package/dist/lib/settings/settings.component.d.ts +5 -5
  68. package/dist/lib/settings/settings.component.js +15 -14
  69. package/dist/lib/single-application/single-application.component.d.ts +20 -20
  70. package/dist/lib/single-application/single-application.component.js +113 -113
  71. package/dist/lib/single-dashboard/Components/add-item/add-item.component.d.ts +28 -28
  72. package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +210 -212
  73. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.d.ts +13 -13
  74. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +60 -59
  75. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +26 -26
  76. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +170 -169
  77. package/dist/lib/single-dashboard/single-dashboard.component.d.ts +75 -75
  78. package/dist/lib/single-dashboard/single-dashboard.component.js +464 -456
  79. package/dist/lib/single-entity/single-entity.component.d.ts +33 -33
  80. package/dist/lib/single-entity/single-entity.component.js +258 -252
  81. package/dist/lib/single-query/single-query.component.d.ts +16 -0
  82. package/dist/lib/single-query/single-query.component.js +70 -0
  83. package/dist/lib/single-record/single-record.component.d.ts +21 -21
  84. package/dist/lib/single-record/single-record.component.js +95 -95
  85. package/dist/lib/single-report/single-report.component.d.ts +22 -22
  86. package/dist/lib/single-report/single-report.component.js +88 -87
  87. package/dist/lib/single-search-result/single-search-result.component.d.ts +15 -15
  88. package/dist/lib/single-search-result/single-search-result.component.js +61 -60
  89. package/dist/lib/single-view/single-view.component.d.ts +38 -38
  90. package/dist/lib/single-view/single-view.component.js +201 -201
  91. package/dist/lib/user-notifications/user-notifications.component.d.ts +32 -32
  92. package/dist/lib/user-notifications/user-notifications.component.js +282 -282
  93. package/dist/lib/user-profile/user-profile.component.d.ts +10 -10
  94. package/dist/lib/user-profile/user-profile.component.js +42 -41
  95. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +71 -71
  96. package/dist/lib/user-view-properties/view-properties-dialog.component.js +591 -581
  97. package/dist/module.d.ts +69 -65
  98. package/dist/module.js +356 -338
  99. package/dist/public-api.d.ts +46 -47
  100. package/dist/public-api.js +49 -50
  101. package/dist/shared/shared.service.d.ts +94 -92
  102. package/dist/shared/shared.service.js +324 -318
  103. package/dist/shared/urlPipe.d.ts +7 -7
  104. package/dist/shared/urlPipe.js +16 -16
  105. package/package.json +23 -15
@@ -1,282 +1,282 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Component, ViewChild } from '@angular/core';
11
- import { SharedService } from '../../shared/shared.service';
12
- import { Metadata } from '@memberjunction/core';
13
- import * as i0 from "@angular/core";
14
- import * as i1 from "../../shared/shared.service";
15
- import * as i2 from "@angular/router";
16
- import * as i3 from "@angular/common";
17
- import * as i4 from "@progress/kendo-angular-buttons";
18
- import * as i5 from "@progress/kendo-angular-inputs";
19
- import * as i6 from "@memberjunction/ng-container-directives";
20
- import * as i7 from "@progress/kendo-angular-listview";
21
- const _c0 = ["allRadio"];
22
- const _c1 = ["unreadRadio"];
23
- const _c2 = ["readRadio"];
24
- function UserNotificationsComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
25
- i0.ɵɵelement(0, "span", 14);
26
- } }
27
- function UserNotificationsComponent_ng_template_20_button_10_Template(rf, ctx) { if (rf & 1) {
28
- const _r10 = i0.ɵɵgetCurrentView();
29
- i0.ɵɵelementStart(0, "button", 20);
30
- i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const dataItem_r5 = i0.ɵɵnextContext().dataItem; const ctx_r8 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r8.markAsRead(dataItem_r5, true)); });
31
- i0.ɵɵtext(1, "Mark as Read");
32
- i0.ɵɵelementEnd();
33
- } }
34
- function UserNotificationsComponent_ng_template_20_button_11_Template(rf, ctx) { if (rf & 1) {
35
- const _r13 = i0.ɵɵgetCurrentView();
36
- i0.ɵɵelementStart(0, "button", 20);
37
- i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_button_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r13); const dataItem_r5 = i0.ɵɵnextContext().dataItem; const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.markAsRead(dataItem_r5, false)); });
38
- i0.ɵɵtext(1, "Mark as Unread");
39
- i0.ɵɵelementEnd();
40
- } }
41
- function UserNotificationsComponent_ng_template_20_Template(rf, ctx) { if (rf & 1) {
42
- const _r15 = i0.ɵɵgetCurrentView();
43
- i0.ɵɵelementStart(0, "div")(1, "div", 15);
44
- i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_Template_div_click_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r15); const dataItem_r5 = restoredCtx.dataItem; const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.notificationClicked(dataItem_r5)); });
45
- i0.ɵɵtext(2);
46
- i0.ɵɵelementEnd();
47
- i0.ɵɵelementStart(3, "div", 16);
48
- i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_Template_div_click_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r15); const dataItem_r5 = restoredCtx.dataItem; const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.notificationClicked(dataItem_r5)); });
49
- i0.ɵɵelementStart(4, "div", 17);
50
- i0.ɵɵtext(5);
51
- i0.ɵɵpipe(6, "date");
52
- i0.ɵɵelementEnd();
53
- i0.ɵɵelementStart(7, "div", 18);
54
- i0.ɵɵtext(8);
55
- i0.ɵɵelementEnd()();
56
- i0.ɵɵelementStart(9, "div");
57
- i0.ɵɵtemplate(10, UserNotificationsComponent_ng_template_20_button_10_Template, 2, 0, "button", 19);
58
- i0.ɵɵtemplate(11, UserNotificationsComponent_ng_template_20_button_11_Template, 2, 0, "button", 19);
59
- i0.ɵɵelementEnd()();
60
- } if (rf & 2) {
61
- const dataItem_r5 = ctx.dataItem;
62
- const ctx_r4 = i0.ɵɵnextContext();
63
- i0.ɵɵclassMap(ctx_r4.getItemWrapperClass(dataItem_r5));
64
- i0.ɵɵadvance(1);
65
- i0.ɵɵclassMap(ctx_r4.getItemTitleClass(dataItem_r5));
66
- i0.ɵɵadvance(1);
67
- i0.ɵɵtextInterpolate(dataItem_r5.Title);
68
- i0.ɵɵadvance(3);
69
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(6, 9, dataItem_r5.CreatedAt, "long"));
70
- i0.ɵɵadvance(3);
71
- i0.ɵɵtextInterpolate(dataItem_r5.Message);
72
- i0.ɵɵadvance(2);
73
- i0.ɵɵproperty("ngIf", dataItem_r5.Unread);
74
- i0.ɵɵadvance(1);
75
- i0.ɵɵproperty("ngIf", !dataItem_r5.Unread);
76
- } }
77
- export class UserNotificationsComponent {
78
- constructor(sharedService, router) {
79
- this.sharedService = sharedService;
80
- this.router = router;
81
- this.radioSelected = 'all';
82
- this.currentFilter = '';
83
- }
84
- ngAfterViewInit() {
85
- this.sharedService.InvokeManualResize(); // make sure the notifications component is sized correctly
86
- }
87
- get NotificationsToShow() {
88
- let temp = [];
89
- if (this.radioSelected.trim().toLowerCase() === 'all') {
90
- temp = this.AllNotifications;
91
- }
92
- else if (this.radioSelected.trim().toLowerCase() === 'unread') {
93
- temp = this.AllNotifications.filter(n => n.Unread);
94
- }
95
- else {
96
- temp = this.AllNotifications.filter(n => !n.Unread);
97
- }
98
- // Apply filter if it is not empty
99
- if (this.currentFilter.trim().length > 0) {
100
- // check for inclusion of filter value in title or message
101
- temp = temp.filter(n => n.Title.toLowerCase().includes(this.currentFilter.trim().toLowerCase()) ||
102
- n.Message.toLowerCase().includes(this.currentFilter.trim().toLowerCase()));
103
- }
104
- return temp;
105
- }
106
- isNotificationClickable(notification) {
107
- const info = this.notificationUrl(notification);
108
- return (info !== null && info.urlParts && info.urlParts.length > 0);
109
- }
110
- notificationUrl(notification) {
111
- var _a;
112
- let url = [];
113
- let queryString = '';
114
- if (notification.ResourceRecordID && notification.ResourceRecordID > 0 &&
115
- notification.ResourceTypeID && notification.ResourceTypeID > 0) {
116
- // we have a resource here, like a Report, Dashboard, etc
117
- // we can generate a url to navigate to it
118
- const rt = this.sharedService.ResourceTypeByID(notification.ResourceTypeID);
119
- let routeSegment;
120
- if (rt)
121
- routeSegment = this.sharedService.mapResourceTypeNameToRouteSegment(rt.Name);
122
- if (rt && routeSegment && routeSegment.trim().length > 0) {
123
- url.push('resource');
124
- url.push(routeSegment);
125
- url.push(notification.ResourceRecordID.toString());
126
- if (notification.ResourceConfiguration && notification.ResourceConfiguration.trim().length > 0) {
127
- queryString = notification.ResourceConfiguration;
128
- }
129
- }
130
- }
131
- else if (notification.ResourceConfiguration && notification.ResourceConfiguration.trim().length > 0) {
132
- // we do NOT have a resource type or resource record id, but we do have a ResourceConfiguration
133
- // string, which means we might have information on how to navigate to what we want if we parse the config
134
- // HOME screen stuff is done this way
135
- const config = JSON.parse(notification.ResourceConfiguration);
136
- if (config) {
137
- switch ((_a = config.type) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) {
138
- case 'askskip':
139
- url.push('askskip');
140
- if (config.conversationId)
141
- url.push(config.conversationId);
142
- break;
143
- }
144
- }
145
- }
146
- else {
147
- // we have nothing to click on
148
- // don't generate a url
149
- }
150
- return { urlParts: url, queryString: queryString };
151
- }
152
- get AllNotifications() {
153
- return SharedService.UserNotifications;
154
- }
155
- selectReadOption(option) {
156
- this.radioSelected = option;
157
- // now update the radio button group in the UI
158
- switch (option.trim().toLowerCase()) {
159
- case 'all':
160
- this.allRadio.nativeElement.checked = true;
161
- break;
162
- case 'unread':
163
- this.unreadRadio.nativeElement.checked = true;
164
- break;
165
- case 'read':
166
- this.readRadio.nativeElement.checked = true;
167
- break;
168
- }
169
- }
170
- onReadRadioChanged(event) {
171
- const target = event.target;
172
- const value = target.value;
173
- this.radioSelected = value;
174
- }
175
- onFilterChanged(value) {
176
- this.currentFilter = value;
177
- }
178
- getItemTitleClass(notification) {
179
- if (notification.Unread) {
180
- return 'notification-title notification-title-unread';
181
- }
182
- else {
183
- return 'notification-title';
184
- }
185
- }
186
- getItemWrapperClass(notification) {
187
- let classInfo = 'notification-wrap';
188
- if (this.isNotificationClickable(notification))
189
- classInfo += ' notification-wrap-clickable';
190
- if (notification.Unread)
191
- classInfo += ' notification-wrap-unread';
192
- return classInfo;
193
- }
194
- markAsRead(notification, bRead) {
195
- return __awaiter(this, void 0, void 0, function* () {
196
- if (notification) {
197
- notification.Unread = !bRead;
198
- const md = new Metadata();
199
- const notificationEntity = yield md.GetEntityObject('User Notifications');
200
- yield notificationEntity.Load(notification.ID);
201
- notificationEntity.Unread = notification.Unread; //copy from local object
202
- if (yield notificationEntity.Save())
203
- SharedService.RefreshUserNotifications();
204
- else
205
- this.sharedService.CreateSimpleNotification('Unable to mark notification as read', 'error', 5000);
206
- }
207
- });
208
- }
209
- notificationClicked(notification) {
210
- if (this.isNotificationClickable(notification)) {
211
- // also mark this as read when we click it
212
- this.markAsRead(notification, true);
213
- const info = this.notificationUrl(notification);
214
- if (info.queryString && info.queryString.trim().length > 0) {
215
- const fullUrl = `${info.urlParts.join('/')}${info.queryString ? '?' + info.queryString : ''}`;
216
- this.router.navigateByUrl(fullUrl);
217
- }
218
- else
219
- this.router.navigate(info.urlParts);
220
- }
221
- }
222
- }
223
- UserNotificationsComponent.ɵfac = function UserNotificationsComponent_Factory(t) { return new (t || UserNotificationsComponent)(i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i2.Router)); };
224
- UserNotificationsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserNotificationsComponent, selectors: [["app-user-notifications"]], viewQuery: function UserNotificationsComponent_Query(rf, ctx) { if (rf & 1) {
225
- i0.ɵɵviewQuery(_c0, 5);
226
- i0.ɵɵviewQuery(_c1, 5);
227
- i0.ɵɵviewQuery(_c2, 5);
228
- } if (rf & 2) {
229
- let _t;
230
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.allRadio = _t.first);
231
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.unreadRadio = _t.first);
232
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.readRadio = _t.first);
233
- } }, decls: 21, vars: 2, consts: [["mjFillContainer", "", 1, "notification-list-wrap", 3, "bottomMargin"], [1, "header"], [1, "title"], ["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", ""], ["placeholder", "Filter items...", 1, "filter-input", 3, "valueChange"], ["kendoTextBoxSuffixTemplate", ""], [3, "data"], ["kendoListViewItemTemplate", ""], [1, "k-icon", "k-i-search"], [3, "click"], [1, "notification-body", 3, "click"], [1, "notification-date"], [1, "notification-message"], ["kendoButton", "", 3, "click", 4, "ngIf"], ["kendoButton", "", 3, "click"]], template: function UserNotificationsComponent_Template(rf, ctx) { if (rf & 1) {
234
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
235
- i0.ɵɵtext(3, " Notifications ");
236
- i0.ɵɵelementEnd();
237
- i0.ɵɵelementStart(4, "div")(5, "input", 3, 4);
238
- i0.ɵɵlistener("change", function UserNotificationsComponent_Template_input_change_5_listener($event) { return ctx.onReadRadioChanged($event); });
239
- i0.ɵɵelementEnd();
240
- i0.ɵɵelementStart(7, "span", 5);
241
- i0.ɵɵlistener("click", function UserNotificationsComponent_Template_span_click_7_listener() { return ctx.selectReadOption("All"); });
242
- i0.ɵɵtext(8, "All");
243
- i0.ɵɵelementEnd();
244
- i0.ɵɵelementStart(9, "input", 6, 7);
245
- i0.ɵɵlistener("change", function UserNotificationsComponent_Template_input_change_9_listener($event) { return ctx.onReadRadioChanged($event); });
246
- i0.ɵɵelementEnd();
247
- i0.ɵɵelementStart(11, "span", 5);
248
- i0.ɵɵlistener("click", function UserNotificationsComponent_Template_span_click_11_listener() { return ctx.selectReadOption("Unread"); });
249
- i0.ɵɵtext(12, "Unread");
250
- i0.ɵɵelementEnd();
251
- i0.ɵɵelementStart(13, "input", 8, 9);
252
- i0.ɵɵlistener("change", function UserNotificationsComponent_Template_input_change_13_listener($event) { return ctx.onReadRadioChanged($event); });
253
- i0.ɵɵelementEnd();
254
- i0.ɵɵelementStart(15, "span", 5);
255
- i0.ɵɵlistener("click", function UserNotificationsComponent_Template_span_click_15_listener() { return ctx.selectReadOption("Read"); });
256
- i0.ɵɵtext(16, "Read");
257
- i0.ɵɵelementEnd();
258
- i0.ɵɵelementStart(17, "kendo-textbox", 10);
259
- i0.ɵɵlistener("valueChange", function UserNotificationsComponent_Template_kendo_textbox_valueChange_17_listener($event) { return ctx.onFilterChanged($event); });
260
- i0.ɵɵtemplate(18, UserNotificationsComponent_ng_template_18_Template, 1, 0, "ng-template", 11);
261
- i0.ɵɵelementEnd()()();
262
- i0.ɵɵelementStart(19, "kendo-listview", 12);
263
- i0.ɵɵtemplate(20, UserNotificationsComponent_ng_template_20_Template, 12, 12, "ng-template", 13);
264
- i0.ɵɵelementEnd()();
265
- } if (rf & 2) {
266
- i0.ɵɵproperty("bottomMargin", 5);
267
- i0.ɵɵadvance(19);
268
- i0.ɵɵproperty("data", ctx.NotificationsToShow);
269
- } }, dependencies: [i3.NgIf, i4.Button, 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}"] });
270
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserNotificationsComponent, [{
271
- type: Component,
272
- 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}"] }]
273
- }], function () { return [{ type: i1.SharedService }, { type: i2.Router }]; }, { allRadio: [{
274
- type: ViewChild,
275
- args: ['allRadio']
276
- }], unreadRadio: [{
277
- type: ViewChild,
278
- args: ['unreadRadio']
279
- }], readRadio: [{
280
- type: ViewChild,
281
- args: ['readRadio']
282
- }] }); })();
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Component, ViewChild } from '@angular/core';
11
+ import { SharedService } from '../../shared/shared.service';
12
+ import { Metadata } from '@memberjunction/core';
13
+ import * as i0 from "@angular/core";
14
+ import * as i1 from "../../shared/shared.service";
15
+ import * as i2 from "@angular/router";
16
+ import * as i3 from "@angular/common";
17
+ import * as i4 from "@progress/kendo-angular-buttons";
18
+ import * as i5 from "@progress/kendo-angular-inputs";
19
+ import * as i6 from "@memberjunction/ng-container-directives";
20
+ import * as i7 from "@progress/kendo-angular-listview";
21
+ const _c0 = ["allRadio"];
22
+ const _c1 = ["unreadRadio"];
23
+ const _c2 = ["readRadio"];
24
+ function UserNotificationsComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
25
+ i0.ɵɵelement(0, "span", 14);
26
+ } }
27
+ function UserNotificationsComponent_ng_template_20_button_10_Template(rf, ctx) { if (rf & 1) {
28
+ const _r10 = i0.ɵɵgetCurrentView();
29
+ i0.ɵɵelementStart(0, "button", 20);
30
+ i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const dataItem_r5 = i0.ɵɵnextContext().dataItem; const ctx_r8 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r8.markAsRead(dataItem_r5, true)); });
31
+ i0.ɵɵtext(1, "Mark as Read");
32
+ i0.ɵɵelementEnd();
33
+ } }
34
+ function UserNotificationsComponent_ng_template_20_button_11_Template(rf, ctx) { if (rf & 1) {
35
+ const _r13 = i0.ɵɵgetCurrentView();
36
+ i0.ɵɵelementStart(0, "button", 20);
37
+ i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_button_11_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r13); const dataItem_r5 = i0.ɵɵnextContext().dataItem; const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.markAsRead(dataItem_r5, false)); });
38
+ i0.ɵɵtext(1, "Mark as Unread");
39
+ i0.ɵɵelementEnd();
40
+ } }
41
+ function UserNotificationsComponent_ng_template_20_Template(rf, ctx) { if (rf & 1) {
42
+ const _r15 = i0.ɵɵgetCurrentView();
43
+ i0.ɵɵelementStart(0, "div")(1, "div", 15);
44
+ i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_Template_div_click_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r15); const dataItem_r5 = restoredCtx.dataItem; const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.notificationClicked(dataItem_r5)); });
45
+ i0.ɵɵtext(2);
46
+ i0.ɵɵelementEnd();
47
+ i0.ɵɵelementStart(3, "div", 16);
48
+ i0.ɵɵlistener("click", function UserNotificationsComponent_ng_template_20_Template_div_click_3_listener() { const restoredCtx = i0.ɵɵrestoreView(_r15); const dataItem_r5 = restoredCtx.dataItem; const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.notificationClicked(dataItem_r5)); });
49
+ i0.ɵɵelementStart(4, "div", 17);
50
+ i0.ɵɵtext(5);
51
+ i0.ɵɵpipe(6, "date");
52
+ i0.ɵɵelementEnd();
53
+ i0.ɵɵelementStart(7, "div", 18);
54
+ i0.ɵɵtext(8);
55
+ i0.ɵɵelementEnd()();
56
+ i0.ɵɵelementStart(9, "div");
57
+ i0.ɵɵtemplate(10, UserNotificationsComponent_ng_template_20_button_10_Template, 2, 0, "button", 19)(11, UserNotificationsComponent_ng_template_20_button_11_Template, 2, 0, "button", 19);
58
+ i0.ɵɵelementEnd()();
59
+ } if (rf & 2) {
60
+ const dataItem_r5 = ctx.dataItem;
61
+ const ctx_r4 = i0.ɵɵnextContext();
62
+ i0.ɵɵclassMap(ctx_r4.getItemWrapperClass(dataItem_r5));
63
+ i0.ɵɵadvance();
64
+ i0.ɵɵclassMap(ctx_r4.getItemTitleClass(dataItem_r5));
65
+ i0.ɵɵadvance();
66
+ i0.ɵɵtextInterpolate(dataItem_r5.Title);
67
+ i0.ɵɵadvance(3);
68
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(6, 9, dataItem_r5.CreatedAt, "long"));
69
+ i0.ɵɵadvance(3);
70
+ i0.ɵɵtextInterpolate(dataItem_r5.Message);
71
+ i0.ɵɵadvance(2);
72
+ i0.ɵɵproperty("ngIf", dataItem_r5.Unread);
73
+ i0.ɵɵadvance();
74
+ i0.ɵɵproperty("ngIf", !dataItem_r5.Unread);
75
+ } }
76
+ export class UserNotificationsComponent {
77
+ constructor(sharedService, router) {
78
+ this.sharedService = sharedService;
79
+ this.router = router;
80
+ this.radioSelected = 'all';
81
+ this.currentFilter = '';
82
+ }
83
+ ngAfterViewInit() {
84
+ this.sharedService.InvokeManualResize(); // make sure the notifications component is sized correctly
85
+ }
86
+ get NotificationsToShow() {
87
+ let temp = [];
88
+ if (this.radioSelected.trim().toLowerCase() === 'all') {
89
+ temp = this.AllNotifications;
90
+ }
91
+ else if (this.radioSelected.trim().toLowerCase() === 'unread') {
92
+ temp = this.AllNotifications.filter(n => n.Unread);
93
+ }
94
+ else {
95
+ temp = this.AllNotifications.filter(n => !n.Unread);
96
+ }
97
+ // Apply filter if it is not empty
98
+ if (this.currentFilter.trim().length > 0) {
99
+ // check for inclusion of filter value in title or message
100
+ temp = temp.filter(n => n.Title.toLowerCase().includes(this.currentFilter.trim().toLowerCase()) ||
101
+ n.Message.toLowerCase().includes(this.currentFilter.trim().toLowerCase()));
102
+ }
103
+ return temp;
104
+ }
105
+ isNotificationClickable(notification) {
106
+ const info = this.notificationUrl(notification);
107
+ return (info !== null && info.urlParts && info.urlParts.length > 0);
108
+ }
109
+ notificationUrl(notification) {
110
+ var _a;
111
+ let url = [];
112
+ let queryString = '';
113
+ if (notification.ResourceRecordID && notification.ResourceRecordID > 0 &&
114
+ notification.ResourceTypeID && notification.ResourceTypeID > 0) {
115
+ // we have a resource here, like a Report, Dashboard, etc
116
+ // we can generate a url to navigate to it
117
+ const rt = this.sharedService.ResourceTypeByID(notification.ResourceTypeID);
118
+ let routeSegment;
119
+ if (rt)
120
+ routeSegment = this.sharedService.mapResourceTypeNameToRouteSegment(rt.Name);
121
+ if (rt && routeSegment && routeSegment.trim().length > 0) {
122
+ url.push('resource');
123
+ url.push(routeSegment);
124
+ url.push(notification.ResourceRecordID.toString());
125
+ if (notification.ResourceConfiguration && notification.ResourceConfiguration.trim().length > 0) {
126
+ queryString = notification.ResourceConfiguration;
127
+ }
128
+ }
129
+ }
130
+ else if (notification.ResourceConfiguration && notification.ResourceConfiguration.trim().length > 0) {
131
+ // we do NOT have a resource type or resource record id, but we do have a ResourceConfiguration
132
+ // string, which means we might have information on how to navigate to what we want if we parse the config
133
+ // HOME screen stuff is done this way
134
+ const config = JSON.parse(notification.ResourceConfiguration);
135
+ if (config) {
136
+ switch ((_a = config.type) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) {
137
+ case 'askskip':
138
+ url.push('askskip');
139
+ if (config.conversationId)
140
+ url.push(config.conversationId);
141
+ break;
142
+ }
143
+ }
144
+ }
145
+ else {
146
+ // we have nothing to click on
147
+ // don't generate a url
148
+ }
149
+ return { urlParts: url, queryString: queryString };
150
+ }
151
+ get AllNotifications() {
152
+ return SharedService.UserNotifications;
153
+ }
154
+ selectReadOption(option) {
155
+ this.radioSelected = option;
156
+ // now update the radio button group in the UI
157
+ switch (option.trim().toLowerCase()) {
158
+ case 'all':
159
+ this.allRadio.nativeElement.checked = true;
160
+ break;
161
+ case 'unread':
162
+ this.unreadRadio.nativeElement.checked = true;
163
+ break;
164
+ case 'read':
165
+ this.readRadio.nativeElement.checked = true;
166
+ break;
167
+ }
168
+ }
169
+ onReadRadioChanged(event) {
170
+ const target = event.target;
171
+ const value = target.value;
172
+ this.radioSelected = value;
173
+ }
174
+ onFilterChanged(value) {
175
+ this.currentFilter = value;
176
+ }
177
+ getItemTitleClass(notification) {
178
+ if (notification.Unread) {
179
+ return 'notification-title notification-title-unread';
180
+ }
181
+ else {
182
+ return 'notification-title';
183
+ }
184
+ }
185
+ getItemWrapperClass(notification) {
186
+ let classInfo = 'notification-wrap';
187
+ if (this.isNotificationClickable(notification))
188
+ classInfo += ' notification-wrap-clickable';
189
+ if (notification.Unread)
190
+ classInfo += ' notification-wrap-unread';
191
+ return classInfo;
192
+ }
193
+ markAsRead(notification, bRead) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ if (notification) {
196
+ notification.Unread = !bRead;
197
+ const md = new Metadata();
198
+ const notificationEntity = yield md.GetEntityObject('User Notifications');
199
+ yield notificationEntity.Load(notification.ID);
200
+ notificationEntity.Unread = notification.Unread; //copy from local object
201
+ if (yield notificationEntity.Save())
202
+ SharedService.RefreshUserNotifications();
203
+ else
204
+ this.sharedService.CreateSimpleNotification('Unable to mark notification as read', 'error', 5000);
205
+ }
206
+ });
207
+ }
208
+ notificationClicked(notification) {
209
+ if (this.isNotificationClickable(notification)) {
210
+ // also mark this as read when we click it
211
+ this.markAsRead(notification, true);
212
+ const info = this.notificationUrl(notification);
213
+ if (info.queryString && info.queryString.trim().length > 0) {
214
+ const fullUrl = `${info.urlParts.join('/')}${info.queryString ? '?' + info.queryString : ''}`;
215
+ this.router.navigateByUrl(fullUrl);
216
+ }
217
+ else
218
+ this.router.navigate(info.urlParts);
219
+ }
220
+ }
221
+ }
222
+ UserNotificationsComponent.ɵfac = function UserNotificationsComponent_Factory(t) { return new (t || UserNotificationsComponent)(i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i2.Router)); };
223
+ UserNotificationsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserNotificationsComponent, selectors: [["app-user-notifications"]], viewQuery: function UserNotificationsComponent_Query(rf, ctx) { if (rf & 1) {
224
+ i0.ɵɵviewQuery(_c0, 5);
225
+ i0.ɵɵviewQuery(_c1, 5);
226
+ i0.ɵɵviewQuery(_c2, 5);
227
+ } if (rf & 2) {
228
+ let _t;
229
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.allRadio = _t.first);
230
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.unreadRadio = _t.first);
231
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.readRadio = _t.first);
232
+ } }, decls: 21, vars: 2, consts: [["mjFillContainer", "", 1, "notification-list-wrap", 3, "bottomMargin"], [1, "header"], [1, "title"], ["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", ""], ["placeholder", "Filter items...", 1, "filter-input", 3, "valueChange"], ["kendoTextBoxSuffixTemplate", ""], [3, "data"], ["kendoListViewItemTemplate", ""], [1, "k-icon", "k-i-search"], [3, "click"], [1, "notification-body", 3, "click"], [1, "notification-date"], [1, "notification-message"], ["kendoButton", "", 3, "click", 4, "ngIf"], ["kendoButton", "", 3, "click"]], template: function UserNotificationsComponent_Template(rf, ctx) { if (rf & 1) {
233
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
234
+ i0.ɵɵtext(3, " Notifications ");
235
+ i0.ɵɵelementEnd();
236
+ i0.ɵɵelementStart(4, "div")(5, "input", 3, 4);
237
+ i0.ɵɵlistener("change", function UserNotificationsComponent_Template_input_change_5_listener($event) { return ctx.onReadRadioChanged($event); });
238
+ i0.ɵɵelementEnd();
239
+ i0.ɵɵelementStart(7, "span", 5);
240
+ i0.ɵɵlistener("click", function UserNotificationsComponent_Template_span_click_7_listener() { return ctx.selectReadOption("All"); });
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);
260
+ i0.ɵɵelementEnd()()();
261
+ i0.ɵɵelementStart(19, "kendo-listview", 12);
262
+ i0.ɵɵtemplate(20, UserNotificationsComponent_ng_template_20_Template, 12, 12, "ng-template", 13);
263
+ i0.ɵɵelementEnd()();
264
+ } if (rf & 2) {
265
+ i0.ɵɵproperty("bottomMargin", 5);
266
+ i0.ɵɵadvance(19);
267
+ 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}"] });
269
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserNotificationsComponent, [{
270
+ 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}"] }]
272
+ }], () => [{ type: i1.SharedService }, { type: i2.Router }], { allRadio: [{
273
+ type: ViewChild,
274
+ args: ['allRadio']
275
+ }], unreadRadio: [{
276
+ type: ViewChild,
277
+ args: ['unreadRadio']
278
+ }], readRadio: [{
279
+ type: ViewChild,
280
+ args: ['readRadio']
281
+ }] }); })();
282
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserNotificationsComponent, { className: "UserNotificationsComponent", filePath: "src\\lib\\user-notifications\\user-notifications.component.ts", lineNumber: 12 }); })();