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(DateRangeInput): Treat array of nulls as empty value to set start date on click #6215

Merged

Conversation

mendrew
Copy link
Contributor

@mendrew mendrew commented Dec 6, 2023


  • Unit-тесты

Изменения

  • Правим пример в сторибуке, чтобы DateRangeInput реагировал на изменения дат.
  • исправляем поведение при выборе даты, если value={[null, null]}. В этом случае onChange возвращал всегда [null, null], что бы мы не выбрали в DateRangeInput.
    Временное решение без этого фикса это передавать undefined. Будет актуально для v5, если не выпустим там патч.
  • Меняем тип value c Array на Tuple, так как value может содержать только два элемента.

Copy link
Contributor

github-actions bot commented Dec 6, 2023

size-limit report 📦

Path Size
JS 348.25 KB (+0.01% 🔺)
JS (gzip) 106.36 KB (+0.01% 🔺)
JS (brotli) 87.82 KB (-0.03% 🔽)
JS import Div (tree shaking) 1.43 KB (0%)
CSS 258.5 KB (0%)
CSS (gzip) 33.79 KB (0%)
CSS (brotli) 27.42 KB (0%)

@mendrew mendrew changed the title Treat array of nulls as empty value to set start date on click fix(DateRangeInput): Treat array of nulls as empty value to set start date on click Dec 6, 2023
Copy link

codesandbox-ci bot commented Dec 6, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6102b21:

Sandbox Source
VKUI TypeScript Configuration

Copy link
Contributor

github-actions bot commented Dec 6, 2023

e2e tests

Playwright Report

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c7e4c41) 81.07% compared to head (6102b21) 81.14%.
Report is 5 commits behind head on master.

Files Patch % Lines
...i/src/components/DateRangeInput/DateRangeInput.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6215      +/-   ##
==========================================
+ Coverage   81.07%   81.14%   +0.07%     
==========================================
  Files         324      324              
  Lines       10090    10091       +1     
  Branches     3385     3386       +1     
==========================================
+ Hits         8180     8188       +8     
+ Misses       1910     1903       -7     
Flag Coverage Δ
unittests 81.14% <85.71%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Dec 6, 2023

👀 Docs deployed

Commit 6102b21

@mendrew mendrew force-pushed the mendrew/fix/DateRangeInput/handle-array-of-null-as-empty-value branch from d961317 to 2c2cb9e Compare December 6, 2023 14:16
@mendrew mendrew marked this pull request as ready for review December 6, 2023 14:20
@mendrew mendrew requested a review from a team as a code owner December 6, 2023 14:20
inomdzhon
inomdzhon previously approved these changes Dec 6, 2023
Copy link
Contributor

@inomdzhon inomdzhon left a comment

Choose a reason for hiding this comment

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

👏 👏 👏

BlackySoul
BlackySoul previously approved these changes Dec 7, 2023
@mendrew mendrew dismissed stale reviews from BlackySoul and inomdzhon via 6102b21 December 7, 2023 06:11
@mendrew mendrew requested a review from BlackySoul December 7, 2023 08:49
@mendrew mendrew merged commit ec0858f into master Dec 7, 2023
24 checks passed
@mendrew mendrew deleted the mendrew/fix/DateRangeInput/handle-array-of-null-as-empty-value branch December 7, 2023 08:58
mendrew added a commit that referenced this pull request Jan 18, 2024
… date on click (#6215)

- Правим пример в сторибуке, чтобы DateRangeInput реагировал на изменения дат.
- исправляем поведение при выборе даты, если value={[null, null]}. В этом случае onChange возвращал всегда [null, null], что бы мы не выбрали в DateRangeInput.
Временное решение без этого фикса это передавать `undefined`. Будет актуально для v5, если не выпустим там патч.
- Меняем тип value c Array на Tuple, так как value может содержать только два элемента.
@mendrew mendrew mentioned this pull request Jan 18, 2024
mendrew added a commit that referenced this pull request Jan 19, 2024
… date on click (#6215) (#6404)

- Правим пример в сторибуке, чтобы DateRangeInput реагировал на изменения дат.
- исправляем поведение при выборе даты, если value={[null, null]}. В этом случае onChange возвращал всегда [null, null], что бы мы не выбрали в DateRangeInput.
Временное решение без этого фикса это передавать `undefined`. Будет актуально для v5, если не выпустим там патч.
- Меняем тип value c Array на Tuple, так как value может содержать только два элемента.
vkcom-publisher pushed a commit that referenced this pull request Jan 19, 2024
… date on click (#6215) (#6404)

- Правим пример в сторибуке, чтобы DateRangeInput реагировал на изменения дат.
- исправляем поведение при выборе даты, если value={[null, null]}. В этом случае onChange возвращал всегда [null, null], что бы мы не выбрали в DateRangeInput.
Временное решение без этого фикса это передавать `undefined`. Будет актуально для v5, если не выпустим там патч.
- Меняем тип value c Array на Tuple, так как value может содержать только два элемента.
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.

[Doc]: DateRangeInput в сторибуке не реагирует на изменения
3 participants