Skip to content

Commit 088b042

Browse files
authored
Remove EnableDsTemplateParams flag using (#2819)
1 parent 456599c commit 088b042

File tree

1 file changed

+25
-31
lines changed

1 file changed

+25
-31
lines changed

src/ui/units/datasets/containers/Dataset/ActionPanelRightItems.tsx

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const ITEM_SHOW_PREVIEW_BY_DEFAULT = 'showPreviewByDefault';
3939
const ITEM_TEMPLATE_ENABLED = 'templateEnabled';
4040
const ITEM_DATA_EXPORT_ENABLED = 'dataExportEnabled';
4141
const RAW_SQL_LEVELS_ALLOW_TEMPLATING: string[] = [RAW_SQL_LEVEL.TEMPLATE, RAW_SQL_LEVEL.DASHSQL];
42-
const isTemplateParamsFeatureEnabled = isEnabledFeature(Feature.EnableDsTemplateParams);
4342
const isExportSettingsFeatureEnabled = isEnabledFeature(Feature.EnableExportSettings);
4443
const isUpdatingDsSettingsByActionFeatureEnabled = isEnabledFeature(
4544
Feature.EnableUpdatingDsSettingsByAction,
@@ -130,6 +129,14 @@ export function ActionPanelRightItems(props: Props) {
130129
);
131130
}, []);
132131

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+
);
133140
const settingsSelectOptions = [
134141
<Select.Option
135142
key={ITEM_SHOW_PREVIEW_BY_DEFAULT}
@@ -138,38 +145,25 @@ export function ActionPanelRightItems(props: Props) {
138145
>
139146
{i18n('label_load_preview_by_default')}
140147
</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>,
141165
];
142166

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-
173167
if (isExportSettingsFeatureEnabled) {
174168
settingsSelectOptions.push(
175169
<Select.Option

0 commit comments

Comments
 (0)