FEATURE: Add "Recently read topics" tab to user activity page (#12047)
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -125,6 +125,7 @@ export default function () {
|
||||
});
|
||||
this.route("pending");
|
||||
this.route("drafts");
|
||||
this.route("read");
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -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}}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user