mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 17:13:39 +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. |
||
---|---|---|
.. | ||
cloud/cloud66 | ||
environments | ||
initializers | ||
locales | ||
application.rb | ||
boot.rb | ||
cdn.yml.sample | ||
database.yml | ||
deploy.rb.sample | ||
discourse_defaults.conf | ||
discourse.config.sample | ||
discourse.pill.sample | ||
environment.rb | ||
logrotate.conf | ||
multisite.yml.production-sample | ||
nginx.global.conf | ||
nginx.sample.conf | ||
projections.json | ||
puma.rb | ||
routes.rb | ||
sidekiq.yml | ||
site_settings.yml | ||
spring.rb | ||
thin.yml.sample | ||
unicorn_launcher | ||
unicorn_upstart.conf | ||
unicorn.conf.rb |