Skip to content
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

Open
wants to merge 67 commits into
base: develop
Choose a base branch
from

Conversation

MarianS23
Copy link
Contributor

No description provided.

@MarianS23 MarianS23 changed the title Create interface to upload employee Shutov / Create interface to upload employee Sep 14, 2024
Copy link

[ngClass]="{
'error-field-empty': element.errors.employeeSurnameEmpty,
'error-field-wrong-length': element.errors.employeeSurnameLength,
'error-field-wrong-language':element.errors.employeeSurnameLanguage
Copy link
Contributor

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/models/admin-import-export.model.ts Outdated Show resolved Hide resolved
}

private validateField(fieldName: string, item: any, config: FieldValidationConfig): void {
if (config.checkEmpty && !item[fieldName]) {
Copy link
Contributor

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:

  1. Use a validator map
{
  checkLanguage : (value) => !NO_LATIN_REGEX.test(value)
  ...
}
  1. Create constants for magic numbers (2 and 50)
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants