DEV: Make group message summary notification Link to the group inbox (#17884)

This fix is for the experimental user menu.
This commit is contained in:
Osama Sayegh
2022-08-12 15:15:43 +03:00
committed by GitHub
parent b5a6015155
commit 69664d2153
2 changed files with 21 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import NotificationItemBase from "discourse/lib/notification-items/base"; import NotificationItemBase from "discourse/lib/notification-items/base";
import { userPath } from "discourse/lib/url";
import I18n from "I18n"; import I18n from "I18n";
export default class extends NotificationItemBase { export default class extends NotificationItemBase {
@@ -12,4 +13,10 @@ export default class extends NotificationItemBase {
get label() { get label() {
return null; return null;
} }
get linkHref() {
return userPath(
`${this.notification.data.username}/messages/group/${this.notification.data.group_name}`
);
}
} }

View File

@@ -47,5 +47,19 @@ discourseModule(
"displays the right content" "displays the right content"
); );
}); });
test("linkHref", function (assert) {
const notification = getNotification();
const director = createRenderDirector(
notification,
"group_message_summary",
this.siteSettings
);
assert.strictEqual(
director.linkHref,
"/u/drummers.boss/messages/group/drummers",
"links to the group inbox in the user profile"
);
});
} }
); );