From e214e1ace616c3fdd40fcf64c501e08407feb8b3 Mon Sep 17 00:00:00 2001 From: Phillip Kelley-Dotson Date: Fri, 5 Aug 2022 15:01:04 -0700 Subject: [PATCH] chore: update text for dbconn modal (#20773) * chore: update text for dbconn modal * fix text and close opts for adddataset modal * update loading state, add state change for cta btns, and styling * remove space --- .../database/DatabaseModal/ModalHeader.tsx | 17 ++++------------ .../data/database/DatabaseModal/index.tsx | 20 +++++++++++-------- .../data/database/DatabaseModal/styles.ts | 4 ++++ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx index 2ec124c341be5..73c9dc4514247 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/ModalHeader.tsx @@ -108,19 +108,10 @@ const ModalHeader = ({

STEP 3 OF 3

-

- Your database was successfully connected! Create a dataset to begin - visualizing your data as a chart or go to SQL Lab to query your data. -

-

- Need help? Learn more about{' '} - - connecting to {dbModel.name}. - +

Database connected

+

+ Create a dataset to begin visualizing your data as a chart or go to + SQL Lab to query your data.

diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx index 9fe44544d2491..eff95313dae20 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -445,6 +445,7 @@ const DatabaseModal: FunctionComponent = ({ const [validationErrors, getValidation, setValidationErrors] = useDatabaseValidation(); const [hasConnectedDb, setHasConnectedDb] = useState(false); + const [showCTAbtns, setShowCTAbtns] = useState(false); const [dbName, setDbName] = useState(''); const [editNewDb, setEditNewDb] = useState(false); const [isLoading, setLoading] = useState(false); @@ -666,6 +667,7 @@ const DatabaseModal: FunctionComponent = ({ } } + setShowCTAbtns(true); setEditNewDb(false); setLoading(false); }; @@ -808,6 +810,7 @@ const DatabaseModal: FunctionComponent = ({ if (dbFetched) { fetchResource(dbFetched.id as number); } + setShowCTAbtns(false); setEditNewDb(true); }; @@ -1156,24 +1159,25 @@ const DatabaseModal: FunctionComponent = ({ ); @@ -1498,7 +1502,7 @@ const DatabaseModal: FunctionComponent = ({ title={

{t('Connect a database')}

} footer={renderModalFooter()} > - {hasConnectedDb ? ( + {!isLoading && hasConnectedDb ? ( <> = ({ dbModel={dbModel} editNewDb={editNewDb} /> - {renderCTABtns()} + {showCTAbtns && renderCTABtns()} {renderFinishState()} ) : ( diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts index b7c5aa57a9beb..015ba17bf6ec4 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts @@ -51,6 +51,10 @@ export const StyledFormHeader = styled.header` margin: 0; } + .subheader-text { + line-height: ${({ theme }) => theme.gridUnit * 4.25}px; + } + .helper-bottom { padding-top: 0; color: ${({ theme }) => theme.colors.grayscale.base};