@digital-realty/ix-notifications 1.1.21 → 1.1.23

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 (34) hide show
  1. package/dist/IxNotifications.d.ts +4 -4
  2. package/dist/IxNotifications.js.map +1 -1
  3. package/dist/api/notifications-api/apis/NotificationsApi.js.map +1 -1
  4. package/dist/api/notifications-api/models/ErrorResponse.js.map +1 -1
  5. package/dist/api/notifications-api/models/GetNotifications200Response.js.map +1 -1
  6. package/dist/api/notifications-api/models/Notification.js.map +1 -1
  7. package/dist/api/notifications-api/models/NotificationDelete.js.map +1 -1
  8. package/dist/api/notifications-api/models/NotificationPatch.js.map +1 -1
  9. package/dist/api/notifications-api/models/NotificationRequest.js.map +1 -1
  10. package/dist/api/notifications-api/models/PaginatedResponse.js.map +1 -1
  11. package/dist/api/notifications-api/runtime.js.map +1 -1
  12. package/dist/assets/iconset.d.ts +6 -6
  13. package/dist/components/notifications/confirmation-dialog.d.ts +1 -1
  14. package/dist/components/notifications/confirmation-dialog.js.map +1 -1
  15. package/dist/components/notifications/date-filters.d.ts +1 -1
  16. package/dist/components/notifications/date-filters.js.map +1 -1
  17. package/dist/components/notifications/group-filters.d.ts +1 -1
  18. package/dist/components/notifications/group-filters.js.map +1 -1
  19. package/dist/components/notifications/grouped-item.d.ts +2 -2
  20. package/dist/components/notifications/grouped-item.js.map +1 -1
  21. package/dist/components/notifications/notification-item.d.ts +3 -3
  22. package/dist/components/notifications/notification-item.js +6 -3
  23. package/dist/components/notifications/notification-item.js.map +1 -1
  24. package/dist/components/notifications/notification-tooltip.d.ts +1 -1
  25. package/dist/components/notifications/notification-tooltip.js.map +1 -1
  26. package/dist/components/notifications/view-item-dialog.d.ts +1 -1
  27. package/dist/components/notifications/view-item-dialog.js.map +1 -1
  28. package/dist/helper/errors.js.map +1 -1
  29. package/dist/ix-notifications.min.js +1 -1
  30. package/dist/services/notifications-service.js.map +1 -1
  31. package/dist/state/NotificationState.js.map +1 -1
  32. package/dist/tw.js +2 -2
  33. package/dist/tw.js.map +1 -1
  34. package/package.json +13 -14
@@ -1 +1 @@
1
- {"version":3,"file":"confirmation-dialog.js","sourceRoot":"","sources":["../../../src/components/notifications/confirmation-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGlE,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,cAAc;IAA/C;;QAKwC,gBAAW,GAAG,eAAe,CAAC;QAE7B,SAAI,GAAG,KAAK,CAAC;QAc3D,iBAAY,GAAG,GAAG,EAAE;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC;IA2BJ,CAAC;IAjDC,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAMD,OAAO,CAAC,aAAsB;QAC5B,MAAM,KAAK,GAAG,IAAI,WAAW,CAC3B,sBAAsB,EACtB;YACE,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;YACtC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAMD,MAAM;QACJ,OAAO,IAAI,CAAA;cACD,IAAI,CAAC,IAAI;;gBAEP,IAAI,CAAC,YAAY;;6BAEJ,IAAI,CAAC,WAAW;;;;;;sBAMvB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;;;;;;sBAMzB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;;;;iBAK7B,CAAC;IAChB,CAAC;CACF,CAAA;AA7C8C;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;uDAA+B;AAE7B;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gDAAc;AAPhD,kBAAkB;IAD9B,aAAa,CAAC,qBAAqB,CAAC;GACxB,kBAAkB,CAkD9B;SAlDY,kBAAkB","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport { TWStyles } from '../../tw.js';\nimport { ConfirmationDialogEventDetail } from '../../constants/notification-types.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\n\n@customElement('confirmation-dialog')\nexport class ConfirmationDialog extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @property({ type: String, attribute: true }) textMessage = 'Are you sure?';\n\n @property({ type: Boolean, attribute: true }) open = false;\n\n onClick(selectedvalue: Boolean) {\n const event = new CustomEvent<ConfirmationDialogEventDetail>(\n 'on-confirm-selection',\n {\n detail: { returnValue: selectedvalue },\n bubbles: true,\n composed: true,\n }\n );\n this.dispatchEvent(event);\n }\n\n dialogClosed = () => {\n this.dispatchEvent(new CustomEvent('confirm-dialog-closed'));\n };\n\n render() {\n return html` <ix-dialog\n ?open=${this.open}\n class=\"w-[580px]\"\n @closed=${this.dialogClosed}\n >\n <div slot=\"headline\">${this.textMessage}</div>\n <div slot=\"actions\">\n <div class=\"flex flex-row justify-end p-1\">\n <ix-button\n name=\"cancel\"\n appearance=\"text\"\n @click=\"${() => this.onClick(false)}\"\n >DISMISS</ix-button\n >\n <ix-button\n name=\"confirm\"\n appearance=\"text\"\n @click=\"${() => this.onClick(true)}\"\n >YES</ix-button\n >\n </div>\n </div>\n </ix-dialog>`;\n }\n}\n"]}
1
+ {"version":3,"file":"confirmation-dialog.js","sourceRoot":"","sources":["../../../src/components/notifications/confirmation-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGlE,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,cAAc;IAA/C;;QAKwC,gBAAW,GAAG,eAAe,CAAC;QAE7B,SAAI,GAAG,KAAK,CAAC;QAc3D,iBAAY,GAAG,GAAG,EAAE;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC;IA2BJ,CAAC;IAjDC,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAMD,OAAO,CAAC,aAAsB;QAC5B,MAAM,KAAK,GAAG,IAAI,WAAW,CAC3B,sBAAsB,EACtB;YACE,MAAM,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;YACtC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAMD,MAAM;QACJ,OAAO,IAAI,CAAA;cACD,IAAI,CAAC,IAAI;;gBAEP,IAAI,CAAC,YAAY;;6BAEJ,IAAI,CAAC,WAAW;;;;;;sBAMvB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;;;;;;sBAMzB,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;;;;iBAK7B,CAAC;IAChB,CAAC;CACF,CAAA;AA7C8C;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;uDAA+B;AAE7B;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;gDAAc;AAPhD,kBAAkB;IAD9B,aAAa,CAAC,qBAAqB,CAAC;GACxB,kBAAkB,CAkD9B","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport { TWStyles } from '../../tw.js';\nimport { ConfirmationDialogEventDetail } from '../../constants/notification-types.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\n\n@customElement('confirmation-dialog')\nexport class ConfirmationDialog extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @property({ type: String, attribute: true }) textMessage = 'Are you sure?';\n\n @property({ type: Boolean, attribute: true }) open = false;\n\n onClick(selectedvalue: Boolean) {\n const event = new CustomEvent<ConfirmationDialogEventDetail>(\n 'on-confirm-selection',\n {\n detail: { returnValue: selectedvalue },\n bubbles: true,\n composed: true,\n }\n );\n this.dispatchEvent(event);\n }\n\n dialogClosed = () => {\n this.dispatchEvent(new CustomEvent('confirm-dialog-closed'));\n };\n\n render() {\n return html` <ix-dialog\n ?open=${this.open}\n class=\"w-[580px]\"\n @closed=${this.dialogClosed}\n >\n <div slot=\"headline\">${this.textMessage}</div>\n <div slot=\"actions\">\n <div class=\"flex flex-row justify-end p-1\">\n <ix-button\n name=\"cancel\"\n appearance=\"text\"\n @click=\"${() => this.onClick(false)}\"\n >DISMISS</ix-button\n >\n <ix-button\n name=\"confirm\"\n appearance=\"text\"\n @click=\"${() => this.onClick(true)}\"\n >YES</ix-button\n >\n </div>\n </div>\n </ix-dialog>`;\n }\n}\n"]}
@@ -15,5 +15,5 @@ export declare class DateFilters extends MobxLitElement {
15
15
  onToDateChange(toDate: string): void;
16
16
  onApplyDateFilter(selectedvalue: Boolean): void;
17
17
  clearDateFilters(): void;
18
- render(): import("lit").TemplateResult<1>;
18
+ render(): import("lit-html").TemplateResult<1>;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"date-filters.js","sourceRoot":"","sources":["../../../src/components/notifications/date-filters.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,0CAA0C,CAAC;AAClD,OAAO,yBAAyB,CAAC;AACjC,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,cAAc;IAAxC;;QAKY,aAAQ,GAAI,CAAC,wBAAwB,CACpD,kBAAkB,CAAC,WAAW,CAAC,SAAS,CACzC;YACC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,SAAU,EAAE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CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;IACnC,CAAC;IAED,0DAA0D;IAC1D,MAAM;QACJ,OAAO,IAAI,CAAA;;;yDAG0C,IAAI,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;qBAkBzD,IAAI,CAAC,QAAQ;kBAChB,IAAI,CAAC,OAAO;;;yBAGL,IAAI,CAAC,iBAAiB;yBACtB,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;;;;qBAIxC,IAAI,CAAC,MAAM;kBACd,IAAI,CAAC,OAAO;;;yBAGL,IAAI,CAAC,eAAe;yBACpB,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;;;;;;;;;oBASvC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;;;;;;;oBAOnC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;;;;WAI3C,CAAC;IACV,CAAC;CACF,CAAA;AAxJU;IAAR,KAAK,EAAE;6CAIM;AAEL;IAAR,KAAK,EAAE;2CAIM;AAEL;IAAR,KAAK,EAAE;4CAAyD;AAExD;IAAR,KAAK,EAAE;sDAAiC;AAEhC;IAAR,KAAK,EAAE;oDAA+B;AArB5B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA6JvB;SA7JY,WAAW","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-date/ix-date.js';\nimport '@digital-realty/ix-divider/ix-divider.js';\nimport '@digital-realty/ix-icon';\nimport '@material/web/icon/icon.js';\nimport { format } from 'date-fns/format.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport { DefaultDateFormat } from '../../constants/notifications.js';\nimport { FilterDialogEventDetail } from '../../constants/notification-types.js';\nimport { isNullOrUndefinedOrEmpty } from '../../helper/common.js';\n\n@customElement('date-filters')\nexport class DateFilters extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @state() private fromDate? = !isNullOrUndefinedOrEmpty(\n NotificationsState.dateFilters.FROM_DATE\n )\n ? format(NotificationsState.dateFilters.FROM_DATE!, DefaultDateFormat)\n : undefined;\n\n @state() private toDate? = !isNullOrUndefinedOrEmpty(\n NotificationsState.dateFilters.TO_DATE\n )\n ? format(NotificationsState.dateFilters.TO_DATE!, DefaultDateFormat)\n : undefined;\n\n @state() private maxDate = format(new Date(), DefaultDateFormat);\n\n @state() private fromDateErrorText? = '';\n\n @state() private toDateErrorText? = '';\n\n onFromDateChange(fromDate: string) {\n // handling of clear date event of calendar\n if (fromDate === null || fromDate === '') this.fromDate = undefined;\n else {\n this.fromDate = fromDate;\n // clear error message\n if (this.fromDate !== undefined) this.fromDateErrorText = undefined;\n }\n }\n\n onToDateChange(toDate: string) {\n // handling of clear date event of calendar\n if (toDate === null || toDate === '') this.toDate = undefined;\n else {\n this.toDate = toDate;\n // clear error message\n if (this.toDate !== undefined) this.toDateErrorText = undefined;\n }\n }\n\n onApplyDateFilter(selectedvalue: Boolean) {\n if (selectedvalue) {\n if (this.toDate === undefined && this.fromDate !== undefined) {\n this.toDateErrorText = 'Please select to date';\n return;\n }\n\n if (this.fromDate === undefined && this.toDate !== undefined) {\n this.fromDateErrorText = 'Please select from date';\n return;\n }\n\n if (this.fromDate! > this.toDate!) {\n this.fromDateErrorText = 'From date cannot be later than To date.';\n this.fromDate = undefined;\n return;\n }\n\n this.fromDateErrorText = undefined;\n\n if (this.toDate! < this.fromDate!) {\n this.toDateErrorText = 'To date cannot be earlier than From date.';\n this.toDate = undefined;\n return;\n }\n\n this.toDateErrorText = undefined;\n }\n\n const datesChanged =\n selectedvalue &&\n this.toDateErrorText === undefined &&\n this.fromDateErrorText === undefined;\n\n if (datesChanged) {\n NotificationsState.setNotificationDateFilter(this.fromDate, this.toDate);\n this.requestUpdate();\n }\n\n const event = new CustomEvent<FilterDialogEventDetail>('on-selection', {\n detail: { returnValue: datesChanged },\n bubbles: true,\n composed: true,\n });\n\n this.dispatchEvent(event);\n }\n\n clearDateFilters() {\n this.fromDate = undefined;\n this.toDate = undefined;\n this.fromDateErrorText = undefined;\n this.toDateErrorText = undefined;\n }\n\n /* eslint-disable lit-a11y/click-events-have-key-events */\n render() {\n return html` <div class=\"flex flex-col p-4\">\n <div class=\"flex flex-row items-center\">\n <div class=\"grow items-center text-xl font-bold\">Filter by Date</div>\n <div class=\"flex flex-row items-center\" @click=${this.clearDateFilters}>\n <label class=\"grow text-sm text-right pr-1 cursor-pointer\"\n >Clear Filter</label\n >\n <ix-icon-button\n small\n appearance=\"default\"\n icon=\"domain_verification_off\"\n class=\"active-icon\"\n ></ix-icon-button>\n </div>\n </div>\n <ix-divider class=\"my-2\"></ix-divider>\n <div\n class=\"flex xl:flex-row lg:flex-col md:flex-col sm:flex-col justify-between item-center my-4\"\n >\n <div class=\"flex gap-2\">\n <ix-date\n .value=${this.fromDate}\n max=${this.maxDate}\n label=\"From\"\n name=\"FromDate\"\n .errorText=${this.fromDateErrorText}\n .onChanged=${(e: any) => this.onFromDateChange(e)}\n >\n </ix-date>\n <ix-date\n .value=${this.toDate}\n max=${this.maxDate}\n label=\"To\"\n name=\"ToDate\"\n .errorText=${this.toDateErrorText}\n .onChanged=${(e: any) => this.onToDateChange(e)}\n ></ix-date>\n </div>\n </div>\n <div class=\"flex flex-row justify-between\">\n <ix-button\n type=\"\"\n target=\"\"\n appearance=\"text\"\n @click=\"${() => this.onApplyDateFilter(false)}\"\n >Cancel</ix-button\n >\n <ix-button\n type=\"\"\n target=\"\"\n appearance=\"text\"\n @click=\"${() => this.onApplyDateFilter(true)}\"\n >Filter List</ix-button\n >\n </div>\n </div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"date-filters.js","sourceRoot":"","sources":["../../../src/components/notifications/date-filters.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,0CAA0C,CAAC;AAClD,OAAO,yBAAyB,CAAC;AACjC,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,cAAc;IAAxC;;QAKY,aAAQ,GAAI,CAAC,wBAAwB,CACpD,kBAAkB,CAAC,WAAW,CAAC,SAAS,CACzC;YACC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,SAAU,EAAE,iBAAiB,CAAC;YACtE,CAAC,CAAC,SAAS,CAAC;QAEG,WAAM,GAAI,CAAC,wBAAwB,CAClD,kBAAkB,CAAC,WAAW,CAAC,OAAO,CACvC;YACC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,OAAQ,EAAE,iBAAiB,CAAC;YACpE,CAAC,CAAC,SAAS,CAAC;QAEG,YAAO,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE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;;;;;;;;;;;;;;qBAkBzD,IAAI,CAAC,QAAQ;kBAChB,IAAI,CAAC,OAAO;;;yBAGL,IAAI,CAAC,iBAAiB;yBACtB,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;;;;qBAIxC,IAAI,CAAC,MAAM;kBACd,IAAI,CAAC,OAAO;;;yBAGL,IAAI,CAAC,eAAe;yBACpB,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;;;;;;;;;oBASvC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;;;;;;;oBAOnC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;;;;WAI3C,CAAC;IACV,CAAC;CACF,CAAA;AAxJkB;IAAhB,KAAK,EAAE;6CAIM;AAEG;IAAhB,KAAK,EAAE;2CAIM;AAEG;IAAhB,KAAK,EAAE;4CAAyD;AAEhD;IAAhB,KAAK,EAAE;sDAAiC;AAExB;IAAhB,KAAK,EAAE;oDAA+B;AArB5B,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA6JvB","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-date/ix-date.js';\nimport '@digital-realty/ix-divider/ix-divider.js';\nimport '@digital-realty/ix-icon';\nimport '@material/web/icon/icon.js';\nimport { format } from 'date-fns/format.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport { DefaultDateFormat } from '../../constants/notifications.js';\nimport { FilterDialogEventDetail } from '../../constants/notification-types.js';\nimport { isNullOrUndefinedOrEmpty } from '../../helper/common.js';\n\n@customElement('date-filters')\nexport class DateFilters extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @state() private fromDate? = !isNullOrUndefinedOrEmpty(\n NotificationsState.dateFilters.FROM_DATE\n )\n ? format(NotificationsState.dateFilters.FROM_DATE!, DefaultDateFormat)\n : undefined;\n\n @state() private toDate? = !isNullOrUndefinedOrEmpty(\n NotificationsState.dateFilters.TO_DATE\n )\n ? format(NotificationsState.dateFilters.TO_DATE!, DefaultDateFormat)\n : undefined;\n\n @state() private maxDate = format(new Date(), DefaultDateFormat);\n\n @state() private fromDateErrorText? = '';\n\n @state() private toDateErrorText? = '';\n\n onFromDateChange(fromDate: string) {\n // handling of clear date event of calendar\n if (fromDate === null || fromDate === '') this.fromDate = undefined;\n else {\n this.fromDate = fromDate;\n // clear error message\n if (this.fromDate !== undefined) this.fromDateErrorText = undefined;\n }\n }\n\n onToDateChange(toDate: string) {\n // handling of clear date event of calendar\n if (toDate === null || toDate === '') this.toDate = undefined;\n else {\n this.toDate = toDate;\n // clear error message\n if (this.toDate !== undefined) this.toDateErrorText = undefined;\n }\n }\n\n onApplyDateFilter(selectedvalue: Boolean) {\n if (selectedvalue) {\n if (this.toDate === undefined && this.fromDate !== undefined) {\n this.toDateErrorText = 'Please select to date';\n return;\n }\n\n if (this.fromDate === undefined && this.toDate !== undefined) {\n this.fromDateErrorText = 'Please select from date';\n return;\n }\n\n if (this.fromDate! > this.toDate!) {\n this.fromDateErrorText = 'From date cannot be later than To date.';\n this.fromDate = undefined;\n return;\n }\n\n this.fromDateErrorText = undefined;\n\n if (this.toDate! < this.fromDate!) {\n this.toDateErrorText = 'To date cannot be earlier than From date.';\n this.toDate = undefined;\n return;\n }\n\n this.toDateErrorText = undefined;\n }\n\n const datesChanged =\n selectedvalue &&\n this.toDateErrorText === undefined &&\n this.fromDateErrorText === undefined;\n\n if (datesChanged) {\n NotificationsState.setNotificationDateFilter(this.fromDate, this.toDate);\n this.requestUpdate();\n }\n\n const event = new CustomEvent<FilterDialogEventDetail>('on-selection', {\n detail: { returnValue: datesChanged },\n bubbles: true,\n composed: true,\n });\n\n this.dispatchEvent(event);\n }\n\n clearDateFilters() {\n this.fromDate = undefined;\n this.toDate = undefined;\n this.fromDateErrorText = undefined;\n this.toDateErrorText = undefined;\n }\n\n /* eslint-disable lit-a11y/click-events-have-key-events */\n render() {\n return html` <div class=\"flex flex-col p-4\">\n <div class=\"flex flex-row items-center\">\n <div class=\"grow items-center text-xl font-bold\">Filter by Date</div>\n <div class=\"flex flex-row items-center\" @click=${this.clearDateFilters}>\n <label class=\"grow text-sm text-right pr-1 cursor-pointer\"\n >Clear Filter</label\n >\n <ix-icon-button\n small\n appearance=\"default\"\n icon=\"domain_verification_off\"\n class=\"active-icon\"\n ></ix-icon-button>\n </div>\n </div>\n <ix-divider class=\"my-2\"></ix-divider>\n <div\n class=\"flex xl:flex-row lg:flex-col md:flex-col sm:flex-col justify-between item-center my-4\"\n >\n <div class=\"flex gap-2\">\n <ix-date\n .value=${this.fromDate}\n max=${this.maxDate}\n label=\"From\"\n name=\"FromDate\"\n .errorText=${this.fromDateErrorText}\n .onChanged=${(e: any) => this.onFromDateChange(e)}\n >\n </ix-date>\n <ix-date\n .value=${this.toDate}\n max=${this.maxDate}\n label=\"To\"\n name=\"ToDate\"\n .errorText=${this.toDateErrorText}\n .onChanged=${(e: any) => this.onToDateChange(e)}\n ></ix-date>\n </div>\n </div>\n <div class=\"flex flex-row justify-between\">\n <ix-button\n type=\"\"\n target=\"\"\n appearance=\"text\"\n @click=\"${() => this.onApplyDateFilter(false)}\"\n >Cancel</ix-button\n >\n <ix-button\n type=\"\"\n target=\"\"\n appearance=\"text\"\n @click=\"${() => this.onApplyDateFilter(true)}\"\n >Filter List</ix-button\n >\n </div>\n </div>`;\n }\n}\n"]}
@@ -4,5 +4,5 @@ import '@digital-realty/ix-switch/ix-switch.js';
4
4
  export declare class GroupFilters extends MobxLitElement {
5
5
  static get styles(): import("lit").CSSResult[];
6
6
  onSwitchChange(e: Event): void;
7
- render(): import("lit").TemplateResult<1>;
7
+ render(): import("lit-html").TemplateResult<1>;
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"group-filters.js","sourceRoot":"","sources":["../../../src/components/notifications/group-filters.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,wCAAwC,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGlE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,cAAc;IAC9C,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,cAAc,CAAC,CAAQ;;QACrB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAa,CAAC;QAC/B,MAAM,SAAS,GAAG,MAAA,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;QAEhE,kBAAkB,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;iBAME,kBAAkB,CAAC,mBAAmB;qBAClC,kBAAkB,CAAC,mBAAmB;aAC9C,wBAAwB;oBACjB,IAAI,CAAC,cAAc;;;;;;;;;iBAStB,kBAAkB,CAAC,eAAe;qBAC9B,kBAAkB,CAAC,mBAAmB;aAC9C,oBAAoB;oBACb,IAAI,CAAC,cAAc;;;;;;;;;iBAStB,kBAAkB,CAAC,WAAW;qBAC1B,kBAAkB,CAAC,mBAAmB,CAAC,gBAAgB;oBACxD,IAAI,CAAC,cAAc;;gBAEvB,kBAAkB,CAAC,WAAW;;WAEnC,CAAC;IACV,CAAC;CACF,CAAA;AApDY,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAoDxB;SApDY,YAAY","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-switch/ix-switch.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { NotificationGroups } from '../../constants/notifications.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\n\n@customElement('group-filters')\nexport class GroupFilters extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n onSwitchChange(e: Event) {\n const target = e.target as any;\n const groupName = target.attributes.getNamedItem('name')?.value;\n\n NotificationsState.setNotificationFilter(groupName, target.selected);\n this.requestUpdate();\n }\n\n render() {\n return html` <div class=\"flex flex-col\">\n <label\n class=\"whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle\"\n >\n <ix-switch\n class=\"flex\"\n name=${NotificationGroups.PLANNED_MAINTENANCE}\n selected=${NotificationsState.notificationFilters\n .SHOW_PLANNED_MAINTENANCE}\n @change=${this.onSwitchChange}\n ></ix-switch>\n <span>Planned Maintenance</span></label\n >\n <label\n class=\"whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle\"\n >\n <ix-switch\n class=\"flex\"\n name=${NotificationGroups.SERVICE_TICKETS}\n selected=${NotificationsState.notificationFilters\n .SHOW_SERVICE_TICKETS}\n @change=${this.onSwitchChange}\n ></ix-switch>\n <span>Service Ticket Updates</span></label\n >\n <label\n class=\"whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle\"\n >\n <ix-switch\n class=\"flex\"\n name=${NotificationGroups.DCIM_ALERTS}\n selected=${NotificationsState.notificationFilters.SHOW_DCIM_ALERTS}\n @change=${this.onSwitchChange}\n ></ix-switch>\n <span>${NotificationGroups.DCIM_ALERTS}</span></label\n >\n </div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"group-filters.js","sourceRoot":"","sources":["../../../src/components/notifications/group-filters.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,wCAAwC,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAGlE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,cAAc;IAC9C,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,cAAc,CAAC,CAAQ;;QACrB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAa,CAAC;QAC/B,MAAM,SAAS,GAAG,MAAA,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAC;QAEhE,kBAAkB,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;iBAME,kBAAkB,CAAC,mBAAmB;qBAClC,kBAAkB,CAAC,mBAAmB;aAC9C,wBAAwB;oBACjB,IAAI,CAAC,cAAc;;;;;;;;;iBAStB,kBAAkB,CAAC,eAAe;qBAC9B,kBAAkB,CAAC,mBAAmB;aAC9C,oBAAoB;oBACb,IAAI,CAAC,cAAc;;;;;;;;;iBAStB,kBAAkB,CAAC,WAAW;qBAC1B,kBAAkB,CAAC,mBAAmB,CAAC,gBAAgB;oBACxD,IAAI,CAAC,cAAc;;gBAEvB,kBAAkB,CAAC,WAAW;;WAEnC,CAAC;IACV,CAAC;CACF,CAAA;AApDY,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAoDxB","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-switch/ix-switch.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { NotificationGroups } from '../../constants/notifications.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\n\n@customElement('group-filters')\nexport class GroupFilters extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n onSwitchChange(e: Event) {\n const target = e.target as any;\n const groupName = target.attributes.getNamedItem('name')?.value;\n\n NotificationsState.setNotificationFilter(groupName, target.selected);\n this.requestUpdate();\n }\n\n render() {\n return html` <div class=\"flex flex-col\">\n <label\n class=\"whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle\"\n >\n <ix-switch\n class=\"flex\"\n name=${NotificationGroups.PLANNED_MAINTENANCE}\n selected=${NotificationsState.notificationFilters\n .SHOW_PLANNED_MAINTENANCE}\n @change=${this.onSwitchChange}\n ></ix-switch>\n <span>Planned Maintenance</span></label\n >\n <label\n class=\"whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle\"\n >\n <ix-switch\n class=\"flex\"\n name=${NotificationGroups.SERVICE_TICKETS}\n selected=${NotificationsState.notificationFilters\n .SHOW_SERVICE_TICKETS}\n @change=${this.onSwitchChange}\n ></ix-switch>\n <span>Service Ticket Updates</span></label\n >\n <label\n class=\"whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle\"\n >\n <ix-switch\n class=\"flex\"\n name=${NotificationGroups.DCIM_ALERTS}\n selected=${NotificationsState.notificationFilters.SHOW_DCIM_ALERTS}\n @change=${this.onSwitchChange}\n ></ix-switch>\n <span>${NotificationGroups.DCIM_ALERTS}</span></label\n >\n </div>`;\n }\n}\n"]}
@@ -8,6 +8,6 @@ export declare class GroupedItem extends MobxLitElement {
8
8
  private isOpen;
9
9
  onClick: () => void;
10
10
  static get styles(): import("lit").CSSResult[];
11
- renderNotificationItems(): import("lit").TemplateResult<1>;
12
- render(): import("lit").TemplateResult<1>;
11
+ renderNotificationItems(): import("lit-html").TemplateResult<1>;
12
+ render(): import("lit-html").TemplateResult<1>;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"grouped-item.js","sourceRoot":"","sources":["../../../src/components/notifications/grouped-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG/D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,cAAc;IAAxC;;QACwC,eAAU,GAAG,SA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C,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+CAAwB;AAEvB;IAA5C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;8CAAsB;AAEtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+CACR;AAE1B;IAAR,KAAK,EAAE;2CAAwB;AARrB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA+DvB;SA/DY,WAAW","sourcesContent":["import { html, nothing } from 'lit';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { Notification } from '../../models/notification.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport { NotificationGroups } from '../../constants/notifications.js';\n\n@customElement('grouped-item')\nexport class GroupedItem extends MobxLitElement {\n @property({ type: String, attribute: true }) groupTitle = 'Group 1';\n\n @property({ type: String, attribute: true }) groupIcon = 'public';\n\n @property({ type: Array, attribute: true }) childItems?: Notification[] =\n NotificationsState.notifications;\n\n @state() private isOpen = false;\n\n onClick = () => {\n this.isOpen = !this.isOpen;\n };\n\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n renderNotificationItems() {\n if (this.isOpen) {\n if (\n this.childItems?.length !== undefined &&\n this.childItems?.length > 0\n ) {\n return html`<div>\n ${this.childItems?.map(\n item => html`<notification-item\n .notification=${item}\n ?disabled=${item.resourceType === NotificationGroups.INCIDENTS}\n >\n </notification-item>`\n )}\n </div>`;\n }\n return html`<p class=\"dlr-text-caption ml-14 font-bold mr-4\">\n No notifications yet.\n </p>`;\n }\n\n return html`${nothing}`;\n }\n\n render() {\n return html`<div class=\"group-container-row border-b border-outline py-3\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex items-center align-middle\">\n <ix-icon-button\n icon=${this.isOpen ? 'arrow_drop_down' : 'arrow_right'}\n @click=\"${this.onClick}\"\n >\n </ix-icon-button>\n <ix-icon slot=\"default\" class=\"ix-icon-groups\"\n >${unsafeSVG(this.groupIcon)}</ix-icon\n >\n <p class=\"m-0 group-name font-bold pl-1\">${this.groupTitle}</p>\n <p class=\"m-0 pl-4\">\n ${this.childItems?.length.toString().padStart(2, '0')}\n </p>\n </div>\n </div>\n ${this.renderNotificationItems()}\n </div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"grouped-item.js","sourceRoot":"","sources":["../../../src/components/notifications/grouped-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG/D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,cAAc;IAAxC;;QACwC,eAAU,GAAG,SAAS,CAAC;QAEvB,cAAS,GAAG,QAAQ,CAAC;QAEtB,eAAU,GACpD,kBAAkB,CAAC,aAAa,CAAC;QAElB,WAAM,GAAG,KAAK,CAAC;QAEhC,YAAO,GAAG,GAAG,EAAE;YACb,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MA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;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;+CACR;AAElB;IAAhB,KAAK,EAAE;2CAAwB;AARrB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA+DvB","sourcesContent":["import { html, nothing } from 'lit';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { Notification } from '../../models/notification.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport { NotificationGroups } from '../../constants/notifications.js';\n\n@customElement('grouped-item')\nexport class GroupedItem extends MobxLitElement {\n @property({ type: String, attribute: true }) groupTitle = 'Group 1';\n\n @property({ type: String, attribute: true }) groupIcon = 'public';\n\n @property({ type: Array, attribute: true }) childItems?: Notification[] =\n NotificationsState.notifications;\n\n @state() private isOpen = false;\n\n onClick = () => {\n this.isOpen = !this.isOpen;\n };\n\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n renderNotificationItems() {\n if (this.isOpen) {\n if (\n this.childItems?.length !== undefined &&\n this.childItems?.length > 0\n ) {\n return html`<div>\n ${this.childItems?.map(\n item => html`<notification-item\n .notification=${item}\n ?disabled=${item.resourceType === NotificationGroups.INCIDENTS}\n >\n </notification-item>`\n )}\n </div>`;\n }\n return html`<p class=\"dlr-text-caption ml-14 font-bold mr-4\">\n No notifications yet.\n </p>`;\n }\n\n return html`${nothing}`;\n }\n\n render() {\n return html`<div class=\"group-container-row border-b border-outline py-3\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex items-center align-middle\">\n <ix-icon-button\n icon=${this.isOpen ? 'arrow_drop_down' : 'arrow_right'}\n @click=\"${this.onClick}\"\n >\n </ix-icon-button>\n <ix-icon slot=\"default\" class=\"ix-icon-groups\"\n >${unsafeSVG(this.groupIcon)}</ix-icon\n >\n <p class=\"m-0 group-name font-bold pl-1\">${this.groupTitle}</p>\n <p class=\"m-0 pl-4\">\n ${this.childItems?.length.toString().padStart(2, '0')}\n </p>\n </div>\n </div>\n ${this.renderNotificationItems()}\n </div>`;\n }\n}\n"]}
@@ -15,8 +15,8 @@ export declare class NotificationItem extends MobxLitElement {
15
15
  deleteItem(): void;
16
16
  private confirmedDelete;
17
17
  private showDeleteResultMessage;
18
- calculateDuration(): string;
19
- getNotificationIcon(): import("lit").TemplateResult<2> | "sync_saved_locally" | "report";
18
+ calculateDuration(): string | import("lit-html").TemplateResult<1>;
19
+ getNotificationIcon(): import("lit-html").TemplateResult<2> | "sync_saved_locally" | "report";
20
20
  getNotificationTitle(): string;
21
- render(): import("lit").TemplateResult<1>;
21
+ render(): import("lit-html").TemplateResult<1>;
22
22
  }
@@ -4,12 +4,11 @@ import { MobxLitElement } from '@adobe/lit-mobx';
4
4
  import { customElement, property, state } from 'lit/decorators.js';
5
5
  import '@digital-realty/ix-icon-button/ix-icon-button.js';
6
6
  import '@digital-realty/ix-icon/ix-icon.js';
7
- import { format } from 'date-fns/format.js';
8
7
  import { formatDistance } from 'date-fns/formatDistance.js';
9
8
  import { differenceInHours } from 'date-fns/differenceInHours.js';
10
9
  import { TWStyles } from '../../tw.js';
11
10
  import { NotificationsState } from '../../state/NotificationState.js';
12
- import { NotificationStatus, DefaultDateTimeFormat, NotificationGroups, } from '../../constants/notifications.js';
11
+ import { NotificationStatus, NotificationGroups, } from '../../constants/notifications.js';
13
12
  import { NotificationsStyle } from '../../styles/notifications-style.js';
14
13
  import './confirmation-dialog.js';
15
14
  import './view-item-dialog.js';
@@ -74,7 +73,11 @@ let NotificationItem = class NotificationItem extends MobxLitElement {
74
73
  return formatDistance(new Date(this.notification.createdAt), new Date(), {
75
74
  addSuffix: true,
76
75
  });
77
- return format(new Date(this.notification.createdAt), DefaultDateTimeFormat);
76
+ return html `<ix-date
77
+ type="static"
78
+ variant="date-time"
79
+ .value=${this.notification.createdAt}
80
+ ></ix-date>`;
78
81
  }
79
82
  return 'N/A';
80
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notification-item.js","sourceRoot":"","sources":["../../../src/components/notifications/notification-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,kDAAkD,CAAC;AAC1D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,0BAA0B,CAAC;AAClC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,8CAA8C,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGnE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;IAA7C;;QACwB,aAAQ,GAAG,KAAK,CAAC;QAEA,iBAAY,GACxD,EAAkB,CAAC;QAEJ,cAAS,GAAG,KAAK,CAAC;QAElB,2BAAsB,GAAG,KAAK,CAAC;IAwLlD,CAAC;IAtLC,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,QA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,kBAAkB;;gBAE3D,KAAK;;;;;KAKhB,CAAC;IACJ,CAAC;CACF,CAAA;AA/L8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAkB;AAEA;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDACxB;AAEZ;IAAR,KAAK,EAAE;mDAA2B;AAE1B;IAAR,KAAK,EAAE;gEAAwC;AARrC,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAgM5B;SAhMY,gBAAgB","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport { format } from 'date-fns/format.js';\nimport { formatDistance } from 'date-fns/formatDistance.js';\nimport { differenceInHours } from 'date-fns/differenceInHours.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { ApiCallResult, Notification } from '../../models/notification.js';\nimport {\n NotificationStatus,\n DefaultDateTimeFormat,\n NotificationGroups,\n} from '../../constants/notifications.js';\nimport { ConfirmationDialogEventDetail } from '../../constants/notification-types.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport './confirmation-dialog.js';\nimport './view-item-dialog.js';\nimport '@digital-realty/ix-toast/ix-message-toast.js';\nimport { dcim, plannedMaintenance, trash } from '../../assets/iconset.js';\n\n@customElement('notification-item')\nexport class NotificationItem extends MobxLitElement {\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: Object, attribute: false }) notification =\n {} as Notification;\n\n @state() private showModal = false;\n\n @state() private showDeleteConfirmation = false;\n\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n displayItem() {\n if (this.notification.status === NotificationStatus.UNREAD) {\n NotificationsState.setNotificationReadStatus(this.notification.id);\n }\n this.showModal = true;\n }\n\n deleteItem() {\n if (!this.disabled) {\n this.showDeleteConfirmation = true;\n }\n }\n\n private confirmedDelete(e: CustomEvent<ConfirmationDialogEventDetail>) {\n // DELETE IF CONFIRMED TRUE\n if (e.detail.returnValue) {\n NotificationsState.setNotificationDeleted(this.notification.id).then(\n (result: ApiCallResult) => {\n this.showDeleteResultMessage(result, this.notification.id);\n }\n );\n }\n this.showDeleteConfirmation = false;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private showDeleteResultMessage(result: ApiCallResult, id: string) {\n window.dispatchEvent(\n new CustomEvent('add-toast', {\n detail: {\n id,\n content: html` <ix-message-toast\n toastId=${id}\n .TMessageToast=${result.State.toLowerCase()}\n forceClose\n >\n ${result.Message}\n </ix-message-toast>`,\n autoClose: 2000,\n durationOut: 2000,\n vertical: 'bottom',\n horizontal: 'center',\n animated: true,\n above: false,\n },\n })\n );\n }\n\n calculateDuration() {\n if (this.notification.createdAt !== undefined) {\n if (\n differenceInHours(new Date(), new Date(this.notification.createdAt)) <\n 24\n )\n return formatDistance(\n new Date(this.notification.createdAt),\n new Date(),\n {\n addSuffix: true,\n }\n );\n return format(\n new Date(this.notification.createdAt),\n DefaultDateTimeFormat\n );\n }\n return 'N/A';\n }\n\n getNotificationIcon() {\n switch (this.notification.resourceType) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n return plannedMaintenance;\n case NotificationGroups.SERVICE_TICKETS:\n return 'sync_saved_locally';\n case NotificationGroups.INCIDENTS:\n return 'report';\n case NotificationGroups.DCIM_ALERTS:\n return dcim;\n default:\n return 'sync_saved_locally';\n }\n }\n\n getNotificationTitle() {\n switch (this.notification.resourceType) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n return 'Planned Maintenance';\n case NotificationGroups.SERVICE_TICKETS:\n return `${this.notification?.subGroup} Service Ticket Update`;\n case NotificationGroups.INCIDENTS:\n return 'Emergency Repair';\n case NotificationGroups.DCIM_ALERTS:\n return 'DCIM Alert';\n default:\n return 'sync_saved_locally';\n }\n }\n\n /* eslint-disable lit-a11y/click-events-have-key-events */\n render() {\n return html`\n <div class=\"relative notification-item\">\n <div\n class=\"hover:bg-[rgba(0,0,0,0.04)] p-2 pl-3.5 flex gap-3 relative cursor-pointer items-center font-bold ${this\n .notification?.status === 'unread'\n ? 'notification-item-unread border-l-3 border-success'\n : 'notification-item-read border-l-3 border-transparent'}\"\n >\n <ix-icon\n style=\"--ix-icon-font-size: 24px;--ix-icon-line-height: 24px;\"\n icon=${this.getNotificationIcon()}\n class=${this.notification?.status === 'unread'\n ? 'active-icon'\n : 'inactive-icon'}\n @click=${this.displayItem}\n >${this.getNotificationIcon()}\n </ix-icon>\n <div class=\"flex flex-col grow\" @click=${this.displayItem}>\n <div class=\"grow text-base\">\n <h2 class=\"dlr-text-caption\">${this.getNotificationTitle()}</h2>\n </div>\n <div class=\"grow text-xs\">\n <h3 class=\"dlr-text-caption text-on-surface-disabled\">\n ${this.calculateDuration()}\n </h3>\n </div>\n </div>\n <div>\n <view-item-dialog\n ?open=${this.showModal}\n .notification=${this.notification}\n @view-item-dialog-closed=${() => {\n this.showModal = false;\n }}\n >\n </view-item-dialog>\n <confirmation-dialog\n ?open=${this.showDeleteConfirmation}\n @on-confirm-selection=${this.confirmedDelete}\n @confirm-dialog-closed=${() => {\n this.showModal = false;\n }}\n textMessage=\"Are you sure you want to delete this notification?\"\n >\n </confirmation-dialog>\n </div>\n <ix-icon-button\n style=\"--md-icon-button-icon-size:24px;\"\n @click=${this.deleteItem}\n @mouseover=${(e: any) => {\n this.dispatchEvent(\n new CustomEvent('show-notification-tooltip', {\n detail: {\n label: this.disabled\n ? 'Emergency Repair Notification cannot be removed'\n : 'Remove Notification',\n target: e.target,\n },\n })\n );\n }}\n @mouseout=${() =>\n this.dispatchEvent(new CustomEvent('hide-notification-tooltip'))}\n ?disabled=${this.disabled}\n >\n <ix-icon\n slot=\"default\"\n class=\"${this.disabled ? 'inactive-icon' : 'destructive-icon'}\"\n >\n ${trash}\n </ix-icon>\n </ix-icon-button>\n </div>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"notification-item.js","sourceRoot":"","sources":["../../../src/components/notifications/notification-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,kDAAkD,CAAC;AAC1D,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,0BAA0B,CAAC;AAClC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,8CAA8C,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGnE,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;IAA7C;;QACwB,aAAQ,GAAG,KAAK,CAAC;QAEA,iBAAY,GACxD,EAAkB,CAAC;QAEJ,cAAS,GAAG,KAAK,CAAC;QAElB,2BAAsB,GAAG,KAAK,CAAC;IAyLlD,CAAC;IAvLC,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,kBAAkB,CAAC,MAAM,EAAE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,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAkB;AAEA;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDACxB;AAEJ;IAAhB,KAAK,EAAE;mDAA2B;AAElB;IAAhB,KAAK,EAAE;gEAAwC;AARrC,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAiM5B","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport { formatDistance } from 'date-fns/formatDistance.js';\nimport { differenceInHours } from 'date-fns/differenceInHours.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\nimport { ApiCallResult, Notification } from '../../models/notification.js';\nimport {\n NotificationStatus,\n NotificationGroups,\n} from '../../constants/notifications.js';\nimport { ConfirmationDialogEventDetail } from '../../constants/notification-types.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport './confirmation-dialog.js';\nimport './view-item-dialog.js';\nimport '@digital-realty/ix-toast/ix-message-toast.js';\nimport { dcim, plannedMaintenance, trash } from '../../assets/iconset.js';\n\n@customElement('notification-item')\nexport class NotificationItem extends MobxLitElement {\n @property({ type: Boolean }) disabled = false;\n\n @property({ type: Object, attribute: false }) notification =\n {} as Notification;\n\n @state() private showModal = false;\n\n @state() private showDeleteConfirmation = false;\n\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n displayItem() {\n if (this.notification.status === NotificationStatus.UNREAD) {\n NotificationsState.setNotificationReadStatus(this.notification.id);\n }\n this.showModal = true;\n }\n\n deleteItem() {\n if (!this.disabled) {\n this.showDeleteConfirmation = true;\n }\n }\n\n private confirmedDelete(e: CustomEvent<ConfirmationDialogEventDetail>) {\n // DELETE IF CONFIRMED TRUE\n if (e.detail.returnValue) {\n NotificationsState.setNotificationDeleted(this.notification.id).then(\n (result: ApiCallResult) => {\n this.showDeleteResultMessage(result, this.notification.id);\n }\n );\n }\n this.showDeleteConfirmation = false;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private showDeleteResultMessage(result: ApiCallResult, id: string) {\n window.dispatchEvent(\n new CustomEvent('add-toast', {\n detail: {\n id,\n content: html` <ix-message-toast\n toastId=${id}\n .TMessageToast=${result.State.toLowerCase()}\n forceClose\n >\n ${result.Message}\n </ix-message-toast>`,\n autoClose: 2000,\n durationOut: 2000,\n vertical: 'bottom',\n horizontal: 'center',\n animated: true,\n above: false,\n },\n })\n );\n }\n\n calculateDuration() {\n if (this.notification.createdAt !== undefined) {\n if (\n differenceInHours(new Date(), new Date(this.notification.createdAt)) <\n 24\n )\n return formatDistance(\n new Date(this.notification.createdAt),\n new Date(),\n {\n addSuffix: true,\n }\n );\n return html`<ix-date\n type=\"static\"\n variant=\"date-time\"\n .value=${this.notification.createdAt}\n ></ix-date>`;\n }\n return 'N/A';\n }\n\n getNotificationIcon() {\n switch (this.notification.resourceType) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n return plannedMaintenance;\n case NotificationGroups.SERVICE_TICKETS:\n return 'sync_saved_locally';\n case NotificationGroups.INCIDENTS:\n return 'report';\n case NotificationGroups.DCIM_ALERTS:\n return dcim;\n default:\n return 'sync_saved_locally';\n }\n }\n\n getNotificationTitle() {\n switch (this.notification.resourceType) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n return 'Planned Maintenance';\n case NotificationGroups.SERVICE_TICKETS:\n return `${this.notification?.subGroup} Service Ticket Update`;\n case NotificationGroups.INCIDENTS:\n return 'Emergency Repair';\n case NotificationGroups.DCIM_ALERTS:\n return 'DCIM Alert';\n default:\n return 'sync_saved_locally';\n }\n }\n\n /* eslint-disable lit-a11y/click-events-have-key-events */\n render() {\n return html`\n <div class=\"relative notification-item\">\n <div\n class=\"hover:bg-[rgba(0,0,0,0.04)] p-2 pl-3.5 flex gap-3 relative cursor-pointer items-center font-bold ${this\n .notification?.status === 'unread'\n ? 'notification-item-unread border-l-3 border-success'\n : 'notification-item-read border-l-3 border-transparent'}\"\n >\n <ix-icon\n style=\"--ix-icon-font-size: 24px;--ix-icon-line-height: 24px;\"\n icon=${this.getNotificationIcon()}\n class=${this.notification?.status === 'unread'\n ? 'active-icon'\n : 'inactive-icon'}\n @click=${this.displayItem}\n >${this.getNotificationIcon()}\n </ix-icon>\n <div class=\"flex flex-col grow\" @click=${this.displayItem}>\n <div class=\"grow text-base\">\n <h2 class=\"dlr-text-caption\">${this.getNotificationTitle()}</h2>\n </div>\n <div class=\"grow text-xs\">\n <h3 class=\"dlr-text-caption text-on-surface-disabled\">\n ${this.calculateDuration()}\n </h3>\n </div>\n </div>\n <div>\n <view-item-dialog\n ?open=${this.showModal}\n .notification=${this.notification}\n @view-item-dialog-closed=${() => {\n this.showModal = false;\n }}\n >\n </view-item-dialog>\n <confirmation-dialog\n ?open=${this.showDeleteConfirmation}\n @on-confirm-selection=${this.confirmedDelete}\n @confirm-dialog-closed=${() => {\n this.showModal = false;\n }}\n textMessage=\"Are you sure you want to delete this notification?\"\n >\n </confirmation-dialog>\n </div>\n <ix-icon-button\n style=\"--md-icon-button-icon-size:24px;\"\n @click=${this.deleteItem}\n @mouseover=${(e: any) => {\n this.dispatchEvent(\n new CustomEvent('show-notification-tooltip', {\n detail: {\n label: this.disabled\n ? 'Emergency Repair Notification cannot be removed'\n : 'Remove Notification',\n target: e.target,\n },\n })\n );\n }}\n @mouseout=${() =>\n this.dispatchEvent(new CustomEvent('hide-notification-tooltip'))}\n ?disabled=${this.disabled}\n >\n <ix-icon\n slot=\"default\"\n class=\"${this.disabled ? 'inactive-icon' : 'destructive-icon'}\"\n >\n ${trash}\n </ix-icon>\n </ix-icon-button>\n </div>\n </div>\n `;\n }\n}\n"]}
@@ -11,5 +11,5 @@ export declare class NotificationTooltip extends MobxLitElement {
11
11
  configureNotificationTooltip: (e: any) => void;
12
12
  hideNotificationTooltip: () => void;
13
13
  updated(changedProperties: Map<string, any>): void;
14
- render(): import("lit").TemplateResult<1>;
14
+ render(): import("lit-html").TemplateResult<1>;
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"notification-tooltip.js","sourceRoot":"","sources":["../../../src/components/notifications/notification-tooltip.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,wDAAwD;AAEjD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,cAAc;IAAhD;;QAOuC,cAAS,GAAY,KAAK,CAAC;QAE5B,UAAK,GAAW,EAAE,CAAC;QAErD,mBAAc,GAA4B,SAAS,CAAC;QA0B7D,iCAA4B,GAAG,CAAC,CAAM,EAAE,EAAE;YACxC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;YACnC,IAAI,CAAC,cAAc,GAAG,MAAqB,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC,CAAC;QAEF,4BAAuB,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,cAAc,GAAG,SAAS,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AAC,SAAS;SACxB,CAAC;QAEF,OAAO,IAAI,CAAA;+EACgE,QAAQ,CAC7E,OAAO,CACR;;UAEC,IAAI,CAAC,KAAK;;oBAEA,CAAC;IACnB,CAAC;CACF,CAAA;AAxEiC;IAA/B,KAAK,CAAC,uBAAuB,CAAC;gEAAsC;AAEzB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAA4B;AAE5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAoB;AAErD;IAAR,KAAK,EAAE;2DAAqD;AAXlD,mBAAmB;IAD/B,aAAa,CAAC,sBAAsB,CAAC;GACzB,mBAAmB,CA6E/B;SA7EY,mBAAmB","sourcesContent":["/* eslint-disable wc/guard-super-call */\nimport { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { query, customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport { computePosition } from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\n\n// Tooltip code, to be replaced with a generic component\n@customElement('notification-tooltip')\nexport class NotificationTooltip extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @query('.notification-tooltip') notificationTooltip!: HTMLDivElement;\n\n @property({ type: Boolean, reflect: true }) isVisible: boolean = false;\n\n @property({ type: String, reflect: true }) label: string = '';\n\n @state() hoveredElement: HTMLElement | undefined = undefined;\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\n 'show-notification-tooltip',\n this.configureNotificationTooltip\n );\n window.addEventListener(\n 'hide-notification-tooltip',\n this.hideNotificationTooltip\n );\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener(\n 'show-notification-tooltip',\n this.configureNotificationTooltip\n );\n window.removeEventListener(\n 'hide-notification-tooltip',\n this.hideNotificationTooltip\n );\n }\n\n configureNotificationTooltip = (e: any) => {\n const { label, target } = e.detail;\n this.hoveredElement = target as HTMLElement;\n this.label = label;\n this.isVisible = true;\n };\n\n hideNotificationTooltip = () => {\n this.isVisible = false;\n this.hoveredElement = undefined;\n this.label = '';\n };\n\n updated(changedProperties: Map<string, any>) {\n if (changedProperties.has('hoveredElement') && this.isVisible) {\n if (this.hoveredElement) {\n computePosition(this.hoveredElement, this.notificationTooltip, {\n placement: 'bottom-end',\n }).then(({ x, y }) => {\n this.notificationTooltip.style.left = `${x}px`;\n this.notificationTooltip.style.top = `${y + 12}px`;\n });\n }\n }\n }\n\n render() {\n const classes = {\n hidden: !this.isVisible,\n };\n\n return html`<div\n class=\"notification-tooltip z-[9999] rounded absolute p-2 white-text ${classMap(\n classes\n )}\"\n >\n ${this.label}\n </div>\n <slot></slot>`;\n }\n}\n"]}
1
+ {"version":3,"file":"notification-tooltip.js","sourceRoot":"","sources":["../../../src/components/notifications/notification-tooltip.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,kDAAkD,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,wDAAwD;AAEjD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,cAAc;IAAhD;;QAOuC,cAAS,GAAY,KAAK,CAAC;QAE5B,UAA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AI,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,EAAE;oBAC7D,SAAS,EAAE,YAAY;iBACxB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;oBACnB,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;oBAC/C,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC;gBACrD,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS;SACxB,CAAC;QAEF,OAAO,IAAI,CAAA;+EACgE,QAAQ,CAC7E,OAAO,CACR;;UAEC,IAAI,CAAC,KAAK;;oBAEA,CAAC;IACnB,CAAC;CACF,CAAA;AAxEiC;IAA/B,KAAK,CAAC,uBAAuB,CAAC;gEAAsC;AAEzB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAA4B;AAE5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAoB;AAErD;IAAR,KAAK,EAAE;2DAAqD;AAXlD,mBAAmB;IAD/B,aAAa,CAAC,sBAAsB,CAAC;GACzB,mBAAmB,CA6E/B","sourcesContent":["/* eslint-disable wc/guard-super-call */\nimport { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { query, customElement, property, state } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport { computePosition } from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { TWStyles } from '../../tw.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\n\n// Tooltip code, to be replaced with a generic component\n@customElement('notification-tooltip')\nexport class NotificationTooltip extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @query('.notification-tooltip') notificationTooltip!: HTMLDivElement;\n\n @property({ type: Boolean, reflect: true }) isVisible: boolean = false;\n\n @property({ type: String, reflect: true }) label: string = '';\n\n @state() hoveredElement: HTMLElement | undefined = undefined;\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\n 'show-notification-tooltip',\n this.configureNotificationTooltip\n );\n window.addEventListener(\n 'hide-notification-tooltip',\n this.hideNotificationTooltip\n );\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener(\n 'show-notification-tooltip',\n this.configureNotificationTooltip\n );\n window.removeEventListener(\n 'hide-notification-tooltip',\n this.hideNotificationTooltip\n );\n }\n\n configureNotificationTooltip = (e: any) => {\n const { label, target } = e.detail;\n this.hoveredElement = target as HTMLElement;\n this.label = label;\n this.isVisible = true;\n };\n\n hideNotificationTooltip = () => {\n this.isVisible = false;\n this.hoveredElement = undefined;\n this.label = '';\n };\n\n updated(changedProperties: Map<string, any>) {\n if (changedProperties.has('hoveredElement') && this.isVisible) {\n if (this.hoveredElement) {\n computePosition(this.hoveredElement, this.notificationTooltip, {\n placement: 'bottom-end',\n }).then(({ x, y }) => {\n this.notificationTooltip.style.left = `${x}px`;\n this.notificationTooltip.style.top = `${y + 12}px`;\n });\n }\n }\n }\n\n render() {\n const classes = {\n hidden: !this.isVisible,\n };\n\n return html`<div\n class=\"notification-tooltip z-[9999] rounded absolute p-2 white-text ${classMap(\n classes\n )}\"\n >\n ${this.label}\n </div>\n <slot></slot>`;\n }\n}\n"]}
@@ -10,5 +10,5 @@ export declare class ViewItemDialog extends MobxLitElement {
10
10
  getLocation(): string;
11
11
  dialogClosed: () => void;
12
12
  viewRecord: () => void;
13
- render(): import("lit").TemplateResult<1>;
13
+ render(): import("lit-html").TemplateResult<1>;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"view-item-dial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CAAC,YAAY;;;;;cAK9B,IAAI,CAAC,YAAY,CAAC,QAAQ;;;;;;;;;;;;;;;;YAgB5B,IAAI,CAAC,YAAY,CAAC,OAAO;;;;;;;;YAQzB,MAAM,CACN,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EACrC,qBAAqB,CACtB;;;;;;;;YAQC,IAAI,CAAC,WAAW,EAAE;;;;;;kBAMZ,IAAI,CAAC,MAAM,EAAE;oBACX,IAAI,CAAC,UAAU;;;;;iBAKlB,CAAC;IAChB,CAAC;CACF,CAAA;AA3H+C;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDACxB;AAEyB;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;4CAAc;AARhD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAgI1B;SAhIY,cAAc","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-button/ix-button.js';\nimport { format } from 'date-fns/format.js';\nimport { TWStyles } from '../../tw.js';\nimport { Notification } from '../../models/notification.js';\nimport {\n NotificationGroups,\n SubGroups,\n} from '../../constants/notifications.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\n\n@customElement('view-item-dialog')\nexport class ViewItemDialog extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @property({ type: Object, attribute: false }) notification =\n {} as Notification;\n\n @property({ type: Boolean, attribute: true }) open = false;\n\n getUrl(): string {\n const ticketId = this.notification.resourceId;\n\n switch (this.notification.resourceType) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n return `/service-management/reports?ticketId=${ticketId}`;\n case NotificationGroups.SERVICE_TICKETS:\n switch (this.notification.subGroup) {\n case SubGroups.Remote_Hands:\n return `/service-management/service-tickets/remote-hands/${ticketId}`;\n case SubGroups.Customer_Care:\n return `/service-management/service-tickets/customer-care/${ticketId}`;\n case SubGroups.Deliveries:\n return `/service-management/service-tickets/${SubGroups.Deliveries}/${ticketId}`;\n case SubGroups.Facility_Access:\n return `/service-management/service-tickets/facility-access/${ticketId}`;\n case SubGroups.Removals:\n return `/service-management/service-tickets/removals/${ticketId}`;\n case SubGroups.Trouble_Ticket:\n return `/service-management/service-tickets/trouble-tickets/${ticketId}`;\n\n default:\n return '';\n }\n case NotificationGroups.INCIDENTS:\n return `/service-management/incidents/${ticketId}`;\n case NotificationGroups.DCIM_ALERTS:\n return `/dcim/${ticketId}`;\n default:\n return '';\n }\n }\n\n getLocation() {\n if (\n this.notification.locations === undefined ||\n this.notification.locations.length < 1\n ) {\n return '';\n }\n if (this.notification.locations.length > 1) {\n return 'Multiple Sites';\n }\n return this.notification.locations[0];\n }\n\n dialogClosed = () => {\n this.dispatchEvent(new CustomEvent('view-item-dialog-closed'));\n };\n\n viewRecord = () => {\n this.dialogClosed();\n NotificationsState.showDrawer = false;\n };\n\n render() {\n return html` <ix-dialog\n ?open=${this.open}\n @closed=${this.dialogClosed}\n class=\"notification-modal\"\n >\n <div slot=\"headline\" class=\"w-[560px]\">\n <div class=\"flex flex-col flex-start\">\n <div class=\"notification-modal-title text-2xl font-bold text-balance\">\n ${this.notification.resourceType}\n </div>\n <div\n class=\"notification-modal-subtitle pt-4 pb-0 font-bold text-balance\"\n >\n ${this.notification.subGroup}\n </div>\n </div>\n </div>\n <form\n class=\"notification-modal-content\"\n slot=\"content\"\n id=\"form-id\"\n method=\"dialog\"\n >\n <div\n class=\"notification-modal-content-title notification-modal-subject-title\"\n >\n Subject\n </div>\n <div class=\"notification-modal-subject-text font-normal text-wrap\">\n ${this.notification.subject}\n </div>\n <div\n class=\"notification-modal-content-title notification-modal-created-date-title\"\n >\n Create Date\n </div>\n <div class=\"notification-modal-created-date-text font-normal text-wrap\">\n ${format(\n new Date(this.notification.createdAt),\n 'dd/MM/yyyy HH:mm:ss'\n )}\n </div>\n <div\n class=\"notification-modal-content-title notification-modal-site-title\"\n >\n Site\n </div>\n <div class=\"notification-modal-site-text font-normal text-wrap\">\n ${this.getLocation()}\n </div>\n </form>\n <div slot=\"actions\" class=\"flex flex-row flex-end\">\n <ix-button form=\"form-id\" appearance=\"text\"> Close </ix-button>\n <ix-button\n href=\"${this.getUrl()}\"\n @click=\"${this.viewRecord}\"\n appearance=\"text\"\n >View Record</ix-button\n >\n </div>\n </ix-dialog>`;\n }\n}\n"]}
1
+ {"version":3,"file":"view-item-dialog.js","sourceRoot":"","sources":["../../../src/components/notifications/view-item-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,wCAAwC,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EACL,kBAAkB,EAClB,SAAS,GACV,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG/D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,cAAc;IAA3C;;QAKyC,iBAAY,GACxD,EAAkB,CAAC;QAEyB,SAAI,GAAG,KAAK,CAAC;QAgD3D,iBAAY,GAAG,GAAG,EAAE;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC;QACj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AAC;IACH,CAAC;IAED,WAAW;QACT,IACE,IAAI,CAAC,YAAY,CAAC,SAAS,KAAK,SAAS;YACzC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EACtC,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3C,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IAWD,MAAM;QACJ,OAAO,IAAI,CAAA;cACD,IAAI,CAAC,IAAI;gBACP,IAAI,CAAC,YAAY;;;;;;cAMnB,IAAI,CAAC,YAAY,CAAC,YAAY;;;;;cAK9B,IAAI,CAAC,YAAY,CAAC,QAAQ;;;;;;;;;;;;;;;;YAgB5B,IAAI,CAAC,YAAY,CAAC,OAAO;;;;;;;;YAQzB,MAAM,CACN,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EACrC,qBAAqB,CACtB;;;;;;;;YAQC,IAAI,CAAC,WAAW,EAAE;;;;;;kBAMZ,IAAI,CAAC,MAAM,EAAE;oBACX,IAAI,CAAC,UAAU;;;;;iBAKlB,CAAC;IAChB,CAAC;CACF,CAAA;AA3H+C;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDACxB;AAEyB;IAA7C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;4CAAc;AARhD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAgI1B","sourcesContent":["import { html } from 'lit';\nimport { MobxLitElement } from '@adobe/lit-mobx';\nimport { customElement, property } from 'lit/decorators.js';\nimport '@digital-realty/ix-icon-button/ix-icon-button.js';\nimport '@digital-realty/ix-button/ix-button.js';\nimport { format } from 'date-fns/format.js';\nimport { TWStyles } from '../../tw.js';\nimport { Notification } from '../../models/notification.js';\nimport {\n NotificationGroups,\n SubGroups,\n} from '../../constants/notifications.js';\nimport { NotificationsStyle } from '../../styles/notifications-style.js';\nimport { NotificationsState } from '../../state/NotificationState.js';\n\n@customElement('view-item-dialog')\nexport class ViewItemDialog extends MobxLitElement {\n static get styles() {\n return [TWStyles, NotificationsStyle];\n }\n\n @property({ type: Object, attribute: false }) notification =\n {} as Notification;\n\n @property({ type: Boolean, attribute: true }) open = false;\n\n getUrl(): string {\n const ticketId = this.notification.resourceId;\n\n switch (this.notification.resourceType) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n return `/service-management/reports?ticketId=${ticketId}`;\n case NotificationGroups.SERVICE_TICKETS:\n switch (this.notification.subGroup) {\n case SubGroups.Remote_Hands:\n return `/service-management/service-tickets/remote-hands/${ticketId}`;\n case SubGroups.Customer_Care:\n return `/service-management/service-tickets/customer-care/${ticketId}`;\n case SubGroups.Deliveries:\n return `/service-management/service-tickets/${SubGroups.Deliveries}/${ticketId}`;\n case SubGroups.Facility_Access:\n return `/service-management/service-tickets/facility-access/${ticketId}`;\n case SubGroups.Removals:\n return `/service-management/service-tickets/removals/${ticketId}`;\n case SubGroups.Trouble_Ticket:\n return `/service-management/service-tickets/trouble-tickets/${ticketId}`;\n\n default:\n return '';\n }\n case NotificationGroups.INCIDENTS:\n return `/service-management/incidents/${ticketId}`;\n case NotificationGroups.DCIM_ALERTS:\n return `/dcim/${ticketId}`;\n default:\n return '';\n }\n }\n\n getLocation() {\n if (\n this.notification.locations === undefined ||\n this.notification.locations.length < 1\n ) {\n return '';\n }\n if (this.notification.locations.length > 1) {\n return 'Multiple Sites';\n }\n return this.notification.locations[0];\n }\n\n dialogClosed = () => {\n this.dispatchEvent(new CustomEvent('view-item-dialog-closed'));\n };\n\n viewRecord = () => {\n this.dialogClosed();\n NotificationsState.showDrawer = false;\n };\n\n render() {\n return html` <ix-dialog\n ?open=${this.open}\n @closed=${this.dialogClosed}\n class=\"notification-modal\"\n >\n <div slot=\"headline\" class=\"w-[560px]\">\n <div class=\"flex flex-col flex-start\">\n <div class=\"notification-modal-title text-2xl font-bold text-balance\">\n ${this.notification.resourceType}\n </div>\n <div\n class=\"notification-modal-subtitle pt-4 pb-0 font-bold text-balance\"\n >\n ${this.notification.subGroup}\n </div>\n </div>\n </div>\n <form\n class=\"notification-modal-content\"\n slot=\"content\"\n id=\"form-id\"\n method=\"dialog\"\n >\n <div\n class=\"notification-modal-content-title notification-modal-subject-title\"\n >\n Subject\n </div>\n <div class=\"notification-modal-subject-text font-normal text-wrap\">\n ${this.notification.subject}\n </div>\n <div\n class=\"notification-modal-content-title notification-modal-created-date-title\"\n >\n Create Date\n </div>\n <div class=\"notification-modal-created-date-text font-normal text-wrap\">\n ${format(\n new Date(this.notification.createdAt),\n 'dd/MM/yyyy HH:mm:ss'\n )}\n </div>\n <div\n class=\"notification-modal-content-title notification-modal-site-title\"\n >\n Site\n </div>\n <div class=\"notification-modal-site-text font-normal text-wrap\">\n ${this.getLocation()}\n </div>\n </form>\n <div slot=\"actions\" class=\"flex flex-row flex-end\">\n <ix-button form=\"form-id\" appearance=\"text\"> Close </ix-button>\n <ix-button\n href=\"${this.getUrl()}\"\n @click=\"${this.viewRecord}\"\n appearance=\"text\"\n >View Record</ix-button\n >\n </div>\n </ix-dialog>`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/helper/errors.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,CAAM,EAAE,cAAuB,IAAI,EAAE,EAAE;IACvE,IAAI,OAAO,GAAG,mBAAmB,CAAC;IAElC,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;QAC3D,IAAI;YACF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAO,CAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC9D,OAAO,GAAG,MAAM,CAAC;YACjB,IAAI,WAAW;gBAAE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACzC;QAAC,OAAO,EAAO,EAAE;YAChB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClB;KACF;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAClB;AACH,CAAC,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport { ResponseError } from '../api/notifications-api/index.js';\n\nexport const handleError = async (e: any, raiseDialog: boolean = true) => {\n let message = 'An error occurred';\n\n if (e instanceof ResponseError && e.response.status === 400) {\n try {\n const { detail } = await (e as ResponseError).response.json();\n message = detail;\n if (raiseDialog) console.error(message);\n } catch (e2: any) {\n console.error(e);\n }\n } else {\n console.error(e);\n }\n};\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/helper/errors.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,CAAM,EAAE,cAAuB,IAAI,EAAE,EAAE;IACvE,IAAI,OAAO,GAAG,mBAAmB,CAAC;IAElC,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5D,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAO,CAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC9D,OAAO,GAAG,MAAM,CAAC;YACjB,IAAI,WAAW;gBAAE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,EAAO,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport { ResponseError } from '../api/notifications-api/index.js';\n\nexport const handleError = async (e: any, raiseDialog: boolean = true) => {\n let message = 'An error occurred';\n\n if (e instanceof ResponseError && e.response.status === 400) {\n try {\n const { detail } = await (e as ResponseError).response.json();\n message = detail;\n if (raiseDialog) console.error(message);\n } catch (e2: any) {\n console.error(e);\n }\n } else {\n console.error(e);\n }\n};\n"]}