Skip to content

Commit

Permalink
fix: t#4075 error aligment
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Oct 23, 2023
1 parent 04959c2 commit 5198f51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
inputRef
[placeholder]="t('kanban.create_workflow.write_workflow_name')" />
<ng-container inputError>
<tg-ui-error error="required">
{{ t('kanban.create_workflow.workflow_empty') }}
</tg-ui-error>
<tg-ui-error error="pattern">
<tg-ui-error error="required, pattern">
{{ t('kanban.create_workflow.workflow_empty') }}
</tg-ui-error>
</ng-container>
Expand Down
5 changes: 4 additions & 1 deletion javascript/libs/ui/src/lib/inputs/error/error.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ export class ErrorComponent implements OnChanges {
}

const errors = this.fieldService.control?.errors;
const errorNames = this.error.split(',').map((it) => it.trim());
const hasError = errorNames.some((errorName) => errors?.[errorName]);
const fieldControl = this.fieldService.control;
if (errors && errors[this.error] && fieldControl) {

if (errors && hasError && fieldControl) {
const isOnSubmit = fieldControl.updateOn === 'submit';

if (isOnSubmit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Copyright (c) 2023-present Kaleidos INC
& .extra-info {
align-items: flex-start;
display: flex;
flex-direction: column;
justify-content: space-between;
}
}

0 comments on commit 5198f51

Please sign in to comment.