swarm-ui: the moved tabs' redirects come from one table, with tests
The four tab moves each hand-wrote a redirect route. They are one table now, MOVED_ROUTES, and movedHref says where an old address goes with its query kept; /builds?run= still lands on the build's card. The builds page's own redirect helper is gone.
This commit is contained in:
parent
f55f0973eb
commit
c28ca7aab5
1 changed files with 58 additions and 35 deletions
|
|
@ -37,11 +37,6 @@ export const OUTCOME_TONE: Record<BuildOutcome, BadgeTone> = {
|
|||
error: "warning",
|
||||
};
|
||||
|
||||
/** Where an old `/builds` link goes: the jobs page, keeping its query. */
|
||||
export function jobsHref(search: string): string {
|
||||
return search === "" ? "/jobs" : `/jobs?${search}`;
|
||||
}
|
||||
|
||||
/** The run a `?run=<id>` query names, or `null` when it names none. */
|
||||
export function wantedRun(search: string): string | null {
|
||||
const id = new URLSearchParams(search).get("run");
|
||||
|
|
|
|||
Loading…
Reference in a new issue