Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: display create enclave error in scrollable box #1802

Merged
merged 4 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions enclave-manager/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"homepage": ".",
"proxy": "http://localhost:8081",
"dependencies": {
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.1",
Expand Down
6 changes: 4 additions & 2 deletions enclave-manager/web/src/components/KurtosisAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type KurtosisAlertProps = AlertProps & {

export const KurtosisAlert = ({ message, details, ...alertProps }: KurtosisAlertProps) => {
return (
<Alert status="error" {...alertProps}>
<Alert status="error" overflowY={"auto"} maxHeight={"300px"} alignItems={"flex-start"} {...alertProps}>
<AlertIcon />
<Flex flexDirection={"column"} width={"100%"} gap={"8px"}>
<Flex direction={"row"}>
Expand All @@ -40,7 +40,9 @@ export const KurtosisAlert = ({ message, details, ...alertProps }: KurtosisAlert
</AccordionButton>
</h2>
<AccordionPanel pb={4}>
<Box as={"pre"}>{details}</Box>
<Box as={"pre"} whiteSpace={"pre-wrap"} wordBreak={"break-word"}>
{details}
</Box>
</AccordionPanel>
</AccordionItem>
</Accordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
ModalHeader,
ModalOverlay,
Text,
Tooltip, useToast,
Tooltip,
useToast,
} from "@chakra-ui/react";
import { EnclaveMode } from "enclave-manager-sdk/build/engine_service_pb";
import { useMemo, useRef, useState } from "react";
Expand Down Expand Up @@ -152,6 +153,7 @@ export const ConfigureEnclaveModal = ({
const handleClose = () => {
if (!isLoading) {
navigator("#", { replace: true });
setError(undefined);
onClose();
}
};
Expand All @@ -167,7 +169,9 @@ export const ConfigureEnclaveModal = ({
}
} catch (err) {
toast({
title: `An error occurred while preparing data for running package. The package arguments were not proper JSON: ${stringifyError(err)}`,
title: `An error occurred while preparing data for running package. The package arguments were not proper JSON: ${stringifyError(
err,
)}`,
colorScheme: "red",
});
return;
Expand Down Expand Up @@ -251,7 +255,7 @@ export const ConfigureEnclaveModal = ({
<EnclaveSourceButton source={kurtosisPackage.name} size={"sm"} variant={"outline"} color={"gray.100"} />
</Flex>
{isDefined(error) && (
<KurtosisAlert flex={"0"} message={"Could not execute configuration"} details={error} />
<KurtosisAlert flex={"1 0 auto"} message={"Could not execute configuration"} details={error} />
)}
<Flex
flex={"0 1 auto"}
Expand Down