Skip to content

Conversation

@Jose4gg
Copy link
Contributor

@Jose4gg Jose4gg commented Jun 19, 2022

What does it do?

With this PR It will allow to pass the step for time and datetime fields through [Model].json

Why is it needed?

There's some use cases where we don't need every minute to be an option in datetime/time fields

How to test it?

Adding step inside a datetime/time field of a [Model].json component should allow to override the number of minutes to be displayed in the content-manager.

Related issue(s)/PR(s)

#12175
#5099

@Convly Convly requested a review from gu-stav June 20, 2022 09:38
@gu-stav
Copy link
Contributor

gu-stav commented Jun 23, 2022

Thanks for opening the PR. 🚀

While I personally like the idea, I need to verify with the team first, whether we want this information as part of the schema. It will therefore take me a little to review the PR.

@gu-stav gu-stav added source: core:strapi Source is core/strapi package pr: enhancement This PR adds or updates some part of the codebase or features labels Jun 23, 2022
@gu-stav gu-stav added this to the 4.2.1 milestone Jun 23, 2022
@alexandrebodin alexandrebodin added the flag: documentation This PR requires a documentation update label Jun 28, 2022
@derrickmehaffy
Copy link
Member

I think this would be better handled in the ctm "configure the view" and saved to the core store so it can be changed during runtime.

Our general design policy prohibition storing visual changes like this in the schema.

@Convly Convly modified the milestones: 4.2.1, 4.2.2, 4.2.3 Jun 29, 2022
@codecov
Copy link

codecov bot commented Jul 5, 2022

Codecov Report

Merging #13597 (be8224f) into main (cd16049) will decrease coverage by 0.03%.
The diff coverage is 7.69%.

❗ Current head be8224f differs from pull request most recent head 39b8ece. Consider uploading reports for the commit 39b8ece to get more accurate results

@@            Coverage Diff             @@
##             main   #13597      +/-   ##
==========================================
- Coverage   55.50%   55.46%   -0.04%     
==========================================
  Files        1274     1274              
  Lines       31823    31847      +24     
  Branches     5734     5745      +11     
==========================================
+ Hits        17662    17664       +2     
- Misses      12349    12364      +15     
- Partials     1812     1819       +7     
Flag Coverage Δ
front 57.97% <8.00%> (-0.06%) ⬇️
unit 49.38% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...min/src/content-manager/components/Inputs/index.js 16.66% <0.00%> (-1.61%) ⬇️
...content-manager/components/Inputs/utils/getStep.js 28.57% <ø> (+6.34%) ⬆️
...rver/controllers/validation/model-configuration.js 31.81% <0.00%> (-1.52%) ⬇️
...ns/i18n/admin/src/components/ModalEdit/BaseForm.js 0.00% <0.00%> (ø)
...ger/pages/EditSettingsView/components/ModalForm.js 29.68% <22.22%> (-1.23%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

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

We briefly discussed the PR today and would love to merge it, once all comments are resolved. Thank you for working on it - many users will appreciate it!

I've added a few comments and would to hear your opinion. 🚀

Could you please remove all unrelated changes from that PR? It looks like as if your prettier version/ config has some mismatch with what we are using (hence the brace / spacing changes).

Feel free to ping me anytime you need something - back from vacation now.

@alexandrebodin alexandrebodin modified the milestones: 4.2.3, 4.2.4 Jul 13, 2022
@gu-stav gu-stav modified the milestones: 4.2.4, 4.3.0 Jul 20, 2022
@Jose4gg
Copy link
Contributor Author

Jose4gg commented Jul 21, 2022

I did a refactor to get the step from the metadata instead of getting it from the schema @gu-stav

@gu-stav
Copy link
Contributor

gu-stav commented Jul 25, 2022

@Jose4gg Thank you - I haven't checked it a lot yet, but it looks much cleaner. I'm wondering: does the field show up for you?

Screenshot 2022-07-25 at 12 35 28

@soupette
Copy link
Contributor

@Jose4gg Thank you - I haven't checked it a lot yet, but it looks much cleaner. I'm wondering: does the field show up for you?

Screenshot 2022-07-25 at 12 35 28

@gu-stav if he have added the steps in the metadata you should look into the setting page and not the ctb field configuration modal.

@gu-stav
Copy link
Contributor

gu-stav commented Jul 25, 2022

@soupette Good catch - thanks. I keep confusing these two views.

@soupette
Copy link
Contributor

@Jose4gg Thank you - I haven't checked it a lot yet, but it looks much cleaner. I'm wondering: does the field show up for you?

Screenshot 2022-07-25 at 12 35 28

@gu-stav if he have added the steps in the metadata you should look into the setting page and not the ctb field configuration modal.

@soupette Good catch - thanks. I keep confusing these two views.

They should be merged into the CTB at some point...
cc/ @maevalienard

@Convly Convly modified the milestones: 4.3.0, 4.3.1 Jul 27, 2022
@petersg83 petersg83 modified the milestones: 4.3.1, 4.3.2 Aug 1, 2022
@alexandrebodin alexandrebodin removed this from the 4.3.2 milestone Aug 1, 2022
@alexandrebodin alexandrebodin added this to the 4.3.3 milestone Aug 1, 2022
@alexandrebodin alexandrebodin removed this from the 4.3.3 milestone Aug 10, 2022
Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

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

I've checked the PR again today: great work. I think we can almost merge it (there is a new release on Wednesday). I've added two smaller and one bigger comment and I'm interested what you think about it.

Thank you for still working on this! I know it has been a long time and I apologize for that.

@Jose4gg
Copy link
Contributor Author

Jose4gg commented Aug 23, 2022

Changes are done @gu-stav

gu-stav
gu-stav previously approved these changes Aug 24, 2022
Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

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

Thank you very much. It works like a charm and you did a really good job with the code. 🚀

I've already checked with the documentation team: this change only needs a small addition for now in the user-guide. Therefore I'll remove the documenation label and will create a new PR there.

Copy link
Contributor

@gu-stav gu-stav left a comment

Choose a reason for hiding this comment

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

Rebased because the workflows were stuck.

@gu-stav gu-stav removed the flag: documentation This PR requires a documentation update label Aug 24, 2022
@gu-stav gu-stav added source: core:content-type-builder Source is core/content-type-builder package and removed source: core:strapi Source is core/strapi package labels Aug 24, 2022
@gu-stav gu-stav added this to the 4.3.5 milestone Aug 24, 2022
@gu-stav gu-stav merged commit 6ceb77e into strapi:main Aug 24, 2022
@gu-stav gu-stav changed the title Allow to pass step to datetime/time fields Make time interval of datetime / time fields configurable Aug 24, 2022
@Coderwelsch
Copy link

Thank you so much for your work 🥰🥰🥰

@esiao
Copy link

esiao commented Aug 24, 2022

@Jose4gg thank you for this!
@gu-stav Just a heads up, I've noticed that the documentation was updated to include the Step inside of the Content-Type field Advanced Settings (https://docs.strapi.io/user-docs/latest/content-types-builder/configuring-fields-content-type.html#date). I've looked into it and couldn't find it until I found out it's inside of the Configure the View settings and not the field Advanced Settings.

@Jose4gg
Copy link
Contributor Author

Jose4gg commented Aug 24, 2022

@Coderwelsch @esiao Welcome, happy to contribute! 🙌

@gu-stav
Copy link
Contributor

gu-stav commented Aug 24, 2022

@esiao Thank you for sharing that insight. I agree it is not ideal - I will talk to the docs team next week to see how we can improve that situation.

@strapi-bot
Copy link

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/decrease-the-time-granularity-on-datetime-picker/19769/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: enhancement This PR adds or updates some part of the codebase or features source: core:content-type-builder Source is core/content-type-builder package

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

10 participants