Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ import {
FooterNavbar,
RenkuNavBar,
} from "./features/landing/components/NavBar/NavBar";
import {
LegacyDatasetAddToProject,
LegacyDatasets,
LegacyProjectView,
LegacyRoot,
LegacyShowDataset,
} from "./features/legacy";

import LegacyDatasets from "./features/legacy/LegacyDatasets";
import LegacyDatasetAddToProject from "./features/legacy/LegacyDatasetAddToProject";
import LegacyRoot from "./features/legacy/LegacyRoot";
import LegacyProjectView from "./features/legacy/LegacyProjectView";
import LegacyShowDataset from "./features/legacy/LegacyShowDataset";

import LoginHandler from "./features/loginHandler/LoginHandler";
import { Unavailable } from "./features/maintenance/Maintenance";
import LazyRootV2 from "./features/rootV2/LazyRootV2";
Expand Down
46 changes: 46 additions & 0 deletions client/src/components/TakeActionAlert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import cx from "classnames";
import { Alert } from "reactstrap";

interface TakeActionAlertProps {
children: React.ReactNode;
"data-cy"?: string;
icon?: React.ReactNode;
className?: string;
}
export default function TakeActionAlert({
children,
icon,
...props
}: TakeActionAlertProps) {
return (
<Alert
color="take-action"
isOpen
data-cy={props["data-cy"]}
className={cx(props.className, "overflow-y-auto")}
>
<div className={cx("d-flex", "gap-3")}>
{icon && <div>{icon}</div>}
<div className={cx("my-auto", "w-100")}>{children}</div>
</div>
</Alert>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import {
Row,
} from "reactstrap";

import RepositoryGitLabWarnBadge from "~/features/legacy/RepositoryGitLabWarnBadge";

import { useLoginUrl } from "../../../../authentication/useLoginUrl.hook";
import {
ErrorAlert,
Expand Down Expand Up @@ -508,6 +510,11 @@ export function RepositoryItem({
</>
)}
</Row>
<Row>
<Col data-cy="repo-gitlab-warning">
<RepositoryGitLabWarnBadge project={project} />
</Col>
</Row>
</ListGroupItem>
{!readonly && (
<RepositoryView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { ProjectImageView } from "../ProjectPageContent/ProjectInformation/Proje

import ProjectAutostartRedirectBanner from "./ProjectAutostartRedirectBanner";
import ProjectCopyBanner from "./ProjectCopyBanner";
import ProjectGitLabWarnBanner from "../../legacy/ProjectGitLabWarnBanner";
import ProjectTemplateInfoBanner from "./ProjectTemplateInfoBanner";

interface ProjectPageHeaderProps {
Expand Down Expand Up @@ -75,6 +76,11 @@ export default function ProjectPageHeader({ project }: ProjectPageHeaderProps) {
</Col>
</Col>
</Row>
<Row>
<Col>
<ProjectGitLabWarnBanner project={project} />
</Col>
</Row>
<Row>
<Col>
{project.is_template && <ProjectCopyBanner project={project} />}
Expand Down
30 changes: 30 additions & 0 deletions client/src/features/legacy/InternalGitLabWarnBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import cx from "classnames";
import { EmojiDizzyFill } from "react-bootstrap-icons";
import { Badge } from "reactstrap";

export default function InternalGitLabReferenceWarnBadge() {
return (
<Badge pill color="take-action">
<EmojiDizzyFill className={cx("bi", "me-1")} />
Migration needed
</Badge>
);
}
38 changes: 38 additions & 0 deletions client/src/features/legacy/LegacyDatasetAddToProject.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import cx from "classnames";
import { useContext } from "react";

import AppContext from "../../utils/context/appContext";

import SunsetBanner from "../projectsV2/shared/SunsetV1Banner";

import NoLegacySupport from "./NoLegacySupport";

export default function LegacyDatasetAddToProject() {
const { params } = useContext(AppContext);
if (params && !params.LEGACY_SUPPORT.enabled) {
return <NoLegacySupport />;
}
return (
<div className={cx("d-flex", "flex-column", "align-items-center", "w-100")}>
<SunsetBanner />
</div>
);
}
37 changes: 37 additions & 0 deletions client/src/features/legacy/LegacyDatasets.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { useContext } from "react";
import { Navigate } from "react-router";

import { ABSOLUTE_ROUTES } from "../../routing/routes.constants";
import AppContext from "../../utils/context/appContext";

export default function LegacyDatasets() {
const { params } = useContext(AppContext);
if (params && !params.LEGACY_SUPPORT.enabled) {
return (
<Navigate
// eslint-disable-next-line spellcheck/spell-checker
to={`${ABSOLUTE_ROUTES.v2.search}?q=type%3Adataconnector`}
replace
/>
);
}
return <Navigate to={`${ABSOLUTE_ROUTES.v1.search}?type=dataset`} replace />;
}
33 changes: 33 additions & 0 deletions client/src/features/legacy/LegacyProjectView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { useContext } from "react";

import LazyProjectView from "../../project/LazyProjectView";
import AppContext from "../../utils/context/appContext";

import NoLegacySupport from "./NoLegacySupport";

export default function LegacyProjectView() {
const { params } = useContext(AppContext);
if (params && !params.LEGACY_SUPPORT.enabled) {
return <NoLegacySupport />;
}

return <LazyProjectView />;
}
40 changes: 40 additions & 0 deletions client/src/features/legacy/LegacyRoot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import cx from "classnames";
import { useContext } from "react";

import AppContext from "../../utils/context/appContext";

import LazyRootV1 from "../rootV1/LazyRootV1";
import NavbarV2 from "../rootV2/NavbarV2";

import NoLegacySupport from "./NoLegacySupport";

export default function LegacyRoot() {
const { params } = useContext(AppContext);
if (params && !params.LEGACY_SUPPORT.enabled) {
return (
<div className={cx("d-flex", "flex-column", "w-100")}>
<NavbarV2 />
<NoLegacySupport />
</div>
);
}
return <LazyRootV1 />;
}
52 changes: 52 additions & 0 deletions client/src/features/legacy/LegacyShowDataset.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*!
* Copyright 2025 - Swiss Data Science Center (SDSC)
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
* Eidgenössische Technische Hochschule Zürich (ETHZ).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { useContext } from "react";

import { DatasetCoordinator } from "../../dataset/Dataset.state";
import LazyShowDataset from "../../dataset/LazyShowDataset";
import AppContext from "../../utils/context/appContext";

import type { UserInfo } from "../usersV2/api/users.types";

import NoLegacySupport from "./NoLegacySupport";

interface LegacyDatasetProps {
userInfo: UserInfo;
}

export default function LegacyShowDataset({ userInfo }: LegacyDatasetProps) {
const { client, model: contextModel, params } = useContext(AppContext);
if (params && !params.LEGACY_SUPPORT.enabled) {
return <NoLegacySupport />;
}

const model = contextModel as { subModel: (arg0: string) => unknown };
return (
<LazyShowDataset
insideProject={false}
client={client}
projectsUrl="/projects"
datasetCoordinator={
new DatasetCoordinator(client, model.subModel("dataset"))
}
logged={userInfo?.isLoggedIn ?? false}
model={model}
/>
);
}
Loading
Loading