FEATURE: Add "Recently read topics" tab to user activity page (#12047)

This commit is contained in:
Arpit Jalan 2021-02-11 22:36:50 +05:30 committed by GitHub
parent 66151d8056
commit 12b57c0dee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 0 deletions

View File

@ -102,6 +102,11 @@ export default Controller.extend(CanCheckEmails, {
return viewingSelf;
},
@discourseComputed("viewingSelf")
showRead(viewingSelf) {
return viewingSelf;
},
@discourseComputed("viewingSelf", "currentUser.admin")
showPrivateMessages(viewingSelf, isAdmin) {
return (

View File

@ -125,6 +125,7 @@ export default function () {
});
this.route("pending");
this.route("drafts");
this.route("read");
}
);

View File

@ -0,0 +1,12 @@
import UserAction from "discourse/models/user-action";
import UserTopicListRoute from "discourse/routes/user-topic-list";
export default UserTopicListRoute.extend({
userActionType: UserAction.TYPES.topics,
model() {
return this.store.findFiltered("topicList", {
filter: "read",
});
},
});

View File

@ -9,6 +9,11 @@
<li>
{{#link-to "userActivity.replies"}}{{i18n "user_action_groups.5"}}{{/link-to}}
</li>
{{#if user.showRead}}
<li>
{{#link-to "userActivity.read" title=(i18n "user.read_help")}}{{i18n "user.read"}}{{/link-to}}
</li>
{{/if}}
{{#if user.showDrafts}}
<li>
{{#link-to "userActivity.drafts"}}{{i18n "user_action_groups.15"}}{{/link-to}}

View File

@ -31,6 +31,9 @@ module("Unit | Model | user-stream", function () {
// defaults to posts/topics
assert.equal(stream.get("filterParam"), "4,5");
stream.set("filter", UserAction.TYPES.topics);
assert.equal(stream.get("filterParam"), "4");
stream.set("filter", UserAction.TYPES.likes_given);
assert.equal(stream.get("filterParam"), UserAction.TYPES.likes_given);

View File

@ -967,6 +967,8 @@ en:
sunday: "Sunday"
to: "to"
activity_stream: "Activity"
read: "Read"
read_help: "Recently read topics"
preferences: "Preferences"
feature_topic_on_profile:
open_search: "Select a New Topic"