From 9e719d67203e78c9164a978f0ab34f4f4b05532a Mon Sep 17 00:00:00 2001 From: Ben Gazzard Date: Wed, 28 Feb 2024 18:56:30 +0000 Subject: [PATCH] fix: minor EMUI changes (#2232) ## Description: This PR includes: * fix the EMUI support for pasted github links to support repositories with a default branch not named 'main' * Remove the navigation blocker on the enclave logs * Name ports `service:port` when shown in the enclave list ![image](https://github.com/kurtosis-tech/kurtosis/assets/4419574/62c7db37-91d0-4117-84cd-f124c560affb) ## Is this change user facing? YES ## References (if applicable): - https://sageroomworkspace.slack.com/archives/C05DZ4UABDZ/p1708702184444319 thread on issue parsing github url - https://sageroomworkspace.slack.com/archives/C05DZ4UABDZ/p1708618735521189?thread_ts=1708616085.847449&cid=C05DZ4UABDZ request for port name change --- .../web/cypress/support/commands.ts | 1 - .../web/packages/app/src/emui/Navbar.tsx | 58 +++++++++---------- .../emui/enclaves/components/BuildEnclave.tsx | 6 -- .../enclaves/components/EditEnclaveButton.tsx | 8 +-- .../modals/LogNavigationWarningModal.tsx | 40 ------------- .../components/tables/EnclavesTable.tsx | 1 + .../enclaves/components/tables/PortsTable.tsx | 3 +- .../widgets/CreateEnclaveButton.tsx | 24 ++++---- .../enclaves/enclave/logs/EnclaveLogs.tsx | 18 +----- .../web/packages/app/src/emui/settings.tsx | 4 +- .../components/src/utils/packageUtils.ts | 7 ++- 11 files changed, 49 insertions(+), 121 deletions(-) delete mode 100644 enclave-manager/web/packages/app/src/emui/enclaves/components/modals/LogNavigationWarningModal.tsx diff --git a/enclave-manager/web/cypress/support/commands.ts b/enclave-manager/web/cypress/support/commands.ts index d5dada8bc8..f5343c3ede 100644 --- a/enclave-manager/web/cypress/support/commands.ts +++ b/enclave-manager/web/cypress/support/commands.ts @@ -33,7 +33,6 @@ Cypress.Commands.add("createAndGoToEnclave", (enclaveName: string) => { // Go to the enclave overview cy.contains("Go to Enclave Overview").click(); - cy.contains("[role='dialog'] button", "Continue").click(); cy.url().should("match", /enclave\/[^/]+/); }); diff --git a/enclave-manager/web/packages/app/src/emui/Navbar.tsx b/enclave-manager/web/packages/app/src/emui/Navbar.tsx index ae4e647cf3..0330eba977 100644 --- a/enclave-manager/web/packages/app/src/emui/Navbar.tsx +++ b/enclave-manager/web/packages/app/src/emui/Navbar.tsx @@ -1,7 +1,5 @@ import { Button, - FormControl, - FormLabel, Input, InputGroup, InputRightElement, @@ -12,7 +10,6 @@ import { ModalFooter, ModalHeader, ModalOverlay, - Switch, Text, } from "@chakra-ui/react"; import { CopyButton, NavButton, Navigation, NavigationDivider } from "kurtosis-ui-components"; @@ -24,10 +21,9 @@ import { PiLinkSimpleBold } from "react-icons/pi"; import { Link, useLocation } from "react-router-dom"; import { KURTOSIS_CLOUD_CONNECT_URL } from "../client/constants"; import { useKurtosisClient } from "../client/enclaveManager/KurtosisClientContext"; -import { settingKeys, useSettings } from "./settings"; export const Navbar = () => { - const { updateSetting, settings } = useSettings(); + //const { updateSetting, settings } = useSettings(); const location = useLocation(); const kurtosisClient = useKurtosisClient(); const [showAboutDialog, setShowAboutDialog] = useState(false); @@ -83,32 +79,32 @@ export const Navbar = () => { /> - - Settings: - - - - Enable experimental enclave builder interface? - - - updateSetting( - settingKeys.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE, - !settings.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE, - ) - } - isChecked={settings.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE} - /> - + {/**/} + {/* Settings:*/} + {/**/} + {/**/} + {/* */} + {/* Enable experimental enclave builder interface?*/} + {/* */} + {/* */} + {/* updateSetting(*/} + {/* settingKeys.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE,*/} + {/* !settings.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE,*/} + {/* )*/} + {/* }*/} + {/* isChecked={settings.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE}*/} + {/* />*/} + {/**/} diff --git a/enclave-manager/web/packages/app/src/emui/enclaves/components/BuildEnclave.tsx b/enclave-manager/web/packages/app/src/emui/enclaves/components/BuildEnclave.tsx index 1200a5b8bc..9d69a22305 100644 --- a/enclave-manager/web/packages/app/src/emui/enclaves/components/BuildEnclave.tsx +++ b/enclave-manager/web/packages/app/src/emui/enclaves/components/BuildEnclave.tsx @@ -1,12 +1,10 @@ import { isDefined } from "kurtosis-ui-components"; import { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; -import { useSettings } from "../../settings"; import { KURTOSIS_BUILD_ENCLAVE_URL_ARG } from "./configuration/drawer/constants"; import { EnclaveBuilderDrawer } from "./enclaveBuilder/EnclaveBuilderDrawer"; export const BuildEnclave = () => { - const { settings } = useSettings(); const navigate = useNavigate(); const location = useLocation(); @@ -23,9 +21,5 @@ export const BuildEnclave = () => { } }; - if (!settings.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE) { - return null; - } - return ; }; diff --git a/enclave-manager/web/packages/app/src/emui/enclaves/components/EditEnclaveButton.tsx b/enclave-manager/web/packages/app/src/emui/enclaves/components/EditEnclaveButton.tsx index 592eaa578e..41feed4698 100644 --- a/enclave-manager/web/packages/app/src/emui/enclaves/components/EditEnclaveButton.tsx +++ b/enclave-manager/web/packages/app/src/emui/enclaves/components/EditEnclaveButton.tsx @@ -3,7 +3,6 @@ import { KurtosisPackage } from "kurtosis-cloud-indexer-sdk"; import { isDefined } from "kurtosis-ui-components"; import { useState } from "react"; import { FiEdit2 } from "react-icons/fi"; -import { useSettings } from "../../settings"; import { EnclaveFullInfo } from "../types"; import { CreateOrConfigureEnclaveDrawer } from "./configuration/drawer/CreateOrConfigureEnclaveDrawer"; import { EnclaveBuilderDrawer } from "./enclaveBuilder/EnclaveBuilderDrawer"; @@ -15,8 +14,6 @@ type EditEnclaveButtonProps = ButtonProps & { }; export const EditEnclaveButton = ({ enclave, ...buttonProps }: EditEnclaveButtonProps) => { - const { settings } = useSettings(); - if (!isDefined(enclave.starlarkRun)) { return ( - - - - - - ); -}; diff --git a/enclave-manager/web/packages/app/src/emui/enclaves/components/tables/EnclavesTable.tsx b/enclave-manager/web/packages/app/src/emui/enclaves/components/tables/EnclavesTable.tsx index 16eb9a8ba3..338ffcd1ac 100644 --- a/enclave-manager/web/packages/app/src/emui/enclaves/components/tables/EnclavesTable.tsx +++ b/enclave-manager/web/packages/app/src/emui/enclaves/components/tables/EnclavesTable.tsx @@ -54,6 +54,7 @@ const enclaveToRow = (enclave: EnclaveFullInfo, catalog?: Result, publicPorts: Record, publicIp: string, + serviceName?: string, ): PortsTableRow[] => { return Object.entries(privatePorts).map(([name, port]) => { let link; @@ -45,7 +46,7 @@ export const getPortTableRows = ( transportProtocol: transportProtocolToString(port.transportProtocol), privatePort: port.number, publicPort: publicPorts[name].number, - name, + name: isDefined(serviceName) ? `${serviceName}:${name}` : name, }, link: link, }; diff --git a/enclave-manager/web/packages/app/src/emui/enclaves/components/widgets/CreateEnclaveButton.tsx b/enclave-manager/web/packages/app/src/emui/enclaves/components/widgets/CreateEnclaveButton.tsx index fc2bec4e60..f6b5304556 100644 --- a/enclave-manager/web/packages/app/src/emui/enclaves/components/widgets/CreateEnclaveButton.tsx +++ b/enclave-manager/web/packages/app/src/emui/enclaves/components/widgets/CreateEnclaveButton.tsx @@ -1,26 +1,22 @@ import { Button, ButtonGroup, Tooltip } from "@chakra-ui/react"; import { FiPlus, FiTool } from "react-icons/fi"; import { useNavigate } from "react-router-dom"; -import { useSettings } from "../../../settings"; import { KURTOSIS_BUILD_ENCLAVE_URL_ARG, KURTOSIS_CREATE_ENCLAVE_URL_ARG } from "../configuration/drawer/constants"; export const CreateEnclaveButton = () => { - const { settings } = useSettings(); const navigate = useNavigate(); return ( - {settings.ENABLE_EXPERIMENTAL_BUILD_ENCLAVE && ( - - - - )} + + +