-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shutov / Create interface to upload employee #2633
base: develop
Are you sure you want to change the base?
Conversation
…l components from the original branch
Quality Gate passedIssues Measures |
src/app/shared/base-components/upload-excel/upload-excel.component.scss
Outdated
Show resolved
Hide resolved
src/app/shared/base-components/upload-excel/upload-excel.component.scss
Outdated
Show resolved
Hide resolved
src/app/shared/base-components/upload-excel/upload-excel.component.ts
Outdated
Show resolved
Hide resolved
src/app/shared/base-components/upload-excel/upload-excel.component.ts
Outdated
Show resolved
Hide resolved
[ngClass]="{ | ||
'error-field-empty': element.errors.employeeSurnameEmpty, | ||
'error-field-wrong-length': element.errors.employeeSurnameLength, | ||
'error-field-wrong-language':element.errors.employeeSurnameLanguage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix formatting, same below
src/app/shared/base-components/upload-excel/upload-excel.component.ts
Outdated
Show resolved
Hide resolved
src/app/shared/base-components/upload-excel/upload-excel.component.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
private validateField(fieldName: string, item: any, config: FieldValidationConfig): void { | ||
if (config.checkEmpty && !item[fieldName]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to update this method. Here are my suggestions:
- Use a validator map
{
checkLanguage : (value) => !NO_LATIN_REGEX.test(value)
...
}
- Create constants for magic numbers (2 and 50)
- As I understand it, in the table we show only one error for one field - there are 2 ways -> show all errors or exit the method when at least one error is detected
No description provided.