@hmcts/opal-frontend-common 0.0.26 → 0.0.28
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/README.md +55 -0
- package/components/moj/moj-pagination/index.d.ts +46 -128
- package/directives/capitalisation/index.d.ts +1 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +8 -8
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +10 -10
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +10 -10
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-horizontal-scroll-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes-custom-scrollable-panes-inner-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-scrollable-panes.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-inner-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane-custom-vertical-scroll-pane-outer-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-vertical-scroll-pane.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +5 -5
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs +25 -29
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs +104 -226
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs +22 -26
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +7 -10
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs.map +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-hjYG8Hhi.mjs → hmcts-opal-frontend-common-pages-access-denied.component-0Pl64thA.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-hjYG8Hhi.mjs.map → hmcts-opal-frontend-common-pages-access-denied.component-0Pl64thA.mjs.map} +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-joWzJ-cV.mjs → hmcts-opal-frontend-common-pages-sign-in-stub.component-DvQOlQMW.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-joWzJ-cV.mjs.map → hmcts-opal-frontend-common-pages-sign-in-stub.component-DvQOlQMW.mjs.map} +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-JCBGIMBe.mjs → hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-JCBGIMBe.mjs.map → hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs.map} +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pages.mjs +2 -2
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs +7 -10
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-pipes-national-insurance.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs +7 -10
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs +12 -20
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs.map +1 -1
- package/package.json +3 -3
- package/pipes/date-format/index.d.ts +0 -2
- package/resolvers/title/index.d.ts +0 -2
- package/services/transfer-state-service/index.d.ts +3 -5
- package/styles/styles.scss +15 -1
|
@@ -16,13 +16,13 @@ class SignInComponent {
|
|
|
16
16
|
handleStubSignInFormSubmit(formData) {
|
|
17
17
|
this.document.location.href = `${SSO_ENDPOINTS.login}?email=${formData.email}`;
|
|
18
18
|
}
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SignInComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: SignInComponent, isStandalone: true, selector: "opal-lib-sign-in", ngImport: i0, template: "@defer (when !globalStore.ssoEnabled()) {\n <opal-lib-sign-in-stub (signInFormSubmit)=\"handleStubSignInFormSubmit($event)\"></opal-lib-sign-in-stub>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [import('./hmcts-opal-frontend-common-pages-sign-in-stub.component-DvQOlQMW.mjs').then(m => m.SignInStubComponent)]] });
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "20.1.4", ngImport: i0, type: SignInComponent, resolveDeferredDeps: () => [import('./hmcts-opal-frontend-common-pages-sign-in-stub.component-DvQOlQMW.mjs').then(m => m.SignInStubComponent)], resolveMetadata: SignInStubComponent => ({ decorators: [{
|
|
23
23
|
type: Component,
|
|
24
24
|
args: [{ selector: 'opal-lib-sign-in', imports: [CommonModule, SignInStubComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@defer (when !globalStore.ssoEnabled()) {\n <opal-lib-sign-in-stub (signInFormSubmit)=\"handleStubSignInFormSubmit($event)\"></opal-lib-sign-in-stub>\n}\n" }]
|
|
25
25
|
}], ctorParameters: null, propDecorators: null }) });
|
|
26
26
|
|
|
27
27
|
export { SignInComponent };
|
|
28
|
-
//# sourceMappingURL=hmcts-opal-frontend-common-pages-sign-in.component-
|
|
28
|
+
//# sourceMappingURL=hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pages-sign-in.component-
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs","sources":["../../../projects/opal-frontend-common/pages/sign-in/sign-in.component.ts","../../../projects/opal-frontend-common/pages/sign-in/sign-in.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { CommonModule, DOCUMENT } from '@angular/common';\nimport { SignInStubComponent } from './sign-in-stub/sign-in-stub.component';\nimport { ISignInStubForm } from './interfaces';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SSO_ENDPOINTS } from '@hmcts/opal-frontend-common/services/auth-service/constants';\n\n@Component({\n selector: 'opal-lib-sign-in',\n imports: [CommonModule, SignInStubComponent],\n templateUrl: './sign-in.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SignInComponent {\n private readonly document = inject(DOCUMENT);\n\n public readonly globalStore = inject(GlobalStore);\n public ssoEnabled: boolean | null = true;\n\n /**\n * Handles the submission of the stub sign-in form.\n * Redirects the user to the SSO login page with the provided email.\n * @param formData - The form data containing the email.\n */\n public handleStubSignInFormSubmit(formData: ISignInStubForm): void {\n this.document.location.href = `${SSO_ENDPOINTS.login}?email=${formData.email}`;\n }\n}\n","@defer (when !globalStore.ssoEnabled()) {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A,EAAA,6JAAA,EAAA;;;;;"}
|
|
@@ -8,14 +8,14 @@ const routing = [
|
|
|
8
8
|
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
|
|
9
9
|
{
|
|
10
10
|
path: PAGES_ROUTING_PATHS.children.accessDenied,
|
|
11
|
-
loadComponent: () => import('./hmcts-opal-frontend-common-pages-access-denied.component-
|
|
11
|
+
loadComponent: () => import('./hmcts-opal-frontend-common-pages-access-denied.component-0Pl64thA.mjs').then((c) => c.AccessDeniedComponent),
|
|
12
12
|
canActivate: [authGuard],
|
|
13
13
|
data: { title: PAGES_ROUTING_TITLES.children.accessDenied },
|
|
14
14
|
resolve: { userState: userStateResolver, title: TitleResolver },
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
path: PAGES_ROUTING_PATHS.children.signIn,
|
|
18
|
-
loadComponent: () => import('./hmcts-opal-frontend-common-pages-sign-in.component-
|
|
18
|
+
loadComponent: () => import('./hmcts-opal-frontend-common-pages-sign-in.component-yuoev8a3.mjs').then((c) => c.SignInComponent),
|
|
19
19
|
canActivate: [signedInGuard],
|
|
20
20
|
data: { title: PAGES_ROUTING_TITLES.children.signIn },
|
|
21
21
|
resolve: { title: TitleResolver },
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe } from '@angular/core';
|
|
3
|
-
import
|
|
2
|
+
import { inject, Pipe } from '@angular/core';
|
|
3
|
+
import { DateService } from '@hmcts/opal-frontend-common/services/date-service';
|
|
4
4
|
|
|
5
5
|
class DateFormatPipe {
|
|
6
|
-
dateService;
|
|
7
|
-
constructor(dateService) {
|
|
8
|
-
this.dateService = dateService;
|
|
9
|
-
}
|
|
6
|
+
dateService = inject(DateService);
|
|
10
7
|
transform(value, inputFormat, outputFormat) {
|
|
11
8
|
if (!value)
|
|
12
9
|
return '—';
|
|
13
10
|
const formatted = this.dateService.getFromFormatToFormat(value, inputFormat, outputFormat);
|
|
14
11
|
return formatted;
|
|
15
12
|
}
|
|
16
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DateFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
14
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: DateFormatPipe, isStandalone: true, name: "dateFormat" });
|
|
18
15
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DateFormatPipe, decorators: [{
|
|
20
17
|
type: Pipe,
|
|
21
18
|
args: [{
|
|
22
19
|
name: 'dateFormat',
|
|
23
20
|
standalone: true,
|
|
24
21
|
}]
|
|
25
|
-
}]
|
|
22
|
+
}] });
|
|
26
23
|
|
|
27
24
|
/**
|
|
28
25
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-date-format.mjs","sources":["../../../projects/opal-frontend-common/pipes/date-format/date-format.pipe.ts","../../../projects/opal-frontend-common/pipes/date-format/hmcts-opal-frontend-common-pipes-date-format.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Pipe({\n name: 'dateFormat',\n standalone: true,\n})\nexport class DateFormatPipe implements PipeTransform {\n
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-pipes-date-format.mjs","sources":["../../../projects/opal-frontend-common/pipes/date-format/date-format.pipe.ts","../../../projects/opal-frontend-common/pipes/date-format/hmcts-opal-frontend-common-pipes-date-format.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DateService } from '@hmcts/opal-frontend-common/services/date-service';\n\n@Pipe({\n name: 'dateFormat',\n standalone: true,\n})\nexport class DateFormatPipe implements PipeTransform {\n private readonly dateService = inject(DateService);\n\n transform(value: string | null | undefined, inputFormat: string, outputFormat: string): string {\n if (!value) return '—';\n\n const formatted = this.dateService.getFromFormatToFormat(value, inputFormat, outputFormat);\n\n return formatted;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,cAAc,CAAA;AACR,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAElD,IAAA,SAAS,CAAC,KAAgC,EAAE,WAAmB,EAAE,YAAoB,EAAA;AACnF,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,GAAG;AAEtB,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,CAAC;AAE1F,QAAA,OAAO,SAAS;IAClB;uGATW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,YAAY;AAClB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -22,10 +22,10 @@ class DaysAgoPipe {
|
|
|
22
22
|
return 'Invalid date';
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DaysAgoPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
26
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: DaysAgoPipe, isStandalone: true, name: "daysAgo" });
|
|
27
27
|
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DaysAgoPipe, decorators: [{
|
|
29
29
|
type: Pipe,
|
|
30
30
|
args: [{
|
|
31
31
|
name: 'daysAgo',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-days-ago.mjs","sources":["../../../projects/opal-frontend-common/pipes/days-ago/days-ago.pipe.ts","../../../projects/opal-frontend-common/pipes/days-ago/hmcts-opal-frontend-common-pipes-days-ago.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'daysAgo',\n standalone: true,\n})\nexport class DaysAgoPipe implements PipeTransform {\n transform(value: number): string {\n if (value === 0) {\n return 'Today';\n } else if (value === 1) {\n return '1 day ago';\n } else if (value === -1) {\n return 'Tomorrow';\n } else if (value > 1) {\n return `${value} days ago`;\n } else if (value < -1) {\n return `In ${Math.abs(value)} days`;\n } else {\n return 'Invalid date';\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,WAAW,CAAA;AACtB,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,OAAO;QAChB;AAAO,aAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACtB,YAAA,OAAO,WAAW;QACpB;AAAO,aAAA,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACvB,YAAA,OAAO,UAAU;QACnB;AAAO,aAAA,IAAI,KAAK,GAAG,CAAC,EAAE;YACpB,OAAO,CAAA,EAAG,KAAK,CAAA,SAAA,CAAW;QAC5B;AAAO,aAAA,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;YACrB,OAAO,CAAA,GAAA,EAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO;QACrC;aAAO;AACL,YAAA,OAAO,cAAc;QACvB;IACF;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-pipes-days-ago.mjs","sources":["../../../projects/opal-frontend-common/pipes/days-ago/days-ago.pipe.ts","../../../projects/opal-frontend-common/pipes/days-ago/hmcts-opal-frontend-common-pipes-days-ago.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'daysAgo',\n standalone: true,\n})\nexport class DaysAgoPipe implements PipeTransform {\n transform(value: number): string {\n if (value === 0) {\n return 'Today';\n } else if (value === 1) {\n return '1 day ago';\n } else if (value === -1) {\n return 'Tomorrow';\n } else if (value > 1) {\n return `${value} days ago`;\n } else if (value < -1) {\n return `In ${Math.abs(value)} days`;\n } else {\n return 'Invalid date';\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,WAAW,CAAA;AACtB,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,OAAO;QAChB;AAAO,aAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACtB,YAAA,OAAO,WAAW;QACpB;AAAO,aAAA,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;AACvB,YAAA,OAAO,UAAU;QACnB;AAAO,aAAA,IAAI,KAAK,GAAG,CAAC,EAAE;YACpB,OAAO,CAAA,EAAG,KAAK,CAAA,SAAA,CAAW;QAC5B;AAAO,aAAA,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;YACrB,OAAO,CAAA,GAAA,EAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO;QACrC;aAAO;AACL,YAAA,OAAO,cAAc;QACvB;IACF;uGAfW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAX,WAAW,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA;;2FAAX,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,SAAS;AACf,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -11,10 +11,10 @@ class NationalInsurancePipe {
|
|
|
11
11
|
return value;
|
|
12
12
|
return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 4)} ${cleaned.slice(4, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8)}`;
|
|
13
13
|
}
|
|
14
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
15
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
14
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: NationalInsurancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
15
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: NationalInsurancePipe, isStandalone: true, name: "nationalInsurance" });
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: NationalInsurancePipe, decorators: [{
|
|
18
18
|
type: Pipe,
|
|
19
19
|
args: [{
|
|
20
20
|
name: 'nationalInsurance',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-pipes-national-insurance.mjs","sources":["../../../projects/opal-frontend-common/pipes/national-insurance/national-insurance.pipe.ts","../../../projects/opal-frontend-common/pipes/national-insurance/hmcts-opal-frontend-common-pipes-national-insurance.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'nationalInsurance',\n standalone: true,\n})\nexport class NationalInsurancePipe implements PipeTransform {\n transform(value: string | null): string {\n if (!value) {\n return '';\n }\n\n const cleaned = value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();\n\n if (cleaned.length < 9) return value;\n\n return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 4)} ${cleaned.slice(4, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8)}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,qBAAqB,CAAA;AAChC,IAAA,SAAS,CAAC,KAAoB,EAAA;QAC5B,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,EAAE;QACX;AAEA,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;AAEhE,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,KAAK;QAEpC,OAAO,CAAA,EAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC1H;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-pipes-national-insurance.mjs","sources":["../../../projects/opal-frontend-common/pipes/national-insurance/national-insurance.pipe.ts","../../../projects/opal-frontend-common/pipes/national-insurance/hmcts-opal-frontend-common-pipes-national-insurance.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'nationalInsurance',\n standalone: true,\n})\nexport class NationalInsurancePipe implements PipeTransform {\n transform(value: string | null): string {\n if (!value) {\n return '';\n }\n\n const cleaned = value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();\n\n if (cleaned.length < 9) return value;\n\n return `${cleaned.slice(0, 2)} ${cleaned.slice(2, 4)} ${cleaned.slice(4, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8)}`;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,qBAAqB,CAAA;AAChC,IAAA,SAAS,CAAC,KAAoB,EAAA;QAC5B,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,EAAE;QACX;AAEA,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;AAEhE,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;AAAE,YAAA,OAAO,KAAK;QAEpC,OAAO,CAAA,EAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA,EAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC1H;uGAXW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AACzB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { Title } from '@angular/platform-browser';
|
|
4
4
|
|
|
5
5
|
class TitleResolver {
|
|
6
|
-
titleService;
|
|
7
|
-
constructor(titleService) {
|
|
8
|
-
this.titleService = titleService;
|
|
9
|
-
}
|
|
6
|
+
titleService = inject(Title);
|
|
10
7
|
resolve(route) {
|
|
11
8
|
const title = route.data['title'] ?? 'Frontend';
|
|
12
9
|
this.titleService.setTitle(`OPAL - ${title}`);
|
|
13
10
|
}
|
|
14
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
15
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TitleResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TitleResolver, providedIn: 'root' });
|
|
16
13
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: TitleResolver, decorators: [{
|
|
18
15
|
type: Injectable,
|
|
19
16
|
args: [{
|
|
20
17
|
providedIn: 'root',
|
|
21
18
|
}]
|
|
22
|
-
}]
|
|
19
|
+
}] });
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-resolvers-title.mjs","sources":["../../../projects/opal-frontend-common/resolvers/title/title.resolver.ts","../../../projects/opal-frontend-common/resolvers/title/hmcts-opal-frontend-common-resolvers-title.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Resolve, ActivatedRouteSnapshot } from '@angular/router';\nimport { Title } from '@angular/platform-browser';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TitleResolver implements Resolve<void> {\n
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-resolvers-title.mjs","sources":["../../../projects/opal-frontend-common/resolvers/title/title.resolver.ts","../../../projects/opal-frontend-common/resolvers/title/hmcts-opal-frontend-common-resolvers-title.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { Resolve, ActivatedRouteSnapshot } from '@angular/router';\nimport { Title } from '@angular/platform-browser';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TitleResolver implements Resolve<void> {\n private readonly titleService = inject(Title);\n\n resolve(route: ActivatedRouteSnapshot): void {\n const title = route.data['title'] ?? 'Frontend';\n this.titleService.setTitle(`OPAL - ${title}`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,aAAa,CAAA;AACP,IAAA,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC;AAE7C,IAAA,OAAO,CAAC,KAA6B,EAAA;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU;QAC/C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA,OAAA,EAAU,KAAK,CAAA,CAAE,CAAC;IAC/C;uGANW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -35,10 +35,10 @@ class AppInitializerService {
|
|
|
35
35
|
this.initializeAppInsights();
|
|
36
36
|
await this.appInsightsService.initialize();
|
|
37
37
|
}
|
|
38
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
38
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AppInitializerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
39
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AppInitializerService, providedIn: 'root' });
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AppInitializerService, decorators: [{
|
|
42
42
|
type: Injectable,
|
|
43
43
|
args: [{
|
|
44
44
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-app-initializer-service.mjs","sources":["../../../projects/opal-frontend-common/services/app-initializer-service/app-initializer.service.ts","../../../projects/opal-frontend-common/services/app-initializer-service/hmcts-opal-frontend-common-services-app-initializer-service.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { TransferStateService } from '@hmcts/opal-frontend-common/services/transfer-state-service';\nimport { AppInsightsService } from '@hmcts/opal-frontend-common/services/app-insights-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppInitializerService {\n private readonly transferStateService = inject(TransferStateService);\n private readonly appInsightsService = inject(AppInsightsService);\n\n /**\n * Initializes the SSO (Single Sign-On) enabled state.\n * This method calls the `initializeSsoEnabled` method of the `transferStateService`.\n */\n private initializeSsoEnabled(): void {\n this.transferStateService.initializeSsoEnabled();\n }\n\n /**\n * Initializes the LaunchDarkly configuration.\n */\n private initializeLaunchDarkly(): void {\n this.transferStateService.initializeLaunchDarklyConfig();\n }\n\n /**\n * Initializes the Application Insights configuration.\n */\n private initializeAppInsights(): void {\n this.transferStateService.initializeAppInsightsConfig();\n }\n\n /**\n * Initializes the application.\n * This method calls the necessary initialization functions.\n */\n public async initializeApp(): Promise<void> {\n this.initializeSsoEnabled();\n this.initializeLaunchDarkly();\n this.initializeAppInsights();\n await this.appInsightsService.initialize();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,qBAAqB,CAAA;AACf,IAAA,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACnD,IAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAEhE;;;AAGG;IACK,oBAAoB,GAAA;AAC1B,QAAA,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE;IAClD;AAEA;;AAEG;IACK,sBAAsB,GAAA;AAC5B,QAAA,IAAI,CAAC,oBAAoB,CAAC,4BAA4B,EAAE;IAC1D;AAEA;;AAEG;IACK,qBAAqB,GAAA;AAC3B,QAAA,IAAI,CAAC,oBAAoB,CAAC,2BAA2B,EAAE;IACzD;AAEA;;;AAGG;AACI,IAAA,MAAM,aAAa,GAAA;QACxB,IAAI,CAAC,oBAAoB,EAAE;QAC3B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,qBAAqB,EAAE;AAC5B,QAAA,MAAM,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE;IAC5C;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-app-initializer-service.mjs","sources":["../../../projects/opal-frontend-common/services/app-initializer-service/app-initializer.service.ts","../../../projects/opal-frontend-common/services/app-initializer-service/hmcts-opal-frontend-common-services-app-initializer-service.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { TransferStateService } from '@hmcts/opal-frontend-common/services/transfer-state-service';\nimport { AppInsightsService } from '@hmcts/opal-frontend-common/services/app-insights-service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppInitializerService {\n private readonly transferStateService = inject(TransferStateService);\n private readonly appInsightsService = inject(AppInsightsService);\n\n /**\n * Initializes the SSO (Single Sign-On) enabled state.\n * This method calls the `initializeSsoEnabled` method of the `transferStateService`.\n */\n private initializeSsoEnabled(): void {\n this.transferStateService.initializeSsoEnabled();\n }\n\n /**\n * Initializes the LaunchDarkly configuration.\n */\n private initializeLaunchDarkly(): void {\n this.transferStateService.initializeLaunchDarklyConfig();\n }\n\n /**\n * Initializes the Application Insights configuration.\n */\n private initializeAppInsights(): void {\n this.transferStateService.initializeAppInsightsConfig();\n }\n\n /**\n * Initializes the application.\n * This method calls the necessary initialization functions.\n */\n public async initializeApp(): Promise<void> {\n this.initializeSsoEnabled();\n this.initializeLaunchDarkly();\n this.initializeAppInsights();\n await this.appInsightsService.initialize();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,qBAAqB,CAAA;AACf,IAAA,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACnD,IAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAEhE;;;AAGG;IACK,oBAAoB,GAAA;AAC1B,QAAA,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE;IAClD;AAEA;;AAEG;IACK,sBAAsB,GAAA;AAC5B,QAAA,IAAI,CAAC,oBAAoB,CAAC,4BAA4B,EAAE;IAC1D;AAEA;;AAEG;IACK,qBAAqB,GAAA;AAC3B,QAAA,IAAI,CAAC,oBAAoB,CAAC,2BAA2B,EAAE;IACzD;AAEA;;;AAGG;AACI,IAAA,MAAM,aAAa,GAAA;QACxB,IAAI,CAAC,oBAAoB,EAAE;QAC3B,IAAI,CAAC,sBAAsB,EAAE;QAC7B,IAAI,CAAC,qBAAqB,EAAE;AAC5B,QAAA,MAAM,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE;IAC5C;uGAnCW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAArB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -48,10 +48,10 @@ class AppInsightsService {
|
|
|
48
48
|
async initialize() {
|
|
49
49
|
await this.initializeAppInsights();
|
|
50
50
|
}
|
|
51
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
52
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AppInsightsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AppInsightsService, providedIn: 'root' });
|
|
53
53
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AppInsightsService, decorators: [{
|
|
55
55
|
type: Injectable,
|
|
56
56
|
args: [{
|
|
57
57
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-app-insights-service.mjs","sources":["../../../projects/opal-frontend-common/services/app-insights-service/app-insights.service.ts","../../../projects/opal-frontend-common/services/app-insights-service/hmcts-opal-frontend-common-services-app-insights-service.ts"],"sourcesContent":["import { inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { ITelemetryItem } from '@microsoft/applicationinsights-web';\nimport { isPlatformBrowser } from '@angular/common';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppInsightsService {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private appInsights!: any;\n private isInitialized = false;\n private readonly globalStore = inject(GlobalStore);\n private readonly platformId = inject(PLATFORM_ID);\n\n private async initializeAppInsights(): Promise<void> {\n const { ApplicationInsights } = await import('@microsoft/applicationinsights-web');\n const config = this.globalStore.appInsightsConfig();\n if (isPlatformBrowser(this.platformId) && config.enabled) {\n this.appInsights = new ApplicationInsights({\n config: {\n connectionString: config.connectionString,\n enableAutoRouteTracking: true,\n },\n });\n\n this.appInsights.addTelemetryInitializer(this.telemetryInitializer.bind(this));\n this.appInsights.loadAppInsights();\n\n this.isInitialized = true;\n }\n }\n\n private telemetryInitializer(envelope: ITelemetryItem): void {\n envelope.tags = envelope.tags || {};\n const config = this.globalStore.appInsightsConfig();\n if (config.enabled) {\n envelope.tags['ai.cloud.role'] = config.cloudRoleName!;\n }\n }\n\n public logPageView(name?: string, url?: string): void {\n const config = this.globalStore.appInsightsConfig();\n if (!this.isInitialized || !config.enabled) {\n return;\n }\n this.appInsights.trackPageView({ name, uri: url });\n }\n\n public logException(exception: Error, severityLevel?: number): void {\n const config = this.globalStore.appInsightsConfig();\n if (!this.isInitialized || !config.enabled) {\n return;\n }\n this.appInsights.trackException({ exception, severityLevel });\n }\n\n public async initialize(): Promise<void> {\n await this.initializeAppInsights();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,kBAAkB,CAAA;;AAErB,IAAA,WAAW;IACX,aAAa,GAAG,KAAK;AACZ,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAEzC,IAAA,MAAM,qBAAqB,GAAA;QACjC,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,OAAO,oCAAoC,CAAC;QAClF,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;QACnD,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE;AACxD,YAAA,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAmB,CAAC;AACzC,gBAAA,MAAM,EAAE;oBACN,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;AACzC,oBAAA,uBAAuB,EAAE,IAAI;AAC9B,iBAAA;AACF,aAAA,CAAC;AAEF,YAAA,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9E,YAAA,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE;AAElC,YAAA,IAAI,CAAC,aAAa,GAAG,IAAI;QAC3B;IACF;AAEQ,IAAA,oBAAoB,CAAC,QAAwB,EAAA;QACnD,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;AACnD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,aAAc;QACxD;IACF;IAEO,WAAW,CAAC,IAAa,EAAE,GAAY,EAAA;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;QACnD,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YAC1C;QACF;AACA,QAAA,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACpD;IAEO,YAAY,CAAC,SAAgB,EAAE,aAAsB,EAAA;QAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE;QACnD,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YAC1C;QACF;QACA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IAC/D;AAEO,IAAA,MAAM,UAAU,GAAA;AACrB,QAAA,MAAM,IAAI,CAAC,qBAAqB,EAAE;IACpC;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-app-insights-service.mjs","sources":["../../../projects/opal-frontend-common/services/app-insights-service/app-insights.service.ts","../../../projects/opal-frontend-common/services/app-insights-service/hmcts-opal-frontend-common-services-app-insights-service.ts"],"sourcesContent":["import { inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { ITelemetryItem } from '@microsoft/applicationinsights-web';\nimport { isPlatformBrowser } from '@angular/common';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AppInsightsService {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private appInsights!: any;\n private isInitialized = false;\n private readonly globalStore = inject(GlobalStore);\n private readonly platformId = inject(PLATFORM_ID);\n\n private async initializeAppInsights(): Promise<void> {\n const { ApplicationInsights } = await import('@microsoft/applicationinsights-web');\n const config = this.globalStore.appInsightsConfig();\n if (isPlatformBrowser(this.platformId) && config.enabled) {\n this.appInsights = new ApplicationInsights({\n config: {\n connectionString: config.connectionString,\n enableAutoRouteTracking: true,\n },\n });\n\n this.appInsights.addTelemetryInitializer(this.telemetryInitializer.bind(this));\n this.appInsights.loadAppInsights();\n\n this.isInitialized = true;\n }\n }\n\n private telemetryInitializer(envelope: ITelemetryItem): void {\n envelope.tags = envelope.tags || {};\n const config = this.globalStore.appInsightsConfig();\n if (config.enabled) {\n envelope.tags['ai.cloud.role'] = config.cloudRoleName!;\n }\n }\n\n public logPageView(name?: string, url?: string): void {\n const config = this.globalStore.appInsightsConfig();\n if (!this.isInitialized || !config.enabled) {\n return;\n }\n this.appInsights.trackPageView({ name, uri: url });\n }\n\n public logException(exception: Error, severityLevel?: number): void {\n const config = this.globalStore.appInsightsConfig();\n if (!this.isInitialized || !config.enabled) {\n return;\n }\n this.appInsights.trackException({ exception, severityLevel });\n }\n\n public async initialize(): Promise<void> {\n await this.initializeAppInsights();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAQa,kBAAkB,CAAA;;AAErB,IAAA,WAAW;IACX,aAAa,GAAG,KAAK;AACZ,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAEzC,IAAA,MAAM,qBAAqB,GAAA;QACjC,MAAM,EAAE,mBAAmB,EAAE,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,WAAW,CAAC,iBAAiB,EAAE;QACnD,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YAC1C;QACF;QACA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;IAC/D;AAEO,IAAA,MAAM,UAAU,GAAA;AACrB,QAAA,MAAM,IAAI,CAAC,qBAAqB,EAAE;IACpC;uGAnDW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -25,10 +25,10 @@ class AuthService {
|
|
|
25
25
|
return throwError(() => error);
|
|
26
26
|
}));
|
|
27
27
|
}
|
|
28
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
29
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
30
30
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AuthService, decorators: [{
|
|
32
32
|
type: Injectable,
|
|
33
33
|
args: [{
|
|
34
34
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-auth-service.mjs","sources":["../../../projects/opal-frontend-common/services/auth-service/auth.service.ts","../../../projects/opal-frontend-common/services/auth-service/hmcts-opal-frontend-common-services-auth-service.ts"],"sourcesContent":["import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { catchError, tap, throwError } from 'rxjs';\nimport { SSO_ENDPOINTS } from '@hmcts/opal-frontend-common/services/auth-service/constants';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n\n public checkAuthenticated() {\n return this.http\n .get<boolean>(SSO_ENDPOINTS.authenticated, {\n headers: new HttpHeaders({\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n Expires: '0',\n }),\n })\n .pipe(\n tap((resp) => {\n this.globalStore.setAuthenticated(resp);\n }),\n )\n .pipe(\n catchError((error) => {\n this.globalStore.setAuthenticated(false);\n return throwError(() => error);\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MASa,WAAW,CAAA;AACL,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAE3C,kBAAkB,GAAA;QACvB,OAAO,IAAI,CAAC;AACT,aAAA,GAAG,CAAU,aAAa,CAAC,aAAa,EAAE;YACzC,OAAO,EAAE,IAAI,WAAW,CAAC;AACvB,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,MAAM,EAAE,UAAU;AAClB,gBAAA,OAAO,EAAE,GAAG;aACb,CAAC;SACH;AACA,aAAA,IAAI,CACH,GAAG,CAAC,CAAC,IAAI,KAAI;AACX,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACzC,QAAA,CAAC,CAAC;AAEH,aAAA,IAAI,CACH,UAAU,CAAC,CAAC,KAAK,KAAI;AACnB,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC;AACxC,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,CAAC,CACH;IACL;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-auth-service.mjs","sources":["../../../projects/opal-frontend-common/services/auth-service/auth.service.ts","../../../projects/opal-frontend-common/services/auth-service/hmcts-opal-frontend-common-services-auth-service.ts"],"sourcesContent":["import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { catchError, tap, throwError } from 'rxjs';\nimport { SSO_ENDPOINTS } from '@hmcts/opal-frontend-common/services/auth-service/constants';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n\n public checkAuthenticated() {\n return this.http\n .get<boolean>(SSO_ENDPOINTS.authenticated, {\n headers: new HttpHeaders({\n 'Cache-Control': 'no-cache',\n Pragma: 'no-cache',\n Expires: '0',\n }),\n })\n .pipe(\n tap((resp) => {\n this.globalStore.setAuthenticated(resp);\n }),\n )\n .pipe(\n catchError((error) => {\n this.globalStore.setAuthenticated(false);\n return throwError(() => error);\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MASa,WAAW,CAAA;AACL,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAE3C,kBAAkB,GAAA;QACvB,OAAO,IAAI,CAAC;AACT,aAAA,GAAG,CAAU,aAAa,CAAC,aAAa,EAAE;YACzC,OAAO,EAAE,IAAI,WAAW,CAAC;AACvB,gBAAA,eAAe,EAAE,UAAU;AAC3B,gBAAA,MAAM,EAAE,UAAU;AAClB,gBAAA,OAAO,EAAE,GAAG;aACb,CAAC;SACH;AACA,aAAA,IAAI,CACH,GAAG,CAAC,CAAC,IAAI,KAAI;AACX,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AACzC,QAAA,CAAC,CAAC;AAEH,aAAA,IAAI,CACH,UAAU,CAAC,CAAC,KAAK,KAAI;AACnB,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,CAAC;AACxC,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,CAAC,CACH;IACL;uGAxBW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;2FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -216,10 +216,10 @@ class DateService {
|
|
|
216
216
|
to: this.toFormat(this.getFromIso(dateTo), format),
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
220
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
219
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
220
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DateService, providedIn: 'root' });
|
|
221
221
|
}
|
|
222
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: DateService, decorators: [{
|
|
223
223
|
type: Injectable,
|
|
224
224
|
args: [{
|
|
225
225
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-date-service.mjs","sources":["../../../projects/opal-frontend-common/services/date-service/date.service.ts","../../../projects/opal-frontend-common/services/date-service/hmcts-opal-frontend-common-services-date-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { DateTime, Duration, DurationLikeObject } from 'luxon';\nimport { IDateRange, IAgeObject } from './interfaces/date.service.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DateService {\n /**\n * Calculates the difference in minutes between two DateTime objects.\n * @param startDate The start date and time.\n * @param endDate The end date and time.\n * @returns The difference in minutes between the start and end dates.\n */\n public calculateMinutesDifference(startDate: DateTime, endDate: DateTime): number {\n const minuteDifference = endDate.diff(startDate, 'minutes');\n return Math.max(0, Math.ceil(minuteDifference.minutes));\n }\n\n /**\n * Converts milliseconds to minutes.\n * @param milliseconds - The number of milliseconds to convert.\n * @returns The equivalent number of minutes.\n */\n public convertMillisecondsToMinutes(milliseconds: number): number {\n const minutes = Duration.fromMillis(milliseconds).as('minutes');\n return Math.max(0, Math.ceil(minutes));\n }\n\n /**\n * Calculates the age based on the given date of birth.\n * @param dateOfBirth - The date of birth to calculate the age from.\n * @param format - The format of the date of birth. Defaults to 'dd/MM/yyyy'.\n * @returns The calculated age.\n */\n public calculateAge(dateOfBirth: DateTime | string, format: string = 'dd/MM/yyyy'): number {\n const date = typeof dateOfBirth === 'string' ? this.getFromFormat(dateOfBirth, format) : dateOfBirth;\n\n return Math.floor(DateTime.now().diff(date, 'years').years);\n }\n\n /**\n * Checks if a given date is valid.\n * @param dateInput - The date to be checked. It can be a DateTime object, a string, or null.\n * @param format - The format of the date string (default: 'dd/MM/yyyy').\n * @returns A boolean indicating whether the date is valid or not.\n */\n public isValidDate(dateInput: DateTime | string | null, format: string = 'dd/MM/yyyy'): boolean {\n if (dateInput) {\n const date = typeof dateInput === 'string' ? this.getFromFormat(dateInput, format) : dateInput;\n return date.isValid;\n }\n return false;\n }\n\n /**\n * Returns a string representation of a date subtracted by the given duration.\n * @param duration A DurationLikeObject representing the amount of time to subtract from the current date.\n * @returns A string representing the subtracted date in the format specified by the current locale.\n */\n public getPreviousDate(duration: DurationLikeObject): string {\n return DateTime.now().minus(duration).setLocale('en-gb').toLocaleString();\n }\n\n /**\n * Parses a string value into a DateTime object based on the specified format.\n * @param value - The string value to parse.\n * @param format - The format of the string value.\n * @returns A DateTime object representing the parsed value.\n */\n public getFromFormat(value: string, format: string): DateTime<true> | DateTime<false> {\n return DateTime.fromFormat(value, format);\n }\n\n /**\n * Returns an object containing the age and age group based on the date of birth.\n * @param dateOfBirth - The date of birth to calculate the age from.\n * @returns An object containing the age value and group ('Adult' or 'Youth') if the date is valid, or null if the date is invalid.\n */\n public getAgeObject(dateOfBirth: string): IAgeObject | null {\n if (this.isValidDate(dateOfBirth)) {\n const age = this.calculateAge(dateOfBirth);\n return {\n value: age,\n group: age >= 18 ? 'Adult' : 'Youth',\n };\n }\n return null;\n }\n\n /**\n * Parses a string value into a native JavaScript Date object based on the specified format.\n * @param value - The string value to parse.\n * @param format - The format of the string value.\n * @returns A Date object representing the parsed value, or null if parsing fails.\n */\n public getDateFromFormat(value: string, format: string): Date | null {\n const dateTime = DateTime.fromFormat(value, format);\n return dateTime.isValid ? dateTime.toJSDate() : null;\n }\n\n /**\n * Converts a DateTime value to a formatted string.\n *\n * @param value - The DateTime value to format.\n * @param format - The format string to apply to the DateTime value.\n * @returns The formatted string representation of the DateTime value.\n */\n public toFormat(value: DateTime<true> | DateTime<false>, format: string): string {\n return value.toFormat(format);\n }\n\n /**\n * Converts a given Date object to a formatted string based on the specified format.\n *\n * @param value - The Date object to be formatted.\n * @param format - The string format to apply to the Date object.\n * @returns The formatted date string.\n */\n public toDateStringFormat(value: Date, format: string): string {\n return DateTime.fromJSDate(value).toFormat(format);\n }\n\n /**\n * Converts a string in ISO format to a DateTime object.\n * @param value - The string value in ISO format.\n * @returns A DateTime object representing the given value.\n */\n public getFromIso(value: string): DateTime {\n return DateTime.fromISO(value);\n }\n\n /**\n * Returns the current date and time.\n * @returns {DateTime} The current date and time.\n */\n public getDateNow(): DateTime {\n return DateTime.now();\n }\n\n /**\n * Adds a duration to a given date and returns the result in the specified format.\n * @param date - The date to which the duration will be added.\n * @param years - The number of years to add to the date (default: 0).\n * @param months - The number of months to add to the date (default: 0).\n * @param weeks - The number of weeks to add to the date (default: 0).\n * @param days - The number of days to add to the date (default: 0).\n * @param format - The format in which the resulting date will be returned (default: 'dd/MM/yyyy').\n * @returns The resulting date in the specified format.\n */\n public addDurationToDate(\n date: string,\n years: number = 0,\n months: number = 0,\n weeks: number = 0,\n days: number = 0,\n format: string = 'dd/MM/yyyy',\n ): string {\n const dateObj = this.getFromFormat(date, format);\n const newDate = dateObj.plus({ years, months, weeks, days });\n return newDate.toFormat(format);\n }\n\n /**\n * Calculates the number of days between two dates.\n * @param startDate - The start date in the specified format.\n * @param endDate - The end date in the specified format.\n * @param format - The format of the dates (default: 'dd/MM/yyyy').\n * @returns The number of days between the start and end dates.\n */\n public calculateDaysBetweenDates(startDate: string, endDate: string, format: string = 'dd/MM/yyyy'): number {\n const start = this.getFromFormat(startDate, format);\n const end = this.getFromFormat(endDate, format);\n const diff = end.diff(start, 'days');\n return diff.days;\n }\n\n /**\n * Checks if a given date is in the past.\n * @param date - The date to check.\n * @param format - The format of the date string. Defaults to 'dd/MM/yyyy'.\n * @returns True if the date is in the past, false otherwise.\n */\n public isDateInThePast(date: string, format: string = 'dd/MM/yyyy'): boolean {\n return this.getFromFormat(date, format) < DateTime.now();\n }\n\n /**\n * Checks if a given date is in the future.\n * @param date - The date to check.\n * @param yearsInTheFuture - Optional. The number of years in the future to compare against. If not provided, the current date is used.\n * @param format - Optional. The format of the input date. Defaults to 'dd/MM/yyyy'.\n * @returns True if the date is in the future, false otherwise.\n */\n public isDateInTheFuture(date: string, yearsInTheFuture?: number, format: string = 'dd/MM/yyyy'): boolean {\n const now = DateTime.now();\n const dateValue = this.getFromFormat(date, format);\n\n if (yearsInTheFuture) {\n const futureDate = now.plus({ years: yearsInTheFuture });\n return dateValue > futureDate;\n }\n\n return dateValue > now;\n }\n\n /**\n * Converts a date string from one format to another.\n *\n * @param date - The date string to be converted.\n * @param fromFormat - The format of the input date string.\n * @param toFormat - The desired format of the output date string.\n * @returns The date string in the desired format.\n */\n public getFromFormatToFormat(date: string, fromFormat: string, toFormat: string): string {\n return this.getFromFormat(date, fromFormat).toFormat(toFormat);\n }\n\n /**\n * Calculates the number of days between the current date and a given ISO date string.\n *\n * @param value - An ISO 8601 formatted date string representing the target date.\n * @returns The number of days between the current date and the input date.\n * Returns 0 if the input date is invalid.\n */\n public getDaysAgo(value: string): number {\n const inputDate = this.getFromIso(value).startOf('day');\n\n const now = this.getDateNow().startOf('day');\n return Math.round(now.diff(inputDate, 'days').days);\n }\n\n /**\n * Returns a date range object with 'from' and 'to' properties.\n * @param pastDays - The number of days in the past from today.\n * @param futureDays - The number of days in the future from today.\n * @param format - The format for the date strings (default: 'yyyy-MM-dd').\n * @returns An object containing 'from' and 'to' date strings in the specified format.\n */\n public getDateRange(pastDays: number = 0, futureDays: number = 0, format: string = 'yyyy-MM-dd'): IDateRange {\n const dateTo = this.getDateNow().plus({ days: futureDays }).toISODate();\n const dateFrom = this.getDateNow().minus({ days: pastDays }).toISODate();\n\n if (!dateTo || !dateFrom) {\n throw new Error('Invalid date range');\n }\n\n return {\n from: this.toFormat(this.getFromIso(dateFrom), format),\n to: this.toFormat(this.getFromIso(dateTo), format),\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,WAAW,CAAA;AACtB;;;;;AAKG;IACI,0BAA0B,CAAC,SAAmB,EAAE,OAAiB,EAAA;QACtE,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;AAC3D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD;AAEA;;;;AAIG;AACI,IAAA,4BAA4B,CAAC,YAAoB,EAAA;AACtD,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;AAC/D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC;AAEA;;;;;AAKG;AACI,IAAA,YAAY,CAAC,WAA8B,EAAE,MAAA,GAAiB,YAAY,EAAA;QAC/E,MAAM,IAAI,GAAG,OAAO,WAAW,KAAK,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,WAAW;AAEpG,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC;IAC7D;AAEA;;;;;AAKG;AACI,IAAA,WAAW,CAAC,SAAmC,EAAE,MAAA,GAAiB,YAAY,EAAA;QACnF,IAAI,SAAS,EAAE;YACb,MAAM,IAAI,GAAG,OAAO,SAAS,KAAK,QAAQ,G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IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE;AACxB,YAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC;QACvC;QAEA,OAAO;AACL,YAAA,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;AACtD,YAAA,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;SACnD;IACH;wGApPW,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAX,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cAFV,MAAM,EAAA,CAAA;;4FAEP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAHvB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-date-service.mjs","sources":["../../../projects/opal-frontend-common/services/date-service/date.service.ts","../../../projects/opal-frontend-common/services/date-service/hmcts-opal-frontend-common-services-date-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { DateTime, Duration, DurationLikeObject } from 'luxon';\nimport { IDateRange, IAgeObject } from './interfaces/date.service.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DateService {\n /**\n * Calculates the difference in minutes between two DateTime objects.\n * @param startDate The start date and time.\n * @param endDate The end date and time.\n * @returns The difference in minutes between the start and end dates.\n */\n public calculateMinutesDifference(startDate: DateTime, endDate: DateTime): number {\n const minuteDifference = endDate.diff(startDate, 'minutes');\n return Math.max(0, Math.ceil(minuteDifference.minutes));\n }\n\n /**\n * Converts milliseconds to minutes.\n * @param milliseconds - The number of milliseconds to convert.\n * @returns The equivalent number of minutes.\n */\n public convertMillisecondsToMinutes(milliseconds: number): number {\n const minutes = Duration.fromMillis(milliseconds).as('minutes');\n return Math.max(0, Math.ceil(minutes));\n }\n\n /**\n * Calculates the age based on the given date of birth.\n * @param dateOfBirth - The date of birth to calculate the age from.\n * @param format - The format of the date of birth. Defaults to 'dd/MM/yyyy'.\n * @returns The calculated age.\n */\n public calculateAge(dateOfBirth: DateTime | string, format: string = 'dd/MM/yyyy'): number {\n const date = typeof dateOfBirth === 'string' ? this.getFromFormat(dateOfBirth, format) : dateOfBirth;\n\n return Math.floor(DateTime.now().diff(date, 'years').years);\n }\n\n /**\n * Checks if a given date is valid.\n * @param dateInput - The date to be checked. It can be a DateTime object, a string, or null.\n * @param format - The format of the date string (default: 'dd/MM/yyyy').\n * @returns A boolean indicating whether the date is valid or not.\n */\n public isValidDate(dateInput: DateTime | string | null, format: string = 'dd/MM/yyyy'): boolean {\n if (dateInput) {\n const date = typeof dateInput === 'string' ? this.getFromFormat(dateInput, format) : dateInput;\n return date.isValid;\n }\n return false;\n }\n\n /**\n * Returns a string representation of a date subtracted by the given duration.\n * @param duration A DurationLikeObject representing the amount of time to subtract from the current date.\n * @returns A string representing the subtracted date in the format specified by the current locale.\n */\n public getPreviousDate(duration: DurationLikeObject): string {\n return DateTime.now().minus(duration).setLocale('en-gb').toLocaleString();\n }\n\n /**\n * Parses a string value into a DateTime object based on the specified format.\n * @param value - The string value to parse.\n * @param format - The format of the string value.\n * @returns A DateTime object representing the parsed value.\n */\n public getFromFormat(value: string, format: string): DateTime<true> | DateTime<false> {\n return DateTime.fromFormat(value, format);\n }\n\n /**\n * Returns an object containing the age and age group based on the date of birth.\n * @param dateOfBirth - The date of birth to calculate the age from.\n * @returns An object containing the age value and group ('Adult' or 'Youth') if the date is valid, or null if the date is invalid.\n */\n public getAgeObject(dateOfBirth: string): IAgeObject | null {\n if (this.isValidDate(dateOfBirth)) {\n const age = this.calculateAge(dateOfBirth);\n return {\n value: age,\n group: age >= 18 ? 'Adult' : 'Youth',\n };\n }\n return null;\n }\n\n /**\n * Parses a string value into a native JavaScript Date object based on the specified format.\n * @param value - The string value to parse.\n * @param format - The format of the string value.\n * @returns A Date object representing the parsed value, or null if parsing fails.\n */\n public getDateFromFormat(value: string, format: string): Date | null {\n const dateTime = DateTime.fromFormat(value, format);\n return dateTime.isValid ? dateTime.toJSDate() : null;\n }\n\n /**\n * Converts a DateTime value to a formatted string.\n *\n * @param value - The DateTime value to format.\n * @param format - The format string to apply to the DateTime value.\n * @returns The formatted string representation of the DateTime value.\n */\n public toFormat(value: DateTime<true> | DateTime<false>, format: string): string {\n return value.toFormat(format);\n }\n\n /**\n * Converts a given Date object to a formatted string based on the specified format.\n *\n * @param value - The Date object to be formatted.\n * @param format - The string format to apply to the Date object.\n * @returns The formatted date string.\n */\n public toDateStringFormat(value: Date, format: string): string {\n return DateTime.fromJSDate(value).toFormat(format);\n }\n\n /**\n * Converts a string in ISO format to a DateTime object.\n * @param value - The string value in ISO format.\n * @returns A DateTime object representing the given value.\n */\n public getFromIso(value: string): DateTime {\n return DateTime.fromISO(value);\n }\n\n /**\n * Returns the current date and time.\n * @returns {DateTime} The current date and time.\n */\n public getDateNow(): DateTime {\n return DateTime.now();\n }\n\n /**\n * Adds a duration to a given date and returns the result in the specified format.\n * @param date - The date to which the duration will be added.\n * @param years - The number of years to add to the date (default: 0).\n * @param months - The number of months to add to the date (default: 0).\n * @param weeks - The number of weeks to add to the date (default: 0).\n * @param days - The number of days to add to the date (default: 0).\n * @param format - The format in which the resulting date will be returned (default: 'dd/MM/yyyy').\n * @returns The resulting date in the specified format.\n */\n public addDurationToDate(\n date: string,\n years: number = 0,\n months: number = 0,\n weeks: number = 0,\n days: number = 0,\n format: string = 'dd/MM/yyyy',\n ): string {\n const dateObj = this.getFromFormat(date, format);\n const newDate = dateObj.plus({ years, months, weeks, days });\n return newDate.toFormat(format);\n }\n\n /**\n * Calculates the number of days between two dates.\n * @param startDate - The start date in the specified format.\n * @param endDate - The end date in the specified format.\n * @param format - The format of the dates (default: 'dd/MM/yyyy').\n * @returns The number of days between the start and end dates.\n */\n public calculateDaysBetweenDates(startDate: string, endDate: string, format: string = 'dd/MM/yyyy'): number {\n const start = this.getFromFormat(startDate, format);\n const end = this.getFromFormat(endDate, format);\n const diff = end.diff(start, 'days');\n return diff.days;\n }\n\n /**\n * Checks if a given date is in the past.\n * @param date - The date to check.\n * @param format - The format of the date string. Defaults to 'dd/MM/yyyy'.\n * @returns True if the date is in the past, false otherwise.\n */\n public isDateInThePast(date: string, format: string = 'dd/MM/yyyy'): boolean {\n return this.getFromFormat(date, format) < DateTime.now();\n }\n\n /**\n * Checks if a given date is in the future.\n * @param date - The date to check.\n * @param yearsInTheFuture - Optional. The number of years in the future to compare against. If not provided, the current date is used.\n * @param format - Optional. The format of the input date. Defaults to 'dd/MM/yyyy'.\n * @returns True if the date is in the future, false otherwise.\n */\n public isDateInTheFuture(date: string, yearsInTheFuture?: number, format: string = 'dd/MM/yyyy'): boolean {\n const now = DateTime.now();\n const dateValue = this.getFromFormat(date, format);\n\n if (yearsInTheFuture) {\n const futureDate = now.plus({ years: yearsInTheFuture });\n return dateValue > futureDate;\n }\n\n return dateValue > now;\n }\n\n /**\n * Converts a date string from one format to another.\n *\n * @param date - The date string to be converted.\n * @param fromFormat - The format of the input date string.\n * @param toFormat - The desired format of the output date string.\n * @returns The date string in the desired format.\n */\n public getFromFormatToFormat(date: string, fromFormat: string, toFormat: string): string {\n return this.getFromFormat(date, fromFormat).toFormat(toFormat);\n }\n\n /**\n * Calculates the number of days between the current date and a given ISO date string.\n *\n * @param value - An ISO 8601 formatted date string representing the target date.\n * @returns The number of days between the current date and the input date.\n * Returns 0 if the input date is invalid.\n */\n public getDaysAgo(value: string): number {\n const inputDate = this.getFromIso(value).startOf('day');\n\n const now = this.getDateNow().startOf('day');\n return Math.round(now.diff(inputDate, 'days').days);\n }\n\n /**\n * Returns a date range object with 'from' and 'to' properties.\n * @param pastDays - The number of days in the past from today.\n * @param futureDays - The number of days in the future from today.\n * @param format - The format for the date strings (default: 'yyyy-MM-dd').\n * @returns An object containing 'from' and 'to' date strings in the specified format.\n */\n public getDateRange(pastDays: number = 0, futureDays: number = 0, format: string = 'yyyy-MM-dd'): IDateRange {\n const dateTo = this.getDateNow().plus({ days: futureDays }).toISODate();\n const dateFrom = this.getDateNow().minus({ days: pastDays }).toISODate();\n\n if (!dateTo || !dateFrom) {\n throw new Error('Invalid date range');\n }\n\n return {\n from: this.toFormat(this.getFromIso(dateFrom), format),\n to: this.toFormat(this.getFromIso(dateTo), format),\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAOa,WAAW,CAAA;AACtB;;;;;AAKG;IACI,0BAA0B,CAAC,SAAmB,EAAE,OAAiB,EAAA;QACtE,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;AAC3D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzD;AAEA;;;;AAIG;AACI,IAAA,4BAA4B,CAAC,YAAoB,EAAA;AACtD,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;AAC/D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC;AAEA;;;;;AAKG;AACI,IAAA,YAAY,CAAC,WAA8B,EAAE,MAAA,GAAiB,YAAY,EAAA;QAC/E,MAAM,IAAI,GAAG,OAAO,WAAW,KAAK,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG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ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
83
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LaunchDarklyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
84
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LaunchDarklyService, providedIn: 'root' });
|
|
85
85
|
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: LaunchDarklyService, decorators: [{
|
|
87
87
|
type: Injectable,
|
|
88
88
|
args: [{
|
|
89
89
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-launch-darkly-service.mjs","sources":["../../../projects/opal-frontend-common/services/launch-darkly-service/launch-darkly.service.ts","../../../projects/opal-frontend-common/services/launch-darkly-service/hmcts-opal-frontend-common-services-launch-darkly-service.ts"],"sourcesContent":["import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { initialize, LDClient, LDFlagChangeset, LDFlagSet } from 'launchdarkly-js-client-sdk';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LaunchDarklyService implements OnDestroy {\n private readonly globalStore = inject(GlobalStore);\n private ldClient!: LDClient;\n\n /**\n * Sets the LaunchDarkly flags by updating the featureFlags in the state service.\n */\n private setLaunchDarklyFlags() {\n if (this.ldClient) {\n this.globalStore.setFeatureFlags(this.ldClient.allFlags());\n }\n }\n\n /**\n * Formats the LDFlagChangeset into an LDFlagSet.\n *\n * @param flags - The LDFlagChangeset to be formatted.\n * @returns The formatted LDFlagSet.\n */\n private formatChangeFlags(flags: LDFlagChangeset): LDFlagSet {\n return Object.keys(flags).reduce((flag: LDFlagSet, key) => {\n flag[key] = flags[key].current;\n return flag;\n }, {});\n }\n\n /**\n * Closes the LaunchDarkly client if it is open.\n */\n private closeLaunchDarklyClient(): void {\n if (this.ldClient) {\n this.ldClient.close();\n }\n }\n\n /**\n * Initializes the LaunchDarkly change listener.\n * This method listens for changes in feature flags and updates the state accordingly.\n */\n public initializeLaunchDarklyChangeListener() {\n if (this.ldClient && this.globalStore.launchDarklyConfig().stream) {\n this.ldClient.on('change', (flags: LDFlagChangeset) => {\n const updatedFlags = { ...this.globalStore.featureFlags(), ...this.formatChangeFlags(flags) };\n this.globalStore.setFeatureFlags(updatedFlags);\n });\n }\n }\n\n /**\n * Initializes the LaunchDarkly flags and sets them.\n * If the LD client is already initialized, it waits for initialization and then sets the flags.\n * If the LD client is not initialized, it returns a resolved promise.\n * @returns A promise that resolves when the flags are set.\n */\n public async initializeLaunchDarklyFlags(): Promise<void> {\n if (this.ldClient) {\n return this.ldClient\n .waitForInitialization(5)\n .then(() => this.setLaunchDarklyFlags())\n .catch((err) => {\n throw err;\n });\n }\n\n return Promise.resolve();\n }\n\n /**\n * Initializes the LaunchDarkly client.\n * If a stored LaunchDarkly client ID exists, it initializes the client with the ID and anonymous mode enabled.\n */\n public initializeLaunchDarklyClient(): void {\n if (this.globalStore.launchDarklyConfig()) {\n const { enabled, clientId } = this.globalStore.launchDarklyConfig();\n\n if (enabled && clientId) {\n this.ldClient = initialize(clientId, {\n anonymous: true,\n });\n }\n }\n }\n\n ngOnDestroy(): void {\n this.closeLaunchDarklyClient();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,mBAAmB,CAAA;AACb,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,QAAQ;AAEhB;;AAEG;IACK,oBAAoB,GAAA;AAC1B,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,WAAW,CAAC,eA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AAA,OAAO,OAAO,CAAC,OAAO,EAAE;IAC1B;AAEA;;;AAGG;IACI,4BAA4B,GAAA;AACjC,QAAA,IAAI,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,EAAE;AACzC,YAAA,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE;AAEnE,YAAA,IAAI,OAAO,IAAI,QAAQ,EAAE;AACvB,gBAAA,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AACnC,oBAAA,SAAS,EAAE,IAAI;AAChB,iBAAA,CAAC;YACJ;QACF;IACF;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,uBAAuB,EAAE;IAChC;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-launch-darkly-service.mjs","sources":["../../../projects/opal-frontend-common/services/launch-darkly-service/launch-darkly.service.ts","../../../projects/opal-frontend-common/services/launch-darkly-service/hmcts-opal-frontend-common-services-launch-darkly-service.ts"],"sourcesContent":["import { inject, Injectable, OnDestroy } from '@angular/core';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { initialize, LDClient, LDFlagChangeset, LDFlagSet } from 'launchdarkly-js-client-sdk';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LaunchDarklyService implements OnDestroy {\n private readonly globalStore = inject(GlobalStore);\n private ldClient!: LDClient;\n\n /**\n * Sets the LaunchDarkly flags by updating the featureFlags in the state service.\n */\n private setLaunchDarklyFlags() {\n if (this.ldClient) {\n this.globalStore.setFeatureFlags(this.ldClient.allFlags());\n }\n }\n\n /**\n * Formats the LDFlagChangeset into an LDFlagSet.\n *\n * @param flags - The LDFlagChangeset to be formatted.\n * @returns The formatted LDFlagSet.\n */\n private formatChangeFlags(flags: LDFlagChangeset): LDFlagSet {\n return Object.keys(flags).reduce((flag: LDFlagSet, key) => {\n flag[key] = flags[key].current;\n return flag;\n }, {});\n }\n\n /**\n * Closes the LaunchDarkly client if it is open.\n */\n private closeLaunchDarklyClient(): void {\n if (this.ldClient) {\n this.ldClient.close();\n }\n }\n\n /**\n * Initializes the LaunchDarkly change listener.\n * This method listens for changes in feature flags and updates the state accordingly.\n */\n public initializeLaunchDarklyChangeListener() {\n if (this.ldClient && this.globalStore.launchDarklyConfig().stream) {\n this.ldClient.on('change', (flags: LDFlagChangeset) => {\n const updatedFlags = { ...this.globalStore.featureFlags(), ...this.formatChangeFlags(flags) };\n this.globalStore.setFeatureFlags(updatedFlags);\n });\n }\n }\n\n /**\n * Initializes the LaunchDarkly flags and sets them.\n * If the LD client is already initialized, it waits for initialization and then sets the flags.\n * If the LD client is not initialized, it returns a resolved promise.\n * @returns A promise that resolves when the flags are set.\n */\n public async initializeLaunchDarklyFlags(): Promise<void> {\n if (this.ldClient) {\n return this.ldClient\n .waitForInitialization(5)\n .then(() => this.setLaunchDarklyFlags())\n .catch((err) => {\n throw err;\n });\n }\n\n return Promise.resolve();\n }\n\n /**\n * Initializes the LaunchDarkly client.\n * If a stored LaunchDarkly client ID exists, it initializes the client with the ID and anonymous mode enabled.\n */\n public initializeLaunchDarklyClient(): void {\n if (this.globalStore.launchDarklyConfig()) {\n const { enabled, clientId } = this.globalStore.launchDarklyConfig();\n\n if (enabled && clientId) {\n this.ldClient = initialize(clientId, {\n anonymous: true,\n });\n }\n }\n }\n\n ngOnDestroy(): void {\n this.closeLaunchDarklyClient();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,mBAAmB,CAAA;AACb,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,QAAQ;AAEhB;;AAEG;IACK,oBAAoB,GAAA;AAC1B,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AACjB,YAAA,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC5D;IACF;AAE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GAAA;AACjC,QAAA,IAAI,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,EAAE;AACzC,YAAA,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE;AAEnE,YAAA,IAAI,OAAO,IAAI,QAAQ,EAAE;AACvB,gBAAA,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AACnC,oBAAA,SAAS,EAAE,IAAI;AAChB,iBAAA,CAAC;YACJ;QACF;IACF;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,uBAAuB,EAAE;IAChC;uGArFW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -53,10 +53,10 @@ class PermissionsService {
|
|
|
53
53
|
// if we don't have any roles, we can't have any permissions
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
57
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PermissionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
57
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PermissionsService, providedIn: 'root' });
|
|
58
58
|
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PermissionsService, decorators: [{
|
|
60
60
|
type: Injectable,
|
|
61
61
|
args: [{
|
|
62
62
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ISessionUserState,\n ISessionUserStateRole,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n private storedUniquePermissionIds: number[] = [];\n\n /**\n * Retrieves the unique permission IDs associated with the user.\n * If the unique permission IDs have not been stored yet, it calculates them based on the user's roles and permissions.\n * @returns An array of unique permission IDs.\n */\n public getUniquePermissions(userState: ISessionUserState | null): number[] {\n const roles = userState ? userState['business_unit_user'] : null;\n\n if (!this.storedUniquePermissionIds.length && roles) {\n const permissionIds = roles.flatMap((role) => {\n return role.permissions.map(({ permission_id: permissionId }) => permissionId);\n });\n\n this.storedUniquePermissionIds = [...new Set(permissionIds)];\n }\n\n return this.storedUniquePermissionIds;\n }\n\n /**\n * Determines whether the user has access to a specific permission based on their roles.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check for access.\n * @param roles - An array of user roles, each containing a list of permissions.\n * @returns `true` if the user has the specified permission in any of their roles,\n * or if no roles are provided; otherwise, returns `false`.\n */\n public hasPermissionAccess(permissionId: number, roles: ISessionUserStateRole[]): boolean {\n if (roles?.length) {\n return roles.some((role) => role.permissions.some((permission) => permission.permission_id === permissionId));\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n\n /**\n * Checks if the user has access to a specific permission within a given business unit.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check.\n * @param businessUnitId - The ID of the business unit to check against.\n * @param roles - An array of user roles, each containing permissions and associated business unit IDs.\n * @returns `true` if the user has the specified permission for the business unit, or if no roles are provided; otherwise, `false`.\n */\n public hasBusinessUnitPermissionAccess(\n permissionId: number,\n businessUnitId: number,\n roles: ISessionUserStateRole[],\n ): boolean {\n if (roles?.length) {\n return roles.some(\n (role) =>\n role.business_unit_id === businessUnitId &&\n role.permissions.some((permission) => permission.permission_id === permissionId),\n );\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MASa,kBAAkB,CAAA;IACrB,yBAAyB,GAAa,EAAE;AAEhD;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,SAAmC,EAAA;AAC7D,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI;QAEhE,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,KAAK,EAAE;YACnD,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC3C,gBAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,YAAY,CAAC;AAChF,YAAA,CAAC,CAAC;YAEF,IAAI,CAAC,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;QAC9D;QAEA,OAAO,IAAI,CAAC,yBAAyB;IACvC;AAEA;;;;;;;;;AASG;IACI,mBAAmB,CAAC,YAAoB,EAAE,KAA8B,EAAA;AAC7E,QAAA,IAAI,KAAK,EAAE,MAAM,EAAE;YACjB,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,aAAa,KAAK,YAAY,CAAC,CAAC;QAC/G;;AAEA,QAAA,OAAO,IAAI;IACb;AAEA;;;;;;;;;AASG;AACI,IAAA,+BAA+B,CACpC,YAAoB,EACpB,cAAsB,EACtB,KAA8B,EAAA;AAE9B,QAAA,IAAI,KAAK,EAAE,MAAM,EAAE;AACjB,YAAA,OAAO,KAAK,CAAC,IAAI,CACf,CAAC,IAAI,KACH,IAAI,CAAC,gBAAgB,KAAK,cAAc;AACxC,gBAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC,aAAa,KAAK,YAAY,CAAC,CACnF;QACH;;AAEA,QAAA,OAAO,IAAI;IACb;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-permissions-service.mjs","sources":["../../../projects/opal-frontend-common/services/permissions-service/permissions.service.ts","../../../projects/opal-frontend-common/services/permissions-service/hmcts-opal-frontend-common-services-permissions-service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n ISessionUserState,\n ISessionUserStateRole,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n private storedUniquePermissionIds: number[] = [];\n\n /**\n * Retrieves the unique permission IDs associated with the user.\n * If the unique permission IDs have not been stored yet, it calculates them based on the user's roles and permissions.\n * @returns An array of unique permission IDs.\n */\n public getUniquePermissions(userState: ISessionUserState | null): number[] {\n const roles = userState ? userState['business_unit_user'] : null;\n\n if (!this.storedUniquePermissionIds.length && roles) {\n const permissionIds = roles.flatMap((role) => {\n return role.permissions.map(({ permission_id: permissionId }) => permissionId);\n });\n\n this.storedUniquePermissionIds = [...new Set(permissionIds)];\n }\n\n return this.storedUniquePermissionIds;\n }\n\n /**\n * Determines whether the user has access to a specific permission based on their roles.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check for access.\n * @param roles - An array of user roles, each containing a list of permissions.\n * @returns `true` if the user has the specified permission in any of their roles,\n * or if no roles are provided; otherwise, returns `false`.\n */\n public hasPermissionAccess(permissionId: number, roles: ISessionUserStateRole[]): boolean {\n if (roles?.length) {\n return roles.some((role) => role.permissions.some((permission) => permission.permission_id === permissionId));\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n\n /**\n * Checks if the user has access to a specific permission within a given business unit.\n *\n * This method short-circuits and returns as soon as a matching permission is found for efficiency.\n *\n * @param permissionId - The ID of the permission to check.\n * @param businessUnitId - The ID of the business unit to check against.\n * @param roles - An array of user roles, each containing permissions and associated business unit IDs.\n * @returns `true` if the user has the specified permission for the business unit, or if no roles are provided; otherwise, `false`.\n */\n public hasBusinessUnitPermissionAccess(\n permissionId: number,\n businessUnitId: number,\n roles: ISessionUserStateRole[],\n ): boolean {\n if (roles?.length) {\n return roles.some(\n (role) =>\n role.business_unit_id === businessUnitId &&\n role.permissions.some((permission) => permission.permission_id === permissionId),\n );\n }\n // if we don't have any roles, we can't have any permissions\n return true;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MASa,kBAAkB,CAAA;IACrB,yBAAyB,GAAa,EAAE;AAEhD;;;;AAIG;AACI,IAAA,oBAAoB,CAAC,SAAmC,EAAA;AAC7D,QAAA,MAAM,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI;QAEhE,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,KAAK,EAAE;YACnD,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC3C,gBAAA,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY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;AACnB,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -51,10 +51,10 @@ class SessionService {
|
|
|
51
51
|
}), shareReplay(1));
|
|
52
52
|
return this.tokenExpiryCache$;
|
|
53
53
|
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
55
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
55
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SessionService, providedIn: 'root' });
|
|
56
56
|
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SessionService, decorators: [{
|
|
58
58
|
type: Injectable,
|
|
59
59
|
args: [{
|
|
60
60
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-services-session-service.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/session.service.ts","../../../projects/opal-frontend-common/services/session-service/hmcts-opal-frontend-common-services-session-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable, retry, shareReplay, tap, timer } from 'rxjs';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SESSION_ENDPOINTS } from '@hmcts/opal-frontend-common/services/session-service/constants';\nimport {\n ISessionUserState,\n ISessionTokenExpiry,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SessionService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n private userStateCache$!: Observable<ISessionUserState>;\n private tokenExpiryCache$!: Observable<ISessionTokenExpiry>;\n\n private readonly MAX_RETRIES = 5;\n private readonly RETRY_DELAY_MS = 1000;\n\n /**\n * Retrieves the user state from the backend.\n * If the user state is not available or needs to be refreshed, it makes an HTTP request to fetch the user state.\n * The user state is then stored in the state service for future use.\n * The user state is cached using the `shareReplay` operator to avoid unnecessary HTTP requests.\n * @returns An observable that emits the user state.\n */\n public getUserState(): Observable<ISessionUserState> {\n // The backend can return an empty object so...\n // If we don't have a user state, then we need to refresh it...\n // And override the shareReplay cache...\n const refresh = !this.globalStore.userState()?.user_id;\n\n if (!this.userStateCache$ || refresh) {\n this.userStateCache$ = this.http\n .get<ISessionUserState>(SESSION_ENDPOINTS.userState)\n .pipe(shareReplay(1))\n .pipe(\n tap((userState) => {\n this.globalStore.setUserState(userState);\n }),\n );\n }\n\n return this.userStateCache$;\n }\n\n /**\n * Retrieves the token expiry information from the server.\n * If the token expiry information is already cached, it returns the cached value.\n * Otherwise, it makes an HTTP GET request to fetch the token expiry information,\n * retries the request up to a maximum number of times if it fails, and caches the result.\n *\n * @returns {Observable<ISessionTokenExpiry>} An observable that emits the token expiry information.\n */\n public getTokenExpiry(): Observable<ISessionTokenExpiry> {\n this.tokenExpiryCache$ ??= this.http.get<ISessionTokenExpiry>(SESSION_ENDPOINTS.expiry).pipe(\n retry({\n count: this.MAX_RETRIES,\n delay: () => timer(this.RETRY_DELAY_MS),\n }),\n tap((expiry) => {\n this.globalStore.setTokenExpiry(expiry);\n }),\n shareReplay(1),\n );\n return this.tokenExpiryCache$;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAaa,cAAc,CAAA;AACR,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,eAAe;AACf,IAAA,iBAAiB;IAER,WAAW,GAAG,CAAC;IACf,cAAc,GAAG,IAAI;AAEtC;;;;;;AAMG;IACI,YAAY,GAAA;;;;QAIjB,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,OAAO;AAEtD,QAAA,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,OAAO,EAAE;AACpC,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;AACzB,iBAAA,GAAG,CAAoB,iBAAiB,CAAC,SAAS;AAClD,iBAAA,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACnB,iBAAA,IAAI,CACH,GAAG,CAAC,CAAC,SAAS,KAAI;AAChB,gBAAA,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC;YAC1C,CAAC,CAAC,CACH;QACL;QAEA,OAAO,IAAI,CAAC,eAAe;IAC7B;AAEA;;;;;;;AAOG;IACI,cAAc,GAAA;AACnB,QAAA,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1F,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;AACxC,SAAA,CAAC,EACF,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC;AACzC,QAAA,CAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf;QACD,OAAO,IAAI,CAAC,iBAAiB;IAC/B;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-services-session-service.mjs","sources":["../../../projects/opal-frontend-common/services/session-service/session.service.ts","../../../projects/opal-frontend-common/services/session-service/hmcts-opal-frontend-common-services-session-service.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { Observable, retry, shareReplay, tap, timer } from 'rxjs';\nimport { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';\nimport { SESSION_ENDPOINTS } from '@hmcts/opal-frontend-common/services/session-service/constants';\nimport {\n ISessionUserState,\n ISessionTokenExpiry,\n} from '@hmcts/opal-frontend-common/services/session-service/interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SessionService {\n private readonly http = inject(HttpClient);\n private readonly globalStore = inject(GlobalStore);\n private userStateCache$!: Observable<ISessionUserState>;\n private tokenExpiryCache$!: Observable<ISessionTokenExpiry>;\n\n private readonly MAX_RETRIES = 5;\n private readonly RETRY_DELAY_MS = 1000;\n\n /**\n * Retrieves the user state from the backend.\n * If the user state is not available or needs to be refreshed, it makes an HTTP request to fetch the user state.\n * The user state is then stored in the state service for future use.\n * The user state is cached using the `shareReplay` operator to avoid unnecessary HTTP requests.\n * @returns An observable that emits the user state.\n */\n public getUserState(): Observable<ISessionUserState> {\n // The backend can return an empty object so...\n // If we don't have a user state, then we need to refresh it...\n // And override the shareReplay cache...\n const refresh = !this.globalStore.userState()?.user_id;\n\n if (!this.userStateCache$ || refresh) {\n this.userStateCache$ = this.http\n .get<ISessionUserState>(SESSION_ENDPOINTS.userState)\n .pipe(shareReplay(1))\n .pipe(\n tap((userState) => {\n this.globalStore.setUserState(userState);\n }),\n );\n }\n\n return this.userStateCache$;\n }\n\n /**\n * Retrieves the token expiry information from the server.\n * If the token expiry information is already cached, it returns the cached value.\n * Otherwise, it makes an HTTP GET request to fetch the token expiry information,\n * retries the request up to a maximum number of times if it fails, and caches the result.\n *\n * @returns {Observable<ISessionTokenExpiry>} An observable that emits the token expiry information.\n */\n public getTokenExpiry(): Observable<ISessionTokenExpiry> {\n this.tokenExpiryCache$ ??= this.http.get<ISessionTokenExpiry>(SESSION_ENDPOINTS.expiry).pipe(\n retry({\n count: this.MAX_RETRIES,\n delay: () => timer(this.RETRY_DELAY_MS),\n }),\n tap((expiry) => {\n this.globalStore.setTokenExpiry(expiry);\n }),\n shareReplay(1),\n );\n return this.tokenExpiryCache$;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAaa,cAAc,CAAA;AACR,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AAC1C,IAAA,eAAe;AACf,IAAA,iBAAiB;IAER,WAAW,GAAG,CAAC;IACf,cAAc,GAAG,IAAI;AAEtC;;;;;;AAMG;IACI,YAAY,GAAA;;;;QAIjB,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,OAAO;AAEtD,QAAA,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,OAAO,EAAE;AACpC,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;AACzB,iBAAA,GAAG,CAAoB,iBAAiB,CAAC,SAAS;AAClD,iBAAA,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACnB,iBAAA,IAAI,CACH,GAAG,CAAC,CAAC,SAAS,KAAI;AAChB,gBAAA,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC;YAC1C,CAAC,CAAC,CACH;QACL;QAEA,OAAO,IAAI,CAAC,eAAe;IAC7B;AAEA;;;;;;;AAOG;IACI,cAAc,GAAA;AACnB,QAAA,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1F,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;AACxC,SAAA,CAAC,EACF,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,MAAM,CAAC;AACzC,QAAA,CAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf;QACD,OAAO,IAAI,CAAC,iBAAiB;IAC/B;uGAxDW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;2FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -79,10 +79,10 @@ class SortService {
|
|
|
79
79
|
arraySortDesc(array) {
|
|
80
80
|
return sort(array).desc();
|
|
81
81
|
}
|
|
82
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
83
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
82
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SortService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
83
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SortService, providedIn: 'root' });
|
|
84
84
|
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SortService, decorators: [{
|
|
86
86
|
type: Injectable,
|
|
87
87
|
args: [{
|
|
88
88
|
providedIn: 'root',
|