Skip to content

Commit 9d871fb

Browse files
committed
move location of modal
1 parent 09c7897 commit 9d871fb

6 files changed

Lines changed: 22 additions & 179 deletions

File tree

client/src/features/sessionsV2/SessionList/SessionLauncherDisplay.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type { SessionLauncher } from "../api/sessionLaunchersV2.api";
2424
import { useGetSessionsQuery as useGetSessionsQueryV2 } from "../api/sessionsV2.api";
2525
import UpdateSessionLauncherEnvironmentModal from "../components/SessionModals/UpdateSessionLauncherModal";
2626
import DeleteSessionV2Modal from "../DeleteSessionLauncherModal";
27-
import SessionStartLinkModal from "../SessionView/SessionStartLinkModal";
27+
import SessionLaunchLinkModal from "../SessionView/SessionLaunchLinkModal";
2828
import { SessionView } from "../SessionView/SessionView";
2929
import SessionLauncherCard from "./SessionLauncherCard";
3030
import EnvironmentLogsV2 from "../../../components/LogsV2";
@@ -135,7 +135,7 @@ export function SessionLauncherDisplay({
135135
toggle={toggleDelete}
136136
sessionsLength={filteredSessions?.length}
137137
/>
138-
<SessionStartLinkModal
138+
<SessionLaunchLinkModal
139139
isOpen={isShareLinkOpen}
140140
launcher={launcher}
141141
toggle={toggleShareLink}

client/src/features/sessionsV2/SessionView/SessionLaunchLinkModal.tsx

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

1919
import cx from "classnames";
2020
import { useContext, useEffect, useMemo } from "react";
21-
import { ArrowClockwise, CheckCircle, XLg } from "react-bootstrap-icons";
21+
import {
22+
ArrowClockwise,
23+
CheckCircle,
24+
Link45deg,
25+
XLg,
26+
} from "react-bootstrap-icons";
2227
import {
2328
Controller,
2429
useFieldArray,
@@ -32,6 +37,7 @@ import {
3237
Col,
3338
Form,
3439
FormGroup,
40+
Input,
3541
Label,
3642
Modal,
3743
ModalBody,
@@ -49,8 +55,6 @@ import AppContext from "../../../utils/context/appContext";
4955
import { Project } from "../../projectsV2/api/projectV2.api";
5056
import type { SessionLauncher } from "../api/sessionLaunchersV2.api";
5157

52-
import { Input } from "reactstrap";
53-
5458
interface CustomizeLaunchLinkFormProps {
5559
control: ReturnType<typeof useForm<EnvVariablesCustomizationForm>>["control"];
5660
errors: FieldErrors<EnvVariablesCustomizationForm>;
@@ -408,7 +412,10 @@ export default function SessionLaunchLinkModal({
408412
scrollable
409413
>
410414
<ModalHeader toggle={toggle}>
411-
<div>Share Session launch link for {launcher.name}</div>
415+
<div>
416+
<Link45deg className={cx("bi", "me-1")} /> Share Session launch link
417+
for {launcher.name}
418+
</div>
412419
<div className="fs-6">
413420
Create and share a link that directly launches a Renku session.
414421
</div>

client/src/features/sessionsV2/SessionView/SessionStartLinkModal.tsx

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

client/src/features/sessionsV2/SessionView/SessionView.tsx

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
Database,
2626
ExclamationTriangleFill,
2727
FileCode,
28-
Link45deg,
2928
Pencil,
3029
} from "react-bootstrap-icons";
3130
import {
@@ -71,10 +70,8 @@ import {
7170
import { DEFAULT_URL } from "../session.constants";
7271
import { SessionV2 } from "../sessionsV2.types";
7372
import EnvironmentCard from "./EnvironmentCard";
74-
import useSessionStartLink from "./useSessionStartLink.hook";
7573
import EnvVariablesCard from "./EnvVariablesCard";
7674
import EnvVariablesModal from "./EnvVariablesModal";
77-
import SessionLaunchLinkModal from "./SessionLaunchLinkModal";
7875

7976
interface SessionCardContentProps {
8077
color: string;
@@ -196,23 +193,6 @@ function getSessionColor(state: string) {
196193
: "dark";
197194
}
198195

199-
function SessionLaunchLink({
200-
launcher,
201-
project,
202-
}: Required<Pick<SessionViewProps, "launcher" | "project">>) {
203-
const { url } = useSessionStartLink({ launcher, project });
204-
return (
205-
<div className="mb-2">
206-
<h4 className="my-auto">
207-
<Link45deg className={cx("bi", "me-1")} />
208-
Session Launch Link
209-
</h4>
210-
<p className="mb-2">A session launch link leads directly to a session.</p>
211-
<CommandCopy command={url.toString()} noMargin />
212-
</div>
213-
);
214-
}
215-
216196
interface SessionViewProps {
217197
id?: string;
218198
isOpen: boolean;
@@ -238,8 +218,6 @@ export function SessionView({
238218
const [isUpdateOpen, setIsUpdateOpen] = useState(false);
239219
const [isModifyResourcesOpen, setModifyResourcesOpen] = useState(false);
240220
const [isEnvVariablesModalOpen, setEnvVariablesModalOpen] = useState(false);
241-
const [isSessionLaunchLinksModalOpen, setSessionLaunchLinksModalOpen] =
242-
useState(false);
243221
const toggle = useCallback(() => {
244222
setIsUpdateOpen((open) => !open);
245223
}, []);
@@ -249,9 +227,6 @@ export function SessionView({
249227
const toggleEnvVariables = useCallback(() => {
250228
setEnvVariablesModalOpen((open) => !open);
251229
}, []);
252-
const toggleSessionLaunchLinks = useCallback(() => {
253-
setSessionLaunchLinksModalOpen((open) => !open);
254-
}, []);
255230
const permissions = useProjectPermissions({ projectId: project.id });
256231
const environment = launcher?.environment;
257232

@@ -559,38 +534,6 @@ export function SessionView({
559534
</div>
560535

561536
<SessionViewSessionSecrets />
562-
{launcher && (
563-
<div className="mb-2">
564-
<div className={cx("d-flex", "justify-content-between", "mb-2")}>
565-
<h4 className="my-auto">
566-
<Link45deg className={cx("bi", "me-1")} />
567-
Session Launch Link
568-
</h4>
569-
<Button
570-
color="outline-primary"
571-
id="define-launch-links-button"
572-
onClick={toggleSessionLaunchLinks}
573-
size="sm"
574-
tabIndex={0}
575-
>
576-
<Pencil className="bi" />
577-
</Button>
578-
<UncontrolledTooltip target="define-launch-links-button">
579-
Define custom launch links
580-
</UncontrolledTooltip>
581-
</div>
582-
<p className="mb-2">
583-
A session launch link leads directly to a session.
584-
</p>
585-
<SessionLaunchLink launcher={launcher} project={project} />
586-
<SessionLaunchLinkModal
587-
isOpen={isSessionLaunchLinksModalOpen}
588-
launcher={launcher}
589-
project={project}
590-
toggle={toggleSessionLaunchLinks}
591-
/>
592-
</div>
593-
)}
594537
{launcher && (
595538
<div>
596539
<div

client/src/features/sessionsV2/SessionView/useSessionStartLink.hook.ts

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

tests/cypress/e2e/projectV2setup.spec.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,11 @@ describe("Customize session environment variables", () => {
862862

863863
cy.wait("@sessionLaunchers");
864864
// check session launcher view and edit session launcher
865-
cy.getDataCy("session-name").click();
866-
cy.get("#define-launch-links-button").click();
865+
cy.getDataCy("session-launcher-item")
866+
.find('[data-cy="button-with-menu-dropdown"]')
867+
.click();
868+
cy.getDataCy("session-launcher-menu-share-link").click();
869+
// cy.get("#define-launch-links-button").click();
867870
// cy.contains(
868871
// "To add environment variables, see the Environment Variables section of the session launcher."
869872
// ).should("be.visible");
@@ -896,8 +899,10 @@ describe("Customize session environment variables", () => {
896899

897900
cy.wait("@sessionLaunchers");
898901
// check session launcher view and edit session launcher
899-
cy.getDataCy("session-name").click();
900-
cy.get("#define-launch-links-button").click();
902+
cy.getDataCy("session-launcher-item")
903+
.find('[data-cy="button-with-menu-dropdown"]')
904+
.click();
905+
cy.getDataCy("session-launcher-menu-share-link").click();
901906
cy.contains(
902907
"To add environment variables, see the Environment Variables section of the session launcher."
903908
).should("be.visible");

0 commit comments

Comments
 (0)