We weren't using this very much and introduces a dependency between
discourse-common and discourse which makes moving to yarn workspaces
more difficult.
In the future we might user ember-addons properly but for now it's
easier to move the code into discourse-common.
Note the old folder is still there because at least one plugin was still
requiring the old files. It will be removed in the future.
rebuilding user_actions is not something that should be done.
Plugins such as solved and assigned extend it, there are tons of
little rules that were not captured in `user_actions:rebuild`
Make sure the topic_user.bookmarked column is set correctly when user bookmarks/unbookmarks any post in a topic. For example, you bookmarked a post in the topic that was not the OP, the bookmark icon in the topic list would not be shown. Same if deleting a bookmark for the last bookmarked post in a topic, the bookmark icon in the topic list would not be removed.
Previously this was only setting it to true if bookmarking the OP/topic, which was not correct -- we want to show the icon on the topic list if any post is bookmarked.
Also set to false if unbookmarking the last bookmarked post in the topic.
Also in this PR is a migration to correct any out of sync topic_user.bookmarked columns, based on the new logic.
The local time was not updating between user cards because the computed property was not used correctly.
There's an old saying in Tennessee — I know it's in Texas, probably in Tennessee — that says, fool me once computed properties, shame on — shame on you. Fool me — you can't get fooled again.
This commit reworks slightly the `toggleBookmark` and `toggleBookmarkTopic` functions.
- Pressing [f] (toggleBookmarkTopic)
- a topic list item is selected, we attempt to toggle the related topic
- a post is selected, we bookmark the current topic
- nothing is selected, if there's a currentTopic we bookmark it
- Pressing [b] (toggleBookmark)
- a post is selected, we bookmark it
- a topic list item is selected, we attempt to toggle the related topic
- nothing is selected, if there's a currentTopic we bookmark it
Note this, commit also reduces jquery usage, a bug where the [f] shortcut was propagated to the modal input, and fixes bug when bookmarking a topic list item on the front page and the firstPost couldn't be found.
This adds a site setting (default off) to optionally show a user's local time and timezone in their user card. For example, I live in Brisbane, and if at 3:30PM my time I were to open a user who lives in California's card I would see 22:30 (PST).
FEATURE: dismiss first notification on click anywhere
Quicker jumpstart for those already familiar with the platform:
Allow dismissal of first notification mask from any click.
On the dismissal click, we also need to send a "yes I saw it" confirmation
by grabbing a batch of notifications. This prevents the dialog from appearing
again on refresh, or other browsers and ensures we only see it once.