feat: Remove legacy sql alchemy db connection link from G Sheet connection (#19450)

* feat: Remove legacy sql alchemy db connection link from G Sheet connection

* resolve comment
This commit is contained in:
Smart-Codi 2022-04-14 16:34:15 -04:00 committed by GitHub
parent 158852d074
commit 94075983f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,8 @@ const errorAlertMapping = {
),
},
};
const googleSheetConnectionEngine = 'gsheets';
interface DatabaseModalProps {
addDangerToast: (msg: string) => void;
addSuccessToast: (msg: string) => void;
@ -1575,32 +1577,36 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
validationErrors={validationErrors}
/>
<div css={(theme: SupersetTheme) => infoTooltip(theme)}>
<Button
data-test="sqla-connect-btn"
buttonStyle="link"
onClick={() =>
setDB({
type: ActionType.configMethodChange,
payload: {
engine: db.engine,
configuration_method:
CONFIGURATION_METHOD.SQLALCHEMY_URI,
database_name: db.database_name,
},
})
}
css={buttonLinkStyles}
>
{t(
'Connect this database with a SQLAlchemy URI string instead',
)}
</Button>
<InfoTooltip
tooltip={t(
'Click this link to switch to an alternate form that allows you to input the SQLAlchemy URL for this database manually.',
)}
viewBox="0 -6 24 24"
/>
{dbModel.engine !== googleSheetConnectionEngine && (
<>
<Button
data-test="sqla-connect-btn"
buttonStyle="link"
onClick={() =>
setDB({
type: ActionType.configMethodChange,
payload: {
engine: db.engine,
configuration_method:
CONFIGURATION_METHOD.SQLALCHEMY_URI,
database_name: db.database_name,
},
})
}
css={buttonLinkStyles}
>
{t(
'Connect this database with a SQLAlchemy URI string instead',
)}
</Button>
<InfoTooltip
tooltip={t(
'Click this link to switch to an alternate form that allows you to input the SQLAlchemy URL for this database manually.',
)}
viewBox="0 -6 24 24"
/>
</>
)}
</div>
{/* Step 2 */}
{showDBError && errorAlert()}