@digital-realty/ix-notifications 1.0.2 → 1.0.4
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/dist/IxNotifications.d.ts +37 -37
- package/dist/IxNotifications.js +163 -163
- package/dist/api/notifications-api/apis/NotificationsApi.d.ts +83 -83
- package/dist/api/notifications-api/apis/NotificationsApi.js +203 -203
- package/dist/api/notifications-api/apis/index.d.ts +1 -1
- package/dist/api/notifications-api/apis/index.js +3 -3
- package/dist/api/notifications-api/index.d.ts +3 -3
- package/dist/api/notifications-api/index.js +5 -5
- package/dist/api/notifications-api/models/ErrorResponse.d.ts +55 -55
- package/dist/api/notifications-api/models/ErrorResponse.js +51 -51
- package/dist/api/notifications-api/models/GetNotifications200Response.d.ts +62 -62
- package/dist/api/notifications-api/models/GetNotifications200Response.js +55 -55
- package/dist/api/notifications-api/models/Notification.d.ts +86 -86
- package/dist/api/notifications-api/models/Notification.js +62 -62
- package/dist/api/notifications-api/models/NotificationDelete.d.ts +31 -31
- package/dist/api/notifications-api/models/NotificationDelete.js +43 -43
- package/dist/api/notifications-api/models/NotificationPatch.d.ts +32 -32
- package/dist/api/notifications-api/models/NotificationPatch.js +44 -44
- package/dist/api/notifications-api/models/NotificationRequest.d.ts +73 -73
- package/dist/api/notifications-api/models/NotificationRequest.js +61 -61
- package/dist/api/notifications-api/models/PaginatedResponse.d.ts +61 -61
- package/dist/api/notifications-api/models/PaginatedResponse.js +54 -54
- package/dist/api/notifications-api/models/Status.d.ts +23 -23
- package/dist/api/notifications-api/models/Status.js +30 -30
- package/dist/api/notifications-api/models/index.d.ts +8 -8
- package/dist/api/notifications-api/models/index.js +10 -10
- package/dist/api/notifications-api/runtime.d.ts +182 -182
- package/dist/api/notifications-api/runtime.js +318 -318
- package/dist/components/notifications/confirmation-dialog.d.ts +10 -10
- package/dist/components/notifications/confirmation-dialog.js +42 -42
- package/dist/components/notifications/date-filters.d.ts +19 -19
- package/dist/components/notifications/date-filters.js +90 -90
- package/dist/components/notifications/group-filters.d.ts +8 -8
- package/dist/components/notifications/group-filters.js +35 -35
- package/dist/components/notifications/grouped-item.d.ts +13 -13
- package/dist/components/notifications/grouped-item.js +56 -56
- package/dist/components/notifications/notification-item.d.ts +18 -18
- package/dist/components/notifications/notification-item.js +95 -95
- package/dist/components/notifications/view-item-dialog.d.ts +12 -12
- package/dist/components/notifications/view-item-dialog.js +61 -61
- package/dist/constants/api-constants.d.ts +3 -3
- package/dist/constants/api-constants.js +3 -3
- package/dist/constants/notification-types.d.ts +15 -15
- package/dist/constants/notification-types.js +1 -1
- package/dist/constants/notifications.d.ts +15 -15
- package/dist/constants/notifications.js +18 -18
- package/dist/helper/errors.d.ts +1 -1
- package/dist/helper/errors.js +19 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/ix-notifications.d.ts +1 -1
- package/dist/ix-notifications.js +2 -2
- package/dist/models/notification.d.ts +13 -13
- package/dist/models/notification.js +1 -1
- package/dist/services/api-client.d.ts +13 -13
- package/dist/services/api-client.js +23 -23
- package/dist/services/app-service.d.ts +1 -1
- package/dist/services/app-service.js +6 -6
- package/dist/services/notifications-service.d.ts +10 -10
- package/dist/services/notifications-service.js +55 -55
- package/dist/state/NotificationState.d.ts +28 -28
- package/dist/state/NotificationState.js +153 -153
- package/dist/styles/notifications-style.d.ts +1 -1
- package/dist/styles/notifications-style.js +2 -2
- package/dist/tw.d.ts +1 -1
- package/dist/tw.js +2 -2
- package/package.json +3 -2
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { MobxLitElement } from '@adobe/lit-mobx';
|
|
2
|
-
import '@digital-realty/ix-button/ix-button.js';
|
|
3
|
-
import '@digital-realty/ix-drawer/ix-drawer.js';
|
|
4
|
-
import '@digital-realty/ix-icon';
|
|
5
|
-
import '@material/web/icon/icon.js';
|
|
6
|
-
import { Notification } from './models/notification.js';
|
|
7
|
-
import { FilterDialogEventDetail } from './constants/notification-types.js';
|
|
8
|
-
import './components/notifications/notification-item.js';
|
|
9
|
-
import './components/notifications/grouped-item.js';
|
|
10
|
-
import './components/notifications/group-filters.js';
|
|
11
|
-
import './components/notifications/date-filters.js';
|
|
12
|
-
import './components/notifications/confirmation-dialog.js';
|
|
13
|
-
export declare class IxNotifications extends MobxLitElement {
|
|
14
|
-
static styles: import("lit").CSSResult[];
|
|
15
|
-
private showDrawer;
|
|
16
|
-
private showGroupedView;
|
|
17
|
-
private showFilters;
|
|
18
|
-
private showDateFilters;
|
|
19
|
-
private showMarkAllReadConfirmation;
|
|
20
|
-
baseApiUrl: string;
|
|
21
|
-
firstUpdated(): Promise<void>;
|
|
22
|
-
connectedCallback(): void;
|
|
23
|
-
disconnectedCallback(): void;
|
|
24
|
-
toggleDrawer(): void;
|
|
25
|
-
renderUnReadCountText(): import("lit").TemplateResult<1>;
|
|
26
|
-
markAllread(): void;
|
|
27
|
-
private confirmedMarkAllRead;
|
|
28
|
-
toggleGroupView(): void;
|
|
29
|
-
displayFilters(): void;
|
|
30
|
-
applyNotificationFilters(): Notification[];
|
|
31
|
-
displayDateFilters(): void;
|
|
32
|
-
renderGroupedView(): import("lit").TemplateResult<1>;
|
|
33
|
-
renderDefaultView(): import("lit").TemplateResult<1>;
|
|
34
|
-
renderNoResult(): import("lit").TemplateResult<1>;
|
|
35
|
-
handleCloseClick(_e: CustomEvent<FilterDialogEventDetail>): void;
|
|
36
|
-
render(): import("lit").TemplateResult<1>;
|
|
37
|
-
}
|
|
1
|
+
import { MobxLitElement } from '@adobe/lit-mobx';
|
|
2
|
+
import '@digital-realty/ix-button/ix-button.js';
|
|
3
|
+
import '@digital-realty/ix-drawer/ix-drawer.js';
|
|
4
|
+
import '@digital-realty/ix-icon';
|
|
5
|
+
import '@material/web/icon/icon.js';
|
|
6
|
+
import { Notification } from './models/notification.js';
|
|
7
|
+
import { FilterDialogEventDetail } from './constants/notification-types.js';
|
|
8
|
+
import './components/notifications/notification-item.js';
|
|
9
|
+
import './components/notifications/grouped-item.js';
|
|
10
|
+
import './components/notifications/group-filters.js';
|
|
11
|
+
import './components/notifications/date-filters.js';
|
|
12
|
+
import './components/notifications/confirmation-dialog.js';
|
|
13
|
+
export declare class IxNotifications extends MobxLitElement {
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
private showDrawer;
|
|
16
|
+
private showGroupedView;
|
|
17
|
+
private showFilters;
|
|
18
|
+
private showDateFilters;
|
|
19
|
+
private showMarkAllReadConfirmation;
|
|
20
|
+
baseApiUrl: string;
|
|
21
|
+
firstUpdated(): Promise<void>;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
toggleDrawer(): void;
|
|
25
|
+
renderUnReadCountText(): import("lit").TemplateResult<1>;
|
|
26
|
+
markAllread(): void;
|
|
27
|
+
private confirmedMarkAllRead;
|
|
28
|
+
toggleGroupView(): void;
|
|
29
|
+
displayFilters(): void;
|
|
30
|
+
applyNotificationFilters(): Notification[];
|
|
31
|
+
displayDateFilters(): void;
|
|
32
|
+
renderGroupedView(): import("lit").TemplateResult<1>;
|
|
33
|
+
renderDefaultView(): import("lit").TemplateResult<1>;
|
|
34
|
+
renderNoResult(): import("lit").TemplateResult<1>;
|
|
35
|
+
handleCloseClick(_e: CustomEvent<FilterDialogEventDetail>): void;
|
|
36
|
+
render(): import("lit").TemplateResult<1>;
|
|
37
|
+
}
|
package/dist/IxNotifications.js
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, nothing } from 'lit';
|
|
3
|
-
import { property, state } from 'lit/decorators.js';
|
|
4
|
-
import { MobxLitElement } from '@adobe/lit-mobx';
|
|
5
|
-
import { differenceInDays, differenceInHours } from 'date-fns';
|
|
6
|
-
import { TWStyles } from './tw.js';
|
|
7
|
-
import '@digital-realty/ix-button/ix-button.js';
|
|
8
|
-
import '@digital-realty/ix-drawer/ix-drawer.js';
|
|
9
|
-
import '@digital-realty/ix-icon';
|
|
10
|
-
import '@material/web/icon/icon.js';
|
|
11
|
-
import { NotificationsState } from './state/NotificationState.js';
|
|
12
|
-
import { NotificationGroups, NotificationStatus, } from './constants/notifications.js';
|
|
13
|
-
import './components/notifications/notification-item.js';
|
|
14
|
-
import './components/notifications/grouped-item.js';
|
|
15
|
-
import './components/notifications/group-filters.js';
|
|
16
|
-
import './components/notifications/date-filters.js';
|
|
17
|
-
import './components/notifications/confirmation-dialog.js';
|
|
18
|
-
import { NotificationsStyle } from './styles/notifications-style.js';
|
|
19
|
-
export class IxNotifications extends MobxLitElement {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.showDrawer = false;
|
|
23
|
-
this.showGroupedView = false;
|
|
24
|
-
this.showFilters = false;
|
|
25
|
-
this.showDateFilters = false;
|
|
26
|
-
this.showMarkAllReadConfirmation = false;
|
|
27
|
-
this.baseApiUrl = '';
|
|
28
|
-
}
|
|
29
|
-
async firstUpdated() {
|
|
30
|
-
// Construct ApiClient form baseApiUrl Prop
|
|
31
|
-
NotificationsState.baseApiUrl = this.baseApiUrl;
|
|
32
|
-
NotificationsState.ConstructApiClient();
|
|
33
|
-
}
|
|
34
|
-
connectedCallback() {
|
|
35
|
-
super.connectedCallback();
|
|
36
|
-
window.addEventListener('account-switched', NotificationsState.NewApiClient);
|
|
37
|
-
}
|
|
38
|
-
disconnectedCallback() {
|
|
39
|
-
super.disconnectedCallback();
|
|
40
|
-
window.removeEventListener('account-switched', NotificationsState.NewApiClient);
|
|
41
|
-
}
|
|
42
|
-
toggleDrawer() {
|
|
43
|
-
this.showDrawer = !this.showDrawer;
|
|
44
|
-
if (!this.showDrawer) {
|
|
45
|
-
this.showFilters = false;
|
|
46
|
-
this.showDateFilters = false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/* eslint-disable-next-line */
|
|
50
|
-
renderUnReadCountText() {
|
|
51
|
-
if (NotificationsState.unreadNotificationCount <= 0) {
|
|
52
|
-
return html `${nothing}`;
|
|
53
|
-
}
|
|
54
|
-
let unreadCountText = '';
|
|
55
|
-
if (NotificationsState.unreadNotificationCount > 99) {
|
|
56
|
-
unreadCountText = '99+';
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
unreadCountText = NotificationsState.unreadNotificationCount.toString();
|
|
60
|
-
}
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
|
+
import { MobxLitElement } from '@adobe/lit-mobx';
|
|
5
|
+
import { differenceInDays, differenceInHours } from 'date-fns';
|
|
6
|
+
import { TWStyles } from './tw.js';
|
|
7
|
+
import '@digital-realty/ix-button/ix-button.js';
|
|
8
|
+
import '@digital-realty/ix-drawer/ix-drawer.js';
|
|
9
|
+
import '@digital-realty/ix-icon';
|
|
10
|
+
import '@material/web/icon/icon.js';
|
|
11
|
+
import { NotificationsState } from './state/NotificationState.js';
|
|
12
|
+
import { NotificationGroups, NotificationStatus, } from './constants/notifications.js';
|
|
13
|
+
import './components/notifications/notification-item.js';
|
|
14
|
+
import './components/notifications/grouped-item.js';
|
|
15
|
+
import './components/notifications/group-filters.js';
|
|
16
|
+
import './components/notifications/date-filters.js';
|
|
17
|
+
import './components/notifications/confirmation-dialog.js';
|
|
18
|
+
import { NotificationsStyle } from './styles/notifications-style.js';
|
|
19
|
+
export class IxNotifications extends MobxLitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.showDrawer = false;
|
|
23
|
+
this.showGroupedView = false;
|
|
24
|
+
this.showFilters = false;
|
|
25
|
+
this.showDateFilters = false;
|
|
26
|
+
this.showMarkAllReadConfirmation = false;
|
|
27
|
+
this.baseApiUrl = '';
|
|
28
|
+
}
|
|
29
|
+
async firstUpdated() {
|
|
30
|
+
// Construct ApiClient form baseApiUrl Prop
|
|
31
|
+
NotificationsState.baseApiUrl = this.baseApiUrl;
|
|
32
|
+
NotificationsState.ConstructApiClient();
|
|
33
|
+
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
window.addEventListener('account-switched', NotificationsState.NewApiClient);
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback();
|
|
40
|
+
window.removeEventListener('account-switched', NotificationsState.NewApiClient);
|
|
41
|
+
}
|
|
42
|
+
toggleDrawer() {
|
|
43
|
+
this.showDrawer = !this.showDrawer;
|
|
44
|
+
if (!this.showDrawer) {
|
|
45
|
+
this.showFilters = false;
|
|
46
|
+
this.showDateFilters = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/* eslint-disable-next-line */
|
|
50
|
+
renderUnReadCountText() {
|
|
51
|
+
if (NotificationsState.unreadNotificationCount <= 0) {
|
|
52
|
+
return html `${nothing}`;
|
|
53
|
+
}
|
|
54
|
+
let unreadCountText = '';
|
|
55
|
+
if (NotificationsState.unreadNotificationCount > 99) {
|
|
56
|
+
unreadCountText = '99+';
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
unreadCountText = NotificationsState.unreadNotificationCount.toString();
|
|
60
|
+
}
|
|
61
61
|
return html ` <div
|
|
62
62
|
class="px-1 bg-red-500 rounded-full text-center text-white text-sm absolute icon-position -start-0"
|
|
63
63
|
style="top:0.05rem ;left: 1.5rem;"
|
|
64
64
|
>
|
|
65
65
|
${unreadCountText}
|
|
66
|
-
</div>`;
|
|
67
|
-
}
|
|
68
|
-
markAllread() {
|
|
69
|
-
this.showMarkAllReadConfirmation = true;
|
|
70
|
-
}
|
|
71
|
-
confirmedMarkAllRead(e) {
|
|
72
|
-
// Mark All read if Confirmed True
|
|
73
|
-
if (e.detail.returnValue) {
|
|
74
|
-
const filterNotification = this.applyNotificationFilters();
|
|
75
|
-
filterNotification === null || filterNotification === void 0 ? void 0 : filterNotification.forEach(item => {
|
|
76
|
-
if (item.status === NotificationStatus.UNREAD)
|
|
77
|
-
NotificationsState.setNotificationReadStatus(item.id);
|
|
78
|
-
});
|
|
79
|
-
this.renderUnReadCountText();
|
|
80
|
-
}
|
|
81
|
-
this.showMarkAllReadConfirmation = false;
|
|
82
|
-
}
|
|
83
|
-
toggleGroupView() {
|
|
84
|
-
this.showGroupedView = !this.showGroupedView;
|
|
85
|
-
}
|
|
86
|
-
displayFilters() {
|
|
87
|
-
this.showFilters = !this.showFilters;
|
|
88
|
-
}
|
|
89
|
-
/* eslint-disable-next-line */
|
|
90
|
-
applyNotificationFilters() {
|
|
91
|
-
var _a;
|
|
92
|
-
const filterredNotifications = (_a = NotificationsState.notifications) === null || _a === void 0 ? void 0 : _a.filter((x) => (x.resourceType === NotificationGroups.PLANNED_MAINTENANCE &&
|
|
93
|
-
NotificationsState.notificationFilters.SHOW_PLANNED_MAINTENANCE ===
|
|
94
|
-
true) ||
|
|
95
|
-
(x.resourceType === NotificationGroups.SERVICE_TICKETS &&
|
|
96
|
-
NotificationsState.notificationFilters.SHOW_SERVICE_TICKETS ===
|
|
97
|
-
true) ||
|
|
98
|
-
(x.resourceType === NotificationGroups.DCIM_ALERTS &&
|
|
99
|
-
NotificationsState.notificationFilters.SHOW_DCIM_ALERTS === true) ||
|
|
100
|
-
x.resourceType === NotificationGroups.INCIDENTS); // Always display incidents
|
|
101
|
-
if (NotificationsState.dateFilters.FROM_DATE === undefined ||
|
|
102
|
-
NotificationsState.dateFilters.TO_DATE === undefined)
|
|
103
|
-
return filterredNotifications;
|
|
104
|
-
return filterredNotifications.filter(x => differenceInHours(new Date(x.createdAt), NotificationsState.dateFilters.FROM_DATE) >= 0 &&
|
|
105
|
-
differenceInDays(new Date(x.createdAt), NotificationsState.dateFilters.TO_DATE) <= 0);
|
|
106
|
-
}
|
|
107
|
-
displayDateFilters() {
|
|
108
|
-
this.showDateFilters = !this.showDateFilters;
|
|
109
|
-
}
|
|
110
|
-
renderGroupedView() {
|
|
111
|
-
const filteredNotifications = this.applyNotificationFilters();
|
|
66
|
+
</div>`;
|
|
67
|
+
}
|
|
68
|
+
markAllread() {
|
|
69
|
+
this.showMarkAllReadConfirmation = true;
|
|
70
|
+
}
|
|
71
|
+
confirmedMarkAllRead(e) {
|
|
72
|
+
// Mark All read if Confirmed True
|
|
73
|
+
if (e.detail.returnValue) {
|
|
74
|
+
const filterNotification = this.applyNotificationFilters();
|
|
75
|
+
filterNotification === null || filterNotification === void 0 ? void 0 : filterNotification.forEach(item => {
|
|
76
|
+
if (item.status === NotificationStatus.UNREAD)
|
|
77
|
+
NotificationsState.setNotificationReadStatus(item.id);
|
|
78
|
+
});
|
|
79
|
+
this.renderUnReadCountText();
|
|
80
|
+
}
|
|
81
|
+
this.showMarkAllReadConfirmation = false;
|
|
82
|
+
}
|
|
83
|
+
toggleGroupView() {
|
|
84
|
+
this.showGroupedView = !this.showGroupedView;
|
|
85
|
+
}
|
|
86
|
+
displayFilters() {
|
|
87
|
+
this.showFilters = !this.showFilters;
|
|
88
|
+
}
|
|
89
|
+
/* eslint-disable-next-line */
|
|
90
|
+
applyNotificationFilters() {
|
|
91
|
+
var _a;
|
|
92
|
+
const filterredNotifications = (_a = NotificationsState.notifications) === null || _a === void 0 ? void 0 : _a.filter((x) => (x.resourceType === NotificationGroups.PLANNED_MAINTENANCE &&
|
|
93
|
+
NotificationsState.notificationFilters.SHOW_PLANNED_MAINTENANCE ===
|
|
94
|
+
true) ||
|
|
95
|
+
(x.resourceType === NotificationGroups.SERVICE_TICKETS &&
|
|
96
|
+
NotificationsState.notificationFilters.SHOW_SERVICE_TICKETS ===
|
|
97
|
+
true) ||
|
|
98
|
+
(x.resourceType === NotificationGroups.DCIM_ALERTS &&
|
|
99
|
+
NotificationsState.notificationFilters.SHOW_DCIM_ALERTS === true) ||
|
|
100
|
+
x.resourceType === NotificationGroups.INCIDENTS); // Always display incidents
|
|
101
|
+
if (NotificationsState.dateFilters.FROM_DATE === undefined ||
|
|
102
|
+
NotificationsState.dateFilters.TO_DATE === undefined)
|
|
103
|
+
return filterredNotifications;
|
|
104
|
+
return filterredNotifications.filter(x => differenceInHours(new Date(x.createdAt), NotificationsState.dateFilters.FROM_DATE) >= 0 &&
|
|
105
|
+
differenceInDays(new Date(x.createdAt), NotificationsState.dateFilters.TO_DATE) <= 0);
|
|
106
|
+
}
|
|
107
|
+
displayDateFilters() {
|
|
108
|
+
this.showDateFilters = !this.showDateFilters;
|
|
109
|
+
}
|
|
110
|
+
renderGroupedView() {
|
|
111
|
+
const filteredNotifications = this.applyNotificationFilters();
|
|
112
112
|
return html `<div>
|
|
113
113
|
<grouped-item
|
|
114
114
|
groupTitle=${NotificationGroups.PLANNED_MAINTENANCE}
|
|
@@ -130,54 +130,54 @@ export class IxNotifications extends MobxLitElement {
|
|
|
130
130
|
iconName="public"
|
|
131
131
|
.childItems=${filteredNotifications === null || filteredNotifications === void 0 ? void 0 : filteredNotifications.filter(item => item.resourceType === NotificationGroups.DCIM_ALERTS)}
|
|
132
132
|
></grouped-item>
|
|
133
|
-
</div>`;
|
|
134
|
-
}
|
|
135
|
-
renderDefaultView() {
|
|
136
|
-
const filterNotification = this.applyNotificationFilters();
|
|
137
|
-
const filterTodayItems = filterNotification.filter(x => differenceInDays(x.createdAt, new Date()) === 0);
|
|
138
|
-
const filterEarlierItems = filterNotification.filter(x => differenceInDays(x.createdAt, new Date()) !== 0);
|
|
139
|
-
if ((filterNotification === null || filterNotification === void 0 ? void 0 : filterNotification.length) > 0) {
|
|
133
|
+
</div>`;
|
|
134
|
+
}
|
|
135
|
+
renderDefaultView() {
|
|
136
|
+
const filterNotification = this.applyNotificationFilters();
|
|
137
|
+
const filterTodayItems = filterNotification.filter(x => differenceInDays(x.createdAt, new Date()) === 0);
|
|
138
|
+
const filterEarlierItems = filterNotification.filter(x => differenceInDays(x.createdAt, new Date()) !== 0);
|
|
139
|
+
if ((filterNotification === null || filterNotification === void 0 ? void 0 : filterNotification.length) > 0) {
|
|
140
140
|
return html ` <div class="grow text-sm font-bold py-4 pl-2 align-top">
|
|
141
141
|
Latest
|
|
142
142
|
</div>
|
|
143
143
|
<div class="m-0 p-0">
|
|
144
|
-
${filterTodayItems.length > 0
|
|
144
|
+
${filterTodayItems.length > 0
|
|
145
145
|
? filterTodayItems === null || filterTodayItems === void 0 ? void 0 : filterTodayItems.map(item => html `<notification-item
|
|
146
146
|
.notificaiton=${item}
|
|
147
|
-
?disabled=${item.resourceType ===
|
|
147
|
+
?disabled=${item.resourceType ===
|
|
148
148
|
NotificationGroups.INCIDENTS}
|
|
149
149
|
>
|
|
150
|
-
</notification-item> `)
|
|
150
|
+
</notification-item> `)
|
|
151
151
|
: this.renderNoResult()}
|
|
152
152
|
</div>
|
|
153
153
|
<div class="grow text-sm font-bold py-4 pl-2 align-top">Earlier</div>
|
|
154
154
|
<div>
|
|
155
|
-
${filterEarlierItems.length > 0
|
|
155
|
+
${filterEarlierItems.length > 0
|
|
156
156
|
? filterEarlierItems === null || filterEarlierItems === void 0 ? void 0 : filterEarlierItems.map(item => html `<notification-item
|
|
157
157
|
.notificaiton=${item}
|
|
158
|
-
?disabled=${item.resourceType ===
|
|
158
|
+
?disabled=${item.resourceType ===
|
|
159
159
|
NotificationGroups.INCIDENTS}
|
|
160
160
|
>
|
|
161
|
-
</notification-item> `)
|
|
161
|
+
</notification-item> `)
|
|
162
162
|
: this.renderNoResult()}
|
|
163
|
-
</div>`;
|
|
164
|
-
}
|
|
163
|
+
</div>`;
|
|
164
|
+
}
|
|
165
165
|
return html `<p class="m-0 pl-4 font-bold mr-4">
|
|
166
166
|
<small style="padding-left: 16px">No notifications yet.</small>
|
|
167
|
-
</p>`;
|
|
168
|
-
}
|
|
169
|
-
/* eslint-disable-next-line */
|
|
170
|
-
renderNoResult() {
|
|
167
|
+
</p>`;
|
|
168
|
+
}
|
|
169
|
+
/* eslint-disable-next-line */
|
|
170
|
+
renderNoResult() {
|
|
171
171
|
return html `<p class="m-0 pl-4 font-bold mr-4">
|
|
172
172
|
<small style="padding-left: 16px">No notifications yet.</small>
|
|
173
|
-
</p>`;
|
|
174
|
-
}
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
176
|
-
handleCloseClick(_e) {
|
|
177
|
-
this.showDateFilters = false;
|
|
178
|
-
this.showFilters = false;
|
|
179
|
-
}
|
|
180
|
-
render() {
|
|
173
|
+
</p>`;
|
|
174
|
+
}
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
176
|
+
handleCloseClick(_e) {
|
|
177
|
+
this.showDateFilters = false;
|
|
178
|
+
this.showFilters = false;
|
|
179
|
+
}
|
|
180
|
+
render() {
|
|
181
181
|
return html `
|
|
182
182
|
<div class="relative">
|
|
183
183
|
<ix-icon-button
|
|
@@ -190,8 +190,8 @@ export class IxNotifications extends MobxLitElement {
|
|
|
190
190
|
</div>
|
|
191
191
|
<confirmation-dialog
|
|
192
192
|
?open=${this.showMarkAllReadConfirmation}
|
|
193
|
-
@confirm-dialog-closed=${() => {
|
|
194
|
-
this.showMarkAllReadConfirmation = false;
|
|
193
|
+
@confirm-dialog-closed=${() => {
|
|
194
|
+
this.showMarkAllReadConfirmation = false;
|
|
195
195
|
}}
|
|
196
196
|
@on-confirm-selection=${this.confirmedMarkAllRead}
|
|
197
197
|
textMessage="Are you sure you want to mark all notifications as read?"
|
|
@@ -224,8 +224,8 @@ export class IxNotifications extends MobxLitElement {
|
|
|
224
224
|
class="blue-icon"
|
|
225
225
|
></ix-icon-button>
|
|
226
226
|
<div
|
|
227
|
-
class="filter-dropdown-content ${this.showFilters
|
|
228
|
-
? 'active z-50'
|
|
227
|
+
class="filter-dropdown-content ${this.showFilters
|
|
228
|
+
? 'active z-50'
|
|
229
229
|
: ''}"
|
|
230
230
|
>
|
|
231
231
|
<group-filters></group-filters>
|
|
@@ -236,8 +236,8 @@ export class IxNotifications extends MobxLitElement {
|
|
|
236
236
|
class="blue-icon"
|
|
237
237
|
></ix-icon-button>
|
|
238
238
|
<div
|
|
239
|
-
class="datefilter-dropdown-content ${this.showDateFilters
|
|
240
|
-
? 'active z-50'
|
|
239
|
+
class="datefilter-dropdown-content ${this.showDateFilters
|
|
240
|
+
? 'active z-50'
|
|
241
241
|
: ''}"
|
|
242
242
|
@on-selection=${this.handleCloseClick}
|
|
243
243
|
>
|
|
@@ -246,31 +246,31 @@ export class IxNotifications extends MobxLitElement {
|
|
|
246
246
|
</div>
|
|
247
247
|
</div>
|
|
248
248
|
<div slot="content">
|
|
249
|
-
${this.showGroupedView
|
|
250
|
-
? this.renderGroupedView()
|
|
249
|
+
${this.showGroupedView
|
|
250
|
+
? this.renderGroupedView()
|
|
251
251
|
: this.renderDefaultView()}
|
|
252
252
|
</div>
|
|
253
253
|
</ix-drawer>
|
|
254
|
-
`;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
IxNotifications.styles = [TWStyles, NotificationsStyle];
|
|
258
|
-
__decorate([
|
|
259
|
-
state()
|
|
260
|
-
], IxNotifications.prototype, "showDrawer", void 0);
|
|
261
|
-
__decorate([
|
|
262
|
-
state()
|
|
263
|
-
], IxNotifications.prototype, "showGroupedView", void 0);
|
|
264
|
-
__decorate([
|
|
265
|
-
state()
|
|
266
|
-
], IxNotifications.prototype, "showFilters", void 0);
|
|
267
|
-
__decorate([
|
|
268
|
-
state()
|
|
269
|
-
], IxNotifications.prototype, "showDateFilters", void 0);
|
|
270
|
-
__decorate([
|
|
271
|
-
state()
|
|
272
|
-
], IxNotifications.prototype, "showMarkAllReadConfirmation", void 0);
|
|
273
|
-
__decorate([
|
|
274
|
-
property({ type: String })
|
|
275
|
-
], IxNotifications.prototype, "baseApiUrl", void 0);
|
|
254
|
+
`;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
IxNotifications.styles = [TWStyles, NotificationsStyle];
|
|
258
|
+
__decorate([
|
|
259
|
+
state()
|
|
260
|
+
], IxNotifications.prototype, "showDrawer", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
state()
|
|
263
|
+
], IxNotifications.prototype, "showGroupedView", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
state()
|
|
266
|
+
], IxNotifications.prototype, "showFilters", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
state()
|
|
269
|
+
], IxNotifications.prototype, "showDateFilters", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
state()
|
|
272
|
+
], IxNotifications.prototype, "showMarkAllReadConfirmation", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
property({ type: String })
|
|
275
|
+
], IxNotifications.prototype, "baseApiUrl", void 0);
|
|
276
276
|
//# sourceMappingURL=IxNotifications.js.map
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Notifications API
|
|
3
|
-
* An API to create and read notifications
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.0.0
|
|
6
|
-
* Contact: DevTeamProduct@digitalrealty.com
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
import * as runtime from '../runtime';
|
|
13
|
-
import type { GetNotifications200Response, Notification, NotificationDelete, NotificationPatch, NotificationRequest, Status } from '../models/index';
|
|
14
|
-
export interface CreateNotificationRequest {
|
|
15
|
-
notificationRequest?: NotificationRequest;
|
|
16
|
-
}
|
|
17
|
-
export interface DeleteNotificationsByIdRequest {
|
|
18
|
-
id: string;
|
|
19
|
-
}
|
|
20
|
-
export interface GetNotificationsRequest {
|
|
21
|
-
sort?: string;
|
|
22
|
-
cursor?: string;
|
|
23
|
-
resourceType?: string;
|
|
24
|
-
accountNumber?: string;
|
|
25
|
-
createdAfter?: Date;
|
|
26
|
-
createdBefore?: Date;
|
|
27
|
-
locationId?: string;
|
|
28
|
-
subGroup?: string;
|
|
29
|
-
status?: Status;
|
|
30
|
-
prefer?: Array<string>;
|
|
31
|
-
}
|
|
32
|
-
export interface GetNotificationsByIdRequest {
|
|
33
|
-
id: string;
|
|
34
|
-
}
|
|
35
|
-
export interface PatchNotificationsByIdRequest {
|
|
36
|
-
id: string;
|
|
37
|
-
notificationPatch?: NotificationPatch;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
export declare class NotificationsApi extends runtime.BaseAPI {
|
|
43
|
-
/**
|
|
44
|
-
* Submit notification to be sent to user
|
|
45
|
-
*/
|
|
46
|
-
createNotificationRaw(requestParameters: CreateNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>>;
|
|
47
|
-
/**
|
|
48
|
-
* Submit notification to be sent to user
|
|
49
|
-
*/
|
|
50
|
-
createNotification(requestParameters?: CreateNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification>;
|
|
51
|
-
/**
|
|
52
|
-
* Delete a notification by id
|
|
53
|
-
*/
|
|
54
|
-
deleteNotificationsByIdRaw(requestParameters: DeleteNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationDelete>>;
|
|
55
|
-
/**
|
|
56
|
-
* Delete a notification by id
|
|
57
|
-
*/
|
|
58
|
-
deleteNotificationsById(requestParameters: DeleteNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationDelete>;
|
|
59
|
-
/**
|
|
60
|
-
* Get all notifications
|
|
61
|
-
*/
|
|
62
|
-
getNotificationsRaw(requestParameters: GetNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetNotifications200Response>>;
|
|
63
|
-
/**
|
|
64
|
-
* Get all notifications
|
|
65
|
-
*/
|
|
66
|
-
getNotifications(requestParameters?: GetNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetNotifications200Response>;
|
|
67
|
-
/**
|
|
68
|
-
* Get an notification by id
|
|
69
|
-
*/
|
|
70
|
-
getNotificationsByIdRaw(requestParameters: GetNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>>;
|
|
71
|
-
/**
|
|
72
|
-
* Get an notification by id
|
|
73
|
-
*/
|
|
74
|
-
getNotificationsById(requestParameters: GetNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification>;
|
|
75
|
-
/**
|
|
76
|
-
* Update specific fields on a notification by id
|
|
77
|
-
*/
|
|
78
|
-
patchNotificationsByIdRaw(requestParameters: PatchNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationPatch>>;
|
|
79
|
-
/**
|
|
80
|
-
* Update specific fields on a notification by id
|
|
81
|
-
*/
|
|
82
|
-
patchNotificationsById(requestParameters: PatchNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationPatch>;
|
|
83
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Notifications API
|
|
3
|
+
* An API to create and read notifications
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: DevTeamProduct@digitalrealty.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { GetNotifications200Response, Notification, NotificationDelete, NotificationPatch, NotificationRequest, Status } from '../models/index';
|
|
14
|
+
export interface CreateNotificationRequest {
|
|
15
|
+
notificationRequest?: NotificationRequest;
|
|
16
|
+
}
|
|
17
|
+
export interface DeleteNotificationsByIdRequest {
|
|
18
|
+
id: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetNotificationsRequest {
|
|
21
|
+
sort?: string;
|
|
22
|
+
cursor?: string;
|
|
23
|
+
resourceType?: string;
|
|
24
|
+
accountNumber?: string;
|
|
25
|
+
createdAfter?: Date;
|
|
26
|
+
createdBefore?: Date;
|
|
27
|
+
locationId?: string;
|
|
28
|
+
subGroup?: string;
|
|
29
|
+
status?: Status;
|
|
30
|
+
prefer?: Array<string>;
|
|
31
|
+
}
|
|
32
|
+
export interface GetNotificationsByIdRequest {
|
|
33
|
+
id: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PatchNotificationsByIdRequest {
|
|
36
|
+
id: string;
|
|
37
|
+
notificationPatch?: NotificationPatch;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export declare class NotificationsApi extends runtime.BaseAPI {
|
|
43
|
+
/**
|
|
44
|
+
* Submit notification to be sent to user
|
|
45
|
+
*/
|
|
46
|
+
createNotificationRaw(requestParameters: CreateNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>>;
|
|
47
|
+
/**
|
|
48
|
+
* Submit notification to be sent to user
|
|
49
|
+
*/
|
|
50
|
+
createNotification(requestParameters?: CreateNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete a notification by id
|
|
53
|
+
*/
|
|
54
|
+
deleteNotificationsByIdRaw(requestParameters: DeleteNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationDelete>>;
|
|
55
|
+
/**
|
|
56
|
+
* Delete a notification by id
|
|
57
|
+
*/
|
|
58
|
+
deleteNotificationsById(requestParameters: DeleteNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationDelete>;
|
|
59
|
+
/**
|
|
60
|
+
* Get all notifications
|
|
61
|
+
*/
|
|
62
|
+
getNotificationsRaw(requestParameters: GetNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetNotifications200Response>>;
|
|
63
|
+
/**
|
|
64
|
+
* Get all notifications
|
|
65
|
+
*/
|
|
66
|
+
getNotifications(requestParameters?: GetNotificationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetNotifications200Response>;
|
|
67
|
+
/**
|
|
68
|
+
* Get an notification by id
|
|
69
|
+
*/
|
|
70
|
+
getNotificationsByIdRaw(requestParameters: GetNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Notification>>;
|
|
71
|
+
/**
|
|
72
|
+
* Get an notification by id
|
|
73
|
+
*/
|
|
74
|
+
getNotificationsById(requestParameters: GetNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Notification>;
|
|
75
|
+
/**
|
|
76
|
+
* Update specific fields on a notification by id
|
|
77
|
+
*/
|
|
78
|
+
patchNotificationsByIdRaw(requestParameters: PatchNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NotificationPatch>>;
|
|
79
|
+
/**
|
|
80
|
+
* Update specific fields on a notification by id
|
|
81
|
+
*/
|
|
82
|
+
patchNotificationsById(requestParameters: PatchNotificationsByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NotificationPatch>;
|
|
83
|
+
}
|