mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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}`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user