mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:43:54 -06:00
UX: Add badges section link to community section. (#18044)
We have a link to /badges in the old hamburger dropdown so maintaining parity here.
This commit is contained in:
parent
d390805e40
commit
e3501a207f
@ -14,6 +14,7 @@ import UsersSectionLink from "discourse/lib/sidebar/user/community-section/users
|
|||||||
import AboutSectionLink from "discourse/lib/sidebar/user/community-section/about-section-link";
|
import AboutSectionLink from "discourse/lib/sidebar/user/community-section/about-section-link";
|
||||||
import FAQSectionLink from "discourse/lib/sidebar/user/community-section/faq-section-link";
|
import FAQSectionLink from "discourse/lib/sidebar/user/community-section/faq-section-link";
|
||||||
import AdminSectionLink from "discourse/lib/sidebar/user/community-section/admin-section-link";
|
import AdminSectionLink from "discourse/lib/sidebar/user/community-section/admin-section-link";
|
||||||
|
import BadgesSectionLink from "discourse/lib/sidebar/user/community-section/badges-section-link";
|
||||||
|
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
@ -27,7 +28,11 @@ const MAIN_SECTION_LINKS = [
|
|||||||
|
|
||||||
const ADMIN_MAIN_SECTION_LINKS = [AdminSectionLink];
|
const ADMIN_MAIN_SECTION_LINKS = [AdminSectionLink];
|
||||||
|
|
||||||
const MORE_SECTION_LINKS = [GroupsSectionLink, UsersSectionLink];
|
const MORE_SECTION_LINKS = [
|
||||||
|
GroupsSectionLink,
|
||||||
|
UsersSectionLink,
|
||||||
|
BadgesSectionLink,
|
||||||
|
];
|
||||||
const MORE_SECONDARY_SECTION_LINKS = [AboutSectionLink, FAQSectionLink];
|
const MORE_SECONDARY_SECTION_LINKS = [AboutSectionLink, FAQSectionLink];
|
||||||
|
|
||||||
export default class SidebarUserCommunitySection extends Component {
|
export default class SidebarUserCommunitySection extends Component {
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
import I18n from "I18n";
|
||||||
|
|
||||||
|
import BaseSectionLink from "discourse/lib/sidebar/user/community-section/base-section-link";
|
||||||
|
|
||||||
|
export default class BadgesSectionLink extends BaseSectionLink {
|
||||||
|
get name() {
|
||||||
|
return "badges";
|
||||||
|
}
|
||||||
|
|
||||||
|
get route() {
|
||||||
|
return "badges";
|
||||||
|
}
|
||||||
|
|
||||||
|
get title() {
|
||||||
|
return I18n.t("badges.title");
|
||||||
|
}
|
||||||
|
|
||||||
|
get text() {
|
||||||
|
return I18n.t("badges.title");
|
||||||
|
}
|
||||||
|
}
|
@ -229,6 +229,22 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("clicking on badges link", async function (assert) {
|
||||||
|
await visit("/");
|
||||||
|
|
||||||
|
await click(
|
||||||
|
".sidebar-section-community .sidebar-more-section-links-details-summary"
|
||||||
|
);
|
||||||
|
|
||||||
|
await click(".sidebar-section-community .sidebar-section-link-badges");
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
currentURL(),
|
||||||
|
"/badges",
|
||||||
|
"it should transition to the badges url"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
test("clicking on groups link", async function (assert) {
|
test("clicking on groups link", async function (assert) {
|
||||||
await visit("/t/280");
|
await visit("/t/280");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user