mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 10:15:48 +08:00
e1e74abd4f
### UI Changes If `SiteSetting.enable_bookmarks_with_reminders` is enabled: * Clicking "Bookmark" on a topic will create a new Bookmark record instead of a post + user action * Clicking "Clear Bookmarks" on a topic will delete all the new Bookmark records on a topic * The topic bookmark buttons control the post bookmark flags correctly and vice-versa Disabled selecting the "reminder type" for bookmarks in the UI because the backend functionality is not done yet (of sending users notifications etc.) ### Other Changes * Added delete bookmark route (but no UI yet) * Added a rake task to sync the old PostAction bookmarks to the new Bookmark table, which can be run as many times as we want for a site (it will not create duplicates).
25 lines
617 B
Ruby
25 lines
617 B
Ruby
# frozen_string_literal: true
|
|
|
|
Fabricator(:bookmark) do
|
|
user
|
|
post { Fabricate(:post) }
|
|
topic { |attrs| attrs[:post].topic }
|
|
name "This looked interesting"
|
|
reminder_type { Bookmark.reminder_types[:tomorrow] }
|
|
reminder_at { (Time.now.utc + 1.day).iso8601 }
|
|
end
|
|
|
|
Fabricator(:bookmark_next_business_day_reminder, from: :bookmark) do
|
|
reminder_type { Bookmark.reminder_types[:next_business_day] }
|
|
reminder_at do
|
|
date = if Time.now.utc.friday?
|
|
Time.now.utc + 3.days
|
|
elsif Time.now.utc.saturday?
|
|
Time.now.utc + 2.days
|
|
else
|
|
Time.now.utc + 1.day
|
|
end
|
|
date.iso8601
|
|
end
|
|
end
|