@hmcts/ccd-case-ui-toolkit 7.0.11-manual-caseflag-lang → 7.0.12

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.
@@ -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 jurisdiction if it's not present)
11791
+ // the first instance, only falling back on case type ID or jurisidiction 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,36 +12129,32 @@ 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'];
12136
12132
  const formValues = this.caseFlagParentFormGroup?.value;
12137
12133
  return {
12138
- name: this.flagType?.name,
12139
- name_cy: flagType?.name_cy,
12134
+ name: formValues?.flagType?.name,
12135
+ name_cy: formValues?.flagType?.name_cy,
12140
12136
  // Currently, subTypeValue, subTypeValue_cy and subTypeKey are applicable only to language flag types
12141
- subTypeValue: langSearchTerm && this.rpxTranslationService.language === 'en'
12142
- ? langSearchTerm.value
12143
- : manualLangEntry && this.rpxTranslationService.language === 'en'
12144
- ? manualLangEntry
12137
+ subTypeValue: formValues?.languageSearchTerm && this.rpxTranslationService.language === 'en'
12138
+ ? formValues?.languageSearchTerm.value
12139
+ : formValues?.manualLanguageEntry && this.rpxTranslationService.language === 'en'
12140
+ ? formValues?.manualLanguageEntry
12145
12141
  : null,
12146
- subTypeValue_cy: langSearchTerm && this.rpxTranslationService.language === 'cy'
12147
- ? langSearchTerm?.value_cy
12148
- : manualLangEntry && this.rpxTranslationService.language === 'cy'
12149
- ? manualLangEntry
12142
+ subTypeValue_cy: formValues?.languageSearchTerm && this.rpxTranslationService.language === 'cy'
12143
+ ? formValues?.languageSearchTerm.value_cy
12144
+ : formValues?.manualLanguageEntry && this.rpxTranslationService.language === 'cy'
12145
+ ? formValues?.manualLanguageEntry
12150
12146
  : null,
12151
12147
  // For user-entered (i.e. non-Reference Data) languages, there is no key
12152
- subTypeKey: langSearchTerm
12153
- ? langSearchTerm.key
12148
+ subTypeKey: formValues?.languageSearchTerm
12149
+ ? formValues?.languageSearchTerm.key
12154
12150
  : null,
12155
- otherDescription: flagType?.flagCode === this.otherFlagTypeCode &&
12156
- otherDesc && this.rpxTranslationService.language === 'en'
12157
- ? otherDesc
12151
+ otherDescription: formValues?.flagType?.flagCode === this.otherFlagTypeCode &&
12152
+ formValues?.otherDescription && this.rpxTranslationService.language === 'en'
12153
+ ? formValues?.otherDescription
12158
12154
  : null,
12159
- otherDescription_cy: flagType?.flagCode === this.otherFlagTypeCode &&
12160
- otherDesc && this.rpxTranslationService.language === 'cy'
12161
- ? otherDesc
12155
+ otherDescription_cy: formValues?.flagType?.flagCode === this.otherFlagTypeCode &&
12156
+ formValues?.otherDescription && this.rpxTranslationService.language === 'cy'
12157
+ ? formValues?.otherDescription
12162
12158
  : null,
12163
12159
  flagComment: this.rpxTranslationService.language === 'en'
12164
12160
  ? formValues?.flagComments
@@ -12168,18 +12164,18 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12168
12164
  : null,
12169
12165
  flagUpdateComment: formValues?.statusReason,
12170
12166
  dateTimeCreated: new Date().toISOString(),
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,
12167
+ path: formValues?.flagType?.Path &&
12168
+ formValues?.flagType?.Path.map(pathValue => Object.assign({ id: null, value: pathValue })),
12169
+ hearingRelevant: formValues?.flagType?.hearingRelevant ? 'Yes' : 'No',
12170
+ flagCode: formValues?.flagType?.flagCode,
12175
12171
  // Status should be set to whatever the default is for this flag type, if flag is being created by an external
12176
12172
  // user, otherwise it should be set to "Active" if Case Flags v2.1 is NOT enabled, or the selected status if it is
12177
12173
  status: this.isDisplayContextParameterExternal
12178
- ? flagType?.defaultStatus
12174
+ ? formValues?.flagType?.defaultStatus
12179
12175
  : !this.isDisplayContextParameter2Point1Enabled
12180
12176
  ? CaseFlagStatus.ACTIVE
12181
12177
  : CaseFlagStatus[formValues?.selectedStatus],
12182
- availableExternally: flagType?.externallyAvailable ? 'Yes' : 'No'
12178
+ availableExternally: formValues?.flagType?.externallyAvailable ? 'Yes' : 'No'
12183
12179
  };
12184
12180
  }
12185
12181
  moveToFinalReviewStage() {