-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new emui use monaco as json editor (#1733)
## Description: This PR switches to using the monaco editor for json input. I've changed the layout functionality to effectively match the previous `CodeEditor.js` - which seems to work for me, though I can't explain why calling `layout` twice (or so frequently) is necessary. This PR also fixes the use of the Inter font Additionally this PR fixes several pieces of feedback from Tise: * breadcrumb styling * Uppercase text in tags * Tab hover * `x selected` hover interactivity * Update progress widget and colour used * Implement the copy toast * Fix table header icons and hover appearance. ### Demo https://github.com/kurtosis-tech/kurtosis/assets/4419574/f01efc78-2022-4edf-a18d-01587f053390 ## Is this change user facing? YES
- Loading branch information
Showing
11 changed files
with
87 additions
and
50 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
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
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
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,17 @@ | ||
import { CheckCircleIcon } from "@chakra-ui/icons"; | ||
import { Flex, forwardRef, Icon, Text } from "@chakra-ui/react"; | ||
|
||
type ToastProps = { | ||
message: string; | ||
}; | ||
|
||
export const SuccessToast = forwardRef<ToastProps, "div">(({ message }: ToastProps, ref) => { | ||
return ( | ||
<Flex ref={ref} bg={"rgba(0, 194, 35, 0.24)"} p={"6px 16px"} borderRadius={"6px"} gap={"12px"}> | ||
<Icon height={"24px"} width={"24px"} as={CheckCircleIcon} color={"kurtosisGreen.400"} /> | ||
<Text fontWeight={"bold"} fontSize={"lg"}> | ||
{message} | ||
</Text> | ||
</Flex> | ||
); | ||
}); |
17 changes: 10 additions & 7 deletions
17
enclave-manager/web/src/components/enclaves/configuration/inputs/JSONArgumentInput.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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
import { Textarea } from "@chakra-ui/react"; | ||
import { Controller } from "react-hook-form"; | ||
import { stringifyError } from "../../../../utils"; | ||
import { CodeEditor } from "../../../CodeEditor"; | ||
import { useEnclaveConfigurationFormContext } from "../EnclaveConfigurationForm"; | ||
import { KurtosisArgumentTypeInputProps } from "./KurtosisArgumentTypeInput"; | ||
|
||
export const JSONArgumentInput = (props: Omit<KurtosisArgumentTypeInputProps, "type">) => { | ||
const { register } = useEnclaveConfigurationFormContext(); | ||
const { control } = useEnclaveConfigurationFormContext(); | ||
|
||
return ( | ||
<Textarea | ||
{...register(props.name, { | ||
disabled: props.disabled, | ||
<Controller | ||
render={({ field }) => <CodeEditor text={field.value} onTextChange={field.onChange} />} | ||
name={props.name} | ||
defaultValue={"{}"} | ||
rules={{ | ||
required: props.isRequired, | ||
value: "{}", | ||
validate: (value: string) => { | ||
try { | ||
JSON.parse(value); | ||
} catch (err: any) { | ||
return `This is not valid JSON. ${stringifyError(err)}`; | ||
} | ||
}, | ||
})} | ||
}} | ||
disabled={props.disabled} | ||
/> | ||
); | ||
}; |
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
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