@hmcts/ccd-case-ui-toolkit 7.3.83 → 7.3.85-exui-5069

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.
@@ -11,7 +11,7 @@ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Va
11
11
  import { BehaviorSubject, throwError, Subject, EMPTY, concat, defer, timer, Observable, skip, of, forkJoin, fromEvent, Subscription, combineLatest } from 'rxjs';
12
12
  import { distinctUntilChanged, catchError, map, switchMap, repeat, retry, publish, refCount, debounceTime, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
13
13
  import * as i1$2 from '@angular/common/http';
14
- import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
14
+ import { HttpErrorResponse, HttpHeaders, HttpParams, HttpStatusCode } from '@angular/common/http';
15
15
  import { Type, Exclude, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
16
16
  import moment from 'moment';
17
17
  import { __decorate, __metadata } from 'tslib';
@@ -13989,57 +13989,67 @@ class WriteComplexFieldComponent extends AbstractFieldWriteComponent {
13989
13989
  const _c0$Z = ["writeComplexFieldComponent"];
13990
13990
  const _c1$o = a0 => ({ "form-group-error": a0 });
13991
13991
  const _c2$3 = a0 => ({ "govuk-input--error": a0 });
13992
- function WriteAddressFieldComponent_div_1_div_4_span_5_Template(rf, ctx) { if (rf & 1) {
13993
- i0.ɵɵelementStart(0, "span", 14);
13992
+ function WriteAddressFieldComponent_div_1_span_4_Template(rf, ctx) { if (rf & 1) {
13993
+ i0.ɵɵelementStart(0, "span", 9);
13994
+ i0.ɵɵelement(1, "ccd-markdown", 10);
13995
+ i0.ɵɵpipe(2, "rpxTranslate");
13996
+ i0.ɵɵelementEnd();
13997
+ } if (rf & 2) {
13998
+ const ctx_r0 = i0.ɵɵnextContext(2);
13999
+ i0.ɵɵadvance();
14000
+ i0.ɵɵproperty("content", i0.ɵɵpipeBind1(2, 1, ctx_r0.caseField.hint_text));
14001
+ } }
14002
+ function WriteAddressFieldComponent_div_1_div_5_span_5_Template(rf, ctx) { if (rf & 1) {
14003
+ i0.ɵɵelementStart(0, "span", 17);
13994
14004
  i0.ɵɵtext(1);
13995
14005
  i0.ɵɵpipe(2, "rpxTranslate");
13996
14006
  i0.ɵɵelementEnd();
13997
14007
  } if (rf & 2) {
13998
- const ctx_r1 = i0.ɵɵnextContext(3);
14008
+ const ctx_r0 = i0.ɵɵnextContext(3);
13999
14009
  i0.ɵɵadvance();
14000
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r1.errorMessage));
14010
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.errorMessage));
14001
14011
  } }
14002
- function WriteAddressFieldComponent_div_1_div_4_Template(rf, ctx) { if (rf & 1) {
14003
- const _r1 = i0.ɵɵgetCurrentView();
14004
- i0.ɵɵelementStart(0, "div", 8)(1, "label", 9)(2, "span", 10);
14012
+ function WriteAddressFieldComponent_div_1_div_5_Template(rf, ctx) { if (rf & 1) {
14013
+ const _r2 = i0.ɵɵgetCurrentView();
14014
+ i0.ɵɵelementStart(0, "div", 11)(1, "label", 12)(2, "span", 13);
14005
14015
  i0.ɵɵtext(3);
14006
14016
  i0.ɵɵpipe(4, "rpxTranslate");
14007
14017
  i0.ɵɵelementEnd()();
14008
- i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_4_span_5_Template, 3, 3, "span", 11);
14009
- i0.ɵɵelement(6, "input", 12);
14010
- i0.ɵɵelementStart(7, "button", 13);
14011
- i0.ɵɵlistener("click", function WriteAddressFieldComponent_div_1_div_4_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.findAddress()); });
14018
+ i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_5_span_5_Template, 3, 3, "span", 14);
14019
+ i0.ɵɵelement(6, "input", 15);
14020
+ i0.ɵɵelementStart(7, "button", 16);
14021
+ i0.ɵɵlistener("click", function WriteAddressFieldComponent_div_1_div_5_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.findAddress()); });
14012
14022
  i0.ɵɵtext(8);
14013
14023
  i0.ɵɵpipe(9, "rpxTranslate");
14014
14024
  i0.ɵɵelementEnd()();
14015
14025
  } if (rf & 2) {
14016
- const ctx_r1 = i0.ɵɵnextContext(2);
14017
- i0.ɵɵproperty("id", ctx_r1.createElementId("postcodeLookup"))("ngClass", i0.ɵɵpureFunction1(14, _c1$o, ctx_r1.missingPostcode));
14026
+ const ctx_r0 = i0.ɵɵnextContext(2);
14027
+ i0.ɵɵproperty("id", ctx_r0.createElementId("postcodeLookup"))("ngClass", i0.ɵɵpureFunction1(14, _c1$o, ctx_r0.missingPostcode));
14018
14028
  i0.ɵɵadvance();
14019
- i0.ɵɵproperty("for", ctx_r1.createElementId("postcodeInput"));
14029
+ i0.ɵɵproperty("for", ctx_r0.createElementId("postcodeInput"));
14020
14030
  i0.ɵɵadvance(2);
14021
14031
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 10, "Enter a UK postcode"));
14022
14032
  i0.ɵɵadvance(2);
14023
- i0.ɵɵproperty("ngIf", ctx_r1.missingPostcode);
14033
+ i0.ɵɵproperty("ngIf", ctx_r0.missingPostcode);
14024
14034
  i0.ɵɵadvance();
14025
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c2$3, ctx_r1.missingPostcode))("id", ctx_r1.createElementId("postcodeInput"))("formControl", ctx_r1.postcode);
14035
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c2$3, ctx_r0.missingPostcode))("id", ctx_r0.createElementId("postcodeInput"))("formControl", ctx_r0.postcode);
14026
14036
  i0.ɵɵadvance();
14027
- i0.ɵɵproperty("disabled", ctx_r1.loadingAddresses);
14037
+ i0.ɵɵproperty("disabled", ctx_r0.loadingAddresses);
14028
14038
  i0.ɵɵadvance();
14029
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 12, ctx_r1.loadingAddresses ? "Finding addresses..." : "Find address"), " ");
14039
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 12, ctx_r0.loadingAddresses ? "Finding addresses..." : "Find address"), " ");
14030
14040
  } }
14031
- function WriteAddressFieldComponent_div_1_div_5_span_5_Template(rf, ctx) { if (rf & 1) {
14032
- i0.ɵɵelementStart(0, "span", 14);
14041
+ function WriteAddressFieldComponent_div_1_div_6_span_5_Template(rf, ctx) { if (rf & 1) {
14042
+ i0.ɵɵelementStart(0, "span", 17);
14033
14043
  i0.ɵɵtext(1);
14034
14044
  i0.ɵɵpipe(2, "rpxTranslate");
14035
14045
  i0.ɵɵelementEnd();
14036
14046
  } if (rf & 2) {
14037
- const ctx_r1 = i0.ɵɵnextContext(3);
14047
+ const ctx_r0 = i0.ɵɵnextContext(3);
14038
14048
  i0.ɵɵadvance();
14039
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r1.errorMessage));
14049
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.errorMessage));
14040
14050
  } }
14041
- function WriteAddressFieldComponent_div_1_div_5_option_7_Template(rf, ctx) { if (rf & 1) {
14042
- i0.ɵɵelementStart(0, "option", 19);
14051
+ function WriteAddressFieldComponent_div_1_div_6_option_7_Template(rf, ctx) { if (rf & 1) {
14052
+ i0.ɵɵelementStart(0, "option", 22);
14043
14053
  i0.ɵɵtext(1);
14044
14054
  i0.ɵɵpipe(2, "rpxTranslate");
14045
14055
  i0.ɵɵelementEnd();
@@ -14048,19 +14058,19 @@ function WriteAddressFieldComponent_div_1_div_5_option_7_Template(rf, ctx) { if
14048
14058
  i0.ɵɵadvance();
14049
14059
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "No address found"), " ");
14050
14060
  } }
14051
- function WriteAddressFieldComponent_div_1_div_5_option_8_Template(rf, ctx) { if (rf & 1) {
14052
- i0.ɵɵelementStart(0, "option", 19);
14061
+ function WriteAddressFieldComponent_div_1_div_6_option_8_Template(rf, ctx) { if (rf & 1) {
14062
+ i0.ɵɵelementStart(0, "option", 22);
14053
14063
  i0.ɵɵtext(1);
14054
14064
  i0.ɵɵpipe(2, "rpxTranslate");
14055
14065
  i0.ɵɵelementEnd();
14056
14066
  } if (rf & 2) {
14057
- const ctx_r1 = i0.ɵɵnextContext(3);
14067
+ const ctx_r0 = i0.ɵɵnextContext(3);
14058
14068
  i0.ɵɵproperty("ngValue", undefined);
14059
14069
  i0.ɵɵadvance();
14060
- i0.ɵɵtextInterpolate2(" ", ctx_r1.addressOptions.length, " ", i0.ɵɵpipeBind1(2, 3, ctx_r1.addressOptions.length === 1 ? "address found" : "addresses found"), " ");
14070
+ i0.ɵɵtextInterpolate2(" ", ctx_r0.addressOptions.length, " ", i0.ɵɵpipeBind1(2, 3, ctx_r0.addressOptions.length === 1 ? "address found" : "addresses found"), " ");
14061
14071
  } }
14062
- function WriteAddressFieldComponent_div_1_div_5_option_9_Template(rf, ctx) { if (rf & 1) {
14063
- i0.ɵɵelementStart(0, "option", 19);
14072
+ function WriteAddressFieldComponent_div_1_div_6_option_9_Template(rf, ctx) { if (rf & 1) {
14073
+ i0.ɵɵelementStart(0, "option", 22);
14064
14074
  i0.ɵɵtext(1);
14065
14075
  i0.ɵɵelementEnd();
14066
14076
  } if (rf & 2) {
@@ -14069,39 +14079,39 @@ function WriteAddressFieldComponent_div_1_div_5_option_9_Template(rf, ctx) { if
14069
14079
  i0.ɵɵadvance();
14070
14080
  i0.ɵɵtextInterpolate1(" ", addressOption_r4.description, " ");
14071
14081
  } }
14072
- function WriteAddressFieldComponent_div_1_div_5_Template(rf, ctx) { if (rf & 1) {
14082
+ function WriteAddressFieldComponent_div_1_div_6_Template(rf, ctx) { if (rf & 1) {
14073
14083
  const _r3 = i0.ɵɵgetCurrentView();
14074
- i0.ɵɵelementStart(0, "div", 15)(1, "label", 9)(2, "span", 10);
14084
+ i0.ɵɵelementStart(0, "div", 18)(1, "label", 12)(2, "span", 13);
14075
14085
  i0.ɵɵtext(3);
14076
14086
  i0.ɵɵpipe(4, "rpxTranslate");
14077
14087
  i0.ɵɵelementEnd()();
14078
- i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_5_span_5_Template, 3, 3, "span", 11);
14079
- i0.ɵɵelementStart(6, "select", 16);
14080
- i0.ɵɵlistener("change", function WriteAddressFieldComponent_div_1_div_5_Template_select_change_6_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.addressSelected()); });
14081
- i0.ɵɵtemplate(7, WriteAddressFieldComponent_div_1_div_5_option_7_Template, 3, 4, "option", 17)(8, WriteAddressFieldComponent_div_1_div_5_option_8_Template, 3, 5, "option", 17)(9, WriteAddressFieldComponent_div_1_div_5_option_9_Template, 2, 2, "option", 18);
14088
+ i0.ɵɵtemplate(5, WriteAddressFieldComponent_div_1_div_6_span_5_Template, 3, 3, "span", 14);
14089
+ i0.ɵɵelementStart(6, "select", 19);
14090
+ i0.ɵɵlistener("change", function WriteAddressFieldComponent_div_1_div_6_Template_select_change_6_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.addressSelected()); });
14091
+ i0.ɵɵtemplate(7, WriteAddressFieldComponent_div_1_div_6_option_7_Template, 3, 4, "option", 20)(8, WriteAddressFieldComponent_div_1_div_6_option_8_Template, 3, 5, "option", 20)(9, WriteAddressFieldComponent_div_1_div_6_option_9_Template, 2, 2, "option", 21);
14082
14092
  i0.ɵɵelementEnd()();
14083
14093
  } if (rf & 2) {
14084
- const ctx_r1 = i0.ɵɵnextContext(2);
14085
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c1$o, ctx_r1.noAddressSelected));
14094
+ const ctx_r0 = i0.ɵɵnextContext(2);
14095
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c1$o, ctx_r0.noAddressSelected));
14086
14096
  i0.ɵɵadvance();
14087
- i0.ɵɵproperty("for", ctx_r1.createElementId("addressList"));
14097
+ i0.ɵɵproperty("for", ctx_r0.createElementId("addressList"));
14088
14098
  i0.ɵɵadvance(2);
14089
14099
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 9, "Select an address"));
14090
14100
  i0.ɵɵadvance(2);
14091
- i0.ɵɵproperty("ngIf", ctx_r1.noAddressSelected);
14101
+ i0.ɵɵproperty("ngIf", ctx_r0.noAddressSelected);
14092
14102
  i0.ɵɵadvance();
14093
- i0.ɵɵproperty("id", ctx_r1.createElementId("addressList"))("formControl", ctx_r1.addressList);
14103
+ i0.ɵɵproperty("id", ctx_r0.createElementId("addressList"))("formControl", ctx_r0.addressList);
14094
14104
  i0.ɵɵadvance();
14095
- i0.ɵɵproperty("ngIf", ctx_r1.addressOptions.length === 0);
14105
+ i0.ɵɵproperty("ngIf", ctx_r0.addressOptions.length === 0);
14096
14106
  i0.ɵɵadvance();
14097
- i0.ɵɵproperty("ngIf", ctx_r1.addressOptions.length > 0);
14107
+ i0.ɵɵproperty("ngIf", ctx_r0.addressOptions.length > 0);
14098
14108
  i0.ɵɵadvance();
14099
- i0.ɵɵproperty("ngForOf", ctx_r1.addressOptions);
14109
+ i0.ɵɵproperty("ngForOf", ctx_r0.addressOptions);
14100
14110
  } }
14101
- function WriteAddressFieldComponent_div_1_a_6_Template(rf, ctx) { if (rf & 1) {
14111
+ function WriteAddressFieldComponent_div_1_a_7_Template(rf, ctx) { if (rf & 1) {
14102
14112
  const _r5 = i0.ɵɵgetCurrentView();
14103
- i0.ɵɵelementStart(0, "a", 20);
14104
- i0.ɵɵlistener("click", function WriteAddressFieldComponent_div_1_a_6_Template_a_click_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); ctx_r1.blankAddress(); return i0.ɵɵresetView($event.preventDefault()); });
14113
+ i0.ɵɵelementStart(0, "a", 23);
14114
+ i0.ɵɵlistener("click", function WriteAddressFieldComponent_div_1_a_7_Template_a_click_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(2); ctx_r0.blankAddress(); return i0.ɵɵresetView($event.preventDefault()); });
14105
14115
  i0.ɵɵtext(1);
14106
14116
  i0.ɵɵpipe(2, "rpxTranslate");
14107
14117
  i0.ɵɵelementEnd();
@@ -14114,18 +14124,20 @@ function WriteAddressFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
14114
14124
  i0.ɵɵtext(2);
14115
14125
  i0.ɵɵpipe(3, "ccdFieldLabel");
14116
14126
  i0.ɵɵelementEnd();
14117
- i0.ɵɵtemplate(4, WriteAddressFieldComponent_div_1_div_4_Template, 10, 18, "div", 5)(5, WriteAddressFieldComponent_div_1_div_5_Template, 10, 13, "div", 6)(6, WriteAddressFieldComponent_div_1_a_6_Template, 3, 3, "a", 7);
14127
+ i0.ɵɵtemplate(4, WriteAddressFieldComponent_div_1_span_4_Template, 3, 3, "span", 5)(5, WriteAddressFieldComponent_div_1_div_5_Template, 10, 18, "div", 6)(6, WriteAddressFieldComponent_div_1_div_6_Template, 10, 13, "div", 7)(7, WriteAddressFieldComponent_div_1_a_7_Template, 3, 3, "a", 8);
14118
14128
  i0.ɵɵelementEnd();
14119
14129
  } if (rf & 2) {
14120
- const ctx_r1 = i0.ɵɵnextContext();
14130
+ const ctx_r0 = i0.ɵɵnextContext();
14121
14131
  i0.ɵɵadvance(2);
14122
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 4, ctx_r1.caseField));
14132
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 5, ctx_r0.caseField));
14123
14133
  i0.ɵɵadvance(2);
14124
- i0.ɵɵproperty("ngIf", !ctx_r1.isExpanded);
14134
+ i0.ɵɵproperty("ngIf", ctx_r0.caseField.hint_text);
14125
14135
  i0.ɵɵadvance();
14126
- i0.ɵɵproperty("ngIf", ctx_r1.addressOptions);
14136
+ i0.ɵɵproperty("ngIf", !ctx_r0.isExpanded);
14127
14137
  i0.ɵɵadvance();
14128
- i0.ɵɵproperty("ngIf", !ctx_r1.shouldShowDetailFields());
14138
+ i0.ɵɵproperty("ngIf", ctx_r0.addressOptions);
14139
+ i0.ɵɵadvance();
14140
+ i0.ɵɵproperty("ngIf", !ctx_r0.shouldShowDetailFields());
14129
14141
  } }
14130
14142
  class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
14131
14143
  isCompoundPipe;
@@ -14259,9 +14271,9 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
14259
14271
  let _t;
14260
14272
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.writeComplexFieldComponent = _t.first);
14261
14273
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.focusElementDirectives = _t);
14262
- } }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 9, consts: [["writeComplexFieldComponent", ""], [1, "form-group", 3, "id"], [4, "ngIf"], [3, "hidden", "caseField", "renderLabel", "parent", "formGroup", "ignoreMandatory", "idPrefix"], [1, "heading-h2"], ["class", "form-group bottom-30 postcodeLookup", 3, "id", "ngClass", 4, "ngIf"], ["class", "form-group", "id", "selectAddress", 3, "ngClass", 4, "ngIf"], ["class", "manual-link bottom-30", "href", "#", 3, "click", 4, "ngIf"], [1, "form-group", "bottom-30", "postcodeLookup", 3, "id", "ngClass"], [3, "for"], [1, "form-label"], ["class", "error-message", 4, "ngIf"], ["type", "text", "name", "postcode", 1, "form-control", "postcodeinput", "inline-block", 3, "ngClass", "id", "formControl"], ["type", "button", 1, "button", "button-30", 3, "click", "disabled"], [1, "error-message"], ["id", "selectAddress", 1, "form-group", 3, "ngClass"], ["name", "address", "focusElement", "", 1, "form-control", "ccd-dropdown", "addressList", 3, "change", "id", "formControl"], [3, "ngValue", 4, "ngIf"], [3, "ngValue", 4, "ngFor", "ngForOf"], [3, "ngValue"], ["href", "#", 1, "manual-link", "bottom-30", 3, "click"]], template: function WriteAddressFieldComponent_Template(rf, ctx) { if (rf & 1) {
14274
+ } }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 9, consts: [["writeComplexFieldComponent", ""], [1, "form-group", 3, "id"], [4, "ngIf"], [3, "hidden", "caseField", "renderLabel", "parent", "formGroup", "ignoreMandatory", "idPrefix"], [1, "heading-h2"], ["class", "form-hint", 4, "ngIf"], ["class", "form-group bottom-30 postcodeLookup", 3, "id", "ngClass", 4, "ngIf"], ["class", "form-group", "id", "selectAddress", 3, "ngClass", 4, "ngIf"], ["class", "manual-link bottom-30", "href", "#", 3, "click", 4, "ngIf"], [1, "form-hint"], [3, "content"], [1, "form-group", "bottom-30", "postcodeLookup", 3, "id", "ngClass"], [3, "for"], [1, "form-label"], ["class", "error-message", 4, "ngIf"], ["type", "text", "name", "postcode", 1, "form-control", "postcodeinput", "inline-block", 3, "ngClass", "id", "formControl"], ["type", "button", 1, "button", "button-30", 3, "click", "disabled"], [1, "error-message"], ["id", "selectAddress", 1, "form-group", 3, "ngClass"], ["name", "address", "focusElement", "", 1, "form-control", "ccd-dropdown", "addressList", 3, "change", "id", "formControl"], [3, "ngValue", 4, "ngIf"], [3, "ngValue", 4, "ngFor", "ngForOf"], [3, "ngValue"], ["href", "#", 1, "manual-link", "bottom-30", 3, "click"]], template: function WriteAddressFieldComponent_Template(rf, ctx) { if (rf & 1) {
14263
14275
  i0.ɵɵelementStart(0, "div", 1);
14264
- i0.ɵɵtemplate(1, WriteAddressFieldComponent_div_1_Template, 7, 6, "div", 2);
14276
+ i0.ɵɵtemplate(1, WriteAddressFieldComponent_div_1_Template, 8, 7, "div", 2);
14265
14277
  i0.ɵɵelement(2, "ccd-write-complex-type-field", 3, 0);
14266
14278
  i0.ɵɵelementEnd();
14267
14279
  } if (rf & 2) {
@@ -14274,7 +14286,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
14274
14286
  }
14275
14287
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteAddressFieldComponent, [{
14276
14288
  type: Component,
14277
- args: [{ selector: 'ccd-write-address-field', standalone: false, template: "<div class=\"form-group\" [id]=\"id()\">\n <div *ngIf=\"!isComplexWithHiddenFields()\">\n <h2 class=\"heading-h2\">{{caseField | ccdFieldLabel}}</h2>\n\n <div class=\"form-group bottom-30 postcodeLookup\" [id]=\"createElementId('postcodeLookup')\" [ngClass]=\"{'form-group-error': missingPostcode}\" *ngIf=\"!isExpanded\">\n <label [for]=\"createElementId('postcodeInput')\">\n <span class=\"form-label\">{{'Enter a UK postcode' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"missingPostcode\">{{errorMessage | rpxTranslate}}</span>\n <input type=\"text\" [ngClass]=\"{'govuk-input--error': missingPostcode}\"\n [id]=\"createElementId('postcodeInput')\" name=\"postcode\" class=\"form-control postcodeinput inline-block\" [formControl]=\"postcode\">\n <button type=\"button\" class=\"button button-30\" (click)=\"findAddress()\" [disabled]=\"loadingAddresses\">\n {{(loadingAddresses ? 'Finding addresses...' : 'Find address') | rpxTranslate}}\n </button>\n </div>\n\n <div class=\"form-group\" *ngIf=\"addressOptions\" id=\"selectAddress\" [ngClass]=\"{'form-group-error': noAddressSelected}\">\n <label [for]=\"createElementId('addressList')\">\n <span class=\"form-label\">{{'Select an address' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"noAddressSelected\">{{errorMessage | rpxTranslate}}</span>\n <select class=\"form-control ccd-dropdown addressList\" [id]=\"createElementId('addressList')\" name=\"address\" [formControl]=\"addressList\" (change)=\"addressSelected()\" focusElement>\n <option *ngIf=\"addressOptions.length === 0\" [ngValue]=\"undefined\">\n {{'No address found' | rpxTranslate}}\n </option>\n <option *ngIf=\"addressOptions.length > 0\" [ngValue]=\"undefined\">\n {{addressOptions.length}} {{(addressOptions.length === 1 ? 'address found' : 'addresses found') | rpxTranslate}}\n </option>\n <option *ngFor=\"let addressOption of addressOptions\" [ngValue]=\"addressOption.value\">\n {{addressOption.description}}\n </option>\n </select>\n </div>\n\n <a class=\"manual-link bottom-30\" *ngIf=\"!shouldShowDetailFields()\" (click)=\"blankAddress(); $event.preventDefault()\" href=\"#\">\n {{\"I can't enter a UK postcode\" | rpxTranslate}}\n </a>\n </div>\n\n <ccd-write-complex-type-field\n [hidden]=\"!shouldShowDetailFields()\"\n [caseField]=\"caseField\"\n [renderLabel]=\"false\"\n [parent]=\"parent\"\n [formGroup]=\"formGroup\"\n [ignoreMandatory]=\"true\"\n [idPrefix]=\"buildIdPrefix('detail')\"\n #writeComplexFieldComponent>\n </ccd-write-complex-type-field>\n</div>\n", styles: [".manual-link{cursor:pointer;display:block;text-decoration:underline}\n"] }]
14289
+ args: [{ selector: 'ccd-write-address-field', standalone: false, template: "<div class=\"form-group\" [id]=\"id()\">\n <div *ngIf=\"!isComplexWithHiddenFields()\">\n <h2 class=\"heading-h2\">{{caseField | ccdFieldLabel}}</h2>\n <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">\n <ccd-markdown [content]=\"caseField.hint_text | rpxTranslate\"></ccd-markdown>\n </span>\n\n <div class=\"form-group bottom-30 postcodeLookup\" [id]=\"createElementId('postcodeLookup')\" [ngClass]=\"{'form-group-error': missingPostcode}\" *ngIf=\"!isExpanded\">\n <label [for]=\"createElementId('postcodeInput')\">\n <span class=\"form-label\">{{'Enter a UK postcode' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"missingPostcode\">{{errorMessage | rpxTranslate}}</span>\n <input type=\"text\" [ngClass]=\"{'govuk-input--error': missingPostcode}\"\n [id]=\"createElementId('postcodeInput')\" name=\"postcode\" class=\"form-control postcodeinput inline-block\" [formControl]=\"postcode\">\n <button type=\"button\" class=\"button button-30\" (click)=\"findAddress()\" [disabled]=\"loadingAddresses\">\n {{(loadingAddresses ? 'Finding addresses...' : 'Find address') | rpxTranslate}}\n </button>\n </div>\n\n <div class=\"form-group\" *ngIf=\"addressOptions\" id=\"selectAddress\" [ngClass]=\"{'form-group-error': noAddressSelected}\">\n <label [for]=\"createElementId('addressList')\">\n <span class=\"form-label\">{{'Select an address' | rpxTranslate}}</span>\n </label>\n <span class=\"error-message\" *ngIf=\"noAddressSelected\">{{errorMessage | rpxTranslate}}</span>\n <select class=\"form-control ccd-dropdown addressList\" [id]=\"createElementId('addressList')\" name=\"address\" [formControl]=\"addressList\" (change)=\"addressSelected()\" focusElement>\n <option *ngIf=\"addressOptions.length === 0\" [ngValue]=\"undefined\">\n {{'No address found' | rpxTranslate}}\n </option>\n <option *ngIf=\"addressOptions.length > 0\" [ngValue]=\"undefined\">\n {{addressOptions.length}} {{(addressOptions.length === 1 ? 'address found' : 'addresses found') | rpxTranslate}}\n </option>\n <option *ngFor=\"let addressOption of addressOptions\" [ngValue]=\"addressOption.value\">\n {{addressOption.description}}\n </option>\n </select>\n </div>\n\n <a class=\"manual-link bottom-30\" *ngIf=\"!shouldShowDetailFields()\" (click)=\"blankAddress(); $event.preventDefault()\" href=\"#\">\n {{\"I can't enter a UK postcode\" | rpxTranslate}}\n </a>\n </div>\n\n <ccd-write-complex-type-field\n [hidden]=\"!shouldShowDetailFields()\"\n [caseField]=\"caseField\"\n [renderLabel]=\"false\"\n [parent]=\"parent\"\n [formGroup]=\"formGroup\"\n [ignoreMandatory]=\"true\"\n [idPrefix]=\"buildIdPrefix('detail')\"\n #writeComplexFieldComponent>\n </ccd-write-complex-type-field>\n</div>\n", styles: [".manual-link{cursor:pointer;display:block;text-decoration:underline}\n"] }]
14278
14290
  }], () => [{ type: AddressesService }, { type: IsCompoundPipe }], { writeComplexFieldComponent: [{
14279
14291
  type: ViewChild,
14280
14292
  args: ['writeComplexFieldComponent', { static: false }]
@@ -14653,8 +14665,8 @@ class CaseFileViewFieldComponent {
14653
14665
  this.caseFileViewService.updateDocumentCategory(cid, this.caseVersion, data.document.attribute_path, data.newCategory)
14654
14666
  .pipe(finalize(() => {
14655
14667
  this.loadingService.unregister(loadingToken);
14656
- }), catchError(() => {
14657
- this.errorMessages = ['You do not have permission to move this document to the selected folder.'];
14668
+ }), catchError((err) => {
14669
+ this.errorMessages = [this.moveDocumentError(err)];
14658
14670
  return of(null);
14659
14671
  }))
14660
14672
  .subscribe(res => {
@@ -14678,6 +14690,31 @@ class CaseFileViewFieldComponent {
14678
14690
  isIcpEnabled() {
14679
14691
  return this.icpEnabled && ((this.icp_jurisdictions?.length < 1) || this.icp_jurisdictions.includes(this.caseNotifier?.cachedCaseView?.case_type?.jurisdiction.id));
14680
14692
  }
14693
+ moveDocumentError(err) {
14694
+ const defaultMsg = 'We couldn\'t move the document. Please try again.';
14695
+ if (!(err instanceof HttpErrorResponse)) {
14696
+ return defaultMsg;
14697
+ }
14698
+ switch (err.status) {
14699
+ case HttpStatusCode.BadRequest:
14700
+ // e.g. malformed PUT, invalid attribute_path, invalid target category
14701
+ return 'The request was invalid. Check the document path and destination folder.';
14702
+ case HttpStatusCode.Conflict:
14703
+ // optimistic concurrency / stale case version
14704
+ return 'This case changed since you opened it. Refresh and try again.';
14705
+ case HttpStatusCode.NotFound:
14706
+ return 'The document or destination folder could not be found.';
14707
+ case HttpStatusCode.Forbidden:
14708
+ case HttpStatusCode.Unauthorized:
14709
+ return 'You do not have permission to move this document to the selected folder.';
14710
+ case HttpStatusCode.ServiceUnavailable:
14711
+ case HttpStatusCode.GatewayTimeout:
14712
+ return 'The service is temporarily unavailable. Please try again in a moment.';
14713
+ default:
14714
+ // Any other status (including 500)
14715
+ return defaultMsg;
14716
+ }
14717
+ }
14681
14718
  static ɵfac = function CaseFileViewFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFileViewFieldComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseFileViewService), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
14682
14719
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], standalone: false, decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["type", "button", 1, "govuk-js-link"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "clickedDocument", "moveDocument", "categoriesAndDocuments", "allowMoving"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height", "caseId", "multimediaPlayerEnabled", "enableICP"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) { if (rf & 1) {
14683
14720
  i0.ɵɵtemplate(0, CaseFileViewFieldComponent_ng_container_0_Template, 8, 1, "ng-container", 0)(1, CaseFileViewFieldComponent_div_1_Template, 5, 0, "div", 1)(2, CaseFileViewFieldComponent_div_2_Template, 9, 3, "div", 0);
@@ -14693,7 +14730,7 @@ class CaseFileViewFieldComponent {
14693
14730
  type: Component,
14694
14731
  args: [{ selector: 'ccd-case-file-view-field', standalone: false, template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\"\n data-module=\"govuk-error-summary\"\n >\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">There is a problem</h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <button type=\"button\" class=\"govuk-js-link\">{{ errorMessage }}</button>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div\n *ngIf=\"getCategoriesAndDocumentsError\"\n class=\"govuk-grid-column-two-thirds\"\n>\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder \n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\" \n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\">\n </ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer\n [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\"\n [caseId]=\"caseId\"\n [multimediaPlayerEnabled]=\"true\"\n [enableICP]=\"isIcpEnabled()\"\n >\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
14695
14732
  }], () => [{ type: i0.ElementRef }, { type: i1$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }, { type: SessionStorageService }, { type: WindowService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
14696
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFieldComponent, { className: "CaseFileViewFieldComponent", filePath: "lib/shared/components/palette/case-file-view/case-file-view-field.component.ts", lineNumber: 19 }); })();
14733
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFieldComponent, { className: "CaseFileViewFieldComponent", filePath: "lib/shared/components/palette/case-file-view/case-file-view-field.component.ts", lineNumber: 20 }); })();
14697
14734
 
14698
14735
  const PVP_FLAG_CODE = 'PF0021';
14699
14736
  const PVP_DISPLAY_TEXT = 'POTENTIALLY VIOLENT PERSON';
@@ -33547,7 +33584,7 @@ i0.ɵɵsetComponentScope(ReadLinkedCasesFieldComponent, function () { return [i4
33547
33584
  // Components for linked cases
33548
33585
  LinkedCasesToTableComponent,
33549
33586
  LinkedCasesFromTableComponent]; }, []);
33550
- i0.ɵɵsetComponentScope(WriteAddressFieldComponent, function () { return [i4.NgClass, i4.NgForOf, i4.NgIf, i3.NgSelectOption, i3.ɵNgSelectMultipleOption, i3.DefaultValueAccessor, i3.SelectControlValueAccessor, i3.NgControlStatus, i3.NgControlStatusGroup, i3.FormControlDirective, i3.FormGroupDirective, WriteComplexFieldComponent]; }, function () { return [FieldLabelPipe, i1.RpxTranslatePipe]; });
33587
+ i0.ɵɵsetComponentScope(WriteAddressFieldComponent, function () { return [i4.NgClass, i4.NgForOf, i4.NgIf, i3.NgSelectOption, i3.ɵNgSelectMultipleOption, i3.DefaultValueAccessor, i3.SelectControlValueAccessor, i3.NgControlStatus, i3.NgControlStatusGroup, i3.FormControlDirective, i3.FormGroupDirective, MarkdownComponent, WriteComplexFieldComponent]; }, function () { return [FieldLabelPipe, i1.RpxTranslatePipe]; });
33551
33588
  i0.ɵɵsetComponentScope(WriteComplexFieldComponent, function () { return [i4.NgForOf, i4.NgIf, i4.NgSwitch, i4.NgSwitchCase, i3.NgControlStatusGroup, i3.FormGroupDirective, LabelSubstitutorDirective, FieldReadComponent,
33552
33589
  FieldWriteComponent]; }, function () { return [FieldLabelPipe, IsReadOnlyPipe]; });
33553
33590
  i0.ɵɵsetComponentScope(WriteDocumentFieldComponent, function () { return [i4.NgClass, i4.NgIf, i1$4.MarkdownComponent, ReadDocumentFieldComponent]; }, function () { return [FieldLabelPipe, i1.RpxTranslatePipe]; });