@hmcts/ccd-case-ui-toolkit 7.2.54-3455-rc6 → 7.2.54-3455-rc8

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.
@@ -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, combineLatest, timer, forkJoin, fromEvent, Subscription } from 'rxjs';
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, take, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, first, takeUntil, filter } from 'rxjs/operators';
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.hourId());
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-'+ 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" }]
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: [{
@@ -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, caseNotifierService, jurisdictionService) {
7166
+ constructor(http, appConfig) {
7247
7167
  this.http = http;
7248
7168
  this.appConfig = appConfig;
7249
- this.caseNotifierService = caseNotifierService;
7250
- this.jurisdictionService = jurisdictionService;
7251
- combineLatest([
7252
- this.caseNotifierService.caseView.pipe(take(1)),
7253
- this.jurisdictionService.getSelectedJurisdiction()
7254
- ]).subscribe(([caseDetails, jurisdiction]) => {
7255
- if (caseDetails) {
7256
- this.caseTypeId = caseDetails?.case_type?.id;
7257
- }
7258
- if (jurisdiction) {
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), i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(JurisdictionService)); };
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 }, { type: CaseNotifier }, { type: JurisdictionService }], null); })();
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";
@@ -15318,20 +15305,20 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15318
15305
  }
15319
15306
  ngOnInit() {
15320
15307
  // Wait for both observables to emit at least once
15308
+ const currUrl = window.location.pathname;
15309
+ if (currUrl.includes('/case-details/')) {
15310
+ this.caseTypeId = currUrl.split('/')[4];
15311
+ }
15321
15312
  this.caseNotifierSubscription = combineLatest([
15322
15313
  this.caseNotifier.caseView.pipe(take(1)),
15323
15314
  this.jurisdictionService.getSelectedJurisdiction()
15324
15315
  ]).subscribe(([caseDetails, jurisdiction]) => {
15325
15316
  if (caseDetails) {
15326
- this.caseTypeId = caseDetails?.case_type?.id;
15327
15317
  this.jurisdictionId = caseDetails?.case_type?.jurisdiction?.id;
15328
15318
  this.caseId = caseDetails?.case_id;
15329
15319
  }
15330
15320
  if (jurisdiction) {
15331
15321
  this.jurisdictionId = jurisdiction.id;
15332
- if (jurisdiction.currentCaseType) {
15333
- this.caseTypeId = jurisdiction.currentCaseType.id;
15334
- }
15335
15322
  }
15336
15323
  //if we havent set the value of caseTypeId yet, we can check if its in the url. e.g. case-creation
15337
15324
  if (!this.caseTypeId) {