From 1f75105ed898ccf856f2402bca83e5ac883143bc Mon Sep 17 00:00:00 2001 From: lyndsiWilliams Date: Mon, 20 Dec 2021 01:29:55 -0600 Subject: [PATCH 1/3] Updated fields in Metrics and Calculated Columns tabs inside dataset editor, deleted label in expanded Metrics tab --- .../Datasource/DatasourceEditor.jsx | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx index e293856fb1a8a..45ed217d86938 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx @@ -297,7 +297,7 @@ function ColumnCollectionTable({ details={record.certification_details} /> )} - + ) : ( @@ -1040,11 +1040,6 @@ class DatasourceEditor extends React.PureComponent { expandFieldset={
- } - /> ), verbose_name: (v, onChange) => ( - + ), expression: (v, onChange) => ( - ), description: (v, onChange, label) => ( @@ -1226,6 +1223,7 @@ class DatasourceEditor extends React.PureComponent { this.setColumns({ databaseColumns }) From 31cd8f42543694bc5891ded3e8d0ac0ea8c77d94 Mon Sep 17 00:00:00 2001 From: lyndsiWilliams Date: Mon, 20 Dec 2021 02:01:55 -0600 Subject: [PATCH 2/3] Fix tests --- .../src/components/Datasource/DatasourceEditor.test.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx index a0d46a6f1ac0b..dc85ad88a0bed 100644 --- a/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx +++ b/superset-frontend/src/components/Datasource/DatasourceEditor.test.jsx @@ -78,7 +78,7 @@ describe('DatasourceEditor', () => { }); 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', () => { From d9a2fad01fce0b200724ae7e2f68126bbb52e449 Mon Sep 17 00:00:00 2001 From: lyndsiWilliams Date: Wed, 22 Dec 2021 01:44:53 -0600 Subject: [PATCH 3/3] Vertically aligned rows in columns tab --- .../src/components/Datasource/DatasourceEditor.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/components/Datasource/DatasourceEditor.jsx b/superset-frontend/src/components/Datasource/DatasourceEditor.jsx index 45ed217d86938..aa3272a6b405b 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) => ( ); @@ -1206,7 +1216,7 @@ class DatasourceEditor extends React.PureComponent { } key={2} > -
+
+