Skip to content

Commit

Permalink
chore(isct-428): update table-cell v1 error message for custom error
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyKIron committed Oct 13, 2024
1 parent ca88a67 commit cdcd4b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface TableColumn {
[errorKey: string]: {
errorMessageKey: string;
textMapping?: {key: string; value: string}[];
errorText?: string;
};
};
filter?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ export class TableCellComponent implements OnInit, OnChanges {
} else {
const allErrors = formControl.errors || {};
Object.keys(allErrors).forEach(errorKey => {
this.inputError$.next(this._getMessage(errorKey, this.column.customErrorMapping[errorKey] || {}));
this.inputError$.next(
this.column.customErrorMapping[errorKey]?.errorText ??
this._getMessage(errorKey, this.column.customErrorMapping[errorKey] || {})
);
});
}
}
Expand Down

0 comments on commit cdcd4b5

Please sign in to comment.