Repository navigation
Consolidate legacy routes into [locale], remove formar.tsx, run hardcoded-string check in CI - #1557
Merged
Merged
Conversation
…ardcoded-string check in CI
Contributor
|
@Diggardson270 is attempting to deploy a commit to the Mftee's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Diggardson270 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
mftee
approved these changes
Oct 22, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
Closes #1516
Closes #1517
Closes #1518
#1516 — Move the duplicate non-localised pages into the
[locale]treeEvery page now lives under
app/[locale]/. WithlocalePrefix: "as-needed", English URLs stay the same and the[locale]page serves them.Moved and translated
These pages were moved into
app/[locale]/(protected)/withgit mv, so history is kept. All their copy is now translated:documents/[id](+not-found)documentDetail,notFound.*documents/[id]/reportdocumentReportdocuments/[id]/verifydocumentVerifymapmapadmin/activityadminActivityadmin/audit-logsadminAuditLogsen,frandes(check:localespasses, 336 keys).useDateFormatting(some were hard-coded toen-GB).Link/useRouterfrom@/i18n/navigation.API helpers
documents/[id],reportandverifycalled${API_BASE}/api/documents/...without thev1prefix and read the token from localStorage by hand.request(apiUrl(...))fromlib/api-client, so they hit/api/v1/...and get refresh-on-401 like the other localised pages.map,activityandaudit-logsalready usedapiUrl, so only their copy changed.Deleted duplicates
app/(protected)/admin/users/page.tsxand itslayout.tsx: superseded by the full[locale]admin users page.app/document/[id]/page.tsx: a second detail page that didn't compile (missingui/separator,@tanstack/react-querynot installed).app/register/page.tsx: a stub that only redirected to/en/register.app/auth/oauth/callback/page.tsx: used acodeexchange flow, but the backend (auth.controller.ts→redirectWithCookies) sends the token in the URL hash, which only the[locale]callback handles.Redirects
/document/...is the only old URL whose path changed.middleware.tsnow 308-redirects/document/:id(/...)to/documents/:id(/...), keeping the locale prefix and query string.LEGACY_ROUTE_REDIRECTS.Tests
middleware.test.tswas already failing onmain: thenext-intl/middlewaremock returned a response instead of a middleware function. Fixed the mock and added redirect tests (12/12 pass).admin-audit-logs.test.tsxandnot-found.test.tsxnow import the moved files; the audit-logs test renders insideNextIntlClientProvider./document/abcends at/login?redirect=/documents/abc.#1517 — Remove
components/formar.tsxformar.tsxwas byte-identical toErrorBanner.tsx(diffis empty), so there was nothing to merge.#1518 — Run
check:hardcodedin CI and drop the duplicate typecheckscripts/check-hardcoded-strings.mjsscripts/hardcoded-strings-baseline.json(18 existing violations) and exits 1 only on strings not in the baseline.--update-baselineregenerates the file, and the script prints a reminder when baselined strings get translated.test-utils/are skipped, since fixtures aren't user-facing..github/workflows/ci.ymlcontinue-on-error: truewhile the regex heuristic beds in. Remove that line to make it blocking.Docs
frontend/README.mdgains a "Routing and i18n" section on the[locale]-only rule, legacy redirects and the baseline workflow.Testing
npm run check:localespasses.npm run check:hardcodedpasses on the tree. A probe file with a new hardcoded string makes it exit 1.npx jest: 15 failing suites vs 16 onmain.middleware.test.tsnow passes and nothing new fails. The remaining failures are the same ones as onmain(missing@testing-library/user-event/@radix-ui/react-dialoginstalls,auth-sessiontest drift).tsc --noEmit: no new errors. The twoMapPageContenterrors moved with the file, and deletingapp/document/[id]removes one error.node_modules; needs a CI run or a local run afternpm ci.