FIX: rename everything link to topics (#22076)

Rename everything link in community sidebar section to topics, which is
a bit more descriptive.
This commit is contained in:
Krzysztof Kotlarek 2023-06-15 11:36:38 +10:00 committed by GitHub
parent f75ac9da30
commit 959c50001d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 46 additions and 133 deletions

View File

@ -24,7 +24,6 @@ import showModal from "discourse/lib/show-modal";
const SPECIAL_LINKS_MAP = {
"/latest": EverythingSectionLink,
"/new": EverythingSectionLink,
"/about": AboutSectionLink,
"/u": UsersSectionLink,
"/faq": FAQSectionLink,

View File

@ -17,7 +17,7 @@ acceptance("Sidebar - Anonymous user - Community Section", function (needs) {
needs.site({});
test("everything section link is shown by default ", async function (assert) {
test("topics section link is shown by default ", async function (assert) {
await visit("/");
const sectionLinks = queryAll(
@ -26,8 +26,8 @@ acceptance("Sidebar - Anonymous user - Community Section", function (needs) {
assert.strictEqual(
sectionLinks[0].textContent.trim(),
I18n.t("sidebar.sections.community.links.everything.content"),
"displays the everything section link first"
I18n.t("sidebar.sections.community.links.topics.content"),
"displays the topics section link first"
);
});

View File

@ -59,7 +59,7 @@ export default {
links: [
{
id: 329,
name: "Everything",
name: "Topics",
value: "/latest",
icon: "layer-group",
external: false,

View File

@ -707,7 +707,7 @@ export default {
links: [
{
id: 329,
name: "Everything",
name: "Topics",
value: "/latest",
icon: "layer-group",
external: false,

View File

@ -9,7 +9,7 @@ class SidebarUrl < ActiveRecord::Base
MAX_VALUE_LENGTH = 200
COMMUNITY_SECTION_LINKS = [
{
name: "Everything",
name: "Topics",
path: "/latest",
icon: "layer-group",
segment: SidebarUrl.segments["primary"],

View File

@ -4766,9 +4766,6 @@ ar:
badges:
content: "الشارات"
title: "كل الشارات الممكن منحها لك"
everything:
content: "كل شيء"
title: "كل الموضوعات"
faq:
content: "الأسئلة الشائعة"
title: "إرشادات لاستخدام هذا الموقع"

View File

@ -3414,8 +3414,6 @@ bg:
content: "Администратор"
badges:
content: "Значки"
everything:
content: "Всичко"
faq:
content: "FAQ"
groups:

View File

@ -3076,8 +3076,6 @@ bs_BA:
content: "Admin"
badges:
content: "Bedž"
everything:
content: "Sve"
faq:
content: "Česta pitanja"
groups:

View File

@ -2912,8 +2912,6 @@ ca:
content: "Administració"
badges:
content: "Insígnies"
everything:
content: "Qualsevol cosa"
faq:
content: "PMF"
groups:

View File

@ -3126,8 +3126,6 @@ cs:
content: "Administrace"
badges:
content: "Odznaky"
everything:
content: "Vše"
faq:
content: "FAQ"
groups:

View File

@ -3617,8 +3617,6 @@ da:
content: "Admin"
badges:
content: "Emblemer"
everything:
content: "Alting"
faq:
content: "OSS"
groups:

View File

@ -4128,9 +4128,6 @@ de:
badges:
content: "Abzeichen"
title: "Alle Abzeichen, die es zu verdienen gibt"
everything:
content: "Alles"
title: "Alle Themen"
faq:
content: "FAQ"
title: "Richtlinien für die Nutzung dieser Website"

View File

@ -3350,9 +3350,6 @@ el:
content: "Διαχείριση"
badges:
content: "Παράσημα"
everything:
content: "Τα πάνΤα"
title: "Όλα τα θέματα"
faq:
content: "Συχνές ερωτήσεις"
groups:

View File

@ -4477,8 +4477,8 @@ en:
badges:
content: "Badges"
title: "All the badges available to earn"
everything:
content: "Everything"
topics:
content: "Topics"
title: "All topics"
faq:
content: "FAQ"

View File

@ -4055,9 +4055,6 @@ es:
badges:
content: "Insignias"
title: "Todas las insignias disponibles para ganar"
everything:
content: "Todo"
title: "Todos los temas"
faq:
content: "Preguntas frecuentes"
title: "Normas de uso de este sitio"

View File

@ -3415,9 +3415,6 @@ fa_IR:
title: "تنظیمات و گزارش‌های سایت"
badges:
content: "نشان‌ها"
everything:
content: "همه چیز"
title: "همه موضوعات"
faq:
content: "پرسش‌های متداول"
title: "راهنمای استفاده از این سایت"

View File

@ -4039,9 +4039,6 @@ fi:
badges:
content: "Kunniamerkit"
title: "Kaikki ansaittavissa olevat kunniamerkit"
everything:
content: "Kaikki"
title: "Kaikki ketjut"
faq:
content: "UKK"
title: "Ohjeet tämän sivuston käyttöön"

View File

@ -4009,9 +4009,6 @@ fr:
badges:
content: "Badges"
title: "Tous les badges disponibles à gagner"
everything:
content: "Tout"
title: "Tous les sujets"
faq:
content: "FAQ"
title: "Lignes directrices pour l'utilisation de ce site"

View File

@ -3352,8 +3352,6 @@ gl:
content: "Administración"
badges:
content: "Insignias"
everything:
content: "Todo"
faq:
content: "PMF"
groups:

View File

@ -4534,9 +4534,6 @@ he:
badges:
content: "עיטורים"
title: "כל העיטורים שאפשר לקבל"
everything:
content: "הכול"
title: "כל הנושאים"
faq:
content: "שאלות נפוצות"
title: "הנחיות לשימוש באתר הזה"

View File

@ -4198,9 +4198,6 @@ hr:
badges:
content: "Značke"
title: "Sve značke dostupne za osvajanje"
everything:
content: "Sve"
title: "Sve teme"
faq:
content: "ČPP"
title: "Smjernice za korištenje ove stranice"

View File

@ -3714,9 +3714,6 @@ hu:
badges:
content: "Jelvények"
title: "Az összes megszerezhető jelvény"
everything:
content: "Összes"
title: "Minden téma"
faq:
content: "GYIK"
title: "Útmutató az oldal használatához"

View File

@ -2887,8 +2887,6 @@ hy:
content: "Ադմին"
badges:
content: "Կրծքանշաններ"
everything:
content: "Բոլորը"
faq:
content: "ՀՏՀ"
groups:

View File

@ -1962,8 +1962,6 @@ id:
content: "Tentang"
admin:
content: "Admin"
everything:
content: "Semuanya"
faq:
content: "FAQ"
groups:

View File

@ -4002,9 +4002,6 @@ it:
badges:
content: "Distintivi"
title: "Tutti i distintivi disponibili"
everything:
content: "Tutti"
title: "Tutti gli argomenti"
faq:
content: "FAQ"
title: "Linee guida per l'utilizzo di questo sito"

View File

@ -3807,9 +3807,6 @@ ja:
badges:
content: "バッジ"
title: "獲得可能なすべてのバッジ"
everything:
content: "すべて"
title: "すべてのトピック"
faq:
content: "FAQ"
title: "このサイトの利用に関するガイドライン"

View File

@ -3568,9 +3568,6 @@ ko:
content: "관리자"
badges:
content: "배지"
everything:
content: "모두"
title: "모든 글"
faq:
content: "자주하는 질문"
groups:

View File

@ -3570,9 +3570,6 @@ lt:
content: "Adminas"
badges:
content: "Trofėjai"
everything:
content: "Viskas"
title: "Visos temos"
faq:
content: "DUK"
groups:

View File

@ -2815,8 +2815,6 @@ lv:
content: "Administrators"
badges:
content: "Žetoni"
everything:
content: "Viss"
faq:
content: "BUJ"
groups:

View File

@ -3411,8 +3411,6 @@ nb_NO:
content: "Administrator"
badges:
content: "Merker"
everything:
content: "Alt"
faq:
content: "O-S-S"
groups:

View File

@ -4002,9 +4002,6 @@ nl:
badges:
content: "Badges"
title: "Alle beschikbare badges om te verdienen"
everything:
content: "Alles"
title: "Alle topics"
faq:
content: "FAQ"
title: "Richtlijnen voor het gebruik van deze site"

View File

@ -4527,9 +4527,6 @@ pl_PL:
badges:
content: "Odznaki"
title: "Wszystkie odznaki dostępne do zdobycia"
everything:
content: "Wszystko"
title: "Wszystkie tematy"
faq:
content: "FAQ"
title: "Wskazówki dotyczące korzystania z tej witryny"

View File

@ -3499,8 +3499,6 @@ pt:
content: "Administrador"
badges:
content: "Crachás"
everything:
content: "Tudo"
faq:
content: "FAQ"
groups:

View File

@ -4040,9 +4040,6 @@ pt_BR:
badges:
content: "Emblemas"
title: "Todos os emblemas disponíveis para ganhar"
everything:
content: "Tudo"
title: "Todos os Tópicos"
faq:
content: "FAQ"
title: "Diretrizes para usar este site"

View File

@ -2957,8 +2957,6 @@ ro:
content: "Administrator"
badges:
content: "Ecusoane"
everything:
content: "Totul"
faq:
content: "Întrebări frecvente"
groups:

View File

@ -4390,9 +4390,6 @@ ru:
badges:
content: "Награды"
title: "Все награды, которые можно получить"
everything:
content: "Все"
title: "Все темы"
faq:
content: "Правила"
title: "Рекомендации по использованию сайта"

View File

@ -2327,8 +2327,6 @@ sk:
content: "Administrátor"
badges:
content: "Odznaky"
everything:
content: "Všetko"
faq:
content: "Časté otázky"
groups:

View File

@ -3393,8 +3393,6 @@ sl:
content: "Admin"
badges:
content: "Značke"
everything:
content: "Vse"
faq:
content: "Pravila skupnosti"
groups:

View File

@ -4128,9 +4128,6 @@ sv:
badges:
content: "Utmärkelser"
title: "Alla utmärkelser som kan förtjänas"
everything:
content: "Allting"
title: "Alla ämnen"
faq:
content: "Vanliga frågor och svar"
title: "Riktlinjer för att använda denna webbplats"

View File

@ -2457,8 +2457,6 @@ th:
content: "แอดมิน"
badges:
content: "เหรียญ"
everything:
content: "ทุกสิ่ง"
faq:
content: "คำถามที่พบบ่อย"
groups:

View File

@ -4061,9 +4061,6 @@ tr_TR:
badges:
content: "Rozetler"
title: "Kazanılabilecek tüm rozetler"
everything:
content: "Her şey"
title: "Tüm konular"
faq:
content: "SSS"
title: "Bu siteyi kullanmak için kılavuz"

View File

@ -4532,9 +4532,6 @@ uk:
badges:
content: "Нагороди"
title: "Всі значки доступні для отримання"
everything:
content: "Усе"
title: "Всі теми"
faq:
content: "Часті запитання"
title: "Правила використання цього сайту"

View File

@ -3626,8 +3626,6 @@ ur:
content: "ایڈمن"
badges:
content: "بَیج"
everything:
content: "تمام"
faq:
content: "عمومی سوالات"
groups:

View File

@ -3583,9 +3583,6 @@ vi:
content: "Quản trị"
badges:
content: "Huy hiệu"
everything:
content: "Mọi thứ"
title: "Tất cả các chủ đề"
faq:
content: "Câu hỏi thường gặp"
groups:

View File

@ -3909,9 +3909,6 @@ zh_CN:
badges:
content: "徽章"
title: "所有可获得的徽章"
everything:
content: "一切"
title: "所有话题"
faq:
content: "常见问题解答"
title: "使用此站点的准则"

View File

@ -2909,9 +2909,6 @@ zh_TW:
content: "管理員"
badges:
content: "徽章"
everything:
content: "所有"
title: "所有話題"
faq:
content: "常見問答"
groups:

View File

@ -0,0 +1,24 @@
# frozen_string_literal: true
class RenameEverythingToTopicsLink < ActiveRecord::Migration[7.0]
def up
DB.exec <<~SQL
UPDATE sidebar_urls su1
SET name = 'Topics'
FROM sidebar_urls su2
INNER JOIN sidebar_section_links ON sidebar_section_links.linkable_id = su2.id
INNER JOIN sidebar_sections ON sidebar_sections.id = sidebar_section_links.sidebar_section_id AND sidebar_sections.section_type = 0
WHERE su1.id = su2.id AND su2.value = '/latest' AND su2.name = 'Everything'
SQL
end
def down
DB.exec <<~SQL
UPDATE sidebar_urls su1
SET name = 'Everything'
FROM sidebar_urls su2
INNER JOIN sidebar_section_links ON sidebar_section_links.linkable_id = su2.id
INNER JOIN sidebar_sections ON sidebar_sections.id = sidebar_section_links.sidebar_section_id AND sidebar_sections.section_type = 0
WHERE su1.id = su2.id AND su2.value = '/topics' AND su2.name = 'Topics'
SQL
end
end

View File

@ -22,7 +22,7 @@ RSpec.describe SidebarSection do
expect(community_section.reload.title).to eq("Community")
expect(community_section.sidebar_section_links.all.map { |link| link.linkable.name }).to eq(
["Everything", "My Posts", "Review", "Admin", "Users", "About", "FAQ", "Groups", "Badges"],
["Topics", "My Posts", "Review", "Admin", "Users", "About", "FAQ", "Groups", "Badges"],
)
end
end

View File

@ -303,12 +303,12 @@ RSpec.describe SidebarSectionsController do
it "allows admin to edit community section" do
sign_in(admin)
everything_link = community_section.sidebar_urls.find_by(name: "Everything")
topics_link = community_section.sidebar_urls.find_by(name: "Topics")
my_posts_link = community_section.sidebar_urls.find_by(name: "My Posts")
community_section
.sidebar_section_links
.where.not(linkable_id: [everything_link.id, my_posts_link.id])
.where.not(linkable_id: [topics_link.id, my_posts_link.id])
.destroy_all
put "/sidebar_sections/#{community_section.id}.json",
@ -316,12 +316,7 @@ RSpec.describe SidebarSectionsController do
title: "community section edited",
links: [
{ icon: "link", id: my_posts_link.id, name: "my posts edited", value: "/my_posts" },
{
icon: "link",
id: everything_link.id,
name: "everything edited",
value: "/everything",
},
{ icon: "link", id: topics_link.id, name: "topics edited", value: "/new" },
],
}
@ -330,8 +325,8 @@ RSpec.describe SidebarSectionsController do
expect(community_section.reload.title).to eq("community section edited")
expect(community_section.sidebar_urls[0].name).to eq("my posts edited")
expect(community_section.sidebar_urls[0].value).to eq("/my_posts")
expect(community_section.sidebar_urls[1].name).to eq("everything edited")
expect(community_section.sidebar_urls[1].value).to eq("/everything")
expect(community_section.sidebar_urls[1].name).to eq("topics edited")
expect(community_section.sidebar_urls[1].value).to eq("/new")
end
end
@ -461,7 +456,6 @@ RSpec.describe SidebarSectionsController do
let(:community_section) do
SidebarSection.find_by(section_type: SidebarSection.section_types[:community])
end
let(:everything_link) { community_section.sidebar_section_links.first }
it "doesn't allow user to reset community section" do
sign_in(user)

View File

@ -202,14 +202,14 @@ describe "Custom sidebar sections", type: :system do
)
sidebar.edit_custom_section("Community")
section_modal.fill_link("Everything", "/latest", "paper-plane")
section_modal.fill_link("Topics", "/latest", "paper-plane")
section_modal.fill_name("Edited community section")
section_modal.everything_link.drag_to(section_modal.review_link, delay: 0.4)
section_modal.topics_link.drag_to(section_modal.review_link, delay: 0.4)
section_modal.save
expect(sidebar).to have_section("Edited community section")
expect(sidebar.primary_section_links("edited-community-section")).to eq(
["My Posts", "Everything", "Review", "Admin", "More"],
["My Posts", "Topics", "Review", "Admin", "More"],
)
expect(sidebar.primary_section_icons("edited-community-section")).to eq(
%w[user paper-plane flag wrench ellipsis-v],
@ -220,7 +220,7 @@ describe "Custom sidebar sections", type: :system do
expect(sidebar).to have_section("Community")
expect(sidebar.primary_section_links("community")).to eq(
["Everything", "My Posts", "Review", "Admin", "More"],
["Topics", "My Posts", "Review", "Admin", "More"],
)
expect(sidebar.primary_section_icons("community")).to eq(
%w[layer-group user flag wrench ellipsis-v],

View File

@ -30,7 +30,7 @@ module PageObjects
)
end
def click_everything_link
def click_topics_link
find(".sidebar-section-link[data-link-name='everything']").click
end

View File

@ -52,8 +52,8 @@ module PageObjects
find_button("Save", disabled: false)
end
def everything_link
find(".draggable[data-link-name='Everything']")
def topics_link
find(".draggable[data-link-name='Topics']")
end
def review_link

View File

@ -41,7 +41,7 @@ describe "Viewing sidebar mobile", type: :system, mobile: true do
expect(sidebar_dropdown).to be_visible
sidebar_dropdown.click_everything_link
sidebar_dropdown.click_topics_link
expect(sidebar_dropdown).to be_hidden
end