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