Skip to content
Draft
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
3 changes: 2 additions & 1 deletion client/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,12 @@ export default defineConfig([
globalIgnores([
"**/*.css",
"**/*.svg",
"src/features/cloudStorage/api/projectCloudStorage.generated-api.ts",
"src/features/connectedServices/api/connectedServices.generated-api.ts",
"src/features/dataConnectorsV2/api/data-connectors.api.ts",
"src/features/dataConnectorsV2/api/doiResolver.generated-api.ts",
"src/features/notifications/api/notifications.generated-api.ts",
"src/features/cloudStorage/api/projectCloudStorage.generated-api.ts",
"src/features/platform/api/platform.generated-api.ts",
"src/features/projectsV2/api/projectV2.api.ts",
"src/features/searchV2/api/searchV2Api.generated-api.ts",
"src/features/sessionsV2/api/computeResources.generated-api.ts",
Expand Down
54 changes: 27 additions & 27 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"@fortawesome/free-solid-svg-icons": "^7.2.0",
"@fortawesome/react-fontawesome": "^3.2.0",
"@popperjs/core": "^2.11.8",
"@react-router/express": "^7.13.1",
"@react-router/node": "^7.13.1",
"@react-router/express": "^7.17.0",
"@react-router/node": "^7.17.0",
"@reduxjs/toolkit": "^2.11.2",
"@sentry/react": "^10.38.0",
"@sentry/react-router": "^10.38.0",
Expand Down Expand Up @@ -89,7 +89,7 @@
"react-hook-form": "^7.71.1",
"react-markdown": "^10.1.0",
"react-redux": "^9.2.0",
"react-router": "^7.13.1",
"react-router": "^7.17.0",
"react-select": "^5.10.2",
"react-toastify": "^11.0.5",
"reactstrap": "^9.2.3",
Expand All @@ -110,7 +110,7 @@
"@eslint/js": "~9.39.3",
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
"@nabla/vite-plugin-eslint": "^3.0.0",
"@react-router/dev": "^7.13.1",
"@react-router/dev": "^7.17.0",
"@rtk-query/codegen-openapi": "^2.2.0",
"@storybook/addon-docs": "^10.2.15",
"@storybook/react-vite": "^10.2.15",
Expand Down
1 change: 0 additions & 1 deletion client/src/authentication/listeners.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const location: Location<void> = {
hash: "",
key: "default",
state: undefined,
unstable_mask: undefined,
};

const navigate = vi.fn();
Expand Down
8 changes: 5 additions & 3 deletions client/src/components/TimeCaption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface TimeCaptionProps {
noCaption?: boolean;
prefix?: ReactNode;
suffix?: ReactNode;
format?: "long" | "short";
}

export function TimeCaption({
Expand All @@ -43,13 +44,14 @@ export function TimeCaption({
noCaption,
prefix,
suffix,
format = "long",
}: TimeCaptionProps) {
const [now, setNow] = useState<DateTime>(DateTime.utc());

const datetime = datetime_ ? ensureDateTime(datetime_) : null;
const durationStr =
datetime != null && datetime.isValid
? toHumanRelativeDuration({ datetime, now })
? toHumanRelativeDuration({ datetime, now, format })
: "at unknown time";

const className = noCaption ? className_ : cx("time-caption", className_);
Expand All @@ -71,9 +73,9 @@ export function TimeCaption({
const refresh = Math.min(
Math.max(
duration.toMillis() / 10,
Duration.fromObject({ seconds: 5 }).toMillis(),
Duration.fromObject({ seconds: 5 }).toMillis()
),
Duration.fromObject({ minutes: 10 }).toMillis(),
Duration.fromObject({ minutes: 10 }).toMillis()
);
/* eslint-enable spellcheck/spell-checker */

Expand Down
1 change: 1 addition & 0 deletions client/src/components/entities/entities.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type EntityTypes =
| "code-repository"
| "data-connector"
| "job-launcher"
| "session-launcher";
15 changes: 9 additions & 6 deletions client/src/components/offcanvas/OffcanvasHeaderWithType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import cx from "classnames";
import {
Database,
FileCode,
Gear,
PlayCircle,
QuestionCircle,
} from "react-bootstrap-icons";
Expand Down Expand Up @@ -29,6 +30,8 @@ export default function OffcanvasHeaderWithType({
<Database className="me-1" />
) : entityType === "session-launcher" ? (
<PlayCircle className="me-1" />
) : entityType === "job-launcher" ? (
<Gear className="me-1" />
) : entityType === "code-repository" ? (
<FileCode className="me-1" />
) : (
Expand All @@ -38,12 +41,12 @@ export default function OffcanvasHeaderWithType({
const entityName = _entityName
? _entityName
: entityType === "data-connector"
? "Data connector"
: entityType === "session-launcher"
? "Session launcher"
: entityType === "code-repository"
? "Code repository"
: "Unknown";
? "Data connector"
: entityType === "session-launcher"
? "Session launcher"
: entityType === "code-repository"
? "Code repository"
: "Unknown";

return (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export default function SessionEnvironmentAdvancedFields({
const toggleIsOpen = useCallback(
() =>
setIsAdvancedSettingsOpen(
(isAdvancedSettingOpen) => !isAdvancedSettingOpen,
(isAdvancedSettingOpen) => !isAdvancedSettingOpen
),
[],
[]
);
return (
<>
Expand All @@ -56,7 +56,7 @@ export default function SessionEnvironmentAdvancedFields({
"fw-bold",
"gap-1",
"p-0",
"w-100",
"w-100"
)}
type="button"
onClick={toggleIsOpen}
Expand All @@ -70,6 +70,7 @@ export default function SessionEnvironmentAdvancedFields({
<AdvancedSettingsFields<SessionEnvironmentForm>
control={control}
errors={errors}
launcherCategory="session"
/>
</CollapseBody>
</Collapse>
Expand Down
24 changes: 13 additions & 11 deletions client/src/features/dashboardV2/DashboardV2Sessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import cx from "classnames";
import { generatePath, Link } from "react-router";
import { Col, ListGroup, Row } from "reactstrap";

import { sessionLauncherKindToCategory } from "~/features/sessionsV2/session.utils.ts";
import RtkOrDataServicesError from "../../components/errors/RtkOrDataServicesError";
import { Loader } from "../../components/Loader";
import { ABSOLUTE_ROUTES } from "../../routing/routes.constants";
Expand Down Expand Up @@ -112,10 +113,10 @@ interface DashboardSessionProps {
function DashboardSession({ session }: DashboardSessionProps) {
const { project_id: projectId, launcher_id: launcherId } = session;
const { data: project } = useGetProjectsByProjectIdQuery(
projectId ? { projectId } : skipToken,
projectId ? { projectId } : skipToken
);
const { data: launcher } = useGetProjectSessionLauncherQuery(
launcherId ? { launcherId } : skipToken,
launcherId ? { launcherId } : skipToken
);

const projectUrl = project
Expand All @@ -124,10 +125,10 @@ function DashboardSession({ session }: DashboardSessionProps) {
slug: project.slug,
})
: projectId
? generatePath(ABSOLUTE_ROUTES.v2.projects.showById, {
id: projectId,
})
: ABSOLUTE_ROUTES.v2.index;
? generatePath(ABSOLUTE_ROUTES.v2.projects.showById, {
id: projectId,
})
: ABSOLUTE_ROUTES.v2.index;
const showSessionUrl = project
? generatePath(ABSOLUTE_ROUTES.v2.projects.show.sessions.show, {
namespace: project.namespace,
Expand All @@ -136,7 +137,8 @@ function DashboardSession({ session }: DashboardSessionProps) {
})
: ABSOLUTE_ROUTES.v2.index;

const sessionStyles = getSessionStatusStyles(session);
const launcherCategory = sessionLauncherKindToCategory(session.session_type);
const sessionStyles = getSessionStatusStyles(session, launcherCategory);
const state = session.status.state;

return (
Expand All @@ -151,7 +153,7 @@ function DashboardSession({ session }: DashboardSessionProps) {
"gap-3",
"link-primary",
"text-body",
"text-decoration-none",
"text-decoration-none"
)}
to={{ pathname: projectUrl }}
>
Expand All @@ -165,7 +167,7 @@ function DashboardSession({ session }: DashboardSessionProps) {
"cursor-pointer",
"d-inline-block",
"link-primary",
"text-body",
"text-body"
)}
data-cy="list-session-link"
>
Expand All @@ -176,7 +178,7 @@ function DashboardSession({ session }: DashboardSessionProps) {
{launcher?.environment?.name}
</>
) : (
(projectId ?? "Unknown")
projectId ?? "Unknown"
)}
</h4>
</Col>
Expand All @@ -195,7 +197,7 @@ function DashboardSession({ session }: DashboardSessionProps) {
"mt-2",
"d-block",
"d-sm-flex",
"gap-5",
"gap-5"
)}
xs={12}
>
Expand Down
Loading
Loading