mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 02:30:57 +08:00
3e3f3f7b7e
This PR moves all of the time picking functionality from the bookmark modal and controller into a reusable time-shortcut-picker component, which will be used for the topic timer UI revamp. All of the utility JS for getting dates like tomorrow/next week/next month etc. have also been moved into a separate utility lib. The time-shortcut-picker has a couple of options that can be passed in: * prefilledDatetime - The date and time to parse and prefill into the custom date and time section, useful for editing interfaces. * onTimeSelected (callback) - Called when one of the time shortcuts is clicked, and passes the type of the shortcut (e.g. tomorrow) and the datetime selected. * additionalOptionsToShow - An array of option ids to show (by default `later_today` and `later_this_week` are hidden) * hiddenOptions - An array of option ids to hide * customOptions - An array of custom options to display (e.g. the option to select a post date for the bookmarks modal). The options should have the below properties: * id * icon * label (I18n key) * time (moment datetime object) * timeFormatted * hidden The other major work in this PR is moving all of the bookmark functionality out of the bookmark modal controller and into its own component, where it makes more sense to be able to access elements on the page via `document`. Tests have been added to accompany this move, and existing acceptance tests for bookmark are all passing. |
||
---|---|---|
.. | ||
admin | ||
base | ||
components | ||
foundation | ||
select-kit | ||
d-editor.scss | ||
input_tip.scss | ||
printer-friendly.scss | ||
topic-entrance.scss | ||
topic-timeline.scss |