From f69108c04470bef04d80a79b6e352c8867b43905 Mon Sep 17 00:00:00 2001 From: Grace Guo Date: Fri, 13 Nov 2020 23:16:05 -0800 Subject: [PATCH] chore: remove a few obsolete logic (#11676) --- .../src/dashboard/actions/sliceEntities.js | 32 +++++++++---------- .../components/gridComponents/Tabs.jsx | 3 -- .../src/dashboard/util/constants.ts | 3 -- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/superset-frontend/src/dashboard/actions/sliceEntities.js b/superset-frontend/src/dashboard/actions/sliceEntities.js index 5f86b6cedae5e..01512ddb14b51 100644 --- a/superset-frontend/src/dashboard/actions/sliceEntities.js +++ b/superset-frontend/src/dashboard/actions/sliceEntities.js @@ -85,23 +85,21 @@ export function fetchAllSlices(userId) { datasource, }; } - if (['markup', 'separator'].indexOf(slice.viz_type) === -1) { - slices[slice.id] = { - slice_id: slice.id, - slice_url: slice.url, - slice_name: slice.slice_name, - edit_url: slice.edit_url, - form_data, - datasource_name: slice.datasource_name_text, - datasource_url: slice.datasource_url, - changed_on: new Date(slice.changed_on_utc).getTime(), - description: slice.description, - description_markdown: slice.description_markeddown, - viz_type: slice.viz_type, - modified: slice.changed_on_delta_humanized, - changed_on_humanized: slice.changed_on_delta_humanized, - }; - } + slices[slice.id] = { + slice_id: slice.id, + slice_url: slice.url, + slice_name: slice.slice_name, + edit_url: slice.edit_url, + form_data, + datasource_name: slice.datasource_name_text, + datasource_url: slice.datasource_url, + changed_on: new Date(slice.changed_on_utc).getTime(), + description: slice.description, + description_markdown: slice.description_markeddown, + viz_type: slice.viz_type, + modified: slice.changed_on_delta_humanized, + changed_on_humanized: slice.changed_on_delta_humanized, + }; }); return dispatch(setAllSlices(slices)); diff --git a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx index 02f4cfd6f8cfb..455a41a94c381 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx @@ -35,8 +35,6 @@ import { NEW_TAB_ID, DASHBOARD_ROOT_ID } from '../../util/constants'; import { RENDER_TAB, RENDER_TAB_CONTENT } from './Tab'; import { TAB_TYPE } from '../../util/componentTypes'; -const MAX_TAB_COUNT = 10; - const propTypes = { id: PropTypes.string.isRequired, parentId: PropTypes.string.isRequired, @@ -305,7 +303,6 @@ class Tabs extends React.PureComponent { this.handleClickTab(tabIds.indexOf(key)); }} onEdit={this.handleEdit} - hideAdd={tabIds.length >= MAX_TAB_COUNT} data-test="nav-list" type={editMode ? 'editable-card' : 'card'} > diff --git a/superset-frontend/src/dashboard/util/constants.ts b/superset-frontend/src/dashboard/util/constants.ts index dbfd61b95ed58..b743d091749b0 100644 --- a/superset-frontend/src/dashboard/util/constants.ts +++ b/superset-frontend/src/dashboard/util/constants.ts @@ -63,9 +63,6 @@ export const SAVE_TYPE_NEWDASHBOARD = 'newDashboard'; // could be overwritten by server-side config export const DASHBOARD_POSITION_DATA_LIMIT = 65535; -// filter indicators display length -export const FILTER_INDICATORS_DISPLAY_LENGTH = 3; - // in-component element types: can be added into // directPathToChild, used for in dashboard navigation and focus export const IN_COMPONENT_ELEMENT_TYPES = ['LABEL'];