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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import NotificationItemBase from "discourse/lib/notification-items/base";
import { userPath } from "discourse/lib/url";
import I18n from "I18n";
export default class extends NotificationItemBase {
@ -12,4 +13,10 @@ export default class extends NotificationItemBase {
get label() {
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"
);
});
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"
);
});
}
);