-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
24 changed files
with
1,747 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
*.css | ||
*.svg | ||
# Generated files should not be linted | ||
src/features/projectsV2/api/projectV2.api.ts | ||
src/features/projectsV2/api/storagesV2.api.ts | ||
src/features/dataConnectorsV2/api/data-connectors.api.ts | ||
src/features/usersV2/api/users.generated-api.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@import "~bootstrap/scss/functions"; | ||
@import "~bootstrap/scss/variables"; | ||
@import "~bootstrap/scss/variables-dark"; | ||
@import "../styles/renku_bootstrap_customization.scss"; | ||
|
||
.primaryAlert { | ||
--bs-primary-bg-subtle: #{tint-color($primary, 90%)}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*! | ||
* 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 { Alert } from "reactstrap"; | ||
import styles from "./PrimaryAlert.module.scss"; | ||
|
||
interface PrimaryAlertProps { | ||
children: React.ReactNode; | ||
"data-cy"?: string; | ||
icon?: React.ReactNode; | ||
className?: string; | ||
} | ||
export default function PrimaryAlert({ | ||
children, | ||
icon, | ||
...props | ||
}: PrimaryAlertProps) { | ||
return ( | ||
<Alert | ||
color="primary" | ||
isOpen | ||
data-cy={props["data-cy"]} | ||
className={cx(styles.primaryAlert, 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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...features/ProjectPageV2/ProjectPageContent/ProjectInformation/ProjectInformationButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/*! | ||
* 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 { useCallback, useState } from "react"; | ||
|
||
import { DropdownItem } from "reactstrap"; | ||
|
||
import { SingleButtonWithMenu } from "../../../../components/buttons/Button"; | ||
import BootstrapCopyIcon from "../../../../components/icons/BootstrapCopyIcon"; | ||
import useLegacySelector from "../../../../utils/customHooks/useLegacySelector.hook"; | ||
|
||
import type { Project } from "../../../projectsV2/api/projectV2.api"; | ||
import { useGetUserQuery } from "../../../usersV2/api/users.api"; | ||
|
||
import useProjectPermissions from "../../utils/useProjectPermissions.hook"; | ||
import ProjectCopyModal from "../../ProjectPageHeader/ProjectCopyModal"; | ||
|
||
export default function ProjectInformationButton({ | ||
project, | ||
}: { | ||
userPermissions: ReturnType<typeof useProjectPermissions>; | ||
project: Project; | ||
}) { | ||
const { data: currentUser } = useGetUserQuery(); | ||
const [isCopyModalOpen, setCopyModalOpen] = useState(false); | ||
const toggleCopyModal = useCallback(() => { | ||
setCopyModalOpen((open) => !open); | ||
}, []); | ||
const userLogged = useLegacySelector<boolean>( | ||
(state) => state.stateModel.user.logged | ||
); | ||
if (!userLogged) return null; | ||
return ( | ||
<> | ||
<SingleButtonWithMenu color="outline-primary" size="sm"> | ||
<DropdownItem | ||
data-cy="project-copy-menu-item" | ||
onClick={toggleCopyModal} | ||
> | ||
<BootstrapCopyIcon className={cx("bi")} /> | ||
<span className={cx("ms-2")}>Copy project</span> | ||
</DropdownItem> | ||
</SingleButtonWithMenu> | ||
{ | ||
<ProjectCopyModal | ||
currentUser={currentUser} | ||
isOpen={isCopyModalOpen} | ||
project={project} | ||
toggle={toggleCopyModal} | ||
/> | ||
} | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.