@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.
- package/esm2022/lib/shared/components/palette/document/write-document-field.component.mjs +5 -4
- package/esm2022/lib/shared/components/workbasket-filters/workbasket-filters.component.mjs +2 -8
- package/esm2022/lib/shared/services/document-management/document-management.service.mjs +11 -4
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +15 -13
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
- package/lib/shared/components/workbasket-filters/workbasket-filters.component.d.ts.map +1 -1
- package/lib/shared/services/document-management/document-management.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
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 =
|
|
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
|
|
15178
|
-
|
|
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
|
-
(
|
|
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) {
|