Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

updating styling for Database Destination Connection Modal (#71586)

Nick Fitzpatrick01af8eb57f6c
diff --git a/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.module.css b/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.module.css
index d9cc5785681..d8e7b35c826 100644
--- a/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.module.css
+++ b/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.module.css
@@ -1,7 +1,6 @@
.modalRoot {
display: flex;
flex-direction: column;
- overflow-y: hidden;
}
.modalHeader {
@@ -10,4 +9,8 @@
.modalBody {
padding-inline: 0;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ overflow-y: hidden;
}
diff --git a/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.tsx b/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.tsx
index acc7892e1e3..20ffeb165aa 100644
--- a/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/database_routing/DestinationDatabaseConnectionModal/DestinationDatabaseConnectionModal.tsx
@@ -113,42 +113,44 @@ export const DestinationDatabaseConnectionModal = ({
body: S.modalBody,
}}
>
- <LoadingAndErrorWrapper loading={isLoading} error={error}>
- <Flex
- py="sm"
- px="md"
- mx="xl"
- my="md"
- bg="background-secondary"
- align="center"
- justify="space-between"
- bd="1px solid border"
- style={{ borderRadius: ".5rem" }}
- >
- <Text>{t`You can also add databases programmatically via the API.`}</Text>
- <ExternalLink
- key="link"
- href={docsUrl}
- style={{ display: "flex", alignItems: "center", gap: 4 }}
+ <LoadingAndErrorWrapper loading={isLoading} error={error} noWrapper>
+ <>
+ <Flex
+ py="sm"
+ px="md"
+ mx="xl"
+ my="md"
+ bg="background-secondary"
+ align="center"
+ justify="space-between"
+ bd="1px solid border"
+ style={{ borderRadius: ".5rem" }}
>
- {t`Learn more`} <Icon name="share" aria-hidden />
- </ExternalLink>
- </Flex>
-
- <DatabaseEditConnectionForm
- database={destinationDatabase}
- isAttachedDWH={destinationDatabase?.is_attached_dwh ?? false}
- handleSaveDb={handleSaveDatabase}
- onSubmitted={handleOnSubmit}
- onCancel={handleCloseModal}
- route={route}
- config={{
- name: { isSlug: true },
- engine: { fieldState: "hidden" },
- }}
- autofocusFieldName="name"
- formLocation="admin"
- />
+ <Text>{t`You can also add databases programmatically via the API.`}</Text>
+ <ExternalLink
+ key="link"
+ href={docsUrl}
+ style={{ display: "flex", alignItems: "center", gap: 4 }}
+ >
+ {t`Learn more`} <Icon name="share" aria-hidden />
+ </ExternalLink>
+ </Flex>
+
+ <DatabaseEditConnectionForm
+ database={destinationDatabase}
+ isAttachedDWH={destinationDatabase?.is_attached_dwh ?? false}
+ handleSaveDb={handleSaveDatabase}
+ onSubmitted={handleOnSubmit}
+ onCancel={handleCloseModal}
+ route={route}
+ config={{
+ name: { isSlug: true },
+ engine: { fieldState: "hidden" },
+ }}
+ autofocusFieldName="name"
+ formLocation="admin"
+ />
+ </>
</LoadingAndErrorWrapper>
</Modal>
);
diff --git a/frontend/src/metabase/admin/databases/components/DatabaseEditConnectionForm.tsx b/frontend/src/metabase/admin/databases/components/DatabaseEditConnectionForm.tsx
index fc93216fecb..466328baad3 100644
--- a/frontend/src/metabase/admin/databases/components/DatabaseEditConnectionForm.tsx
+++ b/frontend/src/metabase/admin/databases/components/DatabaseEditConnectionForm.tsx
@@ -87,7 +87,11 @@ export const DatabaseEditConnectionForm = withRouter(
return (
<ErrorBoundary errorComponent={GenericError as ComponentType}>
- <LoadingAndErrorWrapper loading={!database} error={initializeError}>
+ <LoadingAndErrorWrapper
+ loading={!database}
+ error={initializeError}
+ noWrapper
+ >
{isDbModifiable({
id: database?.id,
is_attached_dwh: isAttachedDWH,
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx
index 8b3c1bd6ae8..dcb2e8ac237 100644
--- a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseForm.tsx
@@ -111,6 +111,11 @@ export const DatabaseForm = ({
<Form
data-testid="database-form"
pt={location === "full-page" ? undefined : "md"}
+ mih={0}
+ style={{
+ display: "flex",
+ flexDirection: "column",
+ }}
>
<FormDirtyStateProvider onDirtyStateChange={onDirtyStateChange}>
<DatabaseFormBody
diff --git a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormBody.tsx b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormBody.tsx
index 63b1973ed6d..52a8453972a 100644
--- a/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormBody.tsx
+++ b/frontend/src/metabase/databases/components/DatabaseForm/DatabaseFormBody.tsx
@@ -54,7 +54,7 @@ export const DatabaseFormBody = ({
const mah = location === "full-page" ? "100%" : "calc(100vh - 20rem)";
return (
- <Box mah={mah} mb="md" px={px} style={{ overflowY: "auto" }}>
+ <Box mah={mah} mb="md" px={px} flex={1} style={{ overflowY: "auto" }}>
{engineFieldConfig?.fieldState !== "hidden" && (
<>
<DatabaseEngineField