mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Promote bookmarks with reminders to core functionality (#9369)
The main thrust of this PR is to take all the conditional checks based on the `enable_bookmarks_with_reminders` away and only keep the code from the `true` path, making bookmarks with reminders the core bookmarks feature. There is also a migration to create `Bookmark` records out of `PostAction` bookmarks for a site. ### Summary * Remove logic based on whether enable_bookmarks_with_reminders is true. This site setting is now obsolete, the old bookmark functionality is being removed. Retain the setting and set the value to `true` in a migration. * Use the code from the rake task to create a database migration that creates bookmarks from post actions. * Change the bookmark report to read from the new table. * Get rid of old endpoints for bookmarks * Link to the new bookmarks list from the user summary page
This commit is contained in:
@@ -397,10 +397,7 @@ QUnit.test(
|
||||
);
|
||||
|
||||
acceptance("Topic + Post Bookmarks with Reminders", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
enable_bookmarks_with_reminders: true
|
||||
}
|
||||
loggedIn: true
|
||||
});
|
||||
|
||||
QUnit.test("Bookmarks Modal", async assert => {
|
||||
|
||||
@@ -12,7 +12,7 @@ QUnit.test("updating of associated accounts", function(assert) {
|
||||
is_anonymous: true
|
||||
}),
|
||||
currentUser: EmberObject.create({
|
||||
id: 1234,
|
||||
id: 1234
|
||||
}),
|
||||
site: EmberObject.create({
|
||||
isMobileDevice: false
|
||||
|
||||
@@ -397,6 +397,34 @@ export default {
|
||||
featured_user_badge_ids: [5870, 40673, 5868]
|
||||
}
|
||||
},
|
||||
"/u/eviltrout/bookmarks.json": {
|
||||
user_bookmark_list: {
|
||||
bookmarks: [
|
||||
{
|
||||
excerpt: "Here this is my new topic where I yell.",
|
||||
tags: [],
|
||||
id: 576,
|
||||
created_at: "2020-04-07T05:30:40.446Z",
|
||||
topic_id: 119,
|
||||
linked_post_number: 1,
|
||||
post_id: 281,
|
||||
name: "test",
|
||||
reminder_at: null,
|
||||
title: "Yelling topic title :/",
|
||||
deleted: false,
|
||||
hidden: false,
|
||||
category_id: 1,
|
||||
closed: false,
|
||||
archived: false,
|
||||
archetype: "regular",
|
||||
highest_post_number: 5,
|
||||
bumped_at: "2020-04-06T05:20:00.172Z",
|
||||
slug: "yelling-topic-title",
|
||||
username: "someguy"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/user_actions.json": {
|
||||
user_actions: [
|
||||
{
|
||||
|
||||
@@ -31,7 +31,6 @@ Discourse.SiteSettingsOriginal = {
|
||||
allow_new_registrations: true,
|
||||
enable_google_logins: true,
|
||||
enable_google_oauth2_logins: false,
|
||||
enable_bookmarks_with_reminders: false,
|
||||
enable_twitter_logins: true,
|
||||
enable_facebook_logins: true,
|
||||
enable_github_logins: true,
|
||||
|
||||
@@ -532,19 +532,19 @@ widgetTest("can't bookmark", {
|
||||
|
||||
widgetTest("bookmark", {
|
||||
template:
|
||||
'{{mount-widget widget="post" args=args toggleBookmark=(action "toggleBookmark")}}',
|
||||
'{{mount-widget widget="post" args=args toggleBookmarkWithReminder=(action "toggleBookmarkWithReminder")}}',
|
||||
beforeEach() {
|
||||
const args = { canBookmark: true };
|
||||
|
||||
this.set("args", args);
|
||||
this.on("toggleBookmark", () => (args.bookmarked = true));
|
||||
this.on(
|
||||
"toggleBookmarkWithReminder",
|
||||
() => (args.bookmarked_with_reminder = true)
|
||||
);
|
||||
},
|
||||
async test(assert) {
|
||||
assert.equal(find(".post-menu-area .bookmark").length, 1);
|
||||
assert.equal(find("button.bookmarked").length, 0);
|
||||
|
||||
await click("button.bookmark");
|
||||
assert.equal(find("button.bookmarked").length, 1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -145,11 +145,9 @@ widgetTest("bookmarks", {
|
||||
const bookmark = find(".quick-access-panel li a")[0];
|
||||
assert.ok(bookmark);
|
||||
|
||||
assert.ok(bookmark.href.includes("/t/yelling-topic-title/119"));
|
||||
assert.ok(
|
||||
bookmark.href.includes("/t/how-to-check-the-user-level-via-ajax/11993")
|
||||
);
|
||||
assert.ok(
|
||||
bookmark.innerHTML.includes("Abhishek_Gupta"),
|
||||
bookmark.innerHTML.includes("someguy"),
|
||||
"should include the last poster's username"
|
||||
);
|
||||
assert.ok(
|
||||
|
||||
Reference in New Issue
Block a user