Skip to content

Commit 11f68b0

Browse files
authored
Merge branch 'main' into leafty/fix-v1-settings
2 parents 5ffb5fe + 4629a00 commit 11f68b0

31 files changed

Lines changed: 2145 additions & 586 deletions

client/src/components/buttons/Button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ interface ButtonWithMenuV2Props {
130130
id?: string;
131131
preventPropagation?: boolean;
132132
size?: string;
133+
isDisabledDropdownToggle?: boolean;
133134
}
134135
export const ButtonWithMenuV2 = SplitButtonWithMenu;
135136

@@ -143,6 +144,7 @@ export function SplitButtonWithMenu({
143144
id,
144145
preventPropagation,
145146
size,
147+
isDisabledDropdownToggle,
146148
}: ButtonWithMenuV2Props) {
147149
// ! Temporary workaround to quickly implement a design solution -- to be removed ASAP #3250
148150
const additionalProps = preventPropagation
@@ -166,7 +168,7 @@ export function SplitButtonWithMenu({
166168
data-bs-toggle="dropdown"
167169
color={color ?? "primary"}
168170
data-cy="button-with-menu-dropdown"
169-
disabled={disabled}
171+
disabled={isDisabledDropdownToggle ?? disabled}
170172
/>
171173
<DropdownMenu end>{children}</DropdownMenu>
172174
</UncontrolledDropdown>

client/src/features/ProjectPageV2/ProjectPageContent/CodeRepositories/CodeRepositoryDisplay.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,18 @@ function RepositoryView({
639639
<div className={cx("float-end", "mt-1", "ms-1")}>
640640
<CodeRepositoryActions project={project} url={repositoryUrl} />
641641
</div>
642-
<h2
643-
className={cx("m-0", "text-break")}
644-
data-cy="data-source-title"
645-
>
646-
{title}
647-
</h2>
642+
<div className={cx("d-flex", "flex-column")}>
643+
<span className={cx("small", "text-muted", "me-3")}>
644+
Code repository
645+
</span>
646+
<h2
647+
className={cx("m-0", "text-break")}
648+
data-cy="code-repository-title"
649+
>
650+
{title}
651+
</h2>
652+
</div>
648653
</div>
649-
<p className={cx("fst-italic", "m-0")}>Code repository</p>
650654
</div>
651655

652656
<div className={cx("d-flex", "flex-column", "gap-3")}>

client/src/features/dashboardV2/DashboardV2Sessions.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ import { Loader } from "../../components/Loader";
2626
import EnvironmentLogsV2 from "../../components/LogsV2";
2727
import { RtkOrNotebooksError } from "../../components/errors/RtkErrorAlert";
2828
import { ABSOLUTE_ROUTES } from "../../routing/routes.constants";
29-
import useAppSelector from "../../utils/customHooks/useAppSelector.hook";
3029
import { useGetProjectsByProjectIdQuery } from "../projectsV2/api/projectV2.enhanced-api";
3130
import { useGetSessionLaunchersByLauncherIdQuery as useGetProjectSessionLauncherQuery } from "../sessionsV2/api/sessionLaunchersV2.api";
3231
import ActiveSessionButton from "../sessionsV2/components/SessionButton/ActiveSessionButton";
3332
import {
33+
SessionStatusV2Badge,
3434
SessionStatusV2Description,
35-
SessionStatusV2Label,
3635
} from "../sessionsV2/components/SessionStatus/SessionStatus";
3736
import { SessionList, SessionV2 } from "../sessionsV2/sessionsV2.types";
3837

@@ -114,9 +113,6 @@ interface DashboardSessionProps {
114113
session: SessionV2;
115114
}
116115
function DashboardSession({ session }: DashboardSessionProps) {
117-
const displayModal = useAppSelector(
118-
({ display }) => display.modals.sessionLogs
119-
);
120116
const { project_id: projectId, launcher_id: launcherId } = session;
121117
const { data: project } = useGetProjectsByProjectIdQuery(
122118
projectId ? { projectId } : skipToken
@@ -186,7 +182,7 @@ function DashboardSession({ session }: DashboardSessionProps) {
186182
</h6>
187183
</Col>
188184
<Col xs={12} xl="auto" className="mt-1">
189-
<SessionStatusV2Label session={session} />
185+
<SessionStatusV2Badge session={session} />
190186
</Col>
191187
</Row>
192188
</Col>
@@ -209,7 +205,7 @@ function DashboardSession({ session }: DashboardSessionProps) {
209205
showSessionUrl={showSessionUrl}
210206
/>
211207
</div>
212-
<EnvironmentLogsV2 name={displayModal.targetServer} />
208+
<EnvironmentLogsV2 name={session.name} />
213209
</div>
214210
);
215211
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.SessionLauncherCard {
2+
&:hover {
3+
box-shadow: rgba(50, 50, 93, 0.25) 0 2px 10px -1px,
4+
rgba(0, 0, 0, 0.3) 0px 1px 3px -1px !important;
5+
}
6+
}
7+
8+
.SessionLine {
9+
left: 40px;
10+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*!
2+
* Copyright 2025 - Swiss Data Science Center (SDSC)
3+
* A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
4+
* Eidgenössische Technische Hochschule Zürich (ETHZ).
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import cx from "classnames";
20+
import { Col, Row } from "reactstrap";
21+
import { Project } from "../../projectsV2/api/projectV2.api";
22+
import ActiveSessionButton from "../components/SessionButton/ActiveSessionButton";
23+
import {
24+
getSessionStatusStyles,
25+
SessionStatusV2Description,
26+
SessionStatusV2Label,
27+
} from "../components/SessionStatus/SessionStatus";
28+
import { getShowSessionUrlByProject } from "../SessionsV2";
29+
import { SessionV2 } from "../sessionsV2.types";
30+
import styles from "./Session.module.scss";
31+
32+
interface SessionCardProps {
33+
project: Project;
34+
session?: SessionV2;
35+
}
36+
export default function SessionCard({ project, session }: SessionCardProps) {
37+
if (!session) return null;
38+
39+
const stylesPerSession = getSessionStatusStyles(session);
40+
41+
return (
42+
<div
43+
data-cy="session-item"
44+
className={cx(
45+
`bg-${stylesPerSession.bgColor}`,
46+
`bg-opacity-${stylesPerSession.bgOpacity}`,
47+
"p-0",
48+
"pb-3"
49+
)}
50+
>
51+
<img
52+
src={stylesPerSession.sessionLine}
53+
className={cx("position-absolute", styles.SessionLine)}
54+
alt="Session line indicator"
55+
loading="lazy"
56+
/>
57+
<div className={cx("ms-5", "px-3", "pt-3")}>
58+
<Row className="g-2">
59+
<Col xs={12} xl="auto">
60+
<Row className="g-2">
61+
<Col
62+
xs={12}
63+
xl={12}
64+
className={cx(
65+
"d-inline-block",
66+
"link-primary",
67+
"text-body",
68+
"mt-1"
69+
)}
70+
>
71+
<span className={cx("small", "text-muted", "me-3")}>
72+
Session
73+
</span>
74+
</Col>
75+
<Col
76+
className={cx("align-items-center", "mt-0", "gap-2")}
77+
xs="12"
78+
xl="auto"
79+
>
80+
<SessionStatusV2Label session={session} />
81+
</Col>
82+
<Col
83+
xs="auto"
84+
className={cx("mt-0", "ms-0", "ms-xl-3", "d-flex")}
85+
>
86+
<SessionStatusV2Description
87+
session={session}
88+
showInfoDetails={false}
89+
/>
90+
</Col>
91+
</Row>
92+
</Col>
93+
<Col
94+
xs={12}
95+
xl="auto"
96+
className={cx("d-flex", "ms-md-auto", "justify-content-end")}
97+
>
98+
<div>
99+
<ActiveSessionButton
100+
session={session}
101+
showSessionUrl={getShowSessionUrlByProject(
102+
project,
103+
session.name
104+
)}
105+
/>
106+
</div>
107+
</Col>
108+
</Row>
109+
</div>
110+
</div>
111+
);
112+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default function SessionItem({
114114
/>
115115
) : launcher != null ? (
116116
<StartSessionButton
117-
launcherId={launcher.id}
117+
launcher={launcher}
118118
namespace={project.namespace}
119119
slug={project.slug}
120120
/>

0 commit comments

Comments
 (0)