-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Split datetime into three UI types #1093
Conversation
Dependent on #1089. |
@silentninja I made some slight refactors to the display options serializer. Could you give it a quick glance for a sanity check? |
@dmos62 can you mark as a draft since this isn't ready to be merged (due to other PRs needing to be merged first?) |
@kgodey undrafting is part of the process to mark this as ready for review. Should I undraft and redraft in this case? Edit: code review guidelines for authors don't account for the scenario where a PR shouldn't be merged, but can be reviewed. |
Major changes after sync call. What frontend needs to know (first post is now outdated):
|
@dmos62 I would either:
Please update the code review guidelines in the wiki. Also, I recommend basing as many PRs as you can off of |
@kgodey I'll update the wiki.
I'm already doing that. Most PRs end up implementing something that will affect the other PRs. I also sometimes base off another dev branch to avoid having to resolve merge conflicts. |
@silentninja after implementing changes requested in sync call, most of the refactor I mentioned has been removed, because most of the code it was refactoring isn't necessary anymore. You might want to take a look anyway, but now the code is pretty simple, so you're not missing out if you don't. |
serializers.Serializer | ||
): | ||
format = serializers.CharField(validators=[TimeWithoutTimeZoneFormatValidator()]) | ||
format = serializers.CharField(validators=[is_time_format_valid]) |
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.
It would be better to use the max_length
parameter instead of custom validator, this would help up to throw errors with proper error codes.
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.
Fixed 27f75ca
@kgodey should be ready for merge. |
Codecov Report
@@ Coverage Diff @@
## master #1093 +/- ##
==========================================
- Coverage 93.38% 93.25% -0.13%
==========================================
Files 112 112
Lines 4291 4243 -48
==========================================
- Hits 4007 3957 -50
- Misses 284 286 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@dmos62 sounds good, assigned to @silentninja to merge since he already reviewed it. |
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.
Also, remove the arrow
library` as it is unnecessary. Please make the requested changes and merge.
|
||
|
||
class DurationDisplayOptionSerializer(MathesarErrorMessageMixin, OverrideRootPartialMixin, serializers.Serializer): | ||
format = serializers.CharField(validators=[DurationFormatValidator()]) | ||
format = serializers.CharField(max_length=255, validators=[raise_if_duration_format_invalid]) |
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.
Based on our conclusion, other than a character length check, we don't need any additional validators. So the validators
field and the validation function should be removed
…rofci/mathesar into split-datetime-into-three-ui-types
Removed arrow library and custom time/duration format validation. |
Fixes #960
Changes the definition of Mathesar/UI types. What was before
datetime
UI type, now isdate
,time
anddatetime
types.Technical details
Below description is outdated. See this comment: #1093 (comment)
@pavish @seancolsen these types' display options are different too.
datetime
initially acceptedformat
display option. Now,datetime
acceptsdate_format
andtime_format
display options:date
acceptsdate_format
: and,time
acceptstime_format
.Checklist
Update index.md
).master
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin