cisco-sbg-ui / atomic-react

https://atomic-react.security.cisco.com
2 stars 5 forks source link

feat: enable date range state to be controlled #1198

Open brennarvo opened 2 years ago

brennarvo commented 2 years ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce?

Allows a developer to control the state within useADateRange.

What is the current behavior?

The state setter is not returned from useADateRange:

return {
  value: range,
  onChange,
  minDate,
  maxDate,
};

What is the new behavior (if this is a feature change)?

Exposes the setter from useADateRange to allow a consumer to control it's state directly:

return {
  value: range,
  // Also return the state setter
  setValue: setRange,
  onChange,
  minDate,
  maxDate,
};

Does this PR introduce a breaking change?

No

Other information:

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/securex/atomic-react/dLNZNxFcYb3QHNfUVJFNAJv6K6vq
✅ Preview: https://atomic-react-git-feat-control-useadaterange-securex.vercel.app

codecov[bot] commented 2 years ago

Codecov Report

Merging #1198 (cdd463e) into master (4d8377c) will decrease coverage by 0.70%. The diff coverage is 100.00%.

:exclamation: Current head cdd463e differs from pull request most recent head 516db8f. Consider uploading reports for the commit 516db8f to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1198      +/-   ##
==========================================
- Coverage   91.20%   90.50%   -0.71%     
==========================================
  Files         104       98       -6     
  Lines        3162     3054     -108     
  Branches     1054     1046       -8     
==========================================
- Hits         2884     2764     -120     
- Misses        240      249       +9     
- Partials       38       41       +3     
Impacted Files Coverage Δ
framework/components/ADatePicker/helpers.js 100.00% <100.00%> (ø)
framework/components/ADatePicker/useADateRange.js 100.00% <100.00%> (ø)
framework/components/ALoader/APageLoader.js 17.64% <0.00%> (-82.36%) :arrow_down:
framework/components/ALoader/ACiscoLoader.js 33.33% <0.00%> (-66.67%) :arrow_down:
framework/components/AApp/AApp.js 86.66% <0.00%> (-6.67%) :arrow_down:
framework/components/AAlert/AAlert.js 82.35% <0.00%> (-2.95%) :arrow_down:
framework/utils/lorem-ipsum.js
cypress/plugins/index.js
pages/_app.js
pages/_document.js
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0828e63...516db8f. Read the comment docs.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
atomic-react ✅ Ready (Inspect) Visit Preview Jun 6, 2022 at 7:49PM (UTC)