Skip to content

Commit

Permalink
fix: RTL for Database Connections (#15513)
Browse files Browse the repository at this point in the history
* fix: add icons (#15122)

* added alerts

* revisions

* added icon

* spinner

* this will test

* fixed test
  • Loading branch information
AAfghahi authored Jul 1, 2021
1 parent 1a16c49 commit 4fc5589
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('LabeledErrorBoundInput', () => {

const label = screen.getByText(/username/i);
const textboxInput = screen.getByRole('textbox');
const tooltipIcon = screen.getByTestId('info-solid-small');
const tooltipIcon = screen.getByRole('img');

fireEvent.mouseOver(tooltipIcon);

Expand Down
5 changes: 2 additions & 3 deletions superset-frontend/src/components/InfoTooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React from 'react';
import { styled } from '@superset-ui/core';
import { Tooltip } from 'src/components/Tooltip';
import { Icon } from 'src/common/components';
import Icons from 'src/components/Icons';

export interface InfoTooltipProps {
className?: string;
Expand Down Expand Up @@ -65,7 +65,6 @@ export default function InfoTooltip({
trigger = 'hover',
overlayStyle = defaultOverlayStyle,
bgColor = defaultColor,
viewBox = '0 -2 24 24',
}: InfoTooltipProps) {
return (
<StyledTooltip
Expand All @@ -75,7 +74,7 @@ export default function InfoTooltip({
overlayStyle={overlayStyle}
color={bgColor}
>
<Icon name="info-solid-small" viewBox={viewBox} />
<Icons.InfoSolidSmall className="info-solid-small" />
</StyledTooltip>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,35 +124,12 @@ const ExtraOptions = ({
placeholder={t('Create or select schema...')}
onChange={onInputChange}
/>
<InfoTooltip
tooltip={t('Allow creation of new tables based on queries')}
/>
</div>
<div className="helper">
{t(
'Force all tables and views to be created in this schema when clicking CTAS or CVAS in SQL Lab.',
)}
</div>
<StyledInputContainer
className={cx('expandable', { open: createAsOpen })}
>
<div className="control-label">{t('CTAS & CVAS SCHEMA')}</div>
<div className="input-container">
<input
type="text"
name="force_ctas_schema"
value={db?.force_ctas_schema || ''}
placeholder={t('Search or select schema')}
onChange={onInputChange}
/>
</div>
<div className="helper">
{t(
'When allowing CREATE TABLE AS option in SQL Lab, this option ' +
'forces the table to be created in this schema.',
)}
</div>
</StyledInputContainer>
</StyledInputContainer>
</StyledInputContainer>
<StyledInputContainer css={no_margin_bottom}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ describe('DatabaseModal', () => {
name: /checkbox-off/i,
});
const tooltipIcons = screen.getAllByRole('img', {
name: /info-solid-small/i,
name: /info-solid_small/i,
});
const exposeInSQLLabCheckbox = screen.getByRole('checkbox', {
name: /expose database in sql lab/i,
Expand Down

0 comments on commit 4fc5589

Please sign in to comment.