@hmcts/ccd-case-ui-toolkit 7.1.7-query-management-caseQueriesCollection-workaround → 7.1.8-query-management-cqc-workaround
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/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +2 -2
- package/esm2022/lib/shared/components/palette/query-management/components/query-details/query-details.component.mjs +38 -45
- package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +23 -14
- package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +12 -7
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +68 -64
- package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +3 -1
- package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
- package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +1 -0
- package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
- package/package.json +1 -1
package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import moment from 'moment';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export class QueryManagementUtils {
|
|
5
6
|
static caseLevelCaseFieldId = 'CaseQueriesCollection';
|
|
@@ -26,13 +27,13 @@ export class QueryManagementUtils {
|
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
static getNewQueryData(formGroup, currentUserDetails) {
|
|
29
|
-
const currentUserId = currentUserDetails?.uid;
|
|
30
|
-
const currentUserName = currentUserDetails?.name
|
|
30
|
+
const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
|
|
31
|
+
const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
|
|
31
32
|
const subject = formGroup.get('subject').value;
|
|
32
33
|
const body = formGroup.get('body').value;
|
|
33
34
|
const isHearingRelated = formGroup.get('isHearingRelated').value ? 'Yes' : 'No';
|
|
34
|
-
const hearingDate = isHearingRelated
|
|
35
|
-
? formGroup.get('hearingDate').value
|
|
35
|
+
const hearingDate = (isHearingRelated === 'Yes')
|
|
36
|
+
? this.formattedDate(formGroup.get('hearingDate').value)
|
|
36
37
|
: null;
|
|
37
38
|
const attachments = formGroup.get('attachments').value;
|
|
38
39
|
return {
|
|
@@ -48,8 +49,8 @@ export class QueryManagementUtils {
|
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
|
|
51
|
-
const currentUserId = currentUserDetails?.uid;
|
|
52
|
-
const currentUserName = currentUserDetails?.name
|
|
52
|
+
const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
|
|
53
|
+
const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
|
|
53
54
|
const body = formGroup.get('body').value;
|
|
54
55
|
const attachments = formGroup.get('attachments').value;
|
|
55
56
|
queryItem.isHearingRelated = queryItem.isHearingRelated ? 'Yes' : 'No';
|
|
@@ -72,10 +73,14 @@ export class QueryManagementUtils {
|
|
|
72
73
|
static isNonEmptyObject(elem) {
|
|
73
74
|
return this.isObject(elem) && Object.keys(elem).length !== 0;
|
|
74
75
|
}
|
|
76
|
+
static formattedDate(date) {
|
|
77
|
+
const formattedDate = moment(date).format('YYYY-MM-DD');
|
|
78
|
+
return formattedDate;
|
|
79
|
+
}
|
|
75
80
|
static ɵfac = function QueryManagementUtils_Factory(t) { return new (t || QueryManagementUtils)(); };
|
|
76
81
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
|
|
77
82
|
}
|
|
78
83
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryManagementUtils, [{
|
|
79
84
|
type: Injectable
|
|
80
85
|
}], null, null); })();
|
|
81
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
86
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnktbWFuYWdlbWVudC51dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZC1jYXNlLXVpLXRvb2xraXQvc3JjL2xpYi9zaGFyZWQvY29tcG9uZW50cy9wYWxldHRlL3F1ZXJ5LW1hbmFnZW1lbnQvdXRpbHMvcXVlcnktbWFuYWdlbWVudC51dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBSTNDLE9BQU8sRUFBRSxFQUFFLElBQUksTUFBTSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQ3BDLE9BQU8sTUFBTSxNQUFNLFFBQVEsQ0FBQzs7QUFHNUIsTUFBTSxPQUFPLG9CQUFvQjtJQUN2QixNQUFNLENBQVUsb0JBQW9CLEdBQUcsdUJBQXVCLENBQUM7SUFDaEUsTUFBTSxDQUFVLHFCQUFxQixHQUFHLFlBQVksQ0FBQztJQUNyRCxNQUFNLENBQVUsa0JBQWtCLEdBQUcsU0FBUyxDQUFDO0lBRS9DLE1BQU0sQ0FBQywrQkFBK0IsQ0FBQyxTQUFvQjtRQUNoRSxNQUFNLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxHQUFHLFNBQVMsQ0FBQztRQUV4Qyw2QkFBNkI7UUFDN0IsSUFBSSxVQUFVLENBQUMsSUFBSSxLQUFLLG9CQUFvQixDQUFDLGtCQUFrQixFQUFFLENBQUM7WUFDaEUsSUFBSSxVQUFVLENBQUMsRUFBRSxL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nICYmIGVsZW0gIT09IG51bGw7XG4gIH1cblxuICBwdWJsaWMgc3RhdGljIGlzTm9uRW1wdHlPYmplY3QoZWxlbTogYW55KTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHRoaXMuaXNPYmplY3QoZWxlbSkgJiYgT2JqZWN0LmtleXMoZWxlbSkubGVuZ3RoICE9PSAwO1xuICB9XG5cbiAgcHJpdmF0ZSBzdGF0aWMgZm9ybWF0dGVkRGF0ZShkYXRlKTogc3RyaW5nIHtcbiAgICBjb25zdCBmb3JtYXR0ZWREYXRlID0gbW9tZW50KGRhdGUpLmZvcm1hdCgnWVlZWS1NTS1ERCcpO1xuICAgIHJldHVybiBmb3JtYXR0ZWREYXRlO1xuICB9XG59XG4iXX0=
|
|
@@ -19674,13 +19674,13 @@ class QueryManagementUtils {
|
|
|
19674
19674
|
};
|
|
19675
19675
|
}
|
|
19676
19676
|
static getNewQueryData(formGroup, currentUserDetails) {
|
|
19677
|
-
const currentUserId = currentUserDetails?.uid;
|
|
19678
|
-
const currentUserName = currentUserDetails?.name
|
|
19677
|
+
const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
|
|
19678
|
+
const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
|
|
19679
19679
|
const subject = formGroup.get('subject').value;
|
|
19680
19680
|
const body = formGroup.get('body').value;
|
|
19681
19681
|
const isHearingRelated = formGroup.get('isHearingRelated').value ? 'Yes' : 'No';
|
|
19682
|
-
const hearingDate = isHearingRelated
|
|
19683
|
-
? formGroup.get('hearingDate').value
|
|
19682
|
+
const hearingDate = (isHearingRelated === 'Yes')
|
|
19683
|
+
? this.formattedDate(formGroup.get('hearingDate').value)
|
|
19684
19684
|
: null;
|
|
19685
19685
|
const attachments = formGroup.get('attachments').value;
|
|
19686
19686
|
return {
|
|
@@ -19696,8 +19696,8 @@ class QueryManagementUtils {
|
|
|
19696
19696
|
};
|
|
19697
19697
|
}
|
|
19698
19698
|
static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
|
|
19699
|
-
const currentUserId = currentUserDetails?.uid;
|
|
19700
|
-
const currentUserName = currentUserDetails?.name
|
|
19699
|
+
const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
|
|
19700
|
+
const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
|
|
19701
19701
|
const body = formGroup.get('body').value;
|
|
19702
19702
|
const attachments = formGroup.get('attachments').value;
|
|
19703
19703
|
queryItem.isHearingRelated = queryItem.isHearingRelated ? 'Yes' : 'No';
|
|
@@ -19720,6 +19720,10 @@ class QueryManagementUtils {
|
|
|
19720
19720
|
static isNonEmptyObject(elem) {
|
|
19721
19721
|
return this.isObject(elem) && Object.keys(elem).length !== 0;
|
|
19722
19722
|
}
|
|
19723
|
+
static formattedDate(date) {
|
|
19724
|
+
const formattedDate = moment(date).format('YYYY-MM-DD');
|
|
19725
|
+
return formattedDate;
|
|
19726
|
+
}
|
|
19723
19727
|
static ɵfac = function QueryManagementUtils_Factory(t) { return new (t || QueryManagementUtils)(); };
|
|
19724
19728
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
|
|
19725
19729
|
}
|
|
@@ -20145,7 +20149,7 @@ class QueryCheckYourAnswersComponent {
|
|
|
20145
20149
|
this.errorMessages = [
|
|
20146
20150
|
{
|
|
20147
20151
|
title: 'Error',
|
|
20148
|
-
description: '
|
|
20152
|
+
description: 'This case is not configured for query management.',
|
|
20149
20153
|
fieldId: 'field-id'
|
|
20150
20154
|
}
|
|
20151
20155
|
];
|
|
@@ -20496,80 +20500,73 @@ function QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_
|
|
|
20496
20500
|
i0.ɵɵadvance(3);
|
|
20497
20501
|
i0.ɵɵproperty("ngIf", child_r3.attachments);
|
|
20498
20502
|
} }
|
|
20499
|
-
function
|
|
20503
|
+
function QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_template_2_ccd_query_attachments_read_31_Template(rf, ctx) { if (rf & 1) {
|
|
20500
20504
|
i0.ɵɵelement(0, "ccd-query-attachments-read", 12);
|
|
20501
20505
|
} if (rf & 2) {
|
|
20502
20506
|
const child_r3 = i0.ɵɵnextContext(2).$implicit;
|
|
20503
20507
|
i0.ɵɵproperty("attachments", child_r3.attachments);
|
|
20504
20508
|
} }
|
|
20505
20509
|
function QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
20506
|
-
i0.ɵɵelementStart(0, "
|
|
20507
|
-
i0.ɵɵ
|
|
20508
|
-
i0.ɵɵ
|
|
20509
|
-
i0.ɵɵ
|
|
20510
|
-
i0.ɵɵ
|
|
20511
|
-
i0.ɵɵpipe(4, "rpxTranslate");
|
|
20512
|
-
i0.ɵɵelementStart(5, "caption", 4)(6, "div");
|
|
20513
|
-
i0.ɵɵtext(7);
|
|
20514
|
-
i0.ɵɵpipe(8, "rpxTranslate");
|
|
20510
|
+
i0.ɵɵelementStart(0, "table", 3);
|
|
20511
|
+
i0.ɵɵpipe(1, "rpxTranslate");
|
|
20512
|
+
i0.ɵɵelementStart(2, "caption", 4)(3, "div");
|
|
20513
|
+
i0.ɵɵtext(4);
|
|
20514
|
+
i0.ɵɵpipe(5, "rpxTranslate");
|
|
20515
20515
|
i0.ɵɵelementEnd()();
|
|
20516
|
-
i0.ɵɵelementStart(
|
|
20517
|
-
i0.ɵɵtext(
|
|
20518
|
-
i0.ɵɵpipe(
|
|
20516
|
+
i0.ɵɵelementStart(6, "tbody", 5)(7, "tr", 6)(8, "th", 7);
|
|
20517
|
+
i0.ɵɵtext(9);
|
|
20518
|
+
i0.ɵɵpipe(10, "rpxTranslate");
|
|
20519
20519
|
i0.ɵɵelementEnd();
|
|
20520
|
-
i0.ɵɵelementStart(
|
|
20521
|
-
i0.ɵɵtext(
|
|
20522
|
-
i0.ɵɵpipe(
|
|
20520
|
+
i0.ɵɵelementStart(11, "td", 8);
|
|
20521
|
+
i0.ɵɵtext(12);
|
|
20522
|
+
i0.ɵɵpipe(13, "date");
|
|
20523
20523
|
i0.ɵɵelementEnd()();
|
|
20524
|
-
i0.ɵɵelementStart(
|
|
20525
|
-
i0.ɵɵtext(
|
|
20526
|
-
i0.ɵɵpipe(
|
|
20524
|
+
i0.ɵɵelementStart(14, "tr", 6)(15, "th", 7);
|
|
20525
|
+
i0.ɵɵtext(16);
|
|
20526
|
+
i0.ɵɵpipe(17, "rpxTranslate");
|
|
20527
20527
|
i0.ɵɵelementEnd();
|
|
20528
|
-
i0.ɵɵelementStart(
|
|
20529
|
-
i0.ɵɵtext(
|
|
20528
|
+
i0.ɵɵelementStart(18, "td", 8);
|
|
20529
|
+
i0.ɵɵtext(19);
|
|
20530
20530
|
i0.ɵɵelementEnd()();
|
|
20531
|
-
i0.ɵɵelementStart(
|
|
20532
|
-
i0.ɵɵtext(
|
|
20533
|
-
i0.ɵɵpipe(
|
|
20531
|
+
i0.ɵɵelementStart(20, "tr", 6)(21, "th", 7);
|
|
20532
|
+
i0.ɵɵtext(22);
|
|
20533
|
+
i0.ɵɵpipe(23, "rpxTranslate");
|
|
20534
20534
|
i0.ɵɵelementEnd();
|
|
20535
|
-
i0.ɵɵelementStart(
|
|
20536
|
-
i0.ɵɵtext(
|
|
20535
|
+
i0.ɵɵelementStart(24, "td", 8);
|
|
20536
|
+
i0.ɵɵtext(25);
|
|
20537
20537
|
i0.ɵɵelementEnd()();
|
|
20538
|
-
i0.ɵɵelementStart(
|
|
20539
|
-
i0.ɵɵtext(
|
|
20540
|
-
i0.ɵɵpipe(
|
|
20538
|
+
i0.ɵɵelementStart(26, "tr", 6)(27, "th", 7);
|
|
20539
|
+
i0.ɵɵtext(28);
|
|
20540
|
+
i0.ɵɵpipe(29, "rpxTranslate");
|
|
20541
20541
|
i0.ɵɵelementEnd();
|
|
20542
|
-
i0.ɵɵelementStart(
|
|
20543
|
-
i0.ɵɵtemplate(
|
|
20542
|
+
i0.ɵɵelementStart(30, "td", 8);
|
|
20543
|
+
i0.ɵɵtemplate(31, QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_template_2_ccd_query_attachments_read_31_Template, 1, 1, "ccd-query-attachments-read", 10);
|
|
20544
20544
|
i0.ɵɵelementEnd()()()();
|
|
20545
20545
|
} if (rf & 2) {
|
|
20546
20546
|
const child_r3 = i0.ɵɵnextContext().$implicit;
|
|
20547
|
-
i0.ɵɵ
|
|
20548
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 11, "Follow-up"));
|
|
20549
|
-
i0.ɵɵadvance(2);
|
|
20550
|
-
i0.ɵɵattribute("aria-describedby", i0.ɵɵpipeBind1(4, 13, "Follow-up of the response"));
|
|
20547
|
+
i0.ɵɵattribute("aria-describedby", i0.ɵɵpipeBind1(1, 10, "Follow-up of the response"));
|
|
20551
20548
|
i0.ɵɵadvance(4);
|
|
20552
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(
|
|
20549
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 12, "Follow up query"));
|
|
20553
20550
|
i0.ɵɵadvance(5);
|
|
20554
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(
|
|
20551
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 14, "Last submission date"));
|
|
20555
20552
|
i0.ɵɵadvance(3);
|
|
20556
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(
|
|
20553
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(13, 16, child_r3.createdOn, "dd MMM yyyy"));
|
|
20557
20554
|
i0.ɵɵadvance(4);
|
|
20558
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(
|
|
20555
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(17, 19, "Last submitted by"));
|
|
20559
20556
|
i0.ɵɵadvance(3);
|
|
20560
20557
|
i0.ɵɵtextInterpolate(child_r3.name);
|
|
20561
20558
|
i0.ɵɵadvance(3);
|
|
20562
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(
|
|
20559
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 21, "Query detail"));
|
|
20563
20560
|
i0.ɵɵadvance(3);
|
|
20564
20561
|
i0.ɵɵtextInterpolate(child_r3.body);
|
|
20565
20562
|
i0.ɵɵadvance(3);
|
|
20566
|
-
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(
|
|
20563
|
+
i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(29, 23, "Attachments"));
|
|
20567
20564
|
i0.ɵɵadvance(3);
|
|
20568
20565
|
i0.ɵɵproperty("ngIf", child_r3.attachments);
|
|
20569
20566
|
} }
|
|
20570
20567
|
function QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_Template(rf, ctx) { if (rf & 1) {
|
|
20571
20568
|
i0.ɵɵelementContainerStart(0);
|
|
20572
|
-
i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_container_1_Template, 28, 22, "ng-container", 14)(2, QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_template_2_Template,
|
|
20569
|
+
i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_container_1_Template, 28, 22, "ng-container", 14)(2, QueryDetailsComponent_ng_container_0_ng_container_53_ng_container_1_ng_template_2_Template, 32, 25, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
20573
20570
|
i0.ɵɵelementContainerEnd();
|
|
20574
20571
|
} if (rf & 2) {
|
|
20575
20572
|
const i_r4 = ctx.index;
|
|
@@ -20707,7 +20704,7 @@ class QueryDetailsComponent {
|
|
|
20707
20704
|
|| userDetails.roles.some((role) => role.toLowerCase().includes('judge')));
|
|
20708
20705
|
}
|
|
20709
20706
|
static ɵfac = function QueryDetailsComponent_Factory(t) { return new (t || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService)); };
|
|
20710
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query", caseId: "caseId" }, outputs: { backClicked: "backClicked" }, decls: 1, vars: 1, consts: [["followUpMessage", ""], [4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__caption", "govuk-table__caption--l"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row govuk-table__row--isHearingRelated", 4, "ngIf"], [3, "attachments", 4, "ngIf"], [1, "govuk-table__row", "govuk-table__row--isHearingRelated"], [3, "attachments"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"], ["class", "govuk-table__row", 4, "ngIf"]
|
|
20707
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query", caseId: "caseId" }, outputs: { backClicked: "backClicked" }, decls: 1, vars: 1, consts: [["followUpMessage", ""], [4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__caption", "govuk-table__caption--l"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row govuk-table__row--isHearingRelated", 4, "ngIf"], [3, "attachments", 4, "ngIf"], [1, "govuk-table__row", "govuk-table__row--isHearingRelated"], [3, "attachments"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"], ["class", "govuk-table__row", 4, "ngIf"]], template: function QueryDetailsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
20711
20708
|
i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 54, 46, "ng-container", 1);
|
|
20712
20709
|
} if (rf & 2) {
|
|
20713
20710
|
i0.ɵɵproperty("ngIf", ctx.query);
|
|
@@ -20715,7 +20712,7 @@ class QueryDetailsComponent {
|
|
|
20715
20712
|
}
|
|
20716
20713
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
|
|
20717
20714
|
type: Component,
|
|
20718
|
-
args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <br/>\n <p>\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated ? 'Yes' : 'No') }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"i % 2 === 0; else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr *ngIf=\"isCaseworker()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div
|
|
20715
|
+
args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <br/>\n <p>\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated ? 'Yes' : 'No') }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"i % 2 === 0; else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr *ngIf=\"isCaseworker()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
|
|
20719
20716
|
}], () => [{ type: SessionStorageService }], { query: [{
|
|
20720
20717
|
type: Input
|
|
20721
20718
|
}], backClicked: [{
|
|
@@ -21624,14 +21621,16 @@ function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if
|
|
|
21624
21621
|
class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
|
|
21625
21622
|
route;
|
|
21626
21623
|
sessionStorageService;
|
|
21624
|
+
caseNotifier;
|
|
21627
21625
|
caseQueriesCollections;
|
|
21628
21626
|
query;
|
|
21629
21627
|
showQueryList = true;
|
|
21630
21628
|
caseId;
|
|
21631
|
-
constructor(route, sessionStorageService) {
|
|
21629
|
+
constructor(route, sessionStorageService, caseNotifier) {
|
|
21632
21630
|
super();
|
|
21633
21631
|
this.route = route;
|
|
21634
21632
|
this.sessionStorageService = sessionStorageService;
|
|
21633
|
+
this.caseNotifier = caseNotifier;
|
|
21635
21634
|
}
|
|
21636
21635
|
ngOnInit() {
|
|
21637
21636
|
this.caseId = this.route.snapshot.params.cid;
|
|
@@ -21641,16 +21640,21 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
|
|
|
21641
21640
|
// TODO: Actual implementation once the CCD API and data contract is available
|
|
21642
21641
|
// Each parties will have a separate collection of party messages
|
|
21643
21642
|
// Find whether queries tab is available in the case data
|
|
21644
|
-
|
|
21645
|
-
|
|
21646
|
-
|
|
21647
|
-
|
|
21648
|
-
|
|
21649
|
-
|
|
21643
|
+
this.caseNotifier.fetchAndRefresh(this.caseId)
|
|
21644
|
+
.subscribe({
|
|
21645
|
+
next: (caseDetails) => {
|
|
21646
|
+
if (this.route.snapshot.data.case?.tabs) {
|
|
21647
|
+
this.caseQueriesCollections = caseDetails.tabs
|
|
21648
|
+
.filter((tab) => tab.fields?.some((caseField) => caseField.field_type.type === 'ComponentLauncher' && caseField.id === this.caseField.id))[0].fields?.reduce((acc, caseField) => {
|
|
21649
|
+
const extractedCaseQueriesFromCaseField = QueryManagementUtils.extractCaseQueriesFromCaseField(caseField);
|
|
21650
|
+
if (extractedCaseQueriesFromCaseField && typeof extractedCaseQueriesFromCaseField === 'object') {
|
|
21651
|
+
acc.push(extractedCaseQueriesFromCaseField);
|
|
21652
|
+
}
|
|
21653
|
+
return acc;
|
|
21654
|
+
}, []);
|
|
21650
21655
|
}
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
}
|
|
21656
|
+
}
|
|
21657
|
+
});
|
|
21654
21658
|
// Loop through the list of parties and their case queries collections
|
|
21655
21659
|
// QueryManagementUtils.extractCaseQueriesFromCaseField();
|
|
21656
21660
|
}
|
|
@@ -21669,7 +21673,7 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
|
|
|
21669
21673
|
&& !(userDetails.roles.includes('pui-case-manager')
|
|
21670
21674
|
|| userDetails.roles.some((role) => role.toLowerCase().includes('judge')));
|
|
21671
21675
|
}
|
|
21672
|
-
static ɵfac = function ReadQueryManagementFieldComponent_Factory(t) { return new (t || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService)); };
|
|
21676
|
+
static ɵfac = function ReadQueryManagementFieldComponent_Factory(t) { return new (t || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
|
|
21673
21677
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["singleQueryDetails", ""], ["queryIsInReview", ""], [4, "ngIf", "ngIfElse"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-margin-top-8 govuk-!-margin-bottom-8", 4, "ngIf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "selectedQuery", "caseQueriesCollection"], [3, "backClicked", "query", "caseId"], [4, "ngIf"], ["id", "ask-follow-up-question", "data-module", "govuk-button", 1, "govuk-button", 3, "routerLink"], [1, "govuk-!-font-weight-bold"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
|
|
21674
21678
|
i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 2)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
21675
21679
|
} if (rf & 2) {
|
|
@@ -21680,8 +21684,8 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
|
|
|
21680
21684
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
|
|
21681
21685
|
type: Component,
|
|
21682
21686
|
args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isCaseworker()\">\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and will respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"query?.children?.length >= 0 && isCaseworker() && query?.children?.length % 2 === 0\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '3', query.id]\"\n >\n {{ 'Response to a query' | rpxTranslate }}\n </button>\n </ng-container>\n</ng-template>\n" }]
|
|
21683
|
-
}], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }], null); })();
|
|
21684
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber:
|
|
21687
|
+
}], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
|
|
21688
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 14 }); })();
|
|
21685
21689
|
|
|
21686
21690
|
class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
|
|
21687
21691
|
static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(t) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(t || ReadTextAreaFieldComponent); }; })();
|