From 9365a9f8d7a2c02d47c99110796b27beee1bc1d3 Mon Sep 17 00:00:00 2001 From: Brad Harris Date: Mon, 11 Sep 2023 23:23:02 +0000 Subject: [PATCH] wip --- .../src/components/SelectIDEComponent.tsx | 4 +-- .../SelectWorkspaceClassComponent.tsx | 4 +-- components/dashboard/src/icons/CaretDown.svg | 4 +-- .../create-workspace/WorkspaceClass.tsx | 31 +++++++++++++++++-- .../create-workspace/WorkspaceDetails.tsx | 4 +-- .../create-workspace/WorkspaceIDE.tsx | 30 ++++++++++++++++-- 6 files changed, 65 insertions(+), 12 deletions(-) diff --git a/components/dashboard/src/components/SelectIDEComponent.tsx b/components/dashboard/src/components/SelectIDEComponent.tsx index cf3a396158300b..ec24054b8c6d48 100644 --- a/components/dashboard/src/components/SelectIDEComponent.tsx +++ b/components/dashboard/src/components/SelectIDEComponent.tsx @@ -130,7 +130,7 @@ function capitalize(label?: string) { return label && label[0].toLocaleUpperCase() + label.slice(1); } -const IdeOptionElementSelected: FC = ({ option, useLatest, loading = false }) => { +export const IdeOptionElementSelected: FC = ({ option, useLatest, loading = false }) => { let version: string | undefined, label: string | undefined, title: string; if (!option) { title = "Select Editor"; @@ -171,7 +171,7 @@ const IdeOptionElementSelected: FC = ({ option, useLatest ); }; -function IdeOptionElementInDropDown(p: IdeOptionElementProps): JSX.Element { +export function IdeOptionElementInDropDown(p: IdeOptionElementProps): JSX.Element { const { option, useLatest } = p; if (!option) { return <>; diff --git a/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx b/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx index 3241197d74f2a4..846f859e946b7f 100644 --- a/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx +++ b/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx @@ -82,7 +82,7 @@ type WorkspaceClassDropDownElementSelectedProps = { loading?: boolean; }; -const WorkspaceClassDropDownElementSelected: FC = ({ +export const WorkspaceClassDropDownElementSelected: FC = ({ wsClass, loading = false, }) => { @@ -104,7 +104,7 @@ const WorkspaceClassDropDownElementSelected: FC diff --git a/components/dashboard/src/icons/CaretDown.svg b/components/dashboard/src/icons/CaretDown.svg index 56c029abc90adb..abf4cde0f2bb6c 100644 --- a/components/dashboard/src/icons/CaretDown.svg +++ b/components/dashboard/src/icons/CaretDown.svg @@ -1,3 +1,3 @@ - - + + diff --git a/components/dashboard/src/workspaces/create-workspace/WorkspaceClass.tsx b/components/dashboard/src/workspaces/create-workspace/WorkspaceClass.tsx index 588ef7d1383112..4570672912edc0 100644 --- a/components/dashboard/src/workspaces/create-workspace/WorkspaceClass.tsx +++ b/components/dashboard/src/workspaces/create-workspace/WorkspaceClass.tsx @@ -7,6 +7,10 @@ import { FC, useMemo } from "react"; import { useWorkspaceClasses } from "../../data/workspaces/workspace-classes-query"; import ContextMenu, { ContextMenuEntry } from "../../components/ContextMenu"; +import { Button } from "../../components/Button"; +import WorkspaceClassIcon from "../../icons/WorkspaceClass.svg"; +import Arrow from "../../components/Arrow"; +import { WorkspaceClassDropDownElement } from "../../components/SelectWorkspaceClassComponent"; type WorkspaceClassProps = { selectedWSClassID: string; @@ -18,6 +22,7 @@ export const WorkspaceClass: FC = ({ selectedWSClassID, onC const menuEntries = useMemo((): ContextMenuEntry[] => { return (workspaceClasses || [])?.map((c) => ({ title: c.displayName, + customContent: , onClick: () => { onChange(c.id); }, @@ -38,8 +43,30 @@ export const WorkspaceClass: FC = ({ selectedWSClassID, onC } return ( - - {selectedWSClass?.description ?? "unknown"} + + + {/* {selectedWSClass?.displayName ?? "unknown"} */} ); }; diff --git a/components/dashboard/src/workspaces/create-workspace/WorkspaceDetails.tsx b/components/dashboard/src/workspaces/create-workspace/WorkspaceDetails.tsx index a92e8598c5d79e..b7e8b4053d3952 100644 --- a/components/dashboard/src/workspaces/create-workspace/WorkspaceDetails.tsx +++ b/components/dashboard/src/workspaces/create-workspace/WorkspaceDetails.tsx @@ -23,9 +23,9 @@ export const WorkspaceDetails: FC = ({ onIDEChange, }) => { return ( -
+
- class with + with
); diff --git a/components/dashboard/src/workspaces/create-workspace/WorkspaceIDE.tsx b/components/dashboard/src/workspaces/create-workspace/WorkspaceIDE.tsx index 61851d99d4d161..57a3a153ccaa26 100644 --- a/components/dashboard/src/workspaces/create-workspace/WorkspaceIDE.tsx +++ b/components/dashboard/src/workspaces/create-workspace/WorkspaceIDE.tsx @@ -7,6 +7,10 @@ import { FC, useMemo } from "react"; import ContextMenu, { ContextMenuEntry } from "../../components/ContextMenu"; import { useFilteredAndSortedIDEOptions } from "../../data/ide-options/ide-options-query"; +import { Button } from "../../components/Button"; +import Arrow from "../../components/Arrow"; +import Editor from "../../icons/Editor.svg"; +import { IdeOptionElementInDropDown } from "../../components/SelectIDEComponent"; type WorkspaceIDEProps = { selectedIDE: string; @@ -19,6 +23,7 @@ export const WorkspaceIDE: FC = ({ selectedIDE, useLatestIDE, const menuEntries = useMemo((): ContextMenuEntry[] => { return (ideOptions || []).map((ide) => ({ title: ide.title, + customContent: , onClick: () => { onChange(ide.id, useLatestIDE); }, @@ -38,8 +43,29 @@ export const WorkspaceIDE: FC = ({ selectedIDE, useLatestIDE, } return ( - - {selectedOption?.title ?? "unknown"} + + {/* {selectedOption ? ( + + ) : ( + Please select an Editor + )} */} + ); };