mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:57:15 +08:00
FEATURE: Add "delete on owner reply" bookmark functionality (#10231)
This adds an option to "delete on owner reply" to bookmarks. If you select this option in the modal, then reply to the topic the bookmark is in, the bookmark will be deleted on reply. This PR also changes the checkboxes for these additional bookmark options to an Integer column in the DB with a combobox to select the option you want. The use cases are: * Sometimes I will bookmark the topics to read it later. In this case we definitely don’t need to keep the bookmark after I replied to it. * Sometimes I will read the topic in mobile and I will prefer to reply in PC later. Or I may have to do some research before reply. So I will bookmark it for reply later.
This commit is contained in:
@ -654,6 +654,19 @@ describe PostCreator do
|
||||
end
|
||||
end
|
||||
|
||||
context "when the user has bookmarks with auto_delete_preference on_owner_reply" do
|
||||
before do
|
||||
Fabricate(:bookmark, topic: topic, user: user, auto_delete_preference: Bookmark.auto_delete_preferences[:on_owner_reply])
|
||||
Fabricate(:bookmark, topic: topic, user: user, auto_delete_preference: Bookmark.auto_delete_preferences[:on_owner_reply])
|
||||
Fabricate(:bookmark, topic: topic, user: user)
|
||||
Fabricate(:bookmark, user: user)
|
||||
end
|
||||
it "deletes the bookmarks" do
|
||||
creator.create
|
||||
expect(Bookmark.where(user: user).count).to eq(2)
|
||||
end
|
||||
end
|
||||
|
||||
context "topic stats" do
|
||||
before do
|
||||
PostCreator.new(
|
||||
|
Reference in New Issue
Block a user