-
Notifications
You must be signed in to change notification settings - Fork 0
Rss ecomm 3 21 #139
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
Rss ecomm 3 21 #139
Conversation
Friday-13
left a comment
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.
Всё отлично, но я бы переработал вопрос с валидацией поля email. Не всё там здорово.
К нам были вопросы, что поле email допускает лидирующие и оканчивающие пробелы. На деле же, если в компоненте ставится type='email', то браузер сам обрезает пробельные символы. Потому у нас валидация и проходила: браузер передавал уже обрезанную строку. Думаю, стоит сменить тип поля на 'text'. Тогда наша стандартная валидация должна заработать.
| const emailValidator: IValidator = { | ||
| validateFunction: (value: string): boolean => { | ||
| const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; | ||
| const regex = /^\s*([^\s@]+@[^\s@]+\.[^\s@]+)\s*$/; |
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.
А зачем в паттерн добавлены лидирующие и конечные пробелы?
| onClick: () => { | ||
| if (this.emailField.isValid() && this.passwordField.isValid()) { | ||
| const email = this.emailField.getValue(); | ||
| const email = this.emailField.getValue().trim(); |
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.
Как выяснилось, для поля type='email' обрезка лидирующих пробелов выполняется автоматически. Думаю, не стоит её повторять
Golosova76
left a comment
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.
Отличная работа. Если замечания лида исправлены можно мержить
Related task(s)/issue(s) 🔗
RSS-ECOMM-3_21
RSS-ECOMM-3_22
Description 📋
Add User Profile, Catalogue, About us and Cart links in the header
Changed input type to 'text'
Done / deadline 📅
24.05.2024 / 24.05.2024
Screenshot/Illustration (optional) 📌
Comments (optional) 💬