@hmcts/rpx-xui-common-lib 3.2.25-common-lib-defects → 3.2.26

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.
@@ -6,7 +6,7 @@ import * as i1 from '@angular/common';
6
6
  import { formatDate, CommonModule } from '@angular/common';
7
7
  import * as i2$3 from '@angular/forms';
8
8
  import { FormGroup, FormControl, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
- import { combineLatest, BehaviorSubject, Subject, of as of$1, forkJoin, zip, iif, merge } from 'rxjs';
9
+ import { combineLatest, BehaviorSubject, Subject, of as of$1, forkJoin, zip, iif } from 'rxjs';
10
10
  import * as i1$1 from '@angular/router';
11
11
  import { NavigationEnd, RouterModule } from '@angular/router';
12
12
  import { map, filter, distinctUntilChanged, delay, skipWhile, tap, shareReplay, catchError, take, debounceTime, switchMap, mergeMap } from 'rxjs/operators';
@@ -2149,8 +2149,12 @@ class FilterService {
2149
2149
  this.streams = {};
2150
2150
  }
2151
2151
  persist(setting, persistence) {
2152
+ setting = { ...setting };
2153
+ delete setting.idamId;
2152
2154
  switch (persistence) {
2153
2155
  case 'local':
2156
+ this.persistLocal(setting);
2157
+ break;
2154
2158
  case 'session':
2155
2159
  this.persistSession(setting);
2156
2160
  break;
@@ -2162,14 +2166,33 @@ class FilterService {
2162
2166
  }
2163
2167
  get(id) {
2164
2168
  if (this.filterSettings[id]) {
2165
- return this.filterSettings[id];
2169
+ const setting = this.filterSettings[id];
2170
+ return !setting.ownerHash || this.isSameUser(setting) ? setting : null;
2171
+ }
2172
+ const localSetting = localStorage.getItem(id);
2173
+ if (localSetting) {
2174
+ const setting = JSON.parse(localSetting);
2175
+ if (this.isSameUser(setting)) {
2176
+ // A legacy session entry must not override the restored local filter.
2177
+ sessionStorage.removeItem(id);
2178
+ return setting;
2179
+ }
2180
+ localStorage.removeItem(id);
2166
2181
  }
2167
- const storedSetting = sessionStorage.getItem(id);
2168
- if (storedSetting) {
2169
- return JSON.parse(storedSetting);
2182
+ const sessionSetting = sessionStorage.getItem(id);
2183
+ if (sessionSetting) {
2184
+ return JSON.parse(sessionSetting);
2170
2185
  }
2171
2186
  return null;
2172
2187
  }
2188
+ isSameUser(setting) {
2189
+ const ownerHash = this.getOwnerHash();
2190
+ return !!ownerHash && setting.ownerHash === ownerHash;
2191
+ }
2192
+ getOwnerHash() {
2193
+ const userInfoStr = window.sessionStorage.getItem('userDetails');
2194
+ return userInfoStr ? JSON.parse(userInfoStr).filterOwnerHash : undefined;
2195
+ }
2173
2196
  getStream(id) {
2174
2197
  if (!this.streams[id]) {
2175
2198
  this.streams[id] = new BehaviorSubject(this.get(id));
@@ -2178,6 +2201,7 @@ class FilterService {
2178
2201
  }
2179
2202
  clearSessionAndLocalPersistance(id) {
2180
2203
  sessionStorage.removeItem(id);
2204
+ localStorage.removeItem(id);
2181
2205
  if (this.filterSettings[id] !== undefined) {
2182
2206
  this.filterSettings[id] = null;
2183
2207
  }
@@ -2185,8 +2209,21 @@ class FilterService {
2185
2209
  this.streams[id].next(null);
2186
2210
  }
2187
2211
  }
2212
+ persistLocal(setting) {
2213
+ const ownerHash = this.getOwnerHash();
2214
+ if (!ownerHash) {
2215
+ // Without an owner reference, retain selections only in this session.
2216
+ delete setting.ownerHash;
2217
+ this.persistSession(setting);
2218
+ return;
2219
+ }
2220
+ setting.ownerHash = ownerHash;
2221
+ window.localStorage.setItem(setting.id, JSON.stringify(setting));
2222
+ sessionStorage.removeItem(setting.id);
2223
+ }
2188
2224
  persistSession(setting) {
2189
2225
  sessionStorage.setItem(setting.id, JSON.stringify(setting));
2226
+ localStorage.removeItem(setting.id);
2190
2227
  }
2191
2228
  persistMemory(setting) {
2192
2229
  this.filterSettings[setting.id] = setting;
@@ -3379,7 +3416,7 @@ class SearchServiceComponent {
3379
3416
  }
3380
3417
  }
3381
3418
  static { this.ɵfac = function SearchServiceComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SearchServiceComponent)(); }; }
3382
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchServiceComponent, selectors: [["exui-search-service"]], inputs: { options: "options", selectedOptions: "selectedOptions", disabled: "disabled", showAutocomplete: "showAutocomplete", searchTerm: "searchTerm" }, outputs: { searchTermChange: "searchTermChange", optionChanged: "optionChanged" }, standalone: false, decls: 7, vars: 4, consts: [["autoSearchService", "matAutocomplete"], [1, "auto-complete-container"], ["id", "inputServiceSearch", 1, "govuk-input", 3, "input", "value", "matAutocomplete", "disabled"], ["autoActiveFirstOption", "", 1, "mat-autocomplete-panel-extend"], [3, "value"], [3, "onSelectionChange", "value"]], template: function SearchServiceComponent_Template(rf, ctx) { if (rf & 1) {
3419
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchServiceComponent, selectors: [["exui-search-service"]], inputs: { options: "options", selectedOptions: "selectedOptions", disabled: "disabled", showAutocomplete: "showAutocomplete", searchTerm: "searchTerm" }, outputs: { searchTermChange: "searchTermChange", optionChanged: "optionChanged" }, standalone: false, decls: 7, vars: 4, consts: [["autoSearchService", "matAutocomplete"], [1, "auto-complete-container"], ["id", "inputServiceSearch", 1, "govuk-input", 3, "input", "value", "matAutocomplete"], ["autoActiveFirstOption", "", 1, "mat-autocomplete-panel-extend"], [3, "value"], [3, "onSelectionChange", "value"]], template: function SearchServiceComponent_Template(rf, ctx) { if (rf & 1) {
3383
3420
  const _r1 = i0.ɵɵgetCurrentView();
3384
3421
  i0.ɵɵelementStart(0, "div", 1)(1, "input", 2);
3385
3422
  i0.ɵɵlistener("input", function SearchServiceComponent_Template_input_input_1_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onSearchTermChanged($event.target.value)); });
@@ -3391,7 +3428,8 @@ class SearchServiceComponent {
3391
3428
  } if (rf & 2) {
3392
3429
  const autoSearchService_r5 = i0.ɵɵreference(3);
3393
3430
  i0.ɵɵadvance();
3394
- i0.ɵɵproperty("value", ctx.searchTerm)("matAutocomplete", autoSearchService_r5)("disabled", ctx.disabled);
3431
+ i0.ɵɵproperty("value", ctx.searchTerm)("matAutocomplete", autoSearchService_r5);
3432
+ i0.ɵɵattribute("disabled", ctx.disabled);
3395
3433
  i0.ɵɵadvance(3);
3396
3434
  i0.ɵɵrepeater(ctx.filteredOptions);
3397
3435
  i0.ɵɵadvance(2);
@@ -3400,7 +3438,7 @@ class SearchServiceComponent {
3400
3438
  }
3401
3439
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchServiceComponent, [{
3402
3440
  type: Component,
3403
- args: [{ selector: 'exui-search-service', standalone: false, template: "<div class=\"auto-complete-container\">\n <input id=\"inputServiceSearch\"\n class=\"govuk-input\"\n [value]=\"searchTerm\"\n (input)=\"onSearchTermChanged($event.target.value)\"\n [matAutocomplete]=\"autoSearchService\"\n [disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n @for (service of filteredOptions; track service) {\n <mat-option (onSelectionChange)=\"onSelectionChanged($event)\" [value]=\"service.label\">\n {{ service.label }}\n </mat-option>\n }\n @if (!filteredOptions?.length && showAutocomplete) {\n <mat-option>\n No results found\n </mat-option>\n }\n </mat-autocomplete>\n</div>\n", styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width: 641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:250px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}\n"] }]
3441
+ args: [{ selector: 'exui-search-service', standalone: false, template: "<div class=\"auto-complete-container\">\n <input id=\"inputServiceSearch\"\n class=\"govuk-input\"\n [value]=\"searchTerm\"\n (input)=\"onSearchTermChanged($event.target.value)\"\n [matAutocomplete]=\"autoSearchService\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n @for (service of filteredOptions; track service) {\n <mat-option (onSelectionChange)=\"onSelectionChanged($event)\" [value]=\"service.label\">\n {{ service.label }}\n </mat-option>\n }\n @if (!filteredOptions?.length && showAutocomplete) {\n <mat-option>\n No results found\n </mat-option>\n }\n </mat-autocomplete>\n</div>\n", styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width: 641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:250px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}\n"] }]
3404
3442
  }], null, { options: [{
3405
3443
  type: Input
3406
3444
  }], selectedOptions: [{
@@ -4650,7 +4688,6 @@ class GenericFilterComponent {
4650
4688
  if (form.valid) {
4651
4689
  this._settings = {
4652
4690
  id: this.config.id,
4653
- idamId: this.filterService.getUserId(),
4654
4691
  fields: this.getSelectedValues(form.value, this.config)
4655
4692
  };
4656
4693
  this.cdr.markForCheck();
@@ -7799,7 +7836,7 @@ function UserDetailsComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
7799
7836
  function UserDetailsComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
7800
7837
  const _r3 = i0.ɵɵgetCurrentView();
7801
7838
  i0.ɵɵelementStart(0, "button", 12);
7802
- i0.ɵɵlistener("click", function UserDetailsComponent_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.suspendUser(ctx_r0.user)); });
7839
+ i0.ɵɵlistener("click", function UserDetailsComponent_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.suspendUser(ctx_r0.user)); })("keyup.enter", function UserDetailsComponent_Conditional_2_Template_button_keyup_enter_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.suspendUser(ctx_r0.user)); });
7803
7840
  i0.ɵɵtext(1);
7804
7841
  i0.ɵɵpipe(2, "rpxTranslate");
7805
7842
  i0.ɵɵelementEnd();
@@ -7822,7 +7859,7 @@ function UserDetailsComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
7822
7859
  i0.ɵɵpipe(10, "rpxTranslate");
7823
7860
  i0.ɵɵelementEnd()();
7824
7861
  i0.ɵɵelementStart(11, "button", 14);
7825
- i0.ɵɵlistener("click", function UserDetailsComponent_Conditional_3_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.reinviteClick(ctx_r0.user)); });
7862
+ i0.ɵɵlistener("click", function UserDetailsComponent_Conditional_3_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.reinviteClick(ctx_r0.user)); })("keyup.enter", function UserDetailsComponent_Conditional_3_Template_button_keyup_enter_11_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.reinviteClick(ctx_r0.user)); });
7826
7863
  i0.ɵɵtext(12);
7827
7864
  i0.ɵɵpipe(13, "rpxTranslate");
7828
7865
  i0.ɵɵelementEnd()();
@@ -7875,7 +7912,7 @@ class UserDetailsComponent {
7875
7912
  return false;
7876
7913
  }
7877
7914
  static { this.ɵfac = function UserDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserDetailsComponent)(); }; }
7878
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserDetailsComponent, selectors: [["xuilib-user-details"]], inputs: { user: "user", enabledAccessTypes: "enabledAccessTypes", editPermissionRouterLink: "editPermissionRouterLink", warningTitle: "warningTitle", showEditLink: "showEditLink", showHelpLink: "showHelpLink", suspendHelpLink: "suspendHelpLink", showSuspendUserButton: "showSuspendUserButton" }, outputs: { suspendUserEvent: "suspendUserEvent", reinvite: "reinvite" }, standalone: false, decls: 5, vars: 5, consts: [[1, "govuk-warning-text"], ["role", "presentation", 1, "govuk-table"], ["tabindex", "0", 1, "govuk-button", "govuk-button--warning"], [1, "govuk-body"], [1, "govuk-warning-text__icon"], [1, "govuk-visually-hidden"], [1, "govuk-warning-text__text"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["role", "link", 3, "routerLink"], ["tabindex", "0", 1, "govuk-button", "govuk-button--warning", 3, "click"], [1, "govuk-inset-text"], ["tabindex", "0", "id", "resend-invite-button", 1, "govuk-button", 3, "click"], ["target", "_blank", 3, "routerLink"]], template: function UserDetailsComponent_Template(rf, ctx) { if (rf & 1) {
7915
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserDetailsComponent, selectors: [["xuilib-user-details"]], inputs: { user: "user", enabledAccessTypes: "enabledAccessTypes", editPermissionRouterLink: "editPermissionRouterLink", warningTitle: "warningTitle", showEditLink: "showEditLink", showHelpLink: "showHelpLink", suspendHelpLink: "suspendHelpLink", showSuspendUserButton: "showSuspendUserButton" }, outputs: { suspendUserEvent: "suspendUserEvent", reinvite: "reinvite" }, standalone: false, decls: 5, vars: 5, consts: [[1, "govuk-warning-text"], ["role", "presentation", 1, "govuk-table"], ["tabindex", "0", 1, "govuk-button", "govuk-button--warning"], [1, "govuk-body"], [1, "govuk-warning-text__icon"], [1, "govuk-visually-hidden"], [1, "govuk-warning-text__text"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["role", "link", 3, "routerLink"], ["tabindex", "0", 1, "govuk-button", "govuk-button--warning", 3, "click", "keyup.enter"], [1, "govuk-inset-text"], ["tabindex", "0", "id", "resend-invite-button", 1, "govuk-button", 3, "click", "keyup.enter"], ["target", "_blank", 3, "routerLink"]], template: function UserDetailsComponent_Template(rf, ctx) { if (rf & 1) {
7879
7916
  i0.ɵɵconditionalCreate(0, UserDetailsComponent_Conditional_0_Template, 8, 3, "div", 0);
7880
7917
  i0.ɵɵconditionalCreate(1, UserDetailsComponent_Conditional_1_Template, 18, 11, "dl", 1);
7881
7918
  i0.ɵɵconditionalCreate(2, UserDetailsComponent_Conditional_2_Template, 3, 3, "button", 2);
@@ -7895,7 +7932,7 @@ class UserDetailsComponent {
7895
7932
  }
7896
7933
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserDetailsComponent, [{
7897
7934
  type: Component,
7898
- args: [{ selector: 'xuilib-user-details', standalone: false, template: "@if (warningTitle && warningTitle !== '') {\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\">!</span>\n <span class=\"govuk-visually-hidden\">Warning</span>\n <strong class=\"govuk-warning-text__text\">\n {{ warningTitle | rpxTranslate}}\n </strong>\n </div>\n}\n@if (user) {\n <dl class=\"govuk-table\" role=\"presentation\">\n <div class=\"govuk-table__body\">\n <div class=\"govuk-table__row\">\n <dt class=\"govuk-table__header\" scope=\"row\">{{'Name' | rpxTranslate}}</dt>\n <dd class=\"govuk-table__cell\">{{user.fullName | rpxTranslate}}</dd>\n <dd class=\"govuk-table__cell\"></dd>\n </div>\n <div class=\"govuk-table__row\">\n <dt class=\"govuk-table__header\" scope=\"row\">{{'Email address' | rpxTranslate}}</dt>\n <dd class=\"govuk-table__cell\">{{user.email}}</dd>\n <dd class=\"govuk-table__cell\"></dd>\n </div>\n @if (!user.resendInvite) {\n <div class=\"govuk-table__row\">\n <dt class=\"govuk-table__header\" scope=\"row\">{{'Permissions' | rpxTranslate}}</dt>\n <dd class=\"govuk-table__cell\">\n @if (user.manageOrganisations === 'Yes') {\n <div>{{'Manage organisations' | rpxTranslate}}</div>\n }\n @if (user.manageUsers === 'Yes') {\n <div>{{'Manage users' | rpxTranslate}}</div>\n }\n @if (user.manageCases === 'Yes') {\n <div>{{'Manage cases' | rpxTranslate}}</div>\n }\n @if (userHasRole('pui-caa')) {\n <div>{{'Case access administrator' | rpxTranslate}}</div>\n }\n @if (userHasRole('pui-finance-manager')) {\n <div>{{'Manage fee accounts' | rpxTranslate}}</div>\n }\n @for (accesstype of enabledAccessTypes; track accesstype) {\n <div>{{ accesstype | rpxTranslate}}</div>\n }\n </dd>\n <dd class=\"govuk-table__cell\">@if (editPermissionRouterLink && showEditLink) {\n <a role=\"link\" [routerLink]=\"editPermissionRouterLink\">{{'Change' | rpxTranslate}} <span class=\"govuk-visually-hidden\">{{'roles' | rpxTranslate}}</span></a>\n }</dd>\n </div>\n }\n </div>\n </dl>\n}\n@if (showSuspendUserButton) {\n <button class=\"govuk-button govuk-button--warning\" tabindex=\"0\" (click)=\"suspendUser(user)\">\n {{'Suspend account' | rpxTranslate}}\n </button>\n}\n@if (user && user.resendInvite) {\n <div>\n <div class=\"govuk-inset-text\">\n <p>{{'This user has already been invited but has not activated their account.' | rpxTranslate}}</p>\n <p>{{'If you resend an invitation, they\\'ll receive an email from HM Courts and Tribunals to finish setting up their account.' | rpxTranslate}}</p>\n <p>{{'You can\\'t invite the same user more than once an hour.' | rpxTranslate}}</p>\n </div>\n <button class=\"govuk-button\" tabindex=\"0\" (click)=\"reinviteClick(user)\" id=\"resend-invite-button\">\n {{'Resend invitation' | rpxTranslate}}\n </button>\n </div>\n}\n@if (showHelpLink && suspendHelpLink) {\n <p class=\"govuk-body\"><a [routerLink]=\"suspendHelpLink\" target=\"_blank\">{{'Get help' | rpxTranslate}}</a> {{'to reactivate this account.' | rpxTranslate}}</p>\n}\n", styles: [":host{display:block}\n"] }]
7935
+ args: [{ selector: 'xuilib-user-details', standalone: false, template: "@if (warningTitle && warningTitle !== '') {\n <div class=\"govuk-warning-text\">\n <span class=\"govuk-warning-text__icon\">!</span>\n <span class=\"govuk-visually-hidden\">Warning</span>\n <strong class=\"govuk-warning-text__text\">\n {{ warningTitle | rpxTranslate}}\n </strong>\n </div>\n}\n@if (user) {\n <dl class=\"govuk-table\" role=\"presentation\">\n <div class=\"govuk-table__body\">\n <div class=\"govuk-table__row\">\n <dt class=\"govuk-table__header\" scope=\"row\">{{'Name' | rpxTranslate}}</dt>\n <dd class=\"govuk-table__cell\">{{user.fullName | rpxTranslate}}</dd>\n <dd class=\"govuk-table__cell\"></dd>\n </div>\n <div class=\"govuk-table__row\">\n <dt class=\"govuk-table__header\" scope=\"row\">{{'Email address' | rpxTranslate}}</dt>\n <dd class=\"govuk-table__cell\">{{user.email}}</dd>\n <dd class=\"govuk-table__cell\"></dd>\n </div>\n @if (!user.resendInvite) {\n <div class=\"govuk-table__row\">\n <dt class=\"govuk-table__header\" scope=\"row\">{{'Permissions' | rpxTranslate}}</dt>\n <dd class=\"govuk-table__cell\">\n @if (user.manageOrganisations === 'Yes') {\n <div>{{'Manage organisations' | rpxTranslate}}</div>\n }\n @if (user.manageUsers === 'Yes') {\n <div>{{'Manage users' | rpxTranslate}}</div>\n }\n @if (user.manageCases === 'Yes') {\n <div>{{'Manage cases' | rpxTranslate}}</div>\n }\n @if (userHasRole('pui-caa')) {\n <div>{{'Case access administrator' | rpxTranslate}}</div>\n }\n @if (userHasRole('pui-finance-manager')) {\n <div>{{'Manage fee accounts' | rpxTranslate}}</div>\n }\n @for (accesstype of enabledAccessTypes; track accesstype) {\n <div>{{ accesstype | rpxTranslate}}</div>\n }\n </dd>\n <dd class=\"govuk-table__cell\">@if (editPermissionRouterLink && showEditLink) {\n <a role=\"link\" [routerLink]=\"editPermissionRouterLink\">{{'Change' | rpxTranslate}} <span class=\"govuk-visually-hidden\">{{'roles' | rpxTranslate}}</span></a>\n }</dd>\n </div>\n }\n </div>\n </dl>\n}\n@if (showSuspendUserButton) {\n <button class=\"govuk-button govuk-button--warning\" tabindex=\"0\" (click)=\"suspendUser(user)\" (keyup.enter)=\"suspendUser(user)\">\n {{'Suspend account' | rpxTranslate}}\n </button>\n}\n@if (user && user.resendInvite) {\n <div>\n <div class=\"govuk-inset-text\">\n <p>{{'This user has already been invited but has not activated their account.' | rpxTranslate}}</p>\n <p>{{'If you resend an invitation, they\\'ll receive an email from HM Courts and Tribunals to finish setting up their account.' | rpxTranslate}}</p>\n <p>{{'You can\\'t invite the same user more than once an hour.' | rpxTranslate}}</p>\n </div>\n <button class=\"govuk-button\" tabindex=\"0\" (click)=\"reinviteClick(user)\" (keyup.enter)=\"reinviteClick(user)\" id=\"resend-invite-button\">\n {{'Resend invitation' | rpxTranslate}}\n </button>\n </div>\n}\n@if (showHelpLink && suspendHelpLink) {\n <p class=\"govuk-body\"><a [routerLink]=\"suspendHelpLink\" target=\"_blank\">{{'Get help' | rpxTranslate}}</a> {{'to reactivate this account.' | rpxTranslate}}</p>\n}\n", styles: [":host{display:block}\n"] }]
7899
7936
  }], null, { user: [{
7900
7937
  type: Input
7901
7938
  }], enabledAccessTypes: [{
@@ -9373,13 +9410,11 @@ class FeatureToggleDirective {
9373
9410
  }
9374
9411
  }
9375
9412
  updateSubscription() {
9376
- this.subscription?.unsubscribe();
9377
- this.viewContainer.clear();
9378
- this.subscription = this.service.isEnabled(this.feature).subscribe((enabled) => {
9379
- if (enabled && this.viewContainer.length === 0) {
9413
+ this.subscription = this.service.isEnabled(this.feature).subscribe(enabled => {
9414
+ if (enabled) {
9380
9415
  this.viewContainer.createEmbeddedView(this.templateRef);
9381
9416
  }
9382
- else if (!enabled) {
9417
+ else {
9383
9418
  this.viewContainer.clear();
9384
9419
  }
9385
9420
  });
@@ -9580,12 +9615,7 @@ class GovUkDateComponent {
9580
9615
  this.month = `${this.config.id}_month`;
9581
9616
  this.year = `${this.config.id}_year`;
9582
9617
  const dateValidator = this.DateValidator();
9583
- const dayControl = this.formGroup.get(this.day);
9584
- dayControl.setValidators(dateValidator);
9585
- this.dateControlSubscription = merge(this.formGroup.get(this.month).valueChanges, this.formGroup.get(this.year).valueChanges).subscribe(() => dayControl.updateValueAndValidity({ emitEvent: false, onlySelf: true }));
9586
- }
9587
- ngOnDestroy() {
9588
- this.dateControlSubscription?.unsubscribe();
9618
+ this.formGroup.get(this.day).setValidators(dateValidator);
9589
9619
  }
9590
9620
  isValidDate(d, month, year) {
9591
9621
  const dateCheck = !isNaN(d.getTime());
@@ -9676,7 +9706,7 @@ class GovUkDateComponent {
9676
9706
  }], isOptional: [{
9677
9707
  type: Input
9678
9708
  }] }); })();
9679
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GovUkDateComponent, { className: "GovUkDateComponent", filePath: "lib/gov-ui/components/gov-uk-date/gov-uk-date.component.ts", lineNumber: 23 }); })();
9709
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GovUkDateComponent, { className: "GovUkDateComponent", filePath: "lib/gov-ui/components/gov-uk-date/gov-uk-date.component.ts", lineNumber: 21 }); })();
9680
9710
 
9681
9711
  const _c0$3 = a0 => ({ "govuk-form-group--error": a0 });
9682
9712
  const _c1$1 = a0 => ({ "govuk-file-upload--error": a0 });
@@ -10076,7 +10106,7 @@ class GovUkTextareaComponent {
10076
10106
  return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
10077
10107
  }
10078
10108
  static { this.ɵfac = function GovUkTextareaComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GovUkTextareaComponent)(); }; }
10079
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GovUkTextareaComponent, selectors: [["xuilib-gov-uk-textarea"]], inputs: { config: "config", errorMessage: "errorMessage", group: "group" }, standalone: false, decls: 7, vars: 18, consts: [[1, "govuk-form-group", 3, "formGroup", "ngClass"], [3, "config"], [1, "govuk-hint", 3, "id"], [3, "config", "errorMessage"], ["name", "more-detail", 1, "govuk-textarea", 3, "formControlName", "ngClass", "id", "rows"]], template: function GovUkTextareaComponent_Template(rf, ctx) { if (rf & 1) {
10109
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GovUkTextareaComponent, selectors: [["xuilib-gov-uk-textarea"]], inputs: { config: "config", errorMessage: "errorMessage", group: "group" }, standalone: false, decls: 7, vars: 17, consts: [[1, "govuk-form-group", 3, "formGroup", "ngClass"], [3, "config"], ["id", "more-detail-hint", 1, "govuk-hint"], [3, "config", "errorMessage"], ["name", "more-detail", 1, "govuk-textarea", 3, "formControlName", "ngClass", "id", "rows"]], template: function GovUkTextareaComponent_Template(rf, ctx) { if (rf & 1) {
10080
10110
  i0.ɵɵelementStart(0, "div", 0);
10081
10111
  i0.ɵɵelement(1, "xuilib-gov-label", 1);
10082
10112
  i0.ɵɵelementStart(2, "span", 2);
@@ -10086,23 +10116,21 @@ class GovUkTextareaComponent {
10086
10116
  i0.ɵɵelement(5, "xuilib-gov-uk-error-message", 3)(6, "textarea", 4);
10087
10117
  i0.ɵɵelementEnd();
10088
10118
  } if (rf & 2) {
10089
- i0.ɵɵproperty("formGroup", ctx.group)("ngClass", i0.ɵɵpureFunction1(14, _c0$1, ctx.errorMessage == null ? null : ctx.errorMessage.isInvalid));
10119
+ i0.ɵɵproperty("formGroup", ctx.group)("ngClass", i0.ɵɵpureFunction1(13, _c0$1, ctx.errorMessage == null ? null : ctx.errorMessage.isInvalid));
10090
10120
  i0.ɵɵadvance();
10091
10121
  i0.ɵɵproperty("config", ctx.config);
10092
- i0.ɵɵadvance();
10093
- i0.ɵɵproperty("id", ctx.config.id + "-hint");
10094
- i0.ɵɵadvance();
10095
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 12, ctx.config.hint), "\n");
10122
+ i0.ɵɵadvance(2);
10123
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 11, ctx.config.hint), "\n");
10096
10124
  i0.ɵɵadvance(2);
10097
10125
  i0.ɵɵproperty("config", ctx.config)("errorMessage", ctx.errorMessage);
10098
10126
  i0.ɵɵadvance();
10099
- i0.ɵɵproperty("formControlName", ctx.config.key)("ngClass", i0.ɵɵpureFunction1(16, _c1, ctx.errorMessage == null ? null : ctx.errorMessage.isInvalid))("id", ctx.config.id)("rows", ctx.config.rows);
10127
+ i0.ɵɵproperty("formControlName", ctx.config.key)("ngClass", i0.ɵɵpureFunction1(15, _c1, ctx.errorMessage == null ? null : ctx.errorMessage.isInvalid))("id", ctx.config.id)("rows", ctx.config.rows);
10100
10128
  i0.ɵɵattribute("aria-describedby", ctx.setDescribedBy());
10101
10129
  } }, dependencies: [i1.NgClass, i2$3.DefaultValueAccessor, i2$3.NgControlStatus, i2$3.NgControlStatusGroup, i2$3.FormGroupDirective, i2$3.FormControlName, GovUkLabelComponent, GovUkErrorMessageComponent, i2.RpxTranslatePipe], encapsulation: 2 }); }
10102
10130
  }
10103
10131
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GovUkTextareaComponent, [{
10104
10132
  type: Component,
10105
- args: [{ selector: 'xuilib-gov-uk-textarea', standalone: false, template: "<div [formGroup]=\"group\"\nclass=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n<span [id]=\"config.id + '-hint'\" class=\"govuk-hint\">\n {{config.hint | rpxTranslate}}\n</span>\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n<textarea\n class=\"govuk-textarea\" [formControlName]=\"config.key\"\n [ngClass]=\"{'govuk-textarea--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\" name=\"more-detail\" [rows]=\"config.rows\" [attr.aria-describedby]=\"setDescribedBy()\"></textarea>\n</div>\n" }]
10133
+ args: [{ selector: 'xuilib-gov-uk-textarea', standalone: false, template: "<div [formGroup]=\"group\"\nclass=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n<span id=\"more-detail-hint\" class=\"govuk-hint\">\n {{config.hint | rpxTranslate}}\n</span>\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n<textarea\n class=\"govuk-textarea\" [formControlName]=\"config.key\"\n [ngClass]=\"{'govuk-textarea--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\" name=\"more-detail\" [rows]=\"config.rows\" [attr.aria-describedby]=\"setDescribedBy()\"></textarea>\n</div>\n" }]
10106
10134
  }], null, { config: [{
10107
10135
  type: Input
10108
10136
  }], errorMessage: [{