martin
(Martin Brennan)
28.Апрель.2020 06:47:41
121
Сегодня был продуктивный день. Были слиты следующие PR, и все, кроме последнего, уже работают на Meta:
master ← jjaffeux:no-bookmark
merged 01:19AM - 28 Apr 20 UTC
master ← jjaffeux:stop-shortcut-propagation
merged 12:33AM - 28 Apr 20 UTC
This commit reworks slightly the `toggleBookmark` and `toggleBookmarkTopic` func… tions.
The following cases have been identified:
- Pressing [f] (toggleBookmarkTopic)
- a topic list item is selected, we attempt to toggle the related topic
- a post is selected, we bookmark the associated 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 attempts to fix a bug when bookmarking a topic list item on the front page and the firstPost couldn't be found, current repro before fix:
- navigate to /
- press [j] to select a topic list item
- press [f]
- `Uncaught TypeError: Cannot read property 'post_number' of undefined` error appears in console, the topic is not bookmarked
master ← issue/fix-topic-user-bookmarked-column-logic
merged 06:19AM - 28 Apr 20 UTC
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.
А FIX: Do not save bookmark if close (X) on modal is clicked by martin-brennan · Pull Request #9541 · discourse/discourse · GitHub должен быть слит в ближайшее время. У меня также есть PR для возврата URL /bookmarks-with-reminders к /bookmarks; надеюсь, слить его завтра: FIX: Change bookmarks-with-reminders URL back to bookmarks for user activity by martin-brennan · Pull Request #9566 · discourse/discourse · GitHub .
Исправление «Логика столбца закладок пользователя по теме была некорректной» должно появиться на Meta в ближайшие пару часов. Позже на этой неделе мы выпустим ещё одну бета-версию со всеми этими исправлениями.
18 лайков