@hmcts/ccd-case-ui-toolkit 7.0.10 → 7.0.11-manual-caseflag-lang
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/esm2020/lib/shared/components/palette/case-flag/write-case-flag-field.component.mjs +30 -26
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs +31 -27
- package/fesm2015/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs +29 -25
- package/fesm2020/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
- package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -11788,7 +11788,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
11788
11788
|
// Extract all flags-related data from the CaseEventTrigger object in the snapshot data
|
|
11789
11789
|
if (this.route.snapshot.data.eventTrigger) {
|
|
11790
11790
|
// Get the HMCTSServiceId from supplementary data, if it exists (required for retrieving the available flag types in
|
|
11791
|
-
// the first instance, only falling back on case type ID or
|
|
11791
|
+
// the first instance, only falling back on case type ID or jurisdiction if it's not present)
|
|
11792
11792
|
if (this.route.snapshot.data.eventTrigger.supplementary_data
|
|
11793
11793
|
&& this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId) {
|
|
11794
11794
|
this.hmctsServiceId = this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId;
|
|
@@ -12129,32 +12129,36 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12129
12129
|
this.flagCommentsOptional = true;
|
|
12130
12130
|
}
|
|
12131
12131
|
populateNewFlagDetailInstance() {
|
|
12132
|
+
const langSearchTerm = this.caseFlagParentFormGroup?.value['languageSearchTerm'];
|
|
12133
|
+
const manualLangEntry = this.caseFlagParentFormGroup?.value['manualLanguageEntry'];
|
|
12134
|
+
const flagType = this.caseFlagParentFormGroup?.value['flagType'];
|
|
12135
|
+
const otherDesc = this.caseFlagParentFormGroup?.value['otherDescription'];
|
|
12132
12136
|
const formValues = this.caseFlagParentFormGroup?.value;
|
|
12133
12137
|
return {
|
|
12134
|
-
name:
|
|
12135
|
-
name_cy:
|
|
12138
|
+
name: this.flagType?.name,
|
|
12139
|
+
name_cy: flagType?.name_cy,
|
|
12136
12140
|
// Currently, subTypeValue, subTypeValue_cy and subTypeKey are applicable only to language flag types
|
|
12137
|
-
subTypeValue:
|
|
12138
|
-
?
|
|
12139
|
-
:
|
|
12140
|
-
?
|
|
12141
|
+
subTypeValue: langSearchTerm && this.rpxTranslationService.language === 'en'
|
|
12142
|
+
? langSearchTerm.value
|
|
12143
|
+
: manualLangEntry && this.rpxTranslationService.language === 'en'
|
|
12144
|
+
? manualLangEntry
|
|
12141
12145
|
: null,
|
|
12142
|
-
subTypeValue_cy:
|
|
12143
|
-
?
|
|
12144
|
-
:
|
|
12145
|
-
?
|
|
12146
|
+
subTypeValue_cy: langSearchTerm && this.rpxTranslationService.language === 'cy'
|
|
12147
|
+
? langSearchTerm?.value_cy
|
|
12148
|
+
: manualLangEntry && this.rpxTranslationService.language === 'cy'
|
|
12149
|
+
? manualLangEntry
|
|
12146
12150
|
: null,
|
|
12147
12151
|
// For user-entered (i.e. non-Reference Data) languages, there is no key
|
|
12148
|
-
subTypeKey:
|
|
12149
|
-
?
|
|
12152
|
+
subTypeKey: langSearchTerm
|
|
12153
|
+
? langSearchTerm.key
|
|
12150
12154
|
: null,
|
|
12151
|
-
otherDescription:
|
|
12152
|
-
|
|
12153
|
-
?
|
|
12155
|
+
otherDescription: flagType?.flagCode === this.otherFlagTypeCode &&
|
|
12156
|
+
otherDesc && this.rpxTranslationService.language === 'en'
|
|
12157
|
+
? otherDesc
|
|
12154
12158
|
: null,
|
|
12155
|
-
otherDescription_cy:
|
|
12156
|
-
|
|
12157
|
-
?
|
|
12159
|
+
otherDescription_cy: flagType?.flagCode === this.otherFlagTypeCode &&
|
|
12160
|
+
otherDesc && this.rpxTranslationService.language === 'cy'
|
|
12161
|
+
? otherDesc
|
|
12158
12162
|
: null,
|
|
12159
12163
|
flagComment: this.rpxTranslationService.language === 'en'
|
|
12160
12164
|
? formValues?.flagComments
|
|
@@ -12164,18 +12168,18 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
|
|
|
12164
12168
|
: null,
|
|
12165
12169
|
flagUpdateComment: formValues?.statusReason,
|
|
12166
12170
|
dateTimeCreated: new Date().toISOString(),
|
|
12167
|
-
path:
|
|
12168
|
-
|
|
12169
|
-
hearingRelevant:
|
|
12170
|
-
flagCode:
|
|
12171
|
+
path: flagType?.Path &&
|
|
12172
|
+
flagType?.Path.map(pathValue => Object.assign({ id: null, value: pathValue })),
|
|
12173
|
+
hearingRelevant: flagType?.hearingRelevant ? 'Yes' : 'No',
|
|
12174
|
+
flagCode: flagType?.flagCode,
|
|
12171
12175
|
// Status should be set to whatever the default is for this flag type, if flag is being created by an external
|
|
12172
12176
|
// user, otherwise it should be set to "Active" if Case Flags v2.1 is NOT enabled, or the selected status if it is
|
|
12173
12177
|
status: this.isDisplayContextParameterExternal
|
|
12174
|
-
?
|
|
12178
|
+
? flagType?.defaultStatus
|
|
12175
12179
|
: !this.isDisplayContextParameter2Point1Enabled
|
|
12176
12180
|
? CaseFlagStatus.ACTIVE
|
|
12177
12181
|
: CaseFlagStatus[formValues?.selectedStatus],
|
|
12178
|
-
availableExternally:
|
|
12182
|
+
availableExternally: flagType?.externallyAvailable ? 'Yes' : 'No'
|
|
12179
12183
|
};
|
|
12180
12184
|
}
|
|
12181
12185
|
moveToFinalReviewStage() {
|