Skip to content

Commit

Permalink
Merge branch 'master' into exui-2086-caseId-missing-in-mv
Browse files Browse the repository at this point in the history
  • Loading branch information
RiteshHMCTS authored Aug 1, 2024
2 parents d613f46 + 7f3740c commit 0397040
Show file tree
Hide file tree
Showing 11 changed files with 1,611 additions and 2,814 deletions.
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## RELEASE NOTES

### Version 7.0.51
**EXUI-2051** Unable to Add documents

### Version 7.0.50
**EXUI-1298** MC - (Level-A) : DAC_No_Accessible_Name_01
**EXUI-1540** Accessibilty issues
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.0.50-exui-2086-rc1",
"version": "7.0.52-exui-2086-rc1",
"engines": {
"node": ">=18.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.0.50-exui-2086-rc1",
"version": "7.0.52-exui-2086-rc1",
"engines": {
"node": ">=18.19.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
let validErrorFieldFound = false;
let validationErrorAmount = this.validationErrors.length;
const failingFields = fields.filter(casefield => !this.caseFieldService.isReadOnly(casefield))
.filter(casefield => !this.pageValidationService.isHidden(casefield, this.editForm, path));
.filter(casefield => !this.pageValidationService.isHidden(casefield, this.editForm, path));
// note that thougn these checks are on getinvalidfields they are needed for sub field checks
failingFields
.forEach(casefield => {
Expand Down Expand Up @@ -240,7 +240,9 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
id = `${fieldArray['component']['collItems'][0].prefix}`;
}
fieldArray.controls.forEach((c: AbstractControl) => {
errorPresent = this.generateErrorMessage(casefield.field_type.collection_field_type.complex_fields, c.get('value'), id);
const idPrefix = c.get('value')['component'].idPrefix;
id = idPrefix !== id ? idPrefix : id;
errorPresent = this.generateErrorMessage(casefield.field_type.collection_field_type.complex_fields, c.get('value'), id);
});
} else if (FieldsUtils.isCaseFieldOfType(casefield, ['FlagLauncher'])) {
this.validationErrors.push({
Expand All @@ -262,7 +264,7 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
});
if (!validErrorFieldFound) {
path ? this.validationErrors.push({ id: path, message: `There is an internal issue with ${path} fields. The field that is causing the error cannot be determined but there is an error present` })
: this.validationErrors.push({ id: null, message: `The field that is causing the error cannot be determined but there is an error present` });
: this.validationErrors.push({ id: null, message: `The field that is causing the error cannot be determined but there is an error present` });
} else if (this.validationErrors.length === validationErrorAmount) {
// if no error messages have been generated
if (path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2 class="heading-h2 error-summary-heading" id="edit-case-event_error-summary-h
<ng-template matTabContent>
<table [class]="tab.id" [attr.aria-label]="'case viewer table' | rpxTranslate">
<tbody>
<ng-container *ngFor="let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true : formGroup.controls['data']">
<ng-container *ngFor="let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true : formGroup?.controls['data']">
<div ccdLabelSubstitutor [caseField]="field" [contextFields]="caseFields" [hidden]="field.hidden">
<ng-container [ngSwitch]="!(field | ccdIsCompound)">
<tr *ngSwitchCase="true">
Expand All @@ -74,7 +74,7 @@ <h2 class="heading-h2 error-summary-heading" id="edit-case-event_error-summary-h
</th>
<td [id]="'case-viewer-field-read--' + field.id" scope="col">
<span class="text-16">
<ccd-field-read [topLevelFormGroup]="formGroup.controls['data']"
<ccd-field-read [topLevelFormGroup]="formGroup?.controls['data']"
[caseField]="field" [caseReference]="caseDetails.case_id"
[markdownUseHrefAsRouterLink]="markdownUseHrefAsRouterLink">
</ccd-field-read>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ReadComplexFieldComponent extends AbstractFieldReadComponent implem
field.list_items = this.caseField.value[field.id]?.list_items;
field.value = {
list_items: field.list_items,
value: this.caseField.value[field.id]?.value && this.caseField.value[field.id].value.code ?
value: this.caseField.value[field.id]?.value && this.caseField.value[field.id].value?.code ?
this.caseField.value[field.id].value.code :
this.caseField.value[field.id]?.value
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export class WriteDynamicRadioListFieldComponent extends AbstractFieldWriteCompo
this.caseField.list_items = this.caseField.formatted_value.list_items;
}

if (!this.caseField.value && this.caseField.formatted_value && this.caseField.formatted_value.value) {
this.caseField.value = this.caseField.formatted_value.value.code;
if (!this.caseField.value && this.caseField.formatted_value?.value) {
this.caseField.value = this.caseField.formatted_value.value?.code;
}

const isNull: boolean = this.caseField.value === undefined || this.caseField.value === '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class ConditionParser {

private static getValue(fields: object, head: string): any {
if (this.isDynamicList(fields[head])) {
return fields[head].value.code;
return fields[head]?.value?.code;
} else {
return fields[head];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class FieldTypeSanitiser {
const stringValue = data[field.id];
if (typeof stringValue === 'string') {
const listItems = this.getListItems(field);
const matches = listItems.filter(value => value.code === stringValue);
const matches = listItems.filter(value => value?.code === stringValue);
if (matches && matches.length > 0) {
data[field.id] = {
value: matches[0],
Expand Down
2 changes: 1 addition & 1 deletion yarn-audit-known-issues

Large diffs are not rendered by default.

Loading

0 comments on commit 0397040

Please sign in to comment.