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

fix(input-autocomplete): add error and success icons #1551

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

VitaliyKosh
Copy link
Contributor

@VitaliyKosh VitaliyKosh commented Jan 23, 2025

Опишите проблему

В мобильной версии:

  • При задании пропса success={true} не отображается иконка
  • Также при наличии ошибки не отображается иконка ошибки

Шаги для воспроизведения

  1. Задать проп success={true}

  2. Не увидеть иконку успеха

  3. Задать проп error

  4. Не увидеть иконку ошибки

Ожидаемое поведение

При задании пропсов success и error должны отображаться иконки

Чек лист

  • Тесты
  • Документация

Внешний вид

Ожидаемый Фактический
Снимок экрана 2025-01-23 в 15 20 59 Снимок экрана 2025-01-23 в 15 21 40
Снимок экрана 2025-01-23 в 14 53 15 Снимок экрана 2025-01-23 в 15 22 07

Дополнительная информация

Иконка ошибки отображается только в теме сайта

Copy link

changeset-bot bot commented Jan 23, 2025

🦋 Changeset detected

Latest commit: 09ee6ca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@alfalab/core-components-input-autocomplete Minor
@alfalab/core-components-international-phone-input Patch
@alfalab/core-components-intl-phone-input Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@fulcanellee
Copy link
Collaborator

fulcanellee commented Jan 24, 2025

Добавь @alfalab/core-components-status-badge в package.json зависимости и в tsconfig references, тогда ошибки
в экшенах не будет

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@VitaliyKosh VitaliyKosh marked this pull request as ready for review January 24, 2025 12:42
@fulcanellee fulcanellee requested a review from Oladii January 24, 2025 13:15
Copy link
Contributor

Choose a reason for hiding this comment

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

Странно обновилось, тот который был останется в наборе тестов?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Тут был неправильный компонент как preview packages/input-autocomplete/src/component.screenshots.test.tsx

Copy link
Contributor

Choose a reason for hiding this comment

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

Тут был компонент с введённым значением, хочу убедиться, что такой вид тоже остался в тестах

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Тогда более правильно будет оставить такой preview, а для этого вида создать отдельный тест

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Но по сути, там тестировался совсем другой компонент. Который никогда не упадет от изменений в этом

className={cn(styles.errorIcon, styles[`size-${size}`])}
data-addon='error-icon'
>
<StatusBadge
Copy link
Contributor

@reme3d2y reme3d2y Jan 29, 2025

Choose a reason for hiding this comment

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

Разве все это не должно быть частью FormControlMobile?
Сейчас получается сильное дублирование с тем, что есть в Input'е

Возможно стоит использовать его, либо сразу завести задачу на рефакторинг

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Делал по аналогии с BaseInput. rightAddons прокидываются сверху в FormControlMobile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FormControlMobile это же вроде как универсальный ui компонент. В котором совсем нет логики, только отображение

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.

5 participants