style: rename 'Source' top nav item to 'Data' (#10715)

* style: rename 'Source' top nav item to 'Data'

* Fix tests

* tables -> datasets

* rename datasource -> dataset

* lint

* more renaming

* use npm ci
This commit is contained in:
Maxime Beauchemin 2020-08-29 18:09:47 -07:00 committed by GitHub
parent 9fe30ab71e
commit 3d8857ecc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 63 additions and 40 deletions

View File

@ -59,8 +59,7 @@ npm-install() {
say "::group::Install npm packages"
echo "npm: $(npm --version)"
echo "node: $(node --version)"
rm -rf ./node_modules
npm install
npm ci
say "::endgroup::"
# cache-save npm

View File

@ -37,17 +37,41 @@ jobs:
uses: actions/setup-python@v2.1.1
with:
python-version: '3.7'
- name: Install dependencies
- name: OS dependencies
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
apt-get-install
- name: Install python dependencies
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
pip-upgrade
pip install -r requirements/testing.txt
- name: Setup postgres
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
setup-postgres
- name: Import test data
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
testdata
- name: Install npm dependencies
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
npm-install
- name: Build javascript packages
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
build-instrumented-assets
- name: Install cypress
uses: apache-superset/cached-dependencies@b90713b
with:
run: |
cypress-install
- name: Run Cypress
uses: apache-superset/cached-dependencies@b90713b

View File

@ -35,7 +35,7 @@ describe('chart list view', () => {
cy.get('th[role="columnheader"]:nth-child(3)').contains(
'Visualization Type',
);
cy.get('th[role="columnheader"]:nth-child(4)').contains('Datasource');
cy.get('th[role="columnheader"]:nth-child(4)').contains('Dataset');
cy.get('th[role="columnheader"]:nth-child(5)').contains('Modified By');
cy.get('th[role="columnheader"]:nth-child(6)').contains('Last Modified');
cy.get('th[role="columnheader"]:nth-child(7)').contains('Actions');

View File

@ -33,9 +33,9 @@ const defaultProps = {
label: 'Sources',
childs: [
{
name: 'Tables',
name: 'Datasets',
icon: 'fa-table',
label: 'Tables',
label: 'Datasets',
url: '/tablemodelview/list/?_flt_1_is_sqllab_view=y',
},
'-',

View File

@ -27,7 +27,7 @@ import DatasourceControl from 'src/explore/components/controls/DatasourceControl
const defaultProps = {
name: 'datasource',
label: 'Datasource',
label: 'Dataset',
value: '1__table',
datasource: {
name: 'birth_names',

View File

@ -488,7 +488,7 @@ export class DatasourceEditor extends React.PureComponent {
fieldKey="default_endpoint"
label={t('Default URL')}
description={t(
'Default URL to redirect to when accessing from the datasource list page',
'Default URL to redirect to when accessing from the dataset list page',
)}
control={<TextControl />}
/>
@ -547,7 +547,7 @@ export class DatasourceEditor extends React.PureComponent {
fieldKey="sql"
label={t('SQL')}
description={t(
'When specifying SQL, the datasource acts as a view. ' +
'When specifying SQL, the dataset acts as a view. ' +
'Superset will use this statement as a subquery while grouping and filtering ' +
'on the generated parent queries.',
)}
@ -836,7 +836,7 @@ export class DatasourceEditor extends React.PureComponent {
<Alert bsStyle="warning">
<strong>{t('Be careful.')} </strong>
{t(
'Changing these settings will affect all charts using this datasource, including charts owned by other people.',
'Changing these settings will affect all charts using this dataset, including charts owned by other people.',
)}
</Alert>
</div>

View File

@ -116,8 +116,8 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
>
<div>
<i className="fa fa-exclamation-triangle" />{' '}
{t(`The data source configuration exposed here
affects all the charts using this datasource.
{t(`The dataset configuration exposed here
affects all the charts using this dataset.
Be mindful that changing settings
here may affect other charts
in undesirable ways.`)}
@ -142,7 +142,7 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
<Modal.Title>
<div>
<span className="float-left">
{t('Datasource Editor for ')}
{t('Edit Dataset ')}
<strong>{currentDatasource.table_name}</strong>
</span>
</div>

View File

@ -197,7 +197,7 @@ export const controls = {
datasource: {
type: 'DatasourceControl',
label: t('Datasource'),
label: t('Dataset'),
default: null,
description: null,
mapStateToProps: ({ datasource }) => ({

View File

@ -220,7 +220,7 @@ function ChartList(props: ChartListProps) {
},
},
}: any) => <a href={dsUrl}>{dsNameTxt}</a>,
Header: t('Datasource'),
Header: t('Dataset'),
accessor: 'datasource_name',
},
{
@ -345,7 +345,7 @@ function ChartList(props: ChartListProps) {
.map(k => ({ label: k, value: k })),
},
{
Header: t('Datasource'),
Header: t('Dataset'),
id: 'datasource_id',
input: 'select',
operator: 'eq',

View File

@ -370,7 +370,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
paginate: true,
},
{
Header: t('Datasource'),
Header: t('Database'),
id: 'database',
input: 'select',
operator: 'rel_o_m',

View File

@ -209,20 +209,20 @@ class SupersetAppInitializer:
"Databases",
label=__("Databases"),
icon="fa-database",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-database",
)
appbuilder.add_link(
"Tables",
label=__("Tables"),
"Datasets",
label=__("Datasets"),
href="/tablemodelview/list/?_flt_1_is_sqllab_view=y",
icon="fa-table",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-table",
)
appbuilder.add_separator("Sources")
appbuilder.add_separator("Data")
appbuilder.add_view(
SliceModelView,
"Charts",
@ -332,8 +332,8 @@ class SupersetAppInitializer:
label=__("Upload a CSV"),
href="/csvtodatabaseview/form",
icon="fa-upload",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-wrench",
)
try:
@ -347,8 +347,8 @@ class SupersetAppInitializer:
label=__("Upload Excel"),
href="/exceltodatabaseview/form",
icon="fa-upload",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-wrench",
)
except ImportError:
@ -418,13 +418,13 @@ class SupersetAppInitializer:
# Conditionally setup Druid Views
#
if self.config["DRUID_IS_ACTIVE"]:
appbuilder.add_separator("Sources")
appbuilder.add_separator("Data")
appbuilder.add_view(
DruidDatasourceModelView,
"Druid Datasources",
label=__("Druid Datasources"),
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
icon="fa-cube",
)
appbuilder.add_view(
@ -432,8 +432,8 @@ class SupersetAppInitializer:
name="Druid Clusters",
label=__("Druid Clusters"),
icon="fa-cubes",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-database",
)
appbuilder.add_view_no_menu(DruidMetricInlineView)
@ -445,8 +445,8 @@ class SupersetAppInitializer:
"Scan New Datasources",
label=__("Scan New Datasources"),
href="/druid/scan_new_datasources/",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-database",
icon="fa-refresh",
)
@ -454,12 +454,12 @@ class SupersetAppInitializer:
"Refresh Druid Metadata",
label=__("Refresh Druid Metadata"),
href="/druid/refresh_datasources/",
category="Sources",
category_label=__("Sources"),
category="Data",
category_label=__("Data"),
category_icon="fa-database",
icon="fa-cog",
)
appbuilder.add_separator("Sources")
appbuilder.add_separator("Data")
def init_app_in_ctx(self) -> None:
"""

View File

@ -642,8 +642,8 @@ class TestRolePermission(SupersetTestCase):
self.assertIn(("can_explore_json", "Superset"), perm_set)
self.assertIn(("can_userinfo", "UserDBModelView"), perm_set)
self.assert_can_menu("Databases", perm_set)
self.assert_can_menu("Tables", perm_set)
self.assert_can_menu("Sources", perm_set)
self.assert_can_menu("Datasets", perm_set)
self.assert_can_menu("Data", perm_set)
self.assert_can_menu("Charts", perm_set)
self.assert_can_menu("Dashboards", perm_set)