@hmcts/ccd-case-ui-toolkit 7.1.57-civil-multiple-client → 7.1.61-qm-task-management
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/case-viewer/services/case.resolver.mjs +8 -1
- package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +20 -59
- package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +3 -4
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +28 -61
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts +1 -0
- package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
- package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +0 -9
- package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
- package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +0 -1
- package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -20790,12 +20790,11 @@ class QueryManagementUtils {
|
|
|
20790
20790
|
static caseLevelCaseFieldId = 'CaseQueriesCollection';
|
|
20791
20791
|
static FIELD_TYPE_COLLECTION = 'Collection';
|
|
20792
20792
|
static FIELD_TYPE_COMPLEX = 'Complex';
|
|
20793
|
-
static DISPLAY_CONTEXT_READONLY = 'READONLY';
|
|
20794
20793
|
static extractCaseQueriesFromCaseField(caseField) {
|
|
20795
|
-
const { field_type, value
|
|
20794
|
+
const { field_type, value } = caseField;
|
|
20796
20795
|
// Handle Complex type fields
|
|
20797
20796
|
if (field_type.type === QueryManagementUtils.FIELD_TYPE_COMPLEX) {
|
|
20798
|
-
if (field_type.id === QueryManagementUtils.caseLevelCaseFieldId &&
|
|
20797
|
+
if (field_type.id === QueryManagementUtils.caseLevelCaseFieldId && QueryManagementUtils.isNonEmptyObject(value)) {
|
|
20799
20798
|
return value;
|
|
20800
20799
|
}
|
|
20801
20800
|
return null;
|
|
@@ -21067,9 +21066,6 @@ class QueryCheckYourAnswersComponent {
|
|
|
21067
21066
|
CASE_QUERIES_COLLECTION_ID = 'CaseQueriesCollection';
|
|
21068
21067
|
FIELD_TYPE_COMPLEX = 'Complex';
|
|
21069
21068
|
DISPLAY_CONTEXT_READONLY = 'READONLY';
|
|
21070
|
-
QM_SELECT_FIRST_COLLECTION = 'selectFirstCollection';
|
|
21071
|
-
QM_COLLECTION_PROMPT = 'promptQmCollection';
|
|
21072
|
-
CIVIL_JURISDICTION = 'CIVIL';
|
|
21073
21069
|
formGroup;
|
|
21074
21070
|
queryItem;
|
|
21075
21071
|
queryCreateContext;
|
|
@@ -21082,8 +21078,6 @@ class QueryCheckYourAnswersComponent {
|
|
|
21082
21078
|
tid;
|
|
21083
21079
|
createEventSubscription;
|
|
21084
21080
|
searchTasksSubscription;
|
|
21085
|
-
firstCollectionPicked = false; // Track whether the first collection has been picked
|
|
21086
|
-
firstCollectionOrder;
|
|
21087
21081
|
queryCreateContextEnum = QueryCreateContext;
|
|
21088
21082
|
eventCompletionParams;
|
|
21089
21083
|
caseQueriesCollections;
|
|
@@ -21120,11 +21114,13 @@ class QueryCheckYourAnswersComponent {
|
|
|
21120
21114
|
.subscribe({
|
|
21121
21115
|
next: (response) => {
|
|
21122
21116
|
// Filter task by query id
|
|
21123
|
-
if (this.tid
|
|
21124
|
-
|
|
21125
|
-
|
|
21126
|
-
|
|
21127
|
-
|
|
21117
|
+
if (this.tid) {
|
|
21118
|
+
if (response.tasks?.length > 1) {
|
|
21119
|
+
this.filteredTasks = response.tasks?.filter((task) => task.id === this.tid);
|
|
21120
|
+
}
|
|
21121
|
+
else {
|
|
21122
|
+
this.filteredTasks = response.tasks;
|
|
21123
|
+
}
|
|
21128
21124
|
}
|
|
21129
21125
|
},
|
|
21130
21126
|
error: (error) => {
|
|
@@ -21163,7 +21159,14 @@ class QueryCheckYourAnswersComponent {
|
|
|
21163
21159
|
});
|
|
21164
21160
|
}
|
|
21165
21161
|
else {
|
|
21166
|
-
console.error('Error: No task to complete found');
|
|
21162
|
+
console.error('Error: No task to complete was found');
|
|
21163
|
+
this.errorMessages = [
|
|
21164
|
+
{
|
|
21165
|
+
title: 'Error',
|
|
21166
|
+
description: 'No task to complete was found',
|
|
21167
|
+
fieldId: 'field-id'
|
|
21168
|
+
}
|
|
21169
|
+
];
|
|
21167
21170
|
}
|
|
21168
21171
|
}
|
|
21169
21172
|
else {
|
|
@@ -21278,17 +21281,10 @@ class QueryCheckYourAnswersComponent {
|
|
|
21278
21281
|
const messageId = this.route.snapshot.params.dataid;
|
|
21279
21282
|
// Check if the field_type matches CaseQueriesCollection and type is Complex
|
|
21280
21283
|
if (data.field_type.id === this.CASE_QUERIES_COLLECTION_ID && data.field_type.type === this.FIELD_TYPE_COMPLEX) {
|
|
21281
|
-
if (this.
|
|
21284
|
+
if (this.queryCreateContext === QueryCreateContext.NEW_QUERY && data.display_context !== this.DISPLAY_CONTEXT_READONLY) {
|
|
21285
|
+
this.fieldId = id;
|
|
21286
|
+
// TODO
|
|
21282
21287
|
//if number qmCaseQueriesCollection is more then filter out the right qmCaseQueriesCollection
|
|
21283
|
-
if (count > 1) {
|
|
21284
|
-
if (!this.handleMultipleCollections(data, id)) {
|
|
21285
|
-
return;
|
|
21286
|
-
}
|
|
21287
|
-
}
|
|
21288
|
-
else {
|
|
21289
|
-
// Set the field ID dynamically based on the extracted data
|
|
21290
|
-
this.fieldId = id; // Store the ID for use in generating newQueryData
|
|
21291
|
-
}
|
|
21292
21288
|
}
|
|
21293
21289
|
// If messageId is present, find the corresponding case message
|
|
21294
21290
|
this.setMessageFieldId(messageId, value, id);
|
|
@@ -21303,42 +21299,6 @@ class QueryCheckYourAnswersComponent {
|
|
|
21303
21299
|
}
|
|
21304
21300
|
}
|
|
21305
21301
|
}
|
|
21306
|
-
isNewQueryContext(data) {
|
|
21307
|
-
return this.queryCreateContext === QueryCreateContext.NEW_QUERY && data.display_context !== this.DISPLAY_CONTEXT_READONLY;
|
|
21308
|
-
}
|
|
21309
|
-
handleMultipleCollections(data, id) {
|
|
21310
|
-
const jurisdictionId = this.caseDetails?.case_type?.jurisdiction?.id;
|
|
21311
|
-
if (!jurisdictionId) {
|
|
21312
|
-
console.error('Jurisdiction ID is missing.');
|
|
21313
|
-
return false;
|
|
21314
|
-
}
|
|
21315
|
-
if (this.getCollectionSelectionMethod(jurisdictionId) === this.QM_SELECT_FIRST_COLLECTION) {
|
|
21316
|
-
const fieldOrder = this.getFieldOrderFromWizardPages(id);
|
|
21317
|
-
// Pick the collection with the lowest order
|
|
21318
|
-
if (fieldOrder !== undefined &&
|
|
21319
|
-
(this.firstCollectionOrder === undefined || fieldOrder < this.firstCollectionOrder)) {
|
|
21320
|
-
this.fieldId = id;
|
|
21321
|
-
this.firstCollectionOrder = fieldOrder;
|
|
21322
|
-
}
|
|
21323
|
-
}
|
|
21324
|
-
else {
|
|
21325
|
-
// Display Error, for now, until EXUI-2644 is implemented
|
|
21326
|
-
console.error(`Error: Multiple CaseQueriesCollections are not supported yet for the ${jurisdictionId} jurisdiction`);
|
|
21327
|
-
return false;
|
|
21328
|
-
}
|
|
21329
|
-
return true;
|
|
21330
|
-
}
|
|
21331
|
-
getFieldOrderFromWizardPages(fieldId) {
|
|
21332
|
-
const firstPageFields = this.eventData?.wizard_pages[0]?.wizard_page_fields;
|
|
21333
|
-
if (!firstPageFields) {
|
|
21334
|
-
return undefined;
|
|
21335
|
-
}
|
|
21336
|
-
const match = firstPageFields.find((field) => field.case_field_id === fieldId);
|
|
21337
|
-
return match?.order;
|
|
21338
|
-
}
|
|
21339
|
-
getCollectionSelectionMethod(jurisdiction) {
|
|
21340
|
-
return jurisdiction.toUpperCase() === this.CIVIL_JURISDICTION ? this.QM_SELECT_FIRST_COLLECTION : this.QM_COLLECTION_PROMPT;
|
|
21341
|
-
}
|
|
21342
21302
|
getDocumentAttachments() {
|
|
21343
21303
|
const attachmentsValue = this.formGroup.get('attachments').value;
|
|
21344
21304
|
if (attachmentsValue && attachmentsValue.length > 0) {
|
|
@@ -21431,7 +21391,7 @@ class QueryCheckYourAnswersComponent {
|
|
|
21431
21391
|
}], querySubmitted: [{
|
|
21432
21392
|
type: Output
|
|
21433
21393
|
}] }); })();
|
|
21434
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCheckYourAnswersComponent, { className: "QueryCheckYourAnswersComponent", filePath: "lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.ts", lineNumber:
|
|
21394
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCheckYourAnswersComponent, { className: "QueryCheckYourAnswersComponent", filePath: "lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.ts", lineNumber: 27 }); })();
|
|
21435
21395
|
|
|
21436
21396
|
function QueryDetailsComponent_ng_container_0_cut_alert_1_Template(rf, ctx) { if (rf & 1) {
|
|
21437
21397
|
i0.ɵɵelementStart(0, "cut-alert", 11);
|
|
@@ -33491,6 +33451,7 @@ class CaseResolver {
|
|
|
33491
33451
|
static EVENT_REGEX = new RegExp('\/trigger\/.*?\/submit$');
|
|
33492
33452
|
static PARAM_CASE_ID = 'cid';
|
|
33493
33453
|
static CASE_CREATED_MSG = 'The case has been created successfully';
|
|
33454
|
+
static EVENT_ID_QM_RESPOND_TO_QUERY = 'eventId=queryManagementRespondQuery';
|
|
33494
33455
|
static defaultWAPage = '/work/my-work/list';
|
|
33495
33456
|
static defaultPage = '/cases';
|
|
33496
33457
|
// we need to run the CaseResolver on every child route of 'case/:jid/:ctid/:cid'
|
|
@@ -33511,6 +33472,12 @@ class CaseResolver {
|
|
|
33511
33472
|
}
|
|
33512
33473
|
resolve(route) {
|
|
33513
33474
|
const cid = route.paramMap.get(CaseResolver.PARAM_CASE_ID);
|
|
33475
|
+
const currentUrl = this.router.url ?? '';
|
|
33476
|
+
// Prevent resolving if eventId=queryManagementRespondQuery is in the URL
|
|
33477
|
+
if (currentUrl.includes(CaseResolver.EVENT_ID_QM_RESPOND_TO_QUERY)) {
|
|
33478
|
+
console.info('Skipping resolve for event queryManagementRespondQuery.');
|
|
33479
|
+
this.goToDefaultPage();
|
|
33480
|
+
}
|
|
33514
33481
|
if (!cid) {
|
|
33515
33482
|
console.info('No case ID available in the route. Will navigate to case list.');
|
|
33516
33483
|
// when redirected to case view after a case created, and the user has no READ access,
|