Skip to content

Commit bff7d0f

Browse files
authored
Merge branch 'main' into feat/build-private-repositories
2 parents 708a3e4 + 752113c commit bff7d0f

11 files changed

Lines changed: 21 additions & 282 deletions

File tree

client/src/CatchallApp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import LegacyRoot from "./features/legacy/LegacyRoot";
2828
import LegacyShowDataset from "./features/legacy/LegacyShowDataset";
2929
import LazyRootV2 from "./features/rootV2/LazyRootV2";
3030
import { useGetUserQueryState } from "./features/usersV2/api/users.api";
31+
import { RELATIVE_ROUTES } from "./routing/routes.constants";
3132

3233
/**
3334
* "Catch all" component
@@ -45,7 +46,7 @@ export default function CatchallApp() {
4546
/>
4647
<Route path="/datasets/:identifier" element={<LegacyShowDataset />} />
4748
<Route path="/datasets" element={<LegacyDatasets />} />
48-
<Route path="/v1/*" element={<LegacyRoot />} />
49+
<Route path={RELATIVE_ROUTES.v1.splat} element={<LegacyRoot />} />
4950
{user?.isLoggedIn && user.is_admin && (
5051
<Route
5152
path="/admin"

client/src/features/help/HelpRelease.tsx

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
import { useContext } from "react";
20-
import { useLocation } from "react-router";
2120
import { Col, Row } from "reactstrap";
2221

2322
import ExternalLink from "~/components/ExternalLink";
@@ -27,12 +26,7 @@ import { Links } from "~/utils/constants/Docs";
2726
import { RenkuRepositories } from "~/utils/constants/Repositories";
2827
import AppContext from "~/utils/context/appContext";
2928
import { DEFAULT_APP_PARAMS } from "~/utils/context/appParams.constants";
30-
import { isRenkuLegacy } from "~/utils/helpers/HelperFunctionsV2";
31-
import {
32-
useGetCoreVersionsQuery,
33-
useGetDataServicesVersionQuery,
34-
useGetKgVersionQuery,
35-
} from "../versions/versions.api";
29+
import { useGetDataServicesVersionQuery } from "../versions/versions.api";
3630

3731
function componentDocsUrl(
3832
componentUrl: string,
@@ -75,22 +69,6 @@ function ComponentAndDevVersion({
7569
);
7670
}
7771

78-
function CoreRelease() {
79-
const { data, isFetching } = useGetCoreVersionsQuery();
80-
if (isFetching) {
81-
return <Loader inline size={16} />;
82-
}
83-
const coreVersion = data?.coreVersions[0];
84-
const { taggedVersion, devHash } = parseChartVersion(coreVersion);
85-
return (
86-
<ComponentAndDevVersion
87-
componentUrl={RenkuRepositories.Python}
88-
devHash={devHash}
89-
taggedVersion={taggedVersion}
90-
/>
91-
);
92-
}
93-
9472
function DataServicesRelease() {
9573
const { data, isFetching } = useGetDataServicesVersionQuery();
9674
if (isFetching) {
@@ -107,22 +85,6 @@ function DataServicesRelease() {
10785
);
10886
}
10987

110-
function KgRelease() {
111-
const { data, isFetching } = useGetKgVersionQuery();
112-
if (isFetching) {
113-
return <Loader inline size={16} />;
114-
}
115-
const kgVersion = data?.version;
116-
const { taggedVersion, devHash } = parseChartVersion(kgVersion);
117-
return (
118-
<ComponentAndDevVersion
119-
componentUrl={RenkuRepositories.KnowledgeGraph}
120-
devHash={devHash}
121-
taggedVersion={taggedVersion}
122-
/>
123-
);
124-
}
125-
12688
function RenkuRelease() {
12789
const { params } = useContext(AppContext);
12890
const chartVersion =
@@ -153,31 +115,6 @@ function UiRelease() {
153115
}
154116

155117
function ComponentDetails() {
156-
const location = useLocation();
157-
const isLegacy = isRenkuLegacy(location.pathname);
158-
159-
if (isLegacy) {
160-
return (
161-
<>
162-
<div className="fw-bold">Renku legacy component versions</div>
163-
<ul>
164-
<li>
165-
UI: <UiRelease />
166-
</li>
167-
<li>
168-
Core: <CoreRelease />
169-
</li>
170-
<li>
171-
Data Services: <DataServicesRelease />
172-
</li>
173-
<li>
174-
Knowledge Graph: <KgRelease />
175-
</li>
176-
</ul>
177-
</>
178-
);
179-
}
180-
181118
return (
182119
<>
183120
<div className="fw-bold">Renku component versions</div>

client/src/features/landing/components/NavBar/RenkuFooterNavBar.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import cx from "classnames";
2020
import { useContext } from "react";
21-
import { Link, useLocation, useMatch } from "react-router";
21+
import { Link, useMatch } from "react-router";
2222

2323
import { ExternalLink } from "~/components/LegacyExternalLinks";
2424
import { RENKU_LOGO } from "~/components/navbar/navbar.constants";
@@ -27,7 +27,6 @@ import { parseChartVersion } from "~/features/help/release.utils";
2727
import { ABSOLUTE_ROUTES } from "~/routing/routes.constants";
2828
import { Links } from "~/utils/constants/Docs";
2929
import AppContext from "~/utils/context/appContext";
30-
import { isRenkuLegacy } from "~/utils/helpers/HelperFunctionsV2";
3130

3231
export default function RenkuFooterNavBar() {
3332
const matchesShowSessionPage = useMatch(
@@ -86,11 +85,7 @@ function RenkuFooterNavBarInner() {
8685
}
8786

8887
function FooterNavbarLoggedInLinks() {
89-
const location = useLocation();
90-
const forceV2 = true;
91-
const helpLocation = isRenkuLegacy(location.pathname, forceV2)
92-
? ABSOLUTE_ROUTES.v1.help.root
93-
: ABSOLUTE_ROUTES.v2.help.root;
88+
const helpLocation = ABSOLUTE_ROUTES.v2.help.root;
9489
return (
9590
<>
9691
<RenkuNavLinkV2 to={helpLocation}>Help</RenkuNavLinkV2>

client/src/features/projectsV2/fields/ProjectVisibilityFormField.tsx

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,15 @@ import cx from "classnames";
2020
import { Globe, Lock } from "react-bootstrap-icons";
2121
import type { FieldValues } from "react-hook-form";
2222
import { Controller } from "react-hook-form";
23-
import { useLocation } from "react-router";
2423
import { ButtonGroup, Input, Label } from "reactstrap";
2524

26-
import { isRenkuLegacy } from "../../../utils/helpers/HelperFunctionsV2";
2725
import type { GenericProjectFormFieldProps } from "./formField.types";
2826

29-
import styles from "./RenkuV1FormFields.module.scss";
30-
3127
export default function ProjectVisibilityFormField<T extends FieldValues>({
3228
control,
3329
formId,
3430
name,
3531
}: GenericProjectFormFieldProps<T>) {
36-
const location = useLocation();
37-
const isRenkuV1 = isRenkuLegacy(location.pathname);
3832
return (
3933
<div>
4034
<Label className="form-label" for={`${formId}-project-visibility`}>
@@ -50,23 +44,14 @@ export default function ProjectVisibilityFormField<T extends FieldValues>({
5044
<Input
5145
aria-describedby="projectVisibilityHelp"
5246
type="radio"
53-
className={cx(
54-
isRenkuV1 && styles.RenkuV1btnCheck,
55-
"btn-check"
56-
)}
47+
className="btn-check"
5748
id={`${formId}-project-visibility-public`}
5849
value="public"
5950
checked={field.value === "public"}
60-
onChange={(e) => {
61-
field.onChange(e);
62-
}}
51+
onChange={field.onChange}
6352
/>
6453
<Label
65-
className={cx(
66-
"btn",
67-
isRenkuV1 ? "btn-outline-rk-green" : "btn-outline-primary",
68-
"mb-0"
69-
)}
54+
className={cx("btn", "btn-outline-primary", "mb-0")}
7055
data-cy="project-visibility-public"
7156
for={`${formId}-project-visibility-public`}
7257
>
@@ -76,23 +61,14 @@ export default function ProjectVisibilityFormField<T extends FieldValues>({
7661
<Input
7762
aria-describedby="projectVisibilityHelp"
7863
type="radio"
79-
className={cx(
80-
isRenkuV1 && styles.RenkuV1btnCheck,
81-
"btn-check"
82-
)}
64+
className={cx("btn-check")}
8365
id={`${formId}-project-visibility-private`}
8466
value="private"
8567
checked={field.value === "private"}
86-
onChange={(e) => {
87-
field.onChange(e);
88-
}}
68+
onChange={field.onChange}
8969
/>
9070
<Label
91-
className={cx(
92-
"btn",
93-
isRenkuV1 ? "btn-outline-rk-green" : "btn-outline-primary",
94-
"mb-0"
95-
)}
71+
className={cx("btn", "btn-outline-primary", "mb-0")}
9672
data-cy="project-visibility-private"
9773
for={`${formId}-project-visibility-private`}
9874
>

client/src/features/projectsV2/fields/RenkuV1FormFields.module.scss

Lines changed: 0 additions & 18 deletions
This file was deleted.

client/src/features/projectsV2/fields/SlugFormField.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ import cx from "classnames";
2020
import { ArrowCounterclockwise } from "react-bootstrap-icons";
2121
import type { FieldValues } from "react-hook-form";
2222
import { Controller } from "react-hook-form";
23-
import { useLocation } from "react-router";
2423
import { Button, FormText, Input, InputGroup, Label } from "reactstrap";
2524

26-
import { isRenkuLegacy } from "../../../utils/helpers/HelperFunctionsV2.ts";
2725
import type { SlugFormFieldProps } from "./formField.types";
2826

29-
import styles from "./RenkuV1FormFields.module.scss";
30-
3127
export default function SlugFormField<T extends FieldValues>({
3228
compact,
3329
control,
@@ -37,8 +33,6 @@ export default function SlugFormField<T extends FieldValues>({
3733
name,
3834
url,
3935
}: SlugFormFieldProps<T>) {
40-
const location = useLocation();
41-
const isRenkuV1 = isRenkuLegacy(location.pathname);
4236
const content = (
4337
<Controller
4438
control={control}
@@ -54,9 +48,7 @@ export default function SlugFormField<T extends FieldValues>({
5448
className={cx(
5549
"form-control",
5650
errors.slug && "is-invalid",
57-
compact && "p-1",
58-
isRenkuV1 && styles.RenkuV1inputGroup,
59-
isRenkuV1 && styles.RenkuV1input
51+
compact && "p-1"
6052
)}
6153
data-cy={`${entityName}-slug-input`}
6254
id={`${entityName}-slug`}

client/src/not-found/NotFound.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,25 @@
2626
import cx from "classnames";
2727
import { ReactNode } from "react";
2828
import { ArrowLeft } from "react-bootstrap-icons";
29-
import { Link, useLocation } from "react-router";
29+
import { Link } from "react-router";
3030

31+
import { ABSOLUTE_ROUTES } from "~/routing/routes.constants";
3132
import ContainerWrap from "../components/container/ContainerWrap";
32-
import rkNotFoundImg from "../styles/assets/not-found.svg";
3333
import rkNotFoundImgV2 from "../styles/assets/not-foundV2.svg";
34-
import { isRenkuLegacy } from "../utils/helpers/HelperFunctionsV2";
3534

3635
import "./NotFound.css";
3736

3837
interface NotFoundProps {
3938
children?: ReactNode;
4039
description?: string | ReactNode;
41-
forceV2?: boolean;
4240
title?: string;
4341
}
4442

4543
export default function NotFound({
4644
title: title_,
4745
description: description_,
4846
children,
49-
forceV2,
5047
}: NotFoundProps) {
51-
const location = useLocation();
52-
const isV2 = forceV2 || !isRenkuLegacy(location.pathname);
5348
const title = title_ ?? "Page not found";
5449
const description =
5550
description_ ??
@@ -62,7 +57,6 @@ export default function NotFound({
6257
? "p"
6358
: "div";
6459

65-
const homeLink = isV2 ? "/" : "/v1/";
6660
return (
6761
<ContainerWrap>
6862
<div className={cx("d-flex")}>
@@ -76,17 +70,17 @@ export default function NotFound({
7670
"d-flex",
7771
"align-items-center",
7872
"gap-3",
79-
isV2 ? "text-primary" : "text-rk-green"
73+
"text-primary"
8074
)}
8175
>
82-
<img src={isV2 ? rkNotFoundImgV2 : rkNotFoundImg} />
76+
<img src={rkNotFoundImgV2} />
8377
{title}
8478
</h3>
8579
<Tag data-cy="not-found-description">{description}</Tag>
8680
<div>
8781
<Link
88-
to={homeLink}
89-
className={cx("btn", isV2 ? "btn-primary" : "btn-rk-green")}
82+
to={ABSOLUTE_ROUTES.v2.index}
83+
className={cx("btn", "btn-primary")}
9084
>
9185
<ArrowLeft className={cx("bi", "me-1")} />
9286
Return to home

client/src/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export function Layout({ children }: { children: ReactNode }) {
164164
export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
165165
if (isRouteErrorResponse(error)) {
166166
// TODO: Consider rendering the AppRoot here?
167-
return <NotFound forceV2={true} />;
167+
return <NotFound />;
168168
}
169169

170170
let message: string = "An unexpected error occurred.";

0 commit comments

Comments
 (0)