chore(ui): remove dead App Router route stubs under (dashboard) (#30045)
models-and-endpoints, organizations, and virtual-keys each had a page.tsx route under (dashboard)/ that is not in MIGRATED_PAGES, so the sidebar and deep links never resolve to it and the route is unreachable. Each was a thin wrapper that handed the shared view empty or no-op props (empty modelData with a no-op setModelData, hardcoded empty organizations, no-op setUserRole/setUserEmail), so reaching one would render a degraded page in any case. The real wrapper belongs in the PR that flips each page into MIGRATED_PAGES, written with eyes on it and a test This continues the dead-scaffolding cleanup from #28891. The shared components these wrappers rendered (ModelsAndEndpointsView, OrganizationFilters) stay, since the legacy ?page= switch in app/page.tsx and src/components still import them
This commit is contained in:
parent
fe60f9d0f1
commit
38edf241a4
@ -1,26 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
|
||||||
import useTeams from "@/app/(dashboard)/hooks/useTeams";
|
|
||||||
import { useState } from "react";
|
|
||||||
import ModelsAndEndpointsView from "@/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView";
|
|
||||||
|
|
||||||
const ModelsAndEndpointsPage = () => {
|
|
||||||
const { token, premiumUser } = useAuthorized();
|
|
||||||
const [keys, setKeys] = useState<null | any[]>([]);
|
|
||||||
|
|
||||||
const { teams } = useTeams();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ModelsAndEndpointsView
|
|
||||||
token={token}
|
|
||||||
modelData={{ data: [] }}
|
|
||||||
keys={keys}
|
|
||||||
setModelData={() => {}}
|
|
||||||
premiumUser={premiumUser}
|
|
||||||
teams={teams}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ModelsAndEndpointsPage;
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import Organizations, { fetchOrganizations } from "@/components/organizations";
|
|
||||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import { Organization } from "@/components/networking";
|
|
||||||
import { fetchUserModels } from "@/components/organisms/create_key_button";
|
|
||||||
|
|
||||||
const OrganizationsPage = () => {
|
|
||||||
const { userId: userID, accessToken, userRole, premiumUser } = useAuthorized();
|
|
||||||
const [organizations, setOrganizations] = useState<Organization[]>([]);
|
|
||||||
const [userModels, setUserModels] = useState<string[]>([]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchOrganizations(accessToken, setOrganizations).then(() => {});
|
|
||||||
}, [accessToken]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchUserModels(userID, userRole, accessToken, setUserModels).then(() => {});
|
|
||||||
}, [userID, userRole, accessToken]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Organizations
|
|
||||||
organizations={organizations}
|
|
||||||
userRole={userRole}
|
|
||||||
userModels={userModels}
|
|
||||||
accessToken={accessToken}
|
|
||||||
setOrganizations={setOrganizations}
|
|
||||||
premiumUser={premiumUser}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default OrganizationsPage;
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { useState } from "react";
|
|
||||||
import useKeyList from "@/components/key_team_helpers/key_list";
|
|
||||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
|
||||||
import UserDashboard from "@/components/user_dashboard";
|
|
||||||
import useTeams from "@/app/(dashboard)/hooks/useTeams";
|
|
||||||
import { Organization } from "@/components/networking";
|
|
||||||
|
|
||||||
const VirtualKeysPage = () => {
|
|
||||||
const { accessToken, userRole, userId, premiumUser, userEmail } = useAuthorized();
|
|
||||||
const { teams, setTeams } = useTeams();
|
|
||||||
const [createClicked, setCreateClicked] = useState<boolean>(false);
|
|
||||||
const [organizations, setOrganizations] = useState<Organization[]>([]);
|
|
||||||
|
|
||||||
const { keys, isLoading, error, pagination, refresh, setKeys } = useKeyList({
|
|
||||||
selectedKeyAlias: null,
|
|
||||||
currentOrg: null,
|
|
||||||
accessToken: accessToken || "",
|
|
||||||
createClicked,
|
|
||||||
});
|
|
||||||
|
|
||||||
const addKey = (data: any) => {
|
|
||||||
setKeys((prevData) => (prevData ? [...prevData, data] : [data]));
|
|
||||||
setCreateClicked(() => !createClicked);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<UserDashboard
|
|
||||||
userID={userId}
|
|
||||||
userRole={userRole}
|
|
||||||
userEmail={userEmail}
|
|
||||||
teams={teams}
|
|
||||||
keys={keys}
|
|
||||||
setUserRole={() => {}}
|
|
||||||
setUserEmail={() => {}}
|
|
||||||
setTeams={setTeams}
|
|
||||||
setKeys={setKeys}
|
|
||||||
premiumUser={premiumUser}
|
|
||||||
organizations={organizations}
|
|
||||||
addKey={addKey}
|
|
||||||
createClicked={createClicked}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default VirtualKeysPage;
|
|
||||||
Loading…
Reference in New Issue
Block a user