@hmcts/rpx-xui-common-lib 3.2.6 → 3.2.7-exui-4277
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.
|
@@ -1940,7 +1940,7 @@ class TimeoutNotificationsService {
|
|
|
1940
1940
|
}));
|
|
1941
1941
|
this.subs.push(this.idle.onIdleStart.subscribe(() => console.log('You\'ve gone idle!')));
|
|
1942
1942
|
this.subs.push(this.idle.onIdleEnd.subscribe(() => console.log('You\'re no longer idle!')));
|
|
1943
|
-
this.keepalive.interval(config.keepAliveInSeconds ||
|
|
1943
|
+
this.keepalive.interval(config.keepAliveInSeconds || 600);
|
|
1944
1944
|
this.subs.push(this.keepalive.onPing.subscribe(() => {
|
|
1945
1945
|
this.eventEmitter.next({ eventType: KEEP_ALIVE_EVENT });
|
|
1946
1946
|
}));
|
|
@@ -6618,8 +6618,9 @@ class ServiceMessagesComponent {
|
|
|
6618
6618
|
this.getServiceMessages();
|
|
6619
6619
|
}
|
|
6620
6620
|
getServiceMessages() {
|
|
6621
|
-
this.featureToggleService
|
|
6622
|
-
.
|
|
6621
|
+
this.featureToggleService
|
|
6622
|
+
.getValue(this.featureToggleKey, null)
|
|
6623
|
+
.subscribe((messages) => {
|
|
6623
6624
|
this.originalMessages = messages;
|
|
6624
6625
|
if (!!messages) {
|
|
6625
6626
|
this.createFilteredMessages(messages);
|
|
@@ -6633,11 +6634,13 @@ class ServiceMessagesComponent {
|
|
|
6633
6634
|
const { roles, message_en } = message;
|
|
6634
6635
|
const regEx = new RegExp(roles);
|
|
6635
6636
|
// If userRoles is empty or undefined, allow the message through
|
|
6636
|
-
const isRoleMatch = ((!this.userRoles || this.userRoles.length === 0) &&
|
|
6637
|
-
|
|
6638
|
-
|
|
6637
|
+
const isRoleMatch = ((!this.userRoles || this.userRoles.length === 0) &&
|
|
6638
|
+
messageCount === 1 &&
|
|
6639
|
+
roles === ".+") ||
|
|
6640
|
+
(this.userRoles && this.userRoles.some((role) => regEx.test(role)));
|
|
6641
|
+
return (isRoleMatch &&
|
|
6639
6642
|
this.compareDates(message) &&
|
|
6640
|
-
!this.hiddenBanners.includes(message_en);
|
|
6643
|
+
!this.hiddenBanners.includes(message_en));
|
|
6641
6644
|
});
|
|
6642
6645
|
}
|
|
6643
6646
|
compareDates(msg) {
|
|
@@ -6652,13 +6655,17 @@ class ServiceMessagesComponent {
|
|
|
6652
6655
|
if (msg.end && !isNaN(Date.parse(msg.end))) {
|
|
6653
6656
|
endDate = new Date(msg.end);
|
|
6654
6657
|
}
|
|
6655
|
-
this.originalMessages.forEach(msg => {
|
|
6658
|
+
this.originalMessages.forEach((msg) => {
|
|
6656
6659
|
// Only check for errors if both beginDate and endDate are present and valid
|
|
6657
|
-
if (
|
|
6660
|
+
if (msg.begin &&
|
|
6661
|
+
!isNaN(Date.parse(msg.end)) &&
|
|
6662
|
+
msg.end &&
|
|
6663
|
+
!isNaN(Date.parse(msg.end)) &&
|
|
6664
|
+
new Date(msg.begin) > new Date(msg.end)) {
|
|
6658
6665
|
this.isBannerError = true;
|
|
6659
6666
|
this.bannerErrorMsgs.push({
|
|
6660
6667
|
message: `The start date is greater than the end date. Message index: ${msg.index}`,
|
|
6661
|
-
index: msg.index
|
|
6668
|
+
index: msg.index,
|
|
6662
6669
|
});
|
|
6663
6670
|
}
|
|
6664
6671
|
// Check for invalid beginDate or endDate separately, if they are present
|
|
@@ -6666,14 +6673,14 @@ class ServiceMessagesComponent {
|
|
|
6666
6673
|
this.isBannerError = true;
|
|
6667
6674
|
this.bannerErrorMsgs.push({
|
|
6668
6675
|
message: `Invalid start date. Message index: ${msg.index}`,
|
|
6669
|
-
index: msg.index
|
|
6676
|
+
index: msg.index,
|
|
6670
6677
|
});
|
|
6671
6678
|
}
|
|
6672
6679
|
if (msg.end && isNaN(Date.parse(msg.end))) {
|
|
6673
6680
|
this.isBannerError = true;
|
|
6674
6681
|
this.bannerErrorMsgs.push({
|
|
6675
6682
|
message: `Invalid end date. Message index: ${msg.index}`,
|
|
6676
|
-
index: msg.index
|
|
6683
|
+
index: msg.index,
|
|
6677
6684
|
});
|
|
6678
6685
|
}
|
|
6679
6686
|
});
|
|
@@ -6690,9 +6697,9 @@ class ServiceMessagesComponent {
|
|
|
6690
6697
|
this.setSessionCookie(this.serviceMessageCookie, this.hiddenBanners);
|
|
6691
6698
|
}
|
|
6692
6699
|
getSessionCookie(name) {
|
|
6693
|
-
const cookies = document.cookie.split(
|
|
6694
|
-
const cookie = cookies.find((row) => row.startsWith(name +
|
|
6695
|
-
return cookie ? JSON.parse(decodeURIComponent(cookie.split(
|
|
6700
|
+
const cookies = document.cookie.split("; ");
|
|
6701
|
+
const cookie = cookies.find((row) => row.startsWith(name + "="));
|
|
6702
|
+
return cookie ? JSON.parse(decodeURIComponent(cookie.split("=")[1])) : [];
|
|
6696
6703
|
}
|
|
6697
6704
|
static { this.ɵfac = function ServiceMessagesComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ServiceMessagesComponent)(i0.ɵɵdirectiveInject(FeatureToggleService)); }; }
|
|
6698
6705
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ServiceMessagesComponent, selectors: [["xuilib-service-messages"]], inputs: { userRoles: "userRoles", featureToggleKey: "featureToggleKey", serviceMessageCookie: "serviceMessageCookie" }, standalone: false, decls: 2, vars: 2, consts: [[1, "govuk-width-container", "govuk-!-margin-top-6"], [1, "hmcts-banner", "hmcts-banner--warning"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], [1, "govuk-heading-s"], [3, "innerHTML"], [3, "key", "message_en", "message_cy"], [3, "hideMessage", "key", "message_en", "message_cy"]], template: function ServiceMessagesComponent_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -6706,7 +6713,7 @@ class ServiceMessagesComponent {
|
|
|
6706
6713
|
}
|
|
6707
6714
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ServiceMessagesComponent, [{
|
|
6708
6715
|
type: Component,
|
|
6709
|
-
args: [{ selector:
|
|
6716
|
+
args: [{ selector: "xuilib-service-messages", standalone: false, template: "@if (isBannerError) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (errMsg of bannerErrorMsgs; track errMsg) {\n <div class=\"hmcts-banner hmcts-banner--warning\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{'Warning' | rpxTranslate}}</span>\n <h2 class=\"govuk-heading-s\">Error:</h2>\n <p [innerHTML]=\"errMsg.message\"></p>\n </div>\n </div>\n }\n </div>\n}\n@if (filteredMessages?.length > 0) {\n <div class=\"govuk-width-container govuk-!-margin-top-6\">\n @for (message of filteredMessages; track message) {\n <xuilib-service-message [key]=\"message\"\n [message_en]=\"message?.message_en | rpxTranslate\"\n [message_cy]=\"message?.message_cy | rpxTranslate\"\n (hideMessage)=\"hideMessage($event)\">\n </xuilib-service-message>\n }\n </div>\n}" }]
|
|
6710
6717
|
}], () => [{ type: FeatureToggleService }], { userRoles: [{
|
|
6711
6718
|
type: Input
|
|
6712
6719
|
}], featureToggleKey: [{
|
|
@@ -6714,7 +6721,7 @@ class ServiceMessagesComponent {
|
|
|
6714
6721
|
}], serviceMessageCookie: [{
|
|
6715
6722
|
type: Input
|
|
6716
6723
|
}] }); })();
|
|
6717
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ServiceMessagesComponent, { className: "ServiceMessagesComponent", filePath: "lib/components/service-messages/service-messages.component.ts", lineNumber:
|
|
6724
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ServiceMessagesComponent, { className: "ServiceMessagesComponent", filePath: "lib/components/service-messages/service-messages.component.ts", lineNumber: 10 }); })();
|
|
6718
6725
|
|
|
6719
6726
|
function ShareCaseConfirmComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
6720
6727
|
i0.ɵɵelementStart(0, "div", 2);
|