From 54a0578ebc46cb32bb61d6d586251e67bdbab81a Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 19 Dec 2022 02:31:35 +0000 Subject: [PATCH] refactor: remove /dashboard prefix and change /users/ to /u/ This overhaul automatically redirects old routes to new routes they served no purpose anyway and were link noise. i don't like them --- bot/src/slashCommands/commands/faq.ts | 2 +- bot/src/utils/embeds.ts | 4 +- bot/src/utils/misc.ts | 8 +-- bot/src/webhookHandlers/classUpdate.ts | 2 +- .../src/app/pages/dashboard/DashboardPage.tsx | 8 +-- .../games/_game/_playtype/GPTChartPage.tsx | 19 ++--- .../app/pages/dashboard/import/ImportPage.tsx | 7 +- .../pages/dashboard/import/LR2orajaDBPage.tsx | 4 +- .../app/pages/dashboard/import/USCDBPage.tsx | 4 +- .../app/pages/dashboard/misc/CreditsPage.tsx | 2 +- .../pages/dashboard/misc/SupportMePage.tsx | 2 +- .../dashboard/users/ARCIntegrationPage.tsx | 2 +- .../users/FervidexIntegrationPage.tsx | 2 +- .../users/KsHookSV6CIntegrationPage.tsx | 2 +- .../pages/dashboard/users/UserGamesPage.tsx | 4 +- .../pages/dashboard/users/UserImportsPage.tsx | 8 +-- .../dashboard/users/UserIntegrationsPage.tsx | 6 +- .../pages/dashboard/users/UserInvitesPage.tsx | 2 +- .../_game/_playtype/LeaderboardsPage.tsx | 9 +-- .../games/_game/_playtype/ScoresPage.tsx | 8 +-- .../_game/_playtype/SpecificSessionPage.tsx | 2 +- .../_game/_playtype/UGPTSettingsPage.tsx | 6 +- .../_playtype/folders/FolderComparePage.tsx | 2 +- .../_playtype/folders/FolderTablePage.tsx | 2 +- .../_playtype/folders/FoldersMainPage.tsx | 8 +-- .../_playtype/folders/RecentFoldersPage.tsx | 2 +- .../_playtype/rivals/RivalsActivityPage.tsx | 2 +- .../_game/_playtype/rivals/RivalsMainPage.tsx | 6 +- .../_game/_playtype/targets/TargetsPage.tsx | 4 +- .../_game/_playtype/targets/UGPTGoalsPage.tsx | 2 +- .../_playtype/targets/UGPTQuestsPage.tsx | 2 +- .../pages/dashboard/utils/ImportAnalysers.tsx | 8 +-- client/src/app/routes/AppRoutes.tsx | 26 +++---- client/src/app/routes/DashboardRoutes.tsx | 35 +++++----- client/src/app/routes/GameRoutes.tsx | 54 +++++++------- client/src/app/routes/ImportRoutes.tsx | 70 +++++++++---------- .../src/app/routes/RedirectLegacyRoutes.tsx | 19 +++++ client/src/app/routes/UserRoutes.tsx | 53 +++++++------- client/src/app/routes/UtilRoutes.tsx | 6 +- client/src/components/activity/Activity.tsx | 8 +-- .../components/dashboard/DashboardHeader.tsx | 6 +- .../game/charts/ChartInfoFormat.tsx | 2 +- .../src/components/game/targets/QuestPage.tsx | 4 +- .../components/game/targets/QuestlinePage.tsx | 4 +- .../components/game/targets/QuestsPage.tsx | 2 +- .../src/components/imports/ARCImportPage.tsx | 6 +- client/src/components/imports/ImportInfo.tsx | 2 +- .../src/components/layout/footer/Footer.tsx | 6 +- .../src/components/layout/header/AllGames.tsx | 2 +- .../components/layout/header/HeaderMenu.tsx | 2 +- .../components/layout/header/HeaderMobile.tsx | 2 +- .../layout/header/ImportScoresLink.tsx | 2 +- .../components/layout/header/SearchBar.tsx | 15 ++-- .../layout/header/UserNotificationButton.tsx | 2 +- .../layout/header/UserProfileDropdown.tsx | 8 +-- .../layout/header/UtilsDropdown.tsx | 6 +- .../subheader/components/Breadcrumbs.tsx | 4 +- .../notifications/NotificationRow.tsx | 4 +- .../components/sessions/SessionCalendar.tsx | 4 +- .../src/components/sessions/SessionCard.tsx | 4 +- .../sessions/SessionFolderRaiseBreakdown.tsx | 2 +- .../src/components/tables/cells/UserCell.tsx | 2 +- .../tables/imports/FailedImportsTable.tsx | 2 +- .../tables/imports/ImportsTable.tsx | 2 +- .../tables/sessions/GenericSessionTable.tsx | 2 +- client/src/components/targets/Questline.tsx | 4 +- .../src/components/user/UGPTRankingData.tsx | 2 +- .../src/components/user/UGPTStatShowcase.tsx | 6 +- client/src/components/util/GoalLink.tsx | 4 +- client/src/components/util/UserIcon.tsx | 4 +- client/src/components/util/useUGPTBase.tsx | 2 +- github-bot/src/main.ts | 2 +- 72 files changed, 259 insertions(+), 284 deletions(-) create mode 100644 client/src/app/routes/RedirectLegacyRoutes.tsx diff --git a/bot/src/slashCommands/commands/faq.ts b/bot/src/slashCommands/commands/faq.ts index a3d5c2bbc..f227f3d78 100644 --- a/bot/src/slashCommands/commands/faq.ts +++ b/bot/src/slashCommands/commands/faq.ts @@ -120,7 +120,7 @@ Your friend can then go to ${BotConfig.TACHI_SERVER_LOCATION} and sign up with t const BTCHI_FAQ_ENTRIES: Record = { usc_hard_mode: `Hard Mode windows are not supported on ${ServerConfig.name}. Your scores **will be ignored** if they are played on non-standard windows.`, - ir_login: `You **must** put your API Key in the password field for the Bokutachi IR, **NOT your real password!**. See instructions here: ${BotConfig.TACHI_SERVER_LOCATION}/dashboard/import/beatoraja-ir. + ir_login: `You **must** put your API Key in the password field for the Bokutachi IR, **NOT your real password!**. See instructions here: ${BotConfig.TACHI_SERVER_LOCATION}/import/beatoraja-ir. (This is because putting your real password in there is a security nightmare.)`, lr2: `Support for LR2 (the LR2Hook) are **not officially maintained** and therefore **not managed by bokutachi developers**. We urge you to use a more modern BMS client like lr2oraja, unless you have very good reason to stay on LR2. diff --git a/bot/src/utils/embeds.ts b/bot/src/utils/embeds.ts index bbfbfe170..fd88755ca 100644 --- a/bot/src/utils/embeds.ts +++ b/bot/src/utils/embeds.ts @@ -49,7 +49,7 @@ export function CreateImportEmbed(importDoc: ImportDocument) { .addField("Errors", importDoc.errors.length.toString(), true) .addField( "Your Profile", - `${BotConfig.TACHI_SERVER_LOCATION}/dashboard/users/${importDoc.userID}/games/${importDoc.game}` + `${BotConfig.TACHI_SERVER_LOCATION}/u/${importDoc.userID}/games/${importDoc.game}` ); } @@ -59,7 +59,7 @@ export function CreateUserEmbed(userDoc: UserDocument) { .setThumbnail(PrependTachiUrl(`/users/${userDoc.id}/pfp`)) .setDescription(userDoc.status ?? "No status...") .addField("Join Date", FormatDate(userDoc.joinDate)) - .setURL(`${BotConfig.TACHI_SERVER_LOCATION}/dashboard/users/${userDoc.username}`); + .setURL(`${BotConfig.TACHI_SERVER_LOCATION}/u/${userDoc.username}`); } export async function CreateChartScoresEmbed( diff --git a/bot/src/utils/misc.ts b/bot/src/utils/misc.ts index 56ef9c098..894fe2d9c 100644 --- a/bot/src/utils/misc.ts +++ b/bot/src/utils/misc.ts @@ -144,12 +144,12 @@ export function GetGameChannel(client: Client, game: Game) { */ export function CreateChartLink(chart: ChartDocument, game: Game) { if (chart.isPrimary) { - return `${BotConfig.TACHI_SERVER_LOCATION}/dashboard/games/${game}/${ - chart.playtype - }/songs/${chart.songID}/${encodeURIComponent(chart.difficulty)}`; + return `${BotConfig.TACHI_SERVER_LOCATION}/games/${game}/${chart.playtype}/songs/${ + chart.songID + }/${encodeURIComponent(chart.difficulty)}`; } - return `${BotConfig.TACHI_SERVER_LOCATION}/dashboard/games/${game}/${chart.playtype}/songs/${chart.songID}/${chart.chartID}`; + return `${BotConfig.TACHI_SERVER_LOCATION}/games/${game}/${chart.playtype}/songs/${chart.songID}/${chart.chartID}`; } type ScOrPBDoc = PBScoreDocument | ScoreDocument; diff --git a/bot/src/webhookHandlers/classUpdate.ts b/bot/src/webhookHandlers/classUpdate.ts index 06e65cf4c..b1d5736ef 100644 --- a/bot/src/webhookHandlers/classUpdate.ts +++ b/bot/src/webhookHandlers/classUpdate.ts @@ -52,7 +52,7 @@ export async function HandleClassUpdateV1( const embed = CreateEmbed() .setTitle(`${userDoc.username} just achieved ${newClass} in ${FormatGame(game, playtype)}!`) .setURL( - `${BotConfig.TACHI_SERVER_LOCATION}/dashboard/users/${userDoc.username}/games/${game}/${playtype}` + `${BotConfig.TACHI_SERVER_LOCATION}/users/${userDoc.username}/games/${game}/${playtype}` ) .setThumbnail(PrependTachiUrl(`/users/${userDoc.id}/pfp`)); diff --git a/client/src/app/pages/dashboard/DashboardPage.tsx b/client/src/app/pages/dashboard/DashboardPage.tsx index dad775721..20241b24b 100644 --- a/client/src/app/pages/dashboard/DashboardPage.tsx +++ b/client/src/app/pages/dashboard/DashboardPage.tsx @@ -62,13 +62,13 @@ function DashboardLoggedIn({ user }: { user: UserDocument }) { - + - + - + @@ -291,7 +291,7 @@ function DashboardLoggedInNoScores({ user }: { user: UserDocument }) {
You'll get a profile for that game, and a position on the leaderboards! - + Import some scores! diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx index 0c5fbdac0..d6cd72376 100644 --- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx +++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTChartPage.tsx @@ -208,14 +208,11 @@ function InternalGPTChartPage({ - + - + - + - + {user.username} diff --git a/client/src/app/pages/dashboard/import/ImportPage.tsx b/client/src/app/pages/dashboard/import/ImportPage.tsx index 99946c4e1..0d84a7a82 100644 --- a/client/src/app/pages/dashboard/import/ImportPage.tsx +++ b/client/src/app/pages/dashboard/import/ImportPage.tsx @@ -44,7 +44,7 @@ export default function ImportPage({ user }: { user: UserDocument }) { .
Want to manage or revert an import? Go to{" "} - Import Management. + Import Management.