Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and cccs-RyanS committed Dec 17, 2021
1 parent 47cf57f commit 0721284
Showing 1 changed file with 15 additions and 3 deletions.
Expand Up @@ -23,7 +23,7 @@ import { FormGroup } from 'react-bootstrap';
import Tabs from 'src/components/Tabs';
import Button from 'src/components/Button';
import { NativeSelect as Select } from 'src/components/Select';
import { t } from '@superset-ui/core';
import { t, styled } from '@superset-ui/core';

import FormLabel from 'src/components/FormLabel';
import { SQLEditor } from 'src/components/AsyncAceEditor';
Expand Down Expand Up @@ -59,6 +59,18 @@ const defaultProps = {
getCurrentTab: noOp,
};

const StyledSelect = styled(Select)`
.metric-option {
& > svg {
min-width: ${({ theme }) => `${theme.gridUnit * 4}px`};
}
& > .option-label {
overflow: hidden;
text-overflow: ellipsis;
}
}
`;

export const SAVED_TAB_KEY = 'SAVED';

const startingWidth = 320;
Expand Down Expand Up @@ -344,7 +356,7 @@ export default class AdhocMetricEditPopover extends React.PureComponent {
<FormLabel>
<strong>{t('Saved metric')}</strong>
</FormLabel>
<Select
<StyledSelect
{...savedSelectProps}
name="select-saved"
getPopupContainer={triggerNode => triggerNode.parentNode}
Expand All @@ -361,7 +373,7 @@ export default class AdhocMetricEditPopover extends React.PureComponent {
<StyledMetricOption metric={savedMetric} showType />
</Select.Option>
))}
</Select>
</StyledSelect>
</FormGroup>
</Tabs.TabPane>
<Tabs.TabPane key={EXPRESSION_TYPES.SIMPLE} tab={t('Simple')}>
Expand Down

0 comments on commit 0721284

Please sign in to comment.