mirror of
https://github.com/apache/superset.git
synced 2026-05-11 19:05:24 +00:00
refactor: Removes the Filter Box code (#26328)
Co-authored-by: John Bodley <john.bodley@gmail.com>
This commit is contained in:
committed by
GitHub
parent
591f266543
commit
d9a3c3e1dd
@@ -26,8 +26,6 @@ import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
||||
import {
|
||||
css,
|
||||
DatasourceType,
|
||||
isFeatureEnabled,
|
||||
FeatureFlag,
|
||||
isDefined,
|
||||
styled,
|
||||
SupersetClient,
|
||||
@@ -70,7 +68,6 @@ type SaveModalState = {
|
||||
action: SaveActionType;
|
||||
isLoading: boolean;
|
||||
saveStatus?: string | null;
|
||||
vizType?: string;
|
||||
dashboard?: { label: string; value: string | number };
|
||||
};
|
||||
|
||||
@@ -93,7 +90,6 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
||||
datasetName: props.datasource?.name,
|
||||
action: this.canOverwriteSlice() ? 'overwrite' : 'saveas',
|
||||
isLoading: false,
|
||||
vizType: props.form_data?.viz_type,
|
||||
dashboard: undefined,
|
||||
};
|
||||
this.onDashboardChange = this.onDashboardChange.bind(this);
|
||||
@@ -383,32 +379,27 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
||||
/>
|
||||
</FormItem>
|
||||
)}
|
||||
{!(
|
||||
isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) &&
|
||||
this.state.vizType === 'filter_box'
|
||||
) && (
|
||||
<FormItem
|
||||
label={t('Add to dashboard')}
|
||||
data-test="save-chart-modal-select-dashboard-form"
|
||||
>
|
||||
<AsyncSelect
|
||||
allowClear
|
||||
allowNewOptions
|
||||
ariaLabel={t('Select a dashboard')}
|
||||
options={this.loadDashboards}
|
||||
onChange={this.onDashboardChange}
|
||||
value={this.state.dashboard}
|
||||
placeholder={
|
||||
<div>
|
||||
<b>{t('Select')}</b>
|
||||
{t(' a dashboard OR ')}
|
||||
<b>{t('create')}</b>
|
||||
{t(' a new one')}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</FormItem>
|
||||
)}
|
||||
<FormItem
|
||||
label={t('Add to dashboard')}
|
||||
data-test="save-chart-modal-select-dashboard-form"
|
||||
>
|
||||
<AsyncSelect
|
||||
allowClear
|
||||
allowNewOptions
|
||||
ariaLabel={t('Select a dashboard')}
|
||||
options={this.loadDashboards}
|
||||
onChange={this.onDashboardChange}
|
||||
value={this.state.dashboard}
|
||||
placeholder={
|
||||
<div>
|
||||
<b>{t('Select')}</b>
|
||||
{t(' a dashboard OR ')}
|
||||
<b>{t('create')}</b>
|
||||
{t(' a new one')}
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
</FormItem>
|
||||
{info && <Alert type="info" message={info} closable={false} />}
|
||||
{this.props.alert && (
|
||||
<Alert
|
||||
@@ -455,9 +446,7 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
|
||||
!this.state.newSliceName ||
|
||||
!this.state.dashboard ||
|
||||
(this.props.datasource?.type !== DatasourceType.Table &&
|
||||
!this.state.datasetName) ||
|
||||
(isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) &&
|
||||
this.state.vizType === 'filter_box')
|
||||
!this.state.datasetName)
|
||||
}
|
||||
onClick={() => this.saveOrOverwrite(true)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user