@hmcts/ccd-case-ui-toolkit 7.2.13-rc1 → 7.2.13-simplify-cdam-logic

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.
@@ -7273,9 +7273,16 @@ class DocumentManagementService {
7273
7273
  const documentSecureModeCaseTypeExclusions = this.appConfig.getCdamExclusionList()?.split(',');
7274
7274
  const isDocumentOnExclusionList = documentSecureModeCaseTypeExclusions?.includes(this.caseTypeId);
7275
7275
  const documentSecureModeEnabled = this.appConfig.getDocumentSecureMode();
7276
- return (documentSecureModeEnabled && !isDocumentOnExclusionList)
7277
- ? this.appConfig.getDocumentManagementUrlV2()
7278
- : this.appConfig.getDocumentManagementUrl();
7276
+ // if the documentSecureModeEnabled is false, return docV1 endpoint
7277
+ if (!documentSecureModeEnabled) {
7278
+ return this.appConfig.getDocumentManagementUrl();
7279
+ }
7280
+ // if the documentSecureModeEnabled is true, and the case is not in the exclusion list, return docV2 endpoint
7281
+ if (documentSecureModeEnabled && !isDocumentOnExclusionList) {
7282
+ return this.appConfig.getDocumentManagementUrlV2();
7283
+ }
7284
+ // if documentSecureModeEnabled is true, and case is in the exclusion list, return docV1 endpoint
7285
+ return this.appConfig.getDocumentManagementUrl();
7279
7286
  }
7280
7287
  static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(JurisdictionService)); };
7281
7288
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DocumentManagementService, factory: DocumentManagementService.ɵfac });
@@ -15137,7 +15144,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15137
15144
  jurisdictionId;
15138
15145
  caseTypeId;
15139
15146
  caseTypeExclusions;
15140
- fileSecureModeOn = true;
15147
+ fileSecureModeOn = false;
15141
15148
  constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
15142
15149
  super();
15143
15150
  this.appConfig = appConfig;
@@ -15174,8 +15181,9 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15174
15181
  this.caseTypeId = parts[parts.indexOf('case-create') + 2];
15175
15182
  }
15176
15183
  }
15177
- if (this.secureModeOn && this.caseTypeExclusions.split(',').includes(this.caseTypeId)) {
15178
- this.fileSecureModeOn = false;
15184
+ // if the secure mode LD flag is true we should set fileSecureModeOn to false if the caseTypeId is in the exclusion list
15185
+ if (this.secureModeOn && !this.caseTypeExclusions.split(',').includes(this.caseTypeId)) {
15186
+ this.fileSecureModeOn = true;
15179
15187
  }
15180
15188
  this.dialogConfig = initDialog();
15181
15189
  let document = this.caseField.value || { document_url: null, document_binary_url: null, document_filename: null };
@@ -32803,13 +32811,7 @@ class WorkbasketFiltersComponent {
32803
32811
  this.windowService = windowService;
32804
32812
  }
32805
32813
  scrollToTop() {
32806
- (function smoothscroll() {
32807
- const currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
32808
- if (currentScroll > 0) {
32809
- window.requestAnimationFrame(smoothscroll);
32810
- window.scrollTo(0, currentScroll - (currentScroll / 8));
32811
- }
32812
- })();
32814
+ window.scrollTo({ top: 0, behavior: 'smooth' });
32813
32815
  }
32814
32816
  getDefaultJurisdiction() {
32815
32817
  if (!this.jurisdictions || this.jurisdictions.length === 0) {