Skip to content

Commit

Permalink
feat: Remove legacy sql alchemy db connection link from G Sheet conne…
Browse files Browse the repository at this point in the history
…ction (#19450)

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

* resolve comment
  • Loading branch information
codemaster08240328 authored Apr 14, 2022
1 parent 158852d commit 9407598
Showing 1 changed file with 32 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ const errorAlertMapping = {
),
},
};
const googleSheetConnectionEngine = 'gsheets';

interface DatabaseModalProps {
addDangerToast: (msg: string) => void;
addSuccessToast: (msg: string) => void;
Expand Down Expand Up @@ -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()}
Expand Down

0 comments on commit 9407598

Please sign in to comment.