diff --git a/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx b/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx index 938414ad6a..30da605671 100644 --- a/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx +++ b/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx @@ -35,6 +35,7 @@ import { NotebooksHelper } from "../../notebooks"; import { NotebookAnnotations } from "../../notebooks/components/session.types"; import { NOTIFICATION_TOPICS } from "../../notifications/Notifications.constants"; import { NotificationsManager } from "../../notifications/notifications.types"; +import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; import AppContext from "../../utils/context/appContext"; import useLegacySelector from "../../utils/customHooks/useLegacySelector.hook"; import { toHumanDuration } from "../../utils/helpers/DurationUtils"; @@ -104,7 +105,7 @@ function AnonymousDeleteSessionModal({ const navigate = useNavigate(); - const backUrl = generatePath("../../:namespace/:slug", { + const backUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, { namespace: namespace ?? "", slug: slug ?? "", }); @@ -224,7 +225,7 @@ function PauseSessionModalBody({ const navigate = useNavigate(); - const backUrl = generatePath("../../:namespace/:slug", { + const backUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, { namespace: namespace ?? "", slug: slug ?? "", }); @@ -343,7 +344,7 @@ function DeleteSessionModalBody({ const navigate = useNavigate(); - const backUrl = generatePath("../../:namespace/:slug", { + const backUrl = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, { namespace: namespace ?? "", slug: slug ?? "", }); diff --git a/client/src/features/sessionsV2/StartSessionButton.tsx b/client/src/features/sessionsV2/StartSessionButton.tsx index 03d35078b7..482181fb84 100644 --- a/client/src/features/sessionsV2/StartSessionButton.tsx +++ b/client/src/features/sessionsV2/StartSessionButton.tsx @@ -19,6 +19,9 @@ import cx from "classnames"; import { PlayFill } from "react-bootstrap-icons"; import { Link, generatePath } from "react-router-dom-v5-compat"; + +import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; + interface StartSessionButtonProps { namespace: string; slug: string; @@ -31,7 +34,7 @@ export default function StartSessionButton({ slug, }: StartSessionButtonProps) { const startUrl = generatePath( - "/v2/projects/:namespace/:slug/sessions/:launcherId/start", + ABSOLUTE_ROUTES.v2.projects.show.sessions.start, { launcherId, namespace,