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:
parent
b5a6015155
commit
69664d2153
|
@ -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}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue