@hmcts/ccd-case-ui-toolkit 7.2.54-3759-rc1 → 7.2.54-3759-rc4
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/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +102 -115
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/index.d.ts +161 -163
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,10 +8,10 @@ import * as i1$1 from '@angular/router';
|
|
|
8
8
|
import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
|
|
9
9
|
import * as i4 from '@angular/forms';
|
|
10
10
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
11
|
-
import { BehaviorSubject, throwError, Subject, EMPTY, Observable, skip, of,
|
|
11
|
+
import { BehaviorSubject, throwError, Subject, EMPTY, Observable, skip, of, timer, forkJoin, fromEvent, combineLatest, Subscription } from 'rxjs';
|
|
12
12
|
import * as i1$2 from '@angular/common/http';
|
|
13
13
|
import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
14
|
-
import { distinctUntilChanged, catchError, map, publish, refCount, switchMap, debounceTime,
|
|
14
|
+
import { distinctUntilChanged, catchError, map, publish, refCount, switchMap, debounceTime, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
|
|
15
15
|
import { polling } from 'rx-polling-hmcts';
|
|
16
16
|
import { Type, Exclude, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
|
|
17
17
|
import moment from 'moment';
|
|
@@ -431,7 +431,7 @@ function DateInputComponent_div_20_Template(rf, ctx) { if (rf & 1) {
|
|
|
431
431
|
} if (rf & 2) {
|
|
432
432
|
const ctx_r6 = i0.ɵɵnextContext();
|
|
433
433
|
i0.ɵɵadvance();
|
|
434
|
-
i0.ɵɵattribute("id", "minute-label-" + ctx_r6.
|
|
434
|
+
i0.ɵɵattribute("id", "minute-label-" + ctx_r6.minuteId());
|
|
435
435
|
i0.ɵɵadvance();
|
|
436
436
|
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 7, "Minute"));
|
|
437
437
|
i0.ɵɵadvance(2);
|
|
@@ -727,7 +727,7 @@ class DateInputComponent {
|
|
|
727
727
|
useExisting: forwardRef(() => DateInputComponent),
|
|
728
728
|
multi: true
|
|
729
729
|
}
|
|
730
|
-
], standalone: false, template: "<div class=\"form-date\">\n <div class=\"form-group form-group-day\">\n <span class=\"form-label\" [attr.id]=\"'day-label-'+dayId()\">{{'Day' | rpxTranslate}}</span>\n <input #dayInput\n class=\"form-control\"\n [id]=\"dayId()\"\n [name]=\"dayId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'day-label-'+dayId()\"\n [value]=\"displayDay\"\n (change)=\"dayChange(dayInput.value)\"\n (keyup)=\"dayChange(dayInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-month\">\n <span class=\"form-label\" [attr.id]=\"'month-label-'+ monthId()\">{{'Month' | rpxTranslate}}</span>\n <input #monthInput\n class=\"form-control\"\n [id]=\"monthId()\"\n [name]=\"monthId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'month-label-'+ monthId()\"\n [value]=\"displayMonth\"\n (change)=\"monthChange(monthInput.value)\"\n (keyup)=\"monthChange(monthInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-year\">\n <span class=\"form-label\" [attr.id]=\"'year-label-'+ yearId()\">{{'Year' | rpxTranslate}}</span>\n <input #yearInput\n class=\"form-control\"\n [id]=\"yearId()\"\n [name]=\"yearId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'year-label-'+ yearId()\"\n [value]=\"displayYear\"\n (change)=\"yearChange(yearInput.value)\"\n (keyup)=\"yearChange(yearInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-hour\" *ngIf=\"isDateTime\">\n <span class=\"form-label\" [attr.id]=\"'hour-label-'+ hourId()\">{{'Hour' | rpxTranslate}}</span>\n <input #hourInput\n class=\"form-control\"\n [id]=\"hourId()\"\n [name]=\"hourId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'hour-label-'+ hourId()\"\n [value]=\"displayHour\"\n (input)=\"hourChange(hourInput.value)\"\n (keyup)=\"hourChange(hourInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-minute\" *ngIf=\"isDateTime\">\n <span class=\"form-label\" [attr.id]=\"'minute-label-'+
|
|
730
|
+
], standalone: false, template: "<div class=\"form-date\">\n <div class=\"form-group form-group-day\">\n <span class=\"form-label\" [attr.id]=\"'day-label-'+dayId()\">{{'Day' | rpxTranslate}}</span>\n <input #dayInput\n class=\"form-control\"\n [id]=\"dayId()\"\n [name]=\"dayId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'day-label-'+dayId()\"\n [value]=\"displayDay\"\n (change)=\"dayChange(dayInput.value)\"\n (keyup)=\"dayChange(dayInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-month\">\n <span class=\"form-label\" [attr.id]=\"'month-label-'+ monthId()\">{{'Month' | rpxTranslate}}</span>\n <input #monthInput\n class=\"form-control\"\n [id]=\"monthId()\"\n [name]=\"monthId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'month-label-'+ monthId()\"\n [value]=\"displayMonth\"\n (change)=\"monthChange(monthInput.value)\"\n (keyup)=\"monthChange(monthInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-year\">\n <span class=\"form-label\" [attr.id]=\"'year-label-'+ yearId()\">{{'Year' | rpxTranslate}}</span>\n <input #yearInput\n class=\"form-control\"\n [id]=\"yearId()\"\n [name]=\"yearId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'year-label-'+ yearId()\"\n [value]=\"displayYear\"\n (change)=\"yearChange(yearInput.value)\"\n (keyup)=\"yearChange(yearInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-hour\" *ngIf=\"isDateTime\">\n <span class=\"form-label\" [attr.id]=\"'hour-label-'+ hourId()\">{{'Hour' | rpxTranslate}}</span>\n <input #hourInput\n class=\"form-control\"\n [id]=\"hourId()\"\n [name]=\"hourId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'hour-label-'+ hourId()\"\n [value]=\"displayHour\"\n (input)=\"hourChange(hourInput.value)\"\n (keyup)=\"hourChange(hourInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-minute\" *ngIf=\"isDateTime\">\n <span class=\"form-label\" [attr.id]=\"'minute-label-'+ minuteId()\">{{'Minute' | rpxTranslate}}</span>\n <input #minuteInput\n class=\"form-control\"\n [id]=\"minuteId()\"\n [name]=\"minuteId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'minute-label-'+ minuteId()\"\n [value]=\"displayMinute\"\n (input)=\"minuteChange(minuteInput.value)\"\n (keyup)=\"minuteChange(minuteInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n\n <div class=\"form-group form-group-second\" *ngIf=\"isDateTime\">\n <span class=\"form-label\" [attr.id]=\"'second-label-'+ secondId()\">{{'Second' | rpxTranslate}}</span>\n <input #secondInput\n class=\"form-control\"\n [id]=\"secondId()\"\n [name]=\"secondId()\"\n type=\"text\"\n pattern=\"[0-9]*\"\n inputmode=\"numeric\"\n [attr.aria-labelledby]=\"'second-label-'+ secondId()\"\n [value]=\"displaySecond\"\n (input)=\"secondChange(secondInput.value)\"\n (keyup)=\"secondChange(secondInput.value)\"\n (focus)=\"inputFocus()\"\n [ngClass]=\"{'govuk-input--error': isInvalid}\">\n </div>\n</div>\n" }]
|
|
731
731
|
}], null, { id: [{
|
|
732
732
|
type: Input
|
|
733
733
|
}], mandatory: [{
|
|
@@ -7148,89 +7148,9 @@ class ReadCookieService {
|
|
|
7148
7148
|
args: [DOCUMENT]
|
|
7149
7149
|
}] }], null); })();
|
|
7150
7150
|
|
|
7151
|
-
class CaseNotifier {
|
|
7152
|
-
casesService;
|
|
7153
|
-
static CASE_NAME = 'caseNameHmctsInternal';
|
|
7154
|
-
static CASE_LOCATION = 'caseManagementLocation';
|
|
7155
|
-
caseViewSource = new BehaviorSubject(new CaseView());
|
|
7156
|
-
caseView = this.caseViewSource.asObservable();
|
|
7157
|
-
cachedCaseView;
|
|
7158
|
-
constructor(casesService) {
|
|
7159
|
-
this.casesService = casesService;
|
|
7160
|
-
}
|
|
7161
|
-
removeCachedCase() {
|
|
7162
|
-
this.cachedCaseView = null;
|
|
7163
|
-
}
|
|
7164
|
-
announceCase(c) {
|
|
7165
|
-
this.caseViewSource.next(c);
|
|
7166
|
-
}
|
|
7167
|
-
fetchAndRefresh(cid) {
|
|
7168
|
-
return this.casesService
|
|
7169
|
-
.getCaseViewV2(cid)
|
|
7170
|
-
.pipe(map(caseView => {
|
|
7171
|
-
this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
7172
|
-
this.setBasicFields(this.cachedCaseView.tabs);
|
|
7173
|
-
this.announceCase(this.cachedCaseView);
|
|
7174
|
-
return this.cachedCaseView;
|
|
7175
|
-
}));
|
|
7176
|
-
}
|
|
7177
|
-
setBasicFields(tabs) {
|
|
7178
|
-
tabs.forEach((t) => {
|
|
7179
|
-
const caseName = t.fields.find(f => f.id === CaseNotifier.CASE_NAME);
|
|
7180
|
-
const caseLocation = t.fields.find(f => f.id === CaseNotifier.CASE_LOCATION);
|
|
7181
|
-
if (caseName || caseLocation) {
|
|
7182
|
-
this.cachedCaseView.basicFields = {
|
|
7183
|
-
caseNameHmctsInternal: caseName ? caseName.value : null,
|
|
7184
|
-
caseManagementLocation: caseLocation ? caseLocation.value : null
|
|
7185
|
-
};
|
|
7186
|
-
}
|
|
7187
|
-
});
|
|
7188
|
-
}
|
|
7189
|
-
static ɵfac = function CaseNotifier_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseNotifier)(i0.ɵɵinject(CasesService)); };
|
|
7190
|
-
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseNotifier, factory: CaseNotifier.ɵfac });
|
|
7191
|
-
}
|
|
7192
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseNotifier, [{
|
|
7193
|
-
type: Injectable
|
|
7194
|
-
}], () => [{ type: CasesService }], null); })();
|
|
7195
|
-
|
|
7196
|
-
class JurisdictionService {
|
|
7197
|
-
httpService;
|
|
7198
|
-
// We retain the Subject observable because subscribing code couldn't happen a null value
|
|
7199
|
-
selectedJurisdictionSource = new Subject();
|
|
7200
|
-
_selectedJurisdictionBS = new BehaviorSubject(null);
|
|
7201
|
-
selectedJurisdiction;
|
|
7202
|
-
constructor(httpService) {
|
|
7203
|
-
this.httpService = httpService;
|
|
7204
|
-
this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
|
|
7205
|
-
}
|
|
7206
|
-
getJurisdictions() {
|
|
7207
|
-
return this.httpService.get('/aggregated/caseworkers/:uid/jurisdictions?access=read');
|
|
7208
|
-
}
|
|
7209
|
-
announceSelectedJurisdiction(jurisdiction) {
|
|
7210
|
-
this.selectedJurisdictionSource.next(jurisdiction);
|
|
7211
|
-
this._selectedJurisdictionBS.next(jurisdiction);
|
|
7212
|
-
}
|
|
7213
|
-
getSelectedJurisdiction() {
|
|
7214
|
-
return this._selectedJurisdictionBS;
|
|
7215
|
-
}
|
|
7216
|
-
searchJudicialUsers(searchTerm, serviceId) {
|
|
7217
|
-
return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
|
|
7218
|
-
}
|
|
7219
|
-
searchJudicialUsersByPersonalCodes(personalCodes) {
|
|
7220
|
-
return this.httpService.post('api/prd/judicial/searchJudicialUserByPersonalCodes', { personal_code: personalCodes });
|
|
7221
|
-
}
|
|
7222
|
-
static ɵfac = function JurisdictionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JurisdictionService)(i0.ɵɵinject(HttpService)); };
|
|
7223
|
-
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: JurisdictionService, factory: JurisdictionService.ɵfac });
|
|
7224
|
-
}
|
|
7225
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService, [{
|
|
7226
|
-
type: Injectable
|
|
7227
|
-
}], () => [{ type: HttpService }], null); })();
|
|
7228
|
-
|
|
7229
7151
|
class DocumentManagementService {
|
|
7230
7152
|
http;
|
|
7231
7153
|
appConfig;
|
|
7232
|
-
caseNotifierService;
|
|
7233
|
-
jurisdictionService;
|
|
7234
7154
|
static PDF = 'pdf';
|
|
7235
7155
|
static IMAGE = 'image';
|
|
7236
7156
|
static WORD = 'word';
|
|
@@ -7246,32 +7166,21 @@ class DocumentManagementService {
|
|
|
7246
7166
|
static excelList = ['XLS', 'XLSX', 'xls', 'xlsx'];
|
|
7247
7167
|
static powerpointList = ['PPT', 'PPTX', 'ppt', 'pptx'];
|
|
7248
7168
|
caseTypeId = '';
|
|
7249
|
-
constructor(http, appConfig
|
|
7169
|
+
constructor(http, appConfig) {
|
|
7250
7170
|
this.http = http;
|
|
7251
7171
|
this.appConfig = appConfig;
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
if (jurisdiction.currentCaseType) {
|
|
7263
|
-
this.caseTypeId = jurisdiction.currentCaseType.id;
|
|
7264
|
-
}
|
|
7265
|
-
}
|
|
7266
|
-
//if the user refreshes on the case creation page the above logic will not work, we can get the caseTypeId from the URL
|
|
7267
|
-
if (!this.caseTypeId) {
|
|
7268
|
-
const url = window.location.pathname;
|
|
7269
|
-
if (url.indexOf('/case-create/') > -1) {
|
|
7270
|
-
const parts = url.split('/');
|
|
7271
|
-
this.caseTypeId = parts[parts.indexOf('case-create') + 2];
|
|
7272
|
-
}
|
|
7172
|
+
const currUrl = window.location.pathname;
|
|
7173
|
+
if (currUrl.includes('/case-details/')) {
|
|
7174
|
+
this.caseTypeId = currUrl.split('/')[4];
|
|
7175
|
+
}
|
|
7176
|
+
console.log(this.caseTypeId);
|
|
7177
|
+
//if the user refreshes on the case creation page the above logic will not work, we can get the caseTypeId from the URL
|
|
7178
|
+
if (!this.caseTypeId) {
|
|
7179
|
+
if (currUrl.indexOf('/case-create/') > -1) {
|
|
7180
|
+
const parts = currUrl.split('/');
|
|
7181
|
+
this.caseTypeId = parts[parts.indexOf('case-create') + 2];
|
|
7273
7182
|
}
|
|
7274
|
-
}
|
|
7183
|
+
}
|
|
7275
7184
|
}
|
|
7276
7185
|
uploadFile(formData) {
|
|
7277
7186
|
const url = this.getDocStoreUrl();
|
|
@@ -7366,12 +7275,12 @@ class DocumentManagementService {
|
|
|
7366
7275
|
// if documentSecureModeEnabled is true, and case is in the exclusion list, return false
|
|
7367
7276
|
return false;
|
|
7368
7277
|
}
|
|
7369
|
-
static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig)
|
|
7278
|
+
static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig)); };
|
|
7370
7279
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DocumentManagementService, factory: DocumentManagementService.ɵfac });
|
|
7371
7280
|
}
|
|
7372
7281
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DocumentManagementService, [{
|
|
7373
7282
|
type: Injectable
|
|
7374
|
-
}], () => [{ type: HttpService }, { type: AbstractAppConfig }
|
|
7283
|
+
}], () => [{ type: HttpService }, { type: AbstractAppConfig }], null); })();
|
|
7375
7284
|
|
|
7376
7285
|
class ErrorNotifierService {
|
|
7377
7286
|
errorSource = new BehaviorSubject(null);
|
|
@@ -7563,6 +7472,39 @@ class MultipageComponentStateService {
|
|
|
7563
7472
|
}]
|
|
7564
7473
|
}], null, null); })();
|
|
7565
7474
|
|
|
7475
|
+
class JurisdictionService {
|
|
7476
|
+
httpService;
|
|
7477
|
+
// We retain the Subject observable because subscribing code couldn't happen a null value
|
|
7478
|
+
selectedJurisdictionSource = new Subject();
|
|
7479
|
+
_selectedJurisdictionBS = new BehaviorSubject(null);
|
|
7480
|
+
selectedJurisdiction;
|
|
7481
|
+
constructor(httpService) {
|
|
7482
|
+
this.httpService = httpService;
|
|
7483
|
+
this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
|
|
7484
|
+
}
|
|
7485
|
+
getJurisdictions() {
|
|
7486
|
+
return this.httpService.get('/aggregated/caseworkers/:uid/jurisdictions?access=read');
|
|
7487
|
+
}
|
|
7488
|
+
announceSelectedJurisdiction(jurisdiction) {
|
|
7489
|
+
this.selectedJurisdictionSource.next(jurisdiction);
|
|
7490
|
+
this._selectedJurisdictionBS.next(jurisdiction);
|
|
7491
|
+
}
|
|
7492
|
+
getSelectedJurisdiction() {
|
|
7493
|
+
return this._selectedJurisdictionBS;
|
|
7494
|
+
}
|
|
7495
|
+
searchJudicialUsers(searchTerm, serviceId) {
|
|
7496
|
+
return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
|
|
7497
|
+
}
|
|
7498
|
+
searchJudicialUsersByPersonalCodes(personalCodes) {
|
|
7499
|
+
return this.httpService.post('api/prd/judicial/searchJudicialUserByPersonalCodes', { personal_code: personalCodes });
|
|
7500
|
+
}
|
|
7501
|
+
static ɵfac = function JurisdictionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JurisdictionService)(i0.ɵɵinject(HttpService)); };
|
|
7502
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: JurisdictionService, factory: JurisdictionService.ɵfac });
|
|
7503
|
+
}
|
|
7504
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService, [{
|
|
7505
|
+
type: Injectable
|
|
7506
|
+
}], () => [{ type: HttpService }], null); })();
|
|
7507
|
+
|
|
7566
7508
|
class BannersService {
|
|
7567
7509
|
httpService;
|
|
7568
7510
|
appConfig;
|
|
@@ -8682,6 +8624,51 @@ class CaseworkerService {
|
|
|
8682
8624
|
type: Injectable
|
|
8683
8625
|
}], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }], null); })();
|
|
8684
8626
|
|
|
8627
|
+
class CaseNotifier {
|
|
8628
|
+
casesService;
|
|
8629
|
+
static CASE_NAME = 'caseNameHmctsInternal';
|
|
8630
|
+
static CASE_LOCATION = 'caseManagementLocation';
|
|
8631
|
+
caseViewSource = new BehaviorSubject(new CaseView());
|
|
8632
|
+
caseView = this.caseViewSource.asObservable();
|
|
8633
|
+
cachedCaseView;
|
|
8634
|
+
constructor(casesService) {
|
|
8635
|
+
this.casesService = casesService;
|
|
8636
|
+
}
|
|
8637
|
+
removeCachedCase() {
|
|
8638
|
+
this.cachedCaseView = null;
|
|
8639
|
+
}
|
|
8640
|
+
announceCase(c) {
|
|
8641
|
+
this.caseViewSource.next(c);
|
|
8642
|
+
}
|
|
8643
|
+
fetchAndRefresh(cid) {
|
|
8644
|
+
return this.casesService
|
|
8645
|
+
.getCaseViewV2(cid)
|
|
8646
|
+
.pipe(map(caseView => {
|
|
8647
|
+
this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
8648
|
+
this.setBasicFields(this.cachedCaseView.tabs);
|
|
8649
|
+
this.announceCase(this.cachedCaseView);
|
|
8650
|
+
return this.cachedCaseView;
|
|
8651
|
+
}));
|
|
8652
|
+
}
|
|
8653
|
+
setBasicFields(tabs) {
|
|
8654
|
+
tabs.forEach((t) => {
|
|
8655
|
+
const caseName = t.fields.find(f => f.id === CaseNotifier.CASE_NAME);
|
|
8656
|
+
const caseLocation = t.fields.find(f => f.id === CaseNotifier.CASE_LOCATION);
|
|
8657
|
+
if (caseName || caseLocation) {
|
|
8658
|
+
this.cachedCaseView.basicFields = {
|
|
8659
|
+
caseNameHmctsInternal: caseName ? caseName.value : null,
|
|
8660
|
+
caseManagementLocation: caseLocation ? caseLocation.value : null
|
|
8661
|
+
};
|
|
8662
|
+
}
|
|
8663
|
+
});
|
|
8664
|
+
}
|
|
8665
|
+
static ɵfac = function CaseNotifier_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseNotifier)(i0.ɵɵinject(CasesService)); };
|
|
8666
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseNotifier, factory: CaseNotifier.ɵfac });
|
|
8667
|
+
}
|
|
8668
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseNotifier, [{
|
|
8669
|
+
type: Injectable
|
|
8670
|
+
}], () => [{ type: CasesService }], null); })();
|
|
8671
|
+
|
|
8685
8672
|
var Permissions;
|
|
8686
8673
|
(function (Permissions) {
|
|
8687
8674
|
Permissions["Own"] = "OWN";
|
|
@@ -15282,20 +15269,20 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
15282
15269
|
}
|
|
15283
15270
|
ngOnInit() {
|
|
15284
15271
|
// Wait for both observables to emit at least once
|
|
15272
|
+
const currUrl = window.location.pathname;
|
|
15273
|
+
if (currUrl.includes('/case-details/')) {
|
|
15274
|
+
this.caseTypeId = currUrl.split('/')[4];
|
|
15275
|
+
}
|
|
15285
15276
|
this.caseNotifierSubscription = combineLatest([
|
|
15286
15277
|
this.caseNotifier.caseView.pipe(take(1)),
|
|
15287
15278
|
this.jurisdictionService.getSelectedJurisdiction()
|
|
15288
15279
|
]).subscribe(([caseDetails, jurisdiction]) => {
|
|
15289
15280
|
if (caseDetails) {
|
|
15290
|
-
this.caseTypeId = caseDetails?.case_type?.id;
|
|
15291
15281
|
this.jurisdictionId = caseDetails?.case_type?.jurisdiction?.id;
|
|
15292
15282
|
this.caseId = caseDetails?.case_id;
|
|
15293
15283
|
}
|
|
15294
15284
|
if (jurisdiction) {
|
|
15295
15285
|
this.jurisdictionId = jurisdiction.id;
|
|
15296
|
-
if (jurisdiction.currentCaseType) {
|
|
15297
|
-
this.caseTypeId = jurisdiction.currentCaseType.id;
|
|
15298
|
-
}
|
|
15299
15286
|
}
|
|
15300
15287
|
//if we havent set the value of caseTypeId yet, we can check if its in the url. e.g. case-creation
|
|
15301
15288
|
if (!this.caseTypeId) {
|
|
@@ -35857,7 +35844,7 @@ class CaseFullAccessViewComponent {
|
|
|
35857
35844
|
const preferredLabel = FieldsUtils.defaultTabList?.[this.caseDetails?.case_type?.id];
|
|
35858
35845
|
let preSelectTab = null;
|
|
35859
35846
|
if (preferredLabel) {
|
|
35860
|
-
preSelectTab = this.caseDetails.tabs.find(
|
|
35847
|
+
preSelectTab = this.caseDetails.tabs.find(tab => (tab.label === preferredLabel) || (tab.id === preferredLabel)) ?? null;
|
|
35861
35848
|
}
|
|
35862
35849
|
// Fallback to first visible tab if no preferred label found
|
|
35863
35850
|
if (!preSelectTab) {
|
|
@@ -35866,7 +35853,7 @@ class CaseFullAccessViewComponent {
|
|
|
35866
35853
|
// If the preferred tab exists in caseDetails but is hidden (not rendered in tabGroup), fallback again
|
|
35867
35854
|
const renderedTabs = this.tabGroup?._tabs?.toArray?.() ?? [];
|
|
35868
35855
|
const preferredRendered = preSelectTab &&
|
|
35869
|
-
renderedTabs.some(
|
|
35856
|
+
renderedTabs.some(tab => tab.textLabel === preSelectTab.label || tab.textLabel?.toLowerCase() === preSelectTab.label?.toLowerCase());
|
|
35870
35857
|
if (!preferredRendered) {
|
|
35871
35858
|
// Default focus: keep natural first visible tab (do not change selectedIndex explicitly)
|
|
35872
35859
|
preSelectTab = this.findPreSelectedActiveTab();
|