diff --git a/client/src/components/EntityWatermark.tsx b/client/src/components/EntityWatermark.tsx new file mode 100644 index 000000000..dd3c190d0 --- /dev/null +++ b/client/src/components/EntityWatermark.tsx @@ -0,0 +1,43 @@ +/*! + * Copyright 2024 - 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 { CSSProperties } from "react"; +import { Folder, People, Person } from "react-bootstrap-icons"; + +interface EntityWatermarkProps { + type: "project" | "user" | "group"; +} +export function EntityWatermark({ type }: EntityWatermarkProps) { + const watermarkStyles: CSSProperties = { + right: "0", + fontSize: "150px", + lineHeight: "0", + color: "rgba(0, 0, 0, 0.1)", + }; + return ( +
- Add published datasets from data repositories, and connect to - cloud storage to read and write custom data. -
+ {data.total === 0 && namespaceKind === "group" && ( ++ Add published datasets from data repositories, and connect to cloud + storage to read and write custom data. +
+ } + requestedPermission="write" + userPermissions={permissions} + /> + ); +} + +function AddEmptyListForUserNamespace({ namespace }: { namespace: string }) { + const { data: currentUser } = useGetUserQuery(); + + if (currentUser?.isLoggedIn && currentUser.username === namespace) { + return ( ++ Add published datasets from data repositories, and connect to cloud + storage to read and write custom data. +
+ ); + } + returnThis user has no visible data connectors.
; +} diff --git a/client/src/features/dataConnectorsV2/components/DataConnectorsBoxListDisplay.tsx b/client/src/features/dataConnectorsV2/components/DataConnectorsBoxListDisplay.tsx index 181338226..6a1fcf91d 100644 --- a/client/src/features/dataConnectorsV2/components/DataConnectorsBoxListDisplay.tsx +++ b/client/src/features/dataConnectorsV2/components/DataConnectorsBoxListDisplay.tsx @@ -18,11 +18,12 @@ import cx from "classnames"; import { useCallback, useState } from "react"; -import { Globe2, Lock } from "react-bootstrap-icons"; +import { EyeFill, Globe2, Lock, Pencil } from "react-bootstrap-icons"; import { Col, ListGroupItem, Row } from "reactstrap"; import ClampedParagraph from "../../../components/clamped/ClampedParagraph"; import { TimeCaption } from "../../../components/TimeCaption"; +import UserAvatar, { UserAvatarSize } from "../../usersV2/show/UserAvatar.tsx"; import type { DataConnector, DataConnectorToProjectLink, @@ -33,16 +34,20 @@ import DataConnectorView from "./DataConnectorView"; interface DataConnectorBoxListDisplayProps { dataConnector: DataConnector; dataConnectorLink?: DataConnectorToProjectLink; + extendedPreview?: boolean; } export default function DataConnectorBoxListDisplay({ dataConnector, dataConnectorLink, + extendedPreview, }: DataConnectorBoxListDisplayProps) { const { name, description, visibility, creation_date: creationDate, + storage, + namespace, } = dataConnector; const [showDetails, setShowDetails] = useState(false); @@ -50,6 +55,21 @@ export default function DataConnectorBoxListDisplay({ setShowDetails((open) => !open); }, []); + const type = `${storage?.configuration?.type?.toString() ?? ""} ${ + storage?.configuration?.provider?.toString() ?? "" + }`; + const readOnly = storage?.readonly ? ( ++ {namespace} +
+There are no members in this group.
; - } - return ( -There are no members in this group.
} + {isLoading && ( +{`@${username}`}
++ {name ?? "Unknown user"} ({capitalize(role)}) +
{capitalize(role)}
{group.description}
+@{group.slug}
+ +
+
+ {icon} + {title} +
+{`@${slug}`}
-{group.description}
-The project list is empty.
; - } + const emptyListElement = + namespaceKind === "group" ? ( +- - {"@"} - {namespace} - -
- {description &&+ Collaborate on projects with anyone, with data, code, and compute + together in one place. +
+ } + requestedPermission="write" + userPermissions={permissions} + /> ); } + +function AddEmptyListForUserNamespace({ namespace }: { namespace: string }) { + const { data: currentUser } = useGetUserQuery(); + + if (currentUser?.isLoggedIn && currentUser.username === namespace) { + return ( ++ Collaborate on projects with anyone, with data, code, and compute + together in one place. +
+ ); + } + returnThis user has no visible personal projects.
; +} diff --git a/client/src/features/rootV2/RootV2.tsx b/client/src/features/rootV2/RootV2.tsx index 19b8a5620..617ac28ab 100644 --- a/client/src/features/rootV2/RootV2.tsx +++ b/client/src/features/rootV2/RootV2.tsx @@ -26,6 +26,7 @@ import { RELATIVE_ROUTES } from "../../routing/routes.constants"; import useAppDispatch from "../../utils/customHooks/useAppDispatch.hook"; import useAppSelector from "../../utils/customHooks/useAppSelector.hook"; import { setFlag } from "../../utils/feature-flags/featureFlags.slice"; +import LazyGroupContainer from "../groupsV2/LazyGroupContainer.tsx"; import LazyProjectPageV2Show from "../ProjectPageV2/LazyProjectPageV2Show"; import LazyProjectPageOverview from "../ProjectPageV2/ProjectPageContent/LazyProjectPageOverview"; @@ -33,7 +34,7 @@ import LazyProjectPageSettings from "../ProjectPageV2/ProjectPageContent/LazyPro import LazyConnectedServicesPage from "../connectedServices/LazyConnectedServicesPage"; import LazyDashboardV2 from "../dashboardV2/LazyDashboardV2"; import LazyHelpV2 from "../dashboardV2/LazyHelpV2"; -import LazyGroupV2Show from "../groupsV2/LazyGroupV2Show"; +import LazyGroupV2Overview from "../groupsV2/LazyGroupV2Overview.tsx"; import LazyGroupV2New from "../projectsV2/LazyGroupNew"; import LazyProjectV2New from "../projectsV2/LazyProjectV2New"; import LazyProjectV2ShowByProjectId from "../projectsV2/LazyProjectV2ShowByProjectId"; @@ -143,11 +144,13 @@ function GroupsV2Routes() { element={