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:
Martin Brennan
2020-07-21 10:00:39 +10:00
committed by GitHub
parent 949c8923a4
commit 41b43a2a25
19 changed files with 178 additions and 73 deletions

View File

@ -1,4 +1,5 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import {
acceptance,
loggedInUser,
@ -115,7 +116,8 @@ test("Opening the options panel and remembering the option", async assert => {
exists(".bookmark-options-panel"),
"it should open the options panel"
);
await click("#delete_when_reminder_sent");
await selectKit(".bookmark-option-selector").expand();
await selectKit(".bookmark-option-selector").selectRowByValue(1);
await click("#save-bookmark");
await openEditBookmarkModal();
@ -123,9 +125,11 @@ test("Opening the options panel and remembering the option", async assert => {
exists(".bookmark-options-panel"),
"it should reopen the options panel"
);
assert.ok(
exists(".bookmark-options-panel #delete_when_reminder_sent:checked"),
"it should pre-check delete when reminder sent option"
assert.equal(
selectKit(".bookmark-option-selector")
.header()
.value(),
1
);
assert.verifySteps(["none"]);
});