Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add tooltips and button to Connect Postgresql DB Modal Form #15179

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bf0131e
Added tooltips. Still need to place in the right spot.
Jun 15, 2021
69682a9
Revert to where I started.
Jun 15, 2021
8f9475b
Merge remote-tracking branch 'upstream/pexdax/db-connection-ui' into …
andrewbastian Jun 15, 2021
dbf8770
Added 3 tooltips, 1 Button(need link config). BigQuery not added yet.
andrewbastian Jun 15, 2021
e590bfc
Merge branch 'pexdax/db-connection-ui' of https://github.com//apache/…
andrewbastian Jun 16, 2021
fa6c2c5
Added tooltip BigOuery modal. `span` above upload btn missing `*`
andrewbastian Jun 16, 2021
23178d4
Merge branch 'pexdax/db-connection-ui' of https://github.com//apache/…
andrewbastian Jun 17, 2021
aea5905
Added tooltip to `Host` field. Alignment needs to be fixed.
andrewbastian Jun 17, 2021
9a2216d
Merge branch 'pexdax/db-connection-ui' of https://github.com//apache/…
andrewbastian Jun 17, 2021
2622bfe
Stuck trying to add conditional render of tooltip to LabeledErrorBoun…
andrewbastian Jun 17, 2021
b73b40b
Clean commit for review
andrewbastian Jun 18, 2021
a4654a3
Dynamic tooltip componet created. Needs alignment of SVG still.
andrewbastian Jun 18, 2021
8d364cc
Merge branch 'pexdax/db-connection-ui' of https://github.com//apache/…
andrewbastian Jun 18, 2021
c1325ab
Fixed typo.
andrewbastian Jun 18, 2021
46ebb23
Added line spacing back in
andrewbastian Jun 18, 2021
c8bbce0
Changed required props to optional/Remove comment
andrewbastian Jun 18, 2021
49bafb3
Fixed alignment of tooltips & moved 2tooltips outside of Btn
andrewbastian Jun 18, 2021
6da403e
Merge branch 'pexdax/db-connection-ui' of https://github.com//apache/…
andrewbastian Jun 18, 2021
34d56a1
Added one more line space back in
andrewbastian Jun 18, 2021
c103c02
Removed Typo
andrewbastian Jun 18, 2021
23b5a1d
Removed another typo
andrewbastian Jun 18, 2021
2cdf91a
Flixed linter error
andrewbastian Jun 18, 2021
4a39740
Created test for tooltip.
andrewbastian Jun 18, 2021
b0de82a
Added expectation for visible tooltipIcon
andrewbastian Jun 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ const forceSSLField = ({
/>
<span css={toggleStyle}>SSL</span>
<InfoTooltip
tooltip={t('SSL will be enabled in the database connection')}
tooltip={t('SSL Mode "require" will be used.')}
placement="bottomRight"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import React, { EventHandler, ChangeEvent, MouseEvent } from 'react';
import { t, SupersetTheme } from '@superset-ui/core';
import Button from 'src/components/Button';
import { StyledInputContainer, wideButton } from './styles';
import InfoTooltip from 'src/components/InfoTooltip'
import { StyledInputContainer, wideButton, infoTooltip, buttonLinkStyles} from './styles';

import { DatabaseObject } from '../types';

Expand Down Expand Up @@ -92,6 +93,30 @@ const SqlAlchemyTab = ({
>
{t('Test connection')}
</Button>
{/*Button link needs config. Commented code taken from ./index.tsx */}
<div css={(theme: SupersetTheme)=> infoTooltip(theme)}>
<Button
buttonStyle="link"
onClick={() =>
alert('Fix this link and delete line 101 in ./SqlAlchemyForm.tsx')

// setDB({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these comments

// type: ActionType.configMethodChange,
// payload: {
// configuration_method:
// CONFIGURATION_METHOD.????????????
//},
//})

}
css={buttonLinkStyles}
>
Connect this database using the dynamic form instead
<InfoTooltip
tooltip={t('Click this link to switch to an alternate form that exposes only the required fields needed to connect this database.')}
/>
</Button>
</div>
</>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
placement* distributed with this work for additional information
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the star should be to the left

* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
Expand Down Expand Up @@ -34,6 +34,7 @@ import { Alert, Select } from 'src/common/components';
import Modal from 'src/components/Modal';
import Button from 'src/components/Button';
import IconButton from 'src/components/IconButton';
import InfoTooltip from 'src/components/InfoTooltip';
import withToasts from 'src/messageToasts/enhancers/withToasts';
import {
testDatabaseConnection,
Expand Down Expand Up @@ -63,6 +64,7 @@ import {
formStyles,
StyledBasicTab,
SelectDatabaseStyles,
infoTooltip,
} from './styles';
import ModalHeader, { DOCUMENTATION_LINK } from './ModalHeader';

Expand Down Expand Up @@ -817,22 +819,28 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
getValidation={() => getValidation(db)}
validationErrors={validationErrors}
/>

<Button
buttonStyle="link"
onClick={() =>
setDB({
type: ActionType.configMethodChange,
payload: {
configuration_method:
CONFIGURATION_METHOD.SQLALCHEMY_URI,
},
})
}
css={buttonLinkStyles}
>
Connect this database with a SQLAlchemy URI string instead
</Button>
<div css={(theme: SupersetTheme) => infoTooltip(theme)}>
<Button
buttonStyle="link"
onClick={() =>
setDB({
type: ActionType.configMethodChange,
payload: {
configuration_method:
CONFIGURATION_METHOD.SQLALCHEMY_URI,
},
})
}
css={buttonLinkStyles}
>
Connect this database with a SQLAlchemy URI string instead
<InfoTooltip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you're surrounding the button + tooltip in a div, which makes me think you don't want the tooltip to be able to link to sql alchemy. But the info tooltip is still inside the button component.

tooltip={t(
'Click this link to switch to an alternate form that allows you to input the SQLAlchemy URL for this database manually.',
)}
/>
</Button>
</div>
{/* Step 2 */}
</>
))}
Expand Down