FEATURE: Optionally delete bookmark when reminder sent (#9637)

We now show an options gear icon next to the bookmark name.

When expanded we show the "delete bookmark when reminder sent" option. The value of this checkbox is saved in local storage for the user.

If this is ticked, when a reminder is sent for the bookmark the bookmark itself is deleted. This is so people can use the reminder functionality by itself.

Also remove the blue alert reminder section from the "Edit Bookmark" modal as it just added clutter, because the user can already see they had a reminder set:

Adds a default false boolean column `delete_when_reminder_sent` to bookmarks.
This commit is contained in:
Martin Brennan
2020-05-07 13:37:39 +10:00
committed by GitHub
parent 423802fbce
commit 6fb0f36ce1
14 changed files with 196 additions and 31 deletions
@@ -106,6 +106,30 @@ test("Saving a bookmark with a reminder", async assert => {
assert.verifySteps(["tomorrow"]);
});
test("Opening the options panel and remembering the option", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await click(".bookmark-options-button");
assert.ok(
exists(".bookmark-options-panel"),
"it should open the options panel"
);
await click("#delete_when_reminder_sent");
await click("#save-bookmark");
await openEditBookmarkModal();
assert.ok(
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.verifySteps(["none"]);
});
test("Saving a bookmark with no reminder or name", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");