Skip to content

Commit

Permalink
responding to pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
ciyer committed Jan 30, 2025
1 parent 0c752ed commit 3dbc386
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 60 deletions.
3 changes: 2 additions & 1 deletion client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import LazyNotFound from "./not-found/LazyNotFound";
import NotificationsManager from "./notifications/NotificationsManager";
import Cookie from "./privacy/Cookie";
import LazyProjectView from "./project/LazyProjectView";
import { ABSOLUTE_ROUTES } from "./routing/routes.constants";
import AppContext from "./utils/context/appContext";
import useLegacySelector from "./utils/customHooks/useLegacySelector.hook";
import { setupWebSocket } from "./websocket";
Expand Down Expand Up @@ -117,7 +118,7 @@ function CentralContentContainer({ user, socket }) {
/>
</CompatRoute>
<CompatRoute path="/datasets">
<Redirect to="/v1/search?type=dataset" />
<Redirect to={`${ABSOLUTE_ROUTES.v1.search}?type=dataset`} />
</CompatRoute>
<CompatRoute path="/v1">
<LazyRootV1 user={user} />
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/navbar/NavBarItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function RenkuToolbarItemPlus() {
<Link
className="dropdown-item"
id="navbar-project-new"
to="/v1/projects/new"
to={ABSOLUTE_ROUTES.v1.projects.new}
>
Project
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import { Link } from "react-router-dom";

import { WarnAlert } from "../../../components/Alert";
import { ABSOLUTE_ROUTES } from "../../../routing/routes.constants";
import useAppSelector from "../../../utils/customHooks/useAppSelector.hook";
import useLegacySelector from "../../../utils/customHooks/useLegacySelector.hook";
import { Url } from "../../../utils/helpers/url";
import { useGetInactiveKgProjectsQuery } from "../../inactiveKgProjects/InactiveKgProjectsApi";

function InactiveProjectsWarning({
Expand All @@ -39,7 +39,7 @@ function InactiveProjectsWarning({
<WarnAlert>
<div data-cy="inactive-kg-project-alert">
Metadata indexing is not activated on {totalProjectsText}.{" "}
<Link to={Url.get(Url.pages.inactiveKgProjects)}>
<Link to={ABSOLUTE_ROUTES.v1.inactiveKGProjects}>
Activate indexing on your projects
</Link>{" "}
to properly integrate them with Renku.
Expand Down
31 changes: 0 additions & 31 deletions client/src/features/rootV1/LazyProjectRootV1.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions client/src/features/rootV1/ProjectRootV1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

import { Route, Routes } from "react-router-dom-v5-compat";
import ContainerWrap from "../../components/container/ContainerWrap";
import { RELATIVE_ROUTES } from "../../routing/routes.constants";
import LazyNotFound from "../../not-found/LazyNotFound";
import LazyProjectList from "../../project/list/LazyProjectList";
import LazyNewProject from "../../project/new/LazyNewProject";
import { RELATIVE_ROUTES } from "../../routing/routes.constants";

export default function RootV1() {
return (
Expand Down Expand Up @@ -61,7 +62,7 @@ export default function RootV1() {
path="*"
element={
<ContainerWrap>
<LazyProjectList />
<LazyNotFound />
</ContainerWrap>
}
/>
Expand Down
4 changes: 2 additions & 2 deletions client/src/features/rootV1/RootV1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import LazySearchPage from "../kgSearch/LazySearchPage";
import LazySecrets from "../secrets/LazySecrets";
import LazyAnonymousSessionsList from "../session/components/LazyAnonymousSessionsList";

import LazyProjectRootV1 from "./LazyProjectRootV1";
import ProjectRootV1 from "./ProjectRootV1";

export default function RootV1({
user,
Expand Down Expand Up @@ -107,7 +107,7 @@ export default function RootV1({
path={RELATIVE_ROUTES.v1.projects.root}
element={
<ContainerWrap>
<LazyProjectRootV1 />
<ProjectRootV1 />
</ContainerWrap>
}
/>
Expand Down
44 changes: 23 additions & 21 deletions client/src/routing/routes.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@

export const ABSOLUTE_ROUTES = {
root: "/",
v1: {
root: "/v1",
inactiveKGProjects: "/v1/inactive-kg-projects",
search: "/v1/search",
projects: {
root: "/v1/projects",
all: "/v1/projects/all",
new: "/v1/projects/new",
starred: "/v1/projects/starred",
},
help: {
root: "/v1/help",
contact: "/v1/help/contact",
status: "/v1/help/status",
release: "/v1/help/release",
tos: "/v1/help/tos",
privacy: "/v1/help/privacy",
},
notifications: "/v1/notifications",
styleGuide: "/v1/style-guide",
secrets: "/v1/secrets",
sessions: "/v1/sessions",
},
v2: {
root: "/v2",
user: "/v2/user",
Expand Down Expand Up @@ -56,27 +79,6 @@ export const ABSOLUTE_ROUTES = {
connectedServices: "/v2/connected-services",
secrets: "/v2/secrets",
},
v1: {
root: "/v1",
search: "/v1/search",
projects: {
root: "/v1/projects",
all: "/v1/projects/all",
starred: "/v1/projects/starred",
},
help: {
root: "/v1/help",
contact: "/v1/help/contact",
status: "/v1/help/status",
release: "/v1/help/release",
tos: "/v1/help/tos",
privacy: "/v1/help/privacy",
},
notifications: "/v1/notifications",
styleGuide: "/v1/style-guide",
secrets: "/v1/secrets",
sessions: "/v1/sessions",
},
} as const;

export const RELATIVE_ROUTES = {
Expand Down

0 comments on commit 3dbc386

Please sign in to comment.