Skip to content

Conversation

@InStageTwo
Copy link
Collaborator

@InStageTwo InStageTwo commented May 24, 2024

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) 📌

image
image

Comments (optional) 💬

Copy link
Owner

@Friday-13 Friday-13 left a 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*$/;
Copy link
Owner

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();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как выяснилось, для поля type='email' обрезка лидирующих пробелов выполняется автоматически. Думаю, не стоит её повторять

Copy link
Collaborator

@Golosova76 Golosova76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отличная работа. Если замечания лида исправлены можно мержить

@InStageTwo InStageTwo merged commit b47a265 into header_navigation May 25, 2024
@Friday-13 Friday-13 deleted the RSS-ECOMM-3_21 branch June 12, 2024 11:45
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.

RSS-ECOMM-3_21: Implement Navigation 🚦 to Catalog Page in Header RSS-ECOMM-3_22: Implement User Profile Navigation 🚦 in Header

5 participants