@@ -47,7 +47,7 @@ import { Radio } from '@superset-ui/core/components/Radio';
4747import { GRID_COLUMN_COUNT } from 'src/dashboard/util/constants' ;
4848import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils' ;
4949import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions' ;
50- import { SaveActionType } from 'src/explore/types' ;
50+ import { SaveActionType , ChartStatusType } from 'src/explore/types' ;
5151import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes' ;
5252import {
5353 removeChartState ,
@@ -102,7 +102,9 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
102102 this . state = {
103103 newSliceName : props . sliceName ,
104104 datasetName : props . datasource ?. name ,
105- action : this . canOverwriteSlice ( ) ? 'overwrite' : 'saveas' ,
105+ action : this . canOverwriteSlice ( )
106+ ? ChartStatusType . overwrite
107+ : ChartStatusType . saveas ,
106108 isLoading : false ,
107109 dashboard : undefined ,
108110 tabsData : [ ] ,
@@ -258,7 +260,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
258260 : [ ...sliceDashboards , dashboard . id ] ;
259261 formData . dashboards = sliceDashboards ;
260262 if (
261- this . state . action === ' saveas' &&
263+ this . state . action === ChartStatusType . saveas &&
262264 this . state . selectedTab ?. value !== 'OUT_OF_TAB'
263265 ) {
264266 selectedTabId = this . state . selectedTab ?. value as string ;
@@ -603,7 +605,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
603605 < Radio
604606 id = "saveas-radio"
605607 data-test = "saveas-radio"
606- checked = { this . state . action === ' saveas' }
608+ checked = { this . state . action === ChartStatusType . saveas }
607609 onChange = { ( ) => this . changeAction ( 'saveas' ) }
608610 >
609611 { t ( 'Save as...' ) }
@@ -657,7 +659,7 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
657659 }
658660 />
659661 </ FormItem >
660- { this . state . action === ' saveas' && (
662+ { this . state . action === ChartStatusType . saveas && (
661663 < FormItem
662664 label = { t ( 'Add to tabs' ) }
663665 data-test = "save-chart-modal-select-tabs-form"
0 commit comments