-
Notifications
You must be signed in to change notification settings - Fork 11
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
Bugfix news query #579
base: develop
Are you sure you want to change the base?
Bugfix news query #579
Conversation
списки год и месяц, теперь зависят друг от друга, это убирает проблему когда без выбора года нельзя было выбрать месяц
})), | ||
], [year]); | ||
const yearOptions = useMemo(() => { | ||
let yearsArray: {text: string; value: string }[] = []; |
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.
можно вынести в утилитки маппинги
const getFilteredYearOptions = (filters, month, year) => {
const getFilteredMonthOptions = (filters, year) => {
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.
касательно этого, можешь подсказать вынести прямо в отдельную директорию или выше за компонент?
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.
@AlMkin @rkostyuchenko, парни, подскажите как лучше поступить в этой ситуации
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.
Тут дело вкуса. На мой взгляд, достаточно вынести за компонент.
Вообще, фильтр по месяцу без выбора года выглядит довольно бессмысленно: вряд ли кому-то понадобится найти новости за март каждого года. Возможно, лучше запретить пользователю выбирать месяц, пока не выбран год.
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.
Согласен, давайте блокировать выбор по месяцу без установленного года @MADeit0
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.
Погодите, но изначально же так и было, если год не выбран месяц не получится поставить, и соответственно после удаления года стирался и месяц.
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.
Выпадающий список с месяцами лучше явно задизейблить, пока не выбран год
Описание
Pull Request исправляет фильтрацию поиска по месяцу и году, теперь они зависимы друг от друга. Это значит, что если не выбран год или месяц в селектах будут отображаться все доступные варианты, но если выбрать конкретный год или месяц, то у второго селекта будут доступны только те варианты которые есть в рамка выбранного первым селектом.
Ссылка на задачу
Некорректно работающий фильтр по месяцам #560