From d2ed1b72dcabfba4af3f937a4646a095d0944d1b Mon Sep 17 00:00:00 2001 From: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com> Date: Wed, 22 Dec 2021 12:21:37 -0600 Subject: [PATCH] chore: Help user to find the input fields in the dataset editor (#17824) * Updated fields in Metrics and Calculated Columns tabs inside dataset editor, deleted label in expanded Metrics tab * Fix tests * Vertically aligned rows in columns tab --- .../Datasource/DatasourceEditor.jsx | 34 ++++++++++++------- .../Datasource/DatasourceEditor.test.jsx | 9 +++-- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx index 001fc3cba733..0c617c1ff15c 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx @@ -118,6 +118,16 @@ const StyledLabelWrapper = styled.div` } `; +const StyledColumnsTabWrapper = styled.div` + .table > tbody > tr > td { + vertical-align: middle; + } + + .ant-tag { + margin-top: ${({ theme }) => theme.gridUnit}px; + } +`; + const checkboxGenerator = (d, onChange) => ( ); @@ -314,7 +324,7 @@ function ColumnCollectionTable({ details={record.certification_details} /> )} - + ) : ( @@ -1078,11 +1088,6 @@ class DatasourceEditor extends React.PureComponent { expandFieldset={
- } - /> ), verbose_name: (v, onChange) => ( - + ), expression: (v, onChange) => ( - ), description: (v, onChange, label) => ( @@ -1247,7 +1254,7 @@ class DatasourceEditor extends React.PureComponent { } key={2} > -
+
+ { }); userEvent.click(getToggles[0]); const getTextboxes = screen.getAllByRole('textbox'); - expect(getTextboxes.length).toEqual(5); + expect(getTextboxes.length).toEqual(12); const inputLabel = screen.getByPlaceholderText('Label'); const inputDescription = screen.getByPlaceholderText('Description'); @@ -122,10 +122,9 @@ describe('DatasourceEditor', () => { }); expect(addBtn).toBeInTheDocument(); userEvent.click(addBtn); - const newColumn = screen.getByRole('button', { - name: //i, - }); - expect(newColumn).toBeInTheDocument(); + // newColumn (Column name) is the first textbox in the tab + const newColumn = screen.getAllByRole('textbox', { name: '' })[0]; + expect(newColumn).toHaveValue(''); }); it('renders isSqla fields', () => {