@@ -39,7 +39,6 @@ const ITEM_SHOW_PREVIEW_BY_DEFAULT = 'showPreviewByDefault';
39
39
const ITEM_TEMPLATE_ENABLED = 'templateEnabled' ;
40
40
const ITEM_DATA_EXPORT_ENABLED = 'dataExportEnabled' ;
41
41
const RAW_SQL_LEVELS_ALLOW_TEMPLATING : string [ ] = [ RAW_SQL_LEVEL . TEMPLATE , RAW_SQL_LEVEL . DASHSQL ] ;
42
- const isTemplateParamsFeatureEnabled = isEnabledFeature ( Feature . EnableDsTemplateParams ) ;
43
42
const isExportSettingsFeatureEnabled = isEnabledFeature ( Feature . EnableExportSettings ) ;
44
43
const isUpdatingDsSettingsByActionFeatureEnabled = isEnabledFeature (
45
44
Feature . EnableUpdatingDsSettingsByAction ,
@@ -130,6 +129,14 @@ export function ActionPanelRightItems(props: Props) {
130
129
) ;
131
130
} , [ ] ) ;
132
131
132
+ const templateParamsOptionContent = (
133
+ < div style = { { display : 'flex' , height : '100%' } } >
134
+ { i18n ( 'label_enable-templating' ) }
135
+ < HelpMark className = { b ( 'settings-hint' ) } >
136
+ { i18n ( 'label_enable-templating-hint' ) }
137
+ </ HelpMark >
138
+ </ div >
139
+ ) ;
133
140
const settingsSelectOptions = [
134
141
< Select . Option
135
142
key = { ITEM_SHOW_PREVIEW_BY_DEFAULT }
@@ -138,38 +145,25 @@ export function ActionPanelRightItems(props: Props) {
138
145
>
139
146
{ i18n ( 'label_load_preview_by_default' ) }
140
147
</ Select . Option > ,
148
+ < Select . Option
149
+ key = { ITEM_TEMPLATE_ENABLED }
150
+ value = { ITEM_TEMPLATE_ENABLED }
151
+ disabled = { isLoadingDataset || ! isRawSqlLevelEnableTemplating || isValidationLoading }
152
+ >
153
+ { isRawSqlLevelEnableTemplating ? (
154
+ templateParamsOptionContent
155
+ ) : (
156
+ < ActionTooltip
157
+ className = { b ( 'settings-templating-disable-hint' ) }
158
+ title = { i18n ( 'label_enable-templating-disabled-hint' ) }
159
+ placement = "left"
160
+ >
161
+ { templateParamsOptionContent }
162
+ </ ActionTooltip >
163
+ ) }
164
+ </ Select . Option > ,
141
165
] ;
142
166
143
- if ( isTemplateParamsFeatureEnabled ) {
144
- const optionContent = (
145
- < div style = { { display : 'flex' , height : '100%' } } >
146
- { i18n ( 'label_enable-templating' ) }
147
- < HelpMark className = { b ( 'settings-hint' ) } >
148
- { i18n ( 'label_enable-templating-hint' ) }
149
- </ HelpMark >
150
- </ div >
151
- ) ;
152
- settingsSelectOptions . push (
153
- < Select . Option
154
- key = { ITEM_TEMPLATE_ENABLED }
155
- value = { ITEM_TEMPLATE_ENABLED }
156
- disabled = { isLoadingDataset || ! isRawSqlLevelEnableTemplating || isValidationLoading }
157
- >
158
- { isRawSqlLevelEnableTemplating ? (
159
- optionContent
160
- ) : (
161
- < ActionTooltip
162
- className = { b ( 'settings-templating-disable-hint' ) }
163
- title = { i18n ( 'label_enable-templating-disabled-hint' ) }
164
- placement = "left"
165
- >
166
- { optionContent }
167
- </ ActionTooltip >
168
- ) }
169
- </ Select . Option > ,
170
- ) ;
171
- }
172
-
173
167
if ( isExportSettingsFeatureEnabled ) {
174
168
settingsSelectOptions . push (
175
169
< Select . Option
0 commit comments