-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
UI: Part three bug bash custom messages #25229
UI: Part three bug bash custom messages #25229
Conversation
CI Results: |
Build Results: |
ui/lib/config-ui/addon/components/messages/message-expiration-date-form.hbs
Outdated
Show resolved
Hide resolved
ui/lib/config-ui/addon/components/messages/page/create-and-edit-message-form.hbs
Outdated
Show resolved
Hide resolved
ui/lib/config-ui/addon/components/messages/page/create-and-edit-message-form.hbs
Outdated
Show resolved
Hide resolved
ui/lib/config-ui/addon/components/messages/page/create-and-edit-message-form.hbs
Outdated
Show resolved
Hide resolved
const start = new Date(model.startTime); | ||
const end = new Date(model.endTime); | ||
return isBefore(start, end); |
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.
If the start and end times are ISO strings you can pass those directly to isBefore
without needing to create date objects.
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.
These strings are in datetime local format. :)
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.
Sounds good. isBefore
should accept that format without needing to convert to a date object but just more of an FYI than anything 😄
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.
Good to know I'll update that!
this.messageEndTime = e.target.value; | ||
this.args.message.endTime = this.messageEndTime; |
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.
Curious why you are tracking the endTime
with a local variable rather than directly mutating the property on args.message
?
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.
We'll need some way to remember the old endTime
that was selected. If a user selects a specific date, and decides to click 'never', but then goes back to select specific date they'll have their previous state.
* Address comments * Fix serailizer warning mesage * Reset pageFilter when exiting * Add start and end time validation and fix bugs * Fix failing tests * Add validation tests * Set end time in contorller * Address feedback * Remove new date * Put new Date back
Rest pageFilter when exiting
Add start and end time client side validation. Fixes issue where start time was setting date to 1969 when user types in date / time with a prefix of 0.