mirror of
https://github.com/apache/superset.git
synced 2024-09-18 19:49:37 -04:00
chore: Remove the ability to add filter-box charts when DASHBOARD_NATIVE_FILTERS feature is enabled (#23142)
This commit is contained in:
parent
5f0c320415
commit
134acba99a
@ -22,6 +22,7 @@ import rison from 'rison';
|
|||||||
|
|
||||||
import { addDangerToast } from 'src/components/MessageToasts/actions';
|
import { addDangerToast } from 'src/components/MessageToasts/actions';
|
||||||
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
||||||
|
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
|
||||||
|
|
||||||
export const SET_ALL_SLICES = 'SET_ALL_SLICES';
|
export const SET_ALL_SLICES = 'SET_ALL_SLICES';
|
||||||
const FETCH_SLICES_PAGE_SIZE = 200;
|
const FETCH_SLICES_PAGE_SIZE = 200;
|
||||||
@ -55,6 +56,14 @@ export function fetchSlices(
|
|||||||
? [{ col: 'slice_name', opr: 'chart_all_text', value: filter_value }]
|
? [{ col: 'slice_name', opr: 'chart_all_text', value: filter_value }]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
if (isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS)) {
|
||||||
|
additional_filters.push({
|
||||||
|
col: 'viz_type',
|
||||||
|
opr: 'neq',
|
||||||
|
value: 'filter_box',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const cloneSlices = { ...slices };
|
const cloneSlices = { ...slices };
|
||||||
|
|
||||||
return SupersetClient.get({
|
return SupersetClient.get({
|
||||||
|
@ -41,6 +41,7 @@ import { Select } from 'src/components';
|
|||||||
import Loading from 'src/components/Loading';
|
import Loading from 'src/components/Loading';
|
||||||
import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions';
|
import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions';
|
||||||
import { SaveActionType } from 'src/explore/types';
|
import { SaveActionType } from 'src/explore/types';
|
||||||
|
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
|
||||||
|
|
||||||
// Session storage key for recent dashboard
|
// Session storage key for recent dashboard
|
||||||
const SK_DASHBOARD_ID = 'save_chart_recent_dashboard';
|
const SK_DASHBOARD_ID = 'save_chart_recent_dashboard';
|
||||||
@ -69,6 +70,7 @@ type SaveModalState = {
|
|||||||
action: SaveActionType;
|
action: SaveActionType;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
saveStatus?: string | null;
|
saveStatus?: string | null;
|
||||||
|
vizType?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const StyledModal = styled(Modal)`
|
export const StyledModal = styled(Modal)`
|
||||||
@ -92,6 +94,7 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
|||||||
alert: null,
|
alert: null,
|
||||||
action: this.canOverwriteSlice() ? 'overwrite' : 'saveas',
|
action: this.canOverwriteSlice() ? 'overwrite' : 'saveas',
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
vizType: props.form_data?.viz_type,
|
||||||
};
|
};
|
||||||
this.onDashboardSelectChange = this.onDashboardSelectChange.bind(this);
|
this.onDashboardSelectChange = this.onDashboardSelectChange.bind(this);
|
||||||
this.onSliceNameChange = this.onSliceNameChange.bind(this);
|
this.onSliceNameChange = this.onSliceNameChange.bind(this);
|
||||||
@ -339,6 +342,10 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
|||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
{!(
|
||||||
|
isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) &&
|
||||||
|
this.state.vizType === 'filter_box'
|
||||||
|
) && (
|
||||||
<FormItem
|
<FormItem
|
||||||
label={t('Add to dashboard')}
|
label={t('Add to dashboard')}
|
||||||
data-test="save-chart-modal-select-dashboard-form"
|
data-test="save-chart-modal-select-dashboard-form"
|
||||||
@ -360,6 +367,7 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -376,7 +384,9 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
|||||||
!this.state.newSliceName ||
|
!this.state.newSliceName ||
|
||||||
(!this.state.saveToDashboardId && !this.state.newDashboardName) ||
|
(!this.state.saveToDashboardId && !this.state.newDashboardName) ||
|
||||||
(this.props.datasource?.type !== DatasourceType.Table &&
|
(this.props.datasource?.type !== DatasourceType.Table &&
|
||||||
!this.state.datasetName)
|
!this.state.datasetName) ||
|
||||||
|
(isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) &&
|
||||||
|
this.state.vizType === 'filter_box')
|
||||||
}
|
}
|
||||||
onClick={() => this.saveOrOverwrite(true)}
|
onClick={() => this.saveOrOverwrite(true)}
|
||||||
>
|
>
|
||||||
|
@ -33,6 +33,7 @@ import Button from 'src/components/Button';
|
|||||||
import { AsyncSelect, Steps } from 'src/components';
|
import { AsyncSelect, Steps } from 'src/components';
|
||||||
import { Tooltip } from 'src/components/Tooltip';
|
import { Tooltip } from 'src/components/Tooltip';
|
||||||
import withToasts from 'src/components/MessageToasts/withToasts';
|
import withToasts from 'src/components/MessageToasts/withToasts';
|
||||||
|
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
|
||||||
|
|
||||||
import VizTypeGallery, {
|
import VizTypeGallery, {
|
||||||
MAX_ADVISABLE_VIZ_GALLERY_WIDTH,
|
MAX_ADVISABLE_VIZ_GALLERY_WIDTH,
|
||||||
@ -66,6 +67,13 @@ const ELEMENTS_EXCEPT_VIZ_GALLERY = ESTIMATED_NAV_HEIGHT + 250;
|
|||||||
const bootstrapData = getBootstrapData();
|
const bootstrapData = getBootstrapData();
|
||||||
const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST || [];
|
const denyList: string[] = bootstrapData.common.conf.VIZ_TYPE_DENYLIST || [];
|
||||||
|
|
||||||
|
if (
|
||||||
|
isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) &&
|
||||||
|
!('filter_box' in denyList)
|
||||||
|
) {
|
||||||
|
denyList.push('filter_box');
|
||||||
|
}
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledContainer = styled.div`
|
||||||
${({ theme }) => `
|
${({ theme }) => `
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
|
Loading…
Reference in New Issue
Block a user