Skip to content

Commit

Permalink
made changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi committed Mar 30, 2021
1 parent 552e6f9 commit 29e8248
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('DatasourceEditor', () => {
});

it('renders Tabs', () => {
expect(wrapper.find(Tabs)).toExist();
expect(wrapper.find('#table-tabs')).toExist();
});

it('makes an async request', () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export default class SqlEditorLeftBar extends React.PureComponent {
schema={qe.schema}
sqlLabMode
tableNameSticky={false}
useDocumentBody
/>
<div className="divider" />
<StyledScrollbarContainer>
Expand Down
6 changes: 1 addition & 5 deletions superset-frontend/src/components/DatabaseSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ interface DatabaseSelectorProps {
readOnly?: boolean;
schema?: string;
sqlLabMode?: boolean;
useDocumentBody?: boolean;
onChange?: ({
dbId,
schema,
Expand All @@ -97,15 +96,14 @@ export default function DatabaseSelector({
readOnly = false,
schema,
sqlLabMode = false,
useDocumentBody = false,
}: DatabaseSelectorProps) {
const [currentDbId, setCurrentDbId] = useState(dbId);
const [currentSchema, setCurrentSchema] = useState<string | undefined>(
schema,
);
const [schemaLoading, setSchemaLoading] = useState(false);
const [schemaOptions, setSchemaOptions] = useState([]);
let TableRef: HTMLElement;

function fetchSchemas(databaseId: number, forceRefresh = false) {
const actualDbId = databaseId || dbId;
if (actualDbId) {
Expand Down Expand Up @@ -247,8 +245,6 @@ export default function DatabaseSelector({
placeholder={t('Select a database')}
autoSelect
isDisabled={!isDatabaseSelectEnabled || readOnly}
menuPosition="fixed"
menuPortalTarget={useDocumentBody ? document.body : TableRef}
/>,
null,
);
Expand Down
11 changes: 1 addition & 10 deletions superset-frontend/src/components/TableSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ interface TableSelectorProps {
sqlLabMode?: boolean;
tableName?: string;
tableNameSticky?: boolean;
useDocumentBody?: boolean;
}

const TableSelector: FunctionComponent<TableSelectorProps> = ({
Expand All @@ -125,7 +124,6 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
sqlLabMode = true,
tableName,
tableNameSticky = true,
useDocumentBody = false,
}) => {
const [currentSchema, setCurrentSchema] = useState<string | undefined>(
schema,
Expand All @@ -135,7 +133,7 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
);
const [tableLoading, setTableLoading] = useState(false);
const [tableOptions, setTableOptions] = useState([]);
let TableRef: HTMLElement;

function fetchTables(
databaseId?: number,
schema?: string,
Expand Down Expand Up @@ -305,7 +303,6 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
sqlLabMode={sqlLabMode}
isDatabaseSelectEnabled={isDatabaseSelectEnabled && !readOnly}
readOnly={readOnly}
useDocumentBody={useDocumentBody}
/>
);
}
Expand All @@ -320,7 +317,6 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
name="select-table"
isLoading={tableLoading}
ignoreAccents={false}
menuShouldScrollIntoView={false}
placeholder={t('Select table or type table name')}
autosize={false}
onChange={changeTable}
Expand All @@ -330,11 +326,6 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
optionRenderer={renderTableOption}
valueRenderer={renderTableOption}
isDisabled={readOnly}
menuPosition="fixed"
menuPortalTarget={useDocumentBody ? document.body : TableRef}
styles={{
menuPortal: base => ({ ...base, zIndex: 9999 }),
}}
/>
);
} else if (formMode) {
Expand Down
11 changes: 9 additions & 2 deletions superset-frontend/src/datasource/DatasourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ const FlexRowContainer = styled.div`
}
`;

const StyledTableTabs = styled(Tabs)`
overflow: visible;
.ant-tabs-content-holder {
overflow: visible;
}
`;

const EditLockContainer = styled.div`
font-size: ${supersetTheme.typography.sizes.s}px;
display: flex;
Expand Down Expand Up @@ -995,7 +1002,7 @@ class DatasourceEditor extends React.PureComponent {
</>
}
/>
<Tabs
<StyledTableTabs
fullWidth={false}
id="table-tabs"
data-test="edit-dataset-tabs"
Expand Down Expand Up @@ -1086,7 +1093,7 @@ class DatasourceEditor extends React.PureComponent {
</Col>
</div>
</Tabs.TabPane>
</Tabs>
</StyledTableTabs>
</DatasourceContainer>
);
}
Expand Down
4 changes: 4 additions & 0 deletions superset-frontend/src/datasource/DatasourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const StyledDatasourceModal = styled(Modal)`
.modal-footer {
flex: 0 1 auto;
}
.ant-modal-body {
overflow: visible;
}
`;

interface DatasourceModalProps {
Expand Down

0 comments on commit 29e8248

Please sign in to comment.