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}} > @prefixColor={{sectionLink.prefixColor}} >
</Sidebar::SectionLink> </Sidebar::SectionLink>
{{/each}} {{/each}}
<Sidebar::SectionLink
@linkName="more-categories" <Sidebar::Common::AllCategoriesSectionLink />
@content={{i18n "sidebar.more"}}
@route="discovery.categories"
/>
</Sidebar::Section> </Sidebar::Section>

View File

@ -10,9 +10,6 @@
@models={{sectionLink.models}} > @models={{sectionLink.models}} >
</Sidebar::SectionLink> </Sidebar::SectionLink>
{{/each}} {{/each}}
<Sidebar::SectionLink
@linkName="more-tags" <Sidebar::Common::AllTagsSectionLink />
@content={{i18n "sidebar.more"}}
@route="tags"
/>
</Sidebar::Section> </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}} {{html-safe this.noCategoriesText}}
</Sidebar::SectionMessage> </Sidebar::SectionMessage>
{{/if}} {{/if}}
<Sidebar::SectionLink
@linkName="more-categories" <Sidebar::Common::AllCategoriesSectionLink />
@content={{i18n "category.all"}}
@route="discovery.categories"
@class="sidebar-more-link"
/>
</Sidebar::Section> </Sidebar::Section>

View File

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

View File

@ -27,8 +27,8 @@ acceptance("Sidebar - Anonymous Categories Section", function (needs) {
assert.strictEqual(categories[4].textContent.trim(), "ux"); assert.strictEqual(categories[4].textContent.trim(), "ux");
assert.ok( assert.ok(
exists("a.sidebar-section-link-more-categories"), exists("a.sidebar-section-link-all-categories"),
"more link is visible" "all categories link is visible"
); );
}); });
@ -46,8 +46,8 @@ acceptance("Sidebar - Anonymous Categories Section", function (needs) {
assert.strictEqual(categories[2].textContent.trim(), "blog"); assert.strictEqual(categories[2].textContent.trim(), "blog");
assert.ok( assert.ok(
exists("a.sidebar-section-link-more-categories"), exists("a.sidebar-section-link-all-categories"),
"more link is visible" "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.strictEqual(categories[2].textContent.trim(), "fun");
assert.ok( assert.ok(
exists("a.sidebar-section-link-more-tags"), exists("a.sidebar-section-link-all-tags"),
"more link is visible" "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.strictEqual(categories[1].textContent.trim(), "meta");
assert.ok( assert.ok(
exists("a.sidebar-section-link-more-tags"), exists("a.sidebar-section-link-all-tags"),
"more link is visible" "all tags link is visible"
); );
}); });
}); });

View File

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

View File

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