Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Removes the legacy dataset editor #31976

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions RESOURCES/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ These features flags are **safe for production**. They have been tested and will
### Flags on the path to feature launch and flag deprecation/removal

- DASHBOARD_VIRTUALIZATION
- DRILL_BY
- DISABLE_LEGACY_DATASOURCE_EDITOR

### Flags retained for runtime configuration

Expand All @@ -79,6 +77,7 @@ independently. This new framework will also allow for non-boolean configurations
- ALLOW_ADHOC_SUBQUERY
- DASHBOARD_RBAC [(docs)](https://superset.apache.org/docs/using-superset/creating-your-first-dashboard#manage-access-to-dashboards)
- DATAPANEL_CLOSED_BY_DEFAULT
- DRILL_BY
- DRUID_JOINS
- EMBEDDABLE_CHARTS
- EMBEDDED_SUPERSET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ describe('SqlLab query panel', () => {

it.skip('successfully saves a query', () => {
cy.intercept('api/v1/database/**/tables/**').as('getTables');
cy.intercept('savedqueryviewapi/**').as('getSavedQuery');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for housekeeping but probably not needed as the test is being skipped.


const query =
'SELECT ds, gender, name, num FROM main.birth_names ORDER BY name LIMIT 3';
Expand Down
11 changes: 8 additions & 3 deletions superset-frontend/cypress-base/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import '@cypress/code-coverage/support';
import '@applitools/eyes-cypress/commands';
import failOnConsoleError from 'cypress-fail-on-console-error';
import { expect } from 'chai';
import rison from 'rison';

/* eslint-disable @typescript-eslint/no-explicit-any */

Expand Down Expand Up @@ -169,7 +170,7 @@ Cypress.Commands.add('login', () => {
}).then(response => {
if (response.status === 302) {
// If there's a redirect, follow it manually
const redirectUrl = response.headers['location'];
const redirectUrl = response.headers.location;
cy.request({
method: 'GET',
url: redirectUrl,
Expand All @@ -183,8 +184,12 @@ Cypress.Commands.add('login', () => {
});

Cypress.Commands.add('visitChartByName', name => {
cy.request(`/chart/api/read?_flt_3_slice_name=${name}`).then(response => {
cy.visit(`${BASE_EXPLORE_URL}{"slice_id": ${response.body.pks[0]}}`);
const query = rison.encode({
columns: ['id'],
filters: [{ col: 'slice_name', opr: 'eq', value: name }],
});
cy.request(`/api/v1/chart?q=${query}`).then(response => {
cy.visit(`${BASE_EXPLORE_URL}{"slice_id": ${response.body.result[0].id}}`);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export enum FeatureFlag {
DashboardVirtualization = 'DASHBOARD_VIRTUALIZATION',
DashboardRbac = 'DASHBOARD_RBAC',
DatapanelClosedByDefault = 'DATAPANEL_CLOSED_BY_DEFAULT',
DisableLegacyDatasourceEditor = 'DISABLE_LEGACY_DATASOURCE_EDITOR',
/** @deprecated */
DrillToDetail = 'DRILL_TO_DETAIL',
DrillBy = 'DRILL_BY',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"cache_timeout": null,
"params": null,
"perm": "[examples].[birth_names](id:3)",
"edit_url": "/tablemodelview/edit/3",
"sql": null,
"columns": [
{
Expand Down
1 change: 0 additions & 1 deletion superset-frontend/spec/fixtures/mockDatasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,5 @@ export default {
['["num_girls", false]', 'num_girls [desc]'],
],
type: 'table',
edit_url: '/tablemodelview/edit/7',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ describe('DatasourceModal', () => {
expect(screen.getByTestId('datasource-editor')).toBeInTheDocument();
});

it('renders a legacy data source btn', () => {
const button = screen.getByTestId('datasource-modal-legacy-edit');
expect(button).toBeInTheDocument();
});

it('disables the save button when the datasource is managed externally', () => {
// the render is currently in a before operation, so it needs to be cleaned up
// we could alternatively move all the renders back into the tests or find a better
Expand Down
20 changes: 0 additions & 20 deletions superset-frontend/src/components/Datasource/DatasourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import { FunctionComponent, useState, useRef } from 'react';
import Alert from 'src/components/Alert';
import Button from 'src/components/Button';
import {
FeatureFlag,
isDefined,
isFeatureEnabled,
Metric,
styled,
SupersetClient,
Expand Down Expand Up @@ -271,10 +269,6 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
});
};

const showLegacyDatasourceEditor = !isFeatureEnabled(
FeatureFlag.DisableLegacyDatasourceEditor,
);

return (
<StyledDatasourceModal
show={show}
Expand All @@ -288,20 +282,6 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
maskClosable={!isEditing}
footer={
<>
{showLegacyDatasourceEditor && (
<Button
buttonSize="small"
buttonStyle="default"
data-test="datasource-modal-legacy-edit"
className="m-r-5"
onClick={() => {
window.location.href =
currentDatasource.edit_url || currentDatasource.url;
}}
>
{t('Use legacy datasource editor')}
</Button>
)}
<Button
data-test="datasource-modal-cancel"
buttonSize="small"
Expand Down
4 changes: 0 additions & 4 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,6 @@ class D3TimeFormat(TypedDict, total=False):
# When using a recent version of Druid that supports JOINs turn this on
"DRUID_JOINS": False,
"DYNAMIC_PLUGINS": False,
# With Superset 2.0, we are updating the default so that the legacy datasource
# editor no longer shows. Currently this is set to false so that the editor
# option does show, but we will be depreciating it.
"DISABLE_LEGACY_DATASOURCE_EDITOR": True,
"ENABLE_TEMPLATE_PROCESSING": False,
# Allow for javascript controls components
# this enables programmers to customize certain charts (like the
Expand Down
Loading
Loading