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 validation of Date and Time field types for Mongoose connector #5777 #7801

Merged
merged 1 commit into from Sep 29, 2020

Conversation

richardgrey
Copy link
Contributor

Signed-off-by: richardgrey richie.grey@gmail.com

Description of what you did:

This PR fixes #5777

This changes will allow setting an empty value (null, undefined) for fields of type Date/Time through the API.

In the admin panel, it's still not possible to clear the value of Date or Time fields. It is on buffet/core DatePicker component and has related feature request to be able to clear the value of such inputs.

Signed-off-by: richardgrey <richie.grey@gmail.com>
@richardgrey
Copy link
Contributor Author

Guys, not sure about the coding style. Kindly let me know if it needs to be changed.

@codecov
Copy link

codecov bot commented Sep 8, 2020

Codecov Report

Merging #7801 into master will increase coverage by 0.03%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7801      +/-   ##
==========================================
+ Coverage   27.16%   27.20%   +0.03%     
==========================================
  Files        1163     1164       +1     
  Lines       15518    15517       -1     
  Branches     2410     2410              
==========================================
+ Hits         4216     4221       +5     
+ Misses       9534     9528       -6     
  Partials     1768     1768              
Flag Coverage Δ
#front 19.36% <63.63%> (+0.04%) ⬆️
#unit 53.85% <0.00%> (ø)

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

Impacted Files Coverage Δ
...admin/admin/src/components/ContainerFluid/index.js 66.66% <ø> (ø)
...in/src/components/LeftMenu/LeftMenuFooter/index.js 33.33% <0.00%> (-33.34%) ⬇️
...rc/containers/EditViewDataManagerProvider/index.js 0.00% <0.00%> (ø)
.../admin/src/components/ComponentIconPicker/index.js 0.00% <0.00%> (ø)
...agerProvider/utils/retrieveComponentsFromSchema.js 68.75% <ø> (ø)
...rapi-plugin-upload/admin/src/translations/index.js 0.00% <ø> (ø)
packages/strapi-provider-upload-local/lib/index.js 29.16% <0.00%> (ø)
...ovider/utils/getFieldsActionMatchingPermissions.js 100.00% <100.00%> (ø)
...ditViewDataManagerProvider/utils/tests/testData.js 100.00% <100.00%> (ø)
...rc/containers/InputModalStepperProvider/reducer.js 68.33% <100.00%> (ø)
... and 1 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 b13ecc5...ef10fd1. Read the comment docs.

@darron1217
Copy link
Contributor

Is there anyone who can confirm this PR?
This is not a big change.

@darron1217
Copy link
Contributor

darron1217 commented Sep 29, 2020

And also we should handle dateField_null: false case (allowing boolean type).

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

LGTM, thansk for this fix 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:database Source is core/database package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be able to set null for date input
3 participants