@hmcts/ccd-case-ui-toolkit 7.3.1-minute-accessibility → 7.3.1
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 +100 -113
- 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.hourId());
|
|
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-'+ hourId()\">{{'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: [{
|
|
@@ -7145,89 +7145,9 @@ class ReadCookieService {
|
|
|
7145
7145
|
args: [DOCUMENT]
|
|
7146
7146
|
}] }], null); })();
|
|
7147
7147
|
|
|
7148
|
-
class CaseNotifier {
|
|
7149
|
-
casesService;
|
|
7150
|
-
static CASE_NAME = 'caseNameHmctsInternal';
|
|
7151
|
-
static CASE_LOCATION = 'caseManagementLocation';
|
|
7152
|
-
caseViewSource = new BehaviorSubject(new CaseView());
|
|
7153
|
-
caseView = this.caseViewSource.asObservable();
|
|
7154
|
-
cachedCaseView;
|
|
7155
|
-
constructor(casesService) {
|
|
7156
|
-
this.casesService = casesService;
|
|
7157
|
-
}
|
|
7158
|
-
removeCachedCase() {
|
|
7159
|
-
this.cachedCaseView = null;
|
|
7160
|
-
}
|
|
7161
|
-
announceCase(c) {
|
|
7162
|
-
this.caseViewSource.next(c);
|
|
7163
|
-
}
|
|
7164
|
-
fetchAndRefresh(cid) {
|
|
7165
|
-
return this.casesService
|
|
7166
|
-
.getCaseViewV2(cid)
|
|
7167
|
-
.pipe(map(caseView => {
|
|
7168
|
-
this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
7169
|
-
this.setBasicFields(this.cachedCaseView.tabs);
|
|
7170
|
-
this.announceCase(this.cachedCaseView);
|
|
7171
|
-
return this.cachedCaseView;
|
|
7172
|
-
}));
|
|
7173
|
-
}
|
|
7174
|
-
setBasicFields(tabs) {
|
|
7175
|
-
tabs.forEach((t) => {
|
|
7176
|
-
const caseName = t.fields.find(f => f.id === CaseNotifier.CASE_NAME);
|
|
7177
|
-
const caseLocation = t.fields.find(f => f.id === CaseNotifier.CASE_LOCATION);
|
|
7178
|
-
if (caseName || caseLocation) {
|
|
7179
|
-
this.cachedCaseView.basicFields = {
|
|
7180
|
-
caseNameHmctsInternal: caseName ? caseName.value : null,
|
|
7181
|
-
caseManagementLocation: caseLocation ? caseLocation.value : null
|
|
7182
|
-
};
|
|
7183
|
-
}
|
|
7184
|
-
});
|
|
7185
|
-
}
|
|
7186
|
-
static ɵfac = function CaseNotifier_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseNotifier)(i0.ɵɵinject(CasesService)); };
|
|
7187
|
-
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseNotifier, factory: CaseNotifier.ɵfac });
|
|
7188
|
-
}
|
|
7189
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseNotifier, [{
|
|
7190
|
-
type: Injectable
|
|
7191
|
-
}], () => [{ type: CasesService }], null); })();
|
|
7192
|
-
|
|
7193
|
-
class JurisdictionService {
|
|
7194
|
-
httpService;
|
|
7195
|
-
// We retain the Subject observable because subscribing code couldn't happen a null value
|
|
7196
|
-
selectedJurisdictionSource = new Subject();
|
|
7197
|
-
_selectedJurisdictionBS = new BehaviorSubject(null);
|
|
7198
|
-
selectedJurisdiction;
|
|
7199
|
-
constructor(httpService) {
|
|
7200
|
-
this.httpService = httpService;
|
|
7201
|
-
this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
|
|
7202
|
-
}
|
|
7203
|
-
getJurisdictions() {
|
|
7204
|
-
return this.httpService.get('/aggregated/caseworkers/:uid/jurisdictions?access=read');
|
|
7205
|
-
}
|
|
7206
|
-
announceSelectedJurisdiction(jurisdiction) {
|
|
7207
|
-
this.selectedJurisdictionSource.next(jurisdiction);
|
|
7208
|
-
this._selectedJurisdictionBS.next(jurisdiction);
|
|
7209
|
-
}
|
|
7210
|
-
getSelectedJurisdiction() {
|
|
7211
|
-
return this._selectedJurisdictionBS;
|
|
7212
|
-
}
|
|
7213
|
-
searchJudicialUsers(searchTerm, serviceId) {
|
|
7214
|
-
return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
|
|
7215
|
-
}
|
|
7216
|
-
searchJudicialUsersByPersonalCodes(personalCodes) {
|
|
7217
|
-
return this.httpService.post('api/prd/judicial/searchJudicialUserByPersonalCodes', { personal_code: personalCodes });
|
|
7218
|
-
}
|
|
7219
|
-
static ɵfac = function JurisdictionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JurisdictionService)(i0.ɵɵinject(HttpService)); };
|
|
7220
|
-
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: JurisdictionService, factory: JurisdictionService.ɵfac });
|
|
7221
|
-
}
|
|
7222
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService, [{
|
|
7223
|
-
type: Injectable
|
|
7224
|
-
}], () => [{ type: HttpService }], null); })();
|
|
7225
|
-
|
|
7226
7148
|
class DocumentManagementService {
|
|
7227
7149
|
http;
|
|
7228
7150
|
appConfig;
|
|
7229
|
-
caseNotifierService;
|
|
7230
|
-
jurisdictionService;
|
|
7231
7151
|
static PDF = 'pdf';
|
|
7232
7152
|
static IMAGE = 'image';
|
|
7233
7153
|
static WORD = 'word';
|
|
@@ -7243,32 +7163,21 @@ class DocumentManagementService {
|
|
|
7243
7163
|
static excelList = ['XLS', 'XLSX', 'xls', 'xlsx'];
|
|
7244
7164
|
static powerpointList = ['PPT', 'PPTX', 'ppt', 'pptx'];
|
|
7245
7165
|
caseTypeId = '';
|
|
7246
|
-
constructor(http, appConfig
|
|
7166
|
+
constructor(http, appConfig) {
|
|
7247
7167
|
this.http = http;
|
|
7248
7168
|
this.appConfig = appConfig;
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
if (jurisdiction.currentCaseType) {
|
|
7260
|
-
this.caseTypeId = jurisdiction.currentCaseType.id;
|
|
7261
|
-
}
|
|
7262
|
-
}
|
|
7263
|
-
//if the user refreshes on the case creation page the above logic will not work, we can get the caseTypeId from the URL
|
|
7264
|
-
if (!this.caseTypeId) {
|
|
7265
|
-
const url = window.location.pathname;
|
|
7266
|
-
if (url.indexOf('/case-create/') > -1) {
|
|
7267
|
-
const parts = url.split('/');
|
|
7268
|
-
this.caseTypeId = parts[parts.indexOf('case-create') + 2];
|
|
7269
|
-
}
|
|
7169
|
+
const currUrl = window.location.pathname;
|
|
7170
|
+
if (currUrl.includes('/case-details/')) {
|
|
7171
|
+
this.caseTypeId = currUrl.split('/')[4];
|
|
7172
|
+
}
|
|
7173
|
+
console.log(this.caseTypeId);
|
|
7174
|
+
//if the user refreshes on the case creation page the above logic will not work, we can get the caseTypeId from the URL
|
|
7175
|
+
if (!this.caseTypeId) {
|
|
7176
|
+
if (currUrl.indexOf('/case-create/') > -1) {
|
|
7177
|
+
const parts = currUrl.split('/');
|
|
7178
|
+
this.caseTypeId = parts[parts.indexOf('case-create') + 2];
|
|
7270
7179
|
}
|
|
7271
|
-
}
|
|
7180
|
+
}
|
|
7272
7181
|
}
|
|
7273
7182
|
uploadFile(formData) {
|
|
7274
7183
|
const url = this.getDocStoreUrl();
|
|
@@ -7363,12 +7272,12 @@ class DocumentManagementService {
|
|
|
7363
7272
|
// if documentSecureModeEnabled is true, and case is in the exclusion list, return false
|
|
7364
7273
|
return false;
|
|
7365
7274
|
}
|
|
7366
|
-
static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig)
|
|
7275
|
+
static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig)); };
|
|
7367
7276
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DocumentManagementService, factory: DocumentManagementService.ɵfac });
|
|
7368
7277
|
}
|
|
7369
7278
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DocumentManagementService, [{
|
|
7370
7279
|
type: Injectable
|
|
7371
|
-
}], () => [{ type: HttpService }, { type: AbstractAppConfig }
|
|
7280
|
+
}], () => [{ type: HttpService }, { type: AbstractAppConfig }], null); })();
|
|
7372
7281
|
|
|
7373
7282
|
class ErrorNotifierService {
|
|
7374
7283
|
errorSource = new BehaviorSubject(null);
|
|
@@ -7560,6 +7469,39 @@ class MultipageComponentStateService {
|
|
|
7560
7469
|
}]
|
|
7561
7470
|
}], null, null); })();
|
|
7562
7471
|
|
|
7472
|
+
class JurisdictionService {
|
|
7473
|
+
httpService;
|
|
7474
|
+
// We retain the Subject observable because subscribing code couldn't happen a null value
|
|
7475
|
+
selectedJurisdictionSource = new Subject();
|
|
7476
|
+
_selectedJurisdictionBS = new BehaviorSubject(null);
|
|
7477
|
+
selectedJurisdiction;
|
|
7478
|
+
constructor(httpService) {
|
|
7479
|
+
this.httpService = httpService;
|
|
7480
|
+
this.selectedJurisdiction = this.selectedJurisdictionSource.asObservable();
|
|
7481
|
+
}
|
|
7482
|
+
getJurisdictions() {
|
|
7483
|
+
return this.httpService.get('/aggregated/caseworkers/:uid/jurisdictions?access=read');
|
|
7484
|
+
}
|
|
7485
|
+
announceSelectedJurisdiction(jurisdiction) {
|
|
7486
|
+
this.selectedJurisdictionSource.next(jurisdiction);
|
|
7487
|
+
this._selectedJurisdictionBS.next(jurisdiction);
|
|
7488
|
+
}
|
|
7489
|
+
getSelectedJurisdiction() {
|
|
7490
|
+
return this._selectedJurisdictionBS;
|
|
7491
|
+
}
|
|
7492
|
+
searchJudicialUsers(searchTerm, serviceId) {
|
|
7493
|
+
return this.httpService.post('api/prd/judicial/getJudicialUsersSearch', { searchString: searchTerm, serviceCode: serviceId });
|
|
7494
|
+
}
|
|
7495
|
+
searchJudicialUsersByPersonalCodes(personalCodes) {
|
|
7496
|
+
return this.httpService.post('api/prd/judicial/searchJudicialUserByPersonalCodes', { personal_code: personalCodes });
|
|
7497
|
+
}
|
|
7498
|
+
static ɵfac = function JurisdictionService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JurisdictionService)(i0.ɵɵinject(HttpService)); };
|
|
7499
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: JurisdictionService, factory: JurisdictionService.ɵfac });
|
|
7500
|
+
}
|
|
7501
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService, [{
|
|
7502
|
+
type: Injectable
|
|
7503
|
+
}], () => [{ type: HttpService }], null); })();
|
|
7504
|
+
|
|
7563
7505
|
class BannersService {
|
|
7564
7506
|
httpService;
|
|
7565
7507
|
appConfig;
|
|
@@ -8679,6 +8621,51 @@ class CaseworkerService {
|
|
|
8679
8621
|
type: Injectable
|
|
8680
8622
|
}], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }], null); })();
|
|
8681
8623
|
|
|
8624
|
+
class CaseNotifier {
|
|
8625
|
+
casesService;
|
|
8626
|
+
static CASE_NAME = 'caseNameHmctsInternal';
|
|
8627
|
+
static CASE_LOCATION = 'caseManagementLocation';
|
|
8628
|
+
caseViewSource = new BehaviorSubject(new CaseView());
|
|
8629
|
+
caseView = this.caseViewSource.asObservable();
|
|
8630
|
+
cachedCaseView;
|
|
8631
|
+
constructor(casesService) {
|
|
8632
|
+
this.casesService = casesService;
|
|
8633
|
+
}
|
|
8634
|
+
removeCachedCase() {
|
|
8635
|
+
this.cachedCaseView = null;
|
|
8636
|
+
}
|
|
8637
|
+
announceCase(c) {
|
|
8638
|
+
this.caseViewSource.next(c);
|
|
8639
|
+
}
|
|
8640
|
+
fetchAndRefresh(cid) {
|
|
8641
|
+
return this.casesService
|
|
8642
|
+
.getCaseViewV2(cid)
|
|
8643
|
+
.pipe(map(caseView => {
|
|
8644
|
+
this.cachedCaseView = plainToClassFromExist(new CaseView(), caseView);
|
|
8645
|
+
this.setBasicFields(this.cachedCaseView.tabs);
|
|
8646
|
+
this.announceCase(this.cachedCaseView);
|
|
8647
|
+
return this.cachedCaseView;
|
|
8648
|
+
}));
|
|
8649
|
+
}
|
|
8650
|
+
setBasicFields(tabs) {
|
|
8651
|
+
tabs.forEach((t) => {
|
|
8652
|
+
const caseName = t.fields.find(f => f.id === CaseNotifier.CASE_NAME);
|
|
8653
|
+
const caseLocation = t.fields.find(f => f.id === CaseNotifier.CASE_LOCATION);
|
|
8654
|
+
if (caseName || caseLocation) {
|
|
8655
|
+
this.cachedCaseView.basicFields = {
|
|
8656
|
+
caseNameHmctsInternal: caseName ? caseName.value : null,
|
|
8657
|
+
caseManagementLocation: caseLocation ? caseLocation.value : null
|
|
8658
|
+
};
|
|
8659
|
+
}
|
|
8660
|
+
});
|
|
8661
|
+
}
|
|
8662
|
+
static ɵfac = function CaseNotifier_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseNotifier)(i0.ɵɵinject(CasesService)); };
|
|
8663
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseNotifier, factory: CaseNotifier.ɵfac });
|
|
8664
|
+
}
|
|
8665
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseNotifier, [{
|
|
8666
|
+
type: Injectable
|
|
8667
|
+
}], () => [{ type: CasesService }], null); })();
|
|
8668
|
+
|
|
8682
8669
|
var Permissions;
|
|
8683
8670
|
(function (Permissions) {
|
|
8684
8671
|
Permissions["Own"] = "OWN";
|
|
@@ -15279,20 +15266,20 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
|
|
|
15279
15266
|
}
|
|
15280
15267
|
ngOnInit() {
|
|
15281
15268
|
// Wait for both observables to emit at least once
|
|
15269
|
+
const currUrl = window.location.pathname;
|
|
15270
|
+
if (currUrl.includes('/case-details/')) {
|
|
15271
|
+
this.caseTypeId = currUrl.split('/')[4];
|
|
15272
|
+
}
|
|
15282
15273
|
this.caseNotifierSubscription = combineLatest([
|
|
15283
15274
|
this.caseNotifier.caseView.pipe(take(1)),
|
|
15284
15275
|
this.jurisdictionService.getSelectedJurisdiction()
|
|
15285
15276
|
]).subscribe(([caseDetails, jurisdiction]) => {
|
|
15286
15277
|
if (caseDetails) {
|
|
15287
|
-
this.caseTypeId = caseDetails?.case_type?.id;
|
|
15288
15278
|
this.jurisdictionId = caseDetails?.case_type?.jurisdiction?.id;
|
|
15289
15279
|
this.caseId = caseDetails?.case_id;
|
|
15290
15280
|
}
|
|
15291
15281
|
if (jurisdiction) {
|
|
15292
15282
|
this.jurisdictionId = jurisdiction.id;
|
|
15293
|
-
if (jurisdiction.currentCaseType) {
|
|
15294
|
-
this.caseTypeId = jurisdiction.currentCaseType.id;
|
|
15295
|
-
}
|
|
15296
15283
|
}
|
|
15297
15284
|
//if we havent set the value of caseTypeId yet, we can check if its in the url. e.g. case-creation
|
|
15298
15285
|
if (!this.caseTypeId) {
|