UX: Use the same text for linking to more categories and tags in sidebar (#18275)

Before this change, anonymous user and a logged in user used different
text for the links to the categories and tags routes.

Follow-up to 321aa4b4b4
This commit is contained in:
Alan Guo Xiang Tan 2022-09-19 12:01:08 +08:00 committed by GitHub
parent 9a76456986
commit 754ad42344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 39 additions and 35 deletions

View File

@ -14,9 +14,6 @@
@prefixColor={{sectionLink.prefixColor}} >
</Sidebar::SectionLink>
{{/each}}
<Sidebar::SectionLink
@linkName="more-categories"
@content={{i18n "sidebar.more"}}
@route="discovery.categories"
/>
<Sidebar::Common::AllCategoriesSectionLink />
</Sidebar::Section>

View File

@ -10,9 +10,6 @@
@models={{sectionLink.models}} >
</Sidebar::SectionLink>
{{/each}}
<Sidebar::SectionLink
@linkName="more-tags"
@content={{i18n "sidebar.more"}}
@route="tags"
/>
<Sidebar::Common::AllTagsSectionLink />
</Sidebar::Section>

View File

@ -0,0 +1,5 @@
<Sidebar::SectionLink
@linkName="all-categories"
@content={{i18n "sidebar.all_categories"}}
@route="discovery.categories"
/>

View File

@ -0,0 +1,3 @@
import templateOnly from "@ember/component/template-only";
export default templateOnly();

View File

@ -0,0 +1,5 @@
<Sidebar::SectionLink
@linkName="all-tags"
@content={{i18n "sidebar.all_tags"}}
@route="tags"
/>

View File

@ -0,0 +1,3 @@
import templateOnly from "@ember/component/template-only";
export default templateOnly();

View File

@ -27,10 +27,6 @@
{{html-safe this.noCategoriesText}}
</Sidebar::SectionMessage>
{{/if}}
<Sidebar::SectionLink
@linkName="more-categories"
@content={{i18n "category.all"}}
@route="discovery.categories"
@class="sidebar-more-link"
/>
<Sidebar::Common::AllCategoriesSectionLink />
</Sidebar::Section>

View File

@ -22,10 +22,6 @@
{{html-safe this.noTagsText}}
</Sidebar::SectionMessage>
{{/if}}
<Sidebar::SectionLink
@linkName="more-tags"
@content={{i18n "tagging.all_tags"}}
@route="tags"
@class="sidebar-more-link"
/>
<Sidebar::Common::AllTagsSectionLink />
</Sidebar::Section>

View File

@ -27,8 +27,8 @@ acceptance("Sidebar - Anonymous Categories Section", function (needs) {
assert.strictEqual(categories[4].textContent.trim(), "ux");
assert.ok(
exists("a.sidebar-section-link-more-categories"),
"more link is visible"
exists("a.sidebar-section-link-all-categories"),
"all categories link is visible"
);
});
@ -46,8 +46,8 @@ acceptance("Sidebar - Anonymous Categories Section", function (needs) {
assert.strictEqual(categories[2].textContent.trim(), "blog");
assert.ok(
exists("a.sidebar-section-link-more-categories"),
"more link is visible"
exists("a.sidebar-section-link-all-categories"),
"all categories link is visible"
);
});
});

View File

@ -30,8 +30,8 @@ acceptance("Sidebar - Anonymous Tags Section", function (needs) {
assert.strictEqual(categories[2].textContent.trim(), "fun");
assert.ok(
exists("a.sidebar-section-link-more-tags"),
"more link is visible"
exists("a.sidebar-section-link-all-tags"),
"all tags link is visible"
);
});
});
@ -60,8 +60,8 @@ acceptance("Sidebar - Anonymous Tags Section - default tags", function (needs) {
assert.strictEqual(categories[1].textContent.trim(), "meta");
assert.ok(
exists("a.sidebar-section-link-more-tags"),
"more link is visible"
exists("a.sidebar-section-link-all-tags"),
"all tags link is visible"
);
});
});

View File

@ -43,7 +43,7 @@ acceptance(
assert.strictEqual(
count(
".sidebar-section-categories .sidebar-section-link:not(.sidebar-more-link)"
".sidebar-section-categories .sidebar-section-link:not(.sidebar-section-link-all-categories)"
),
1,
"there should only be one section link under the section"
@ -161,7 +161,7 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {
await visit("/");
const categorySectionLinks = queryAll(
".sidebar-section-categories .sidebar-section-link:not(.sidebar-more-link)"
".sidebar-section-categories .sidebar-section-link:not(.sidebar-section-link-all-categories)"
);
const categoryNames = [...categorySectionLinks].map((categorySectionLink) =>
@ -182,7 +182,7 @@ acceptance("Sidebar - Logged on user - Categories Section", function (needs) {
assert.strictEqual(
count(
".sidebar-section-categories .sidebar-section-link:not(.sidebar-more-link)"
".sidebar-section-categories .sidebar-section-link:not(.sidebar-section-link-all-categories)"
),
3,
"there should only be 3 section link under the section"

View File

@ -123,7 +123,7 @@ acceptance("Sidebar - Logged on user - Tags section", function (needs) {
await visit("/");
const tagSectionLinks = queryAll(
".sidebar-section-tags .sidebar-section-link:not(.sidebar-more-link)"
".sidebar-section-tags .sidebar-section-link:not(.sidebar-section-link-all-tags)"
);
const tagNames = [...tagSectionLinks].map((tagSectionLink) =>
@ -142,7 +142,7 @@ acceptance("Sidebar - Logged on user - Tags section", function (needs) {
assert.strictEqual(
count(
".sidebar-section-tags .sidebar-section-link:not(.sidebar-more-link)"
".sidebar-section-tags .sidebar-section-link:not(.sidebar-section-link-all-tags)"
),
4,
"4 section links under the section"

View File

@ -4097,6 +4097,8 @@ en:
other: "%{count} new"
toggle_section: "toggle section"
more: "More..."
all_categories: "All categories"
all_tags: "All tags"
sections:
messages:
header_link_text: "Messages"