Skip to content

Commit e383152

Browse files
committed
fix: show only for query streaming
1 parent fed9ed5 commit e383152

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

src/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.tsx

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type {QuerySettings} from '../../../../types/store/query';
1414
import {cn} from '../../../../utils/cn';
1515
import {
1616
useQueryExecutionSettings,
17+
useQueryStreamingSetting,
1718
useSetting,
1819
useTypedDispatch,
1920
useTypedSelector,
@@ -84,6 +85,7 @@ function QuerySettingsForm({initialValues, onSubmit, onClose}: QuerySettingsForm
8485

8586
const [useShowPlanToSvg] = useSetting<boolean>(SETTING_KEYS.USE_SHOW_PLAN_SVG);
8687
const enableTracingLevel = useTracingLevelOptionAvailable();
88+
const [isQueryStreamingEnabled] = useQueryStreamingSetting();
8789

8890
const timeout = watch('timeout');
8991
const queryMode = watch('queryMode');
@@ -220,41 +222,43 @@ function QuerySettingsForm({initialValues, onSubmit, onClose}: QuerySettingsForm
220222
/>
221223
</div>
222224
</Flex>
223-
<Flex direction="row" alignItems="flex-start" className={b('dialog-row')}>
224-
<label htmlFor="outputChunkMaxSize" className={b('field-title')}>
225-
{QUERY_SETTINGS_FIELD_SETTINGS.outputChunkMaxSize.title}
226-
</label>
227-
<div className={b('control-wrapper')}>
228-
<Controller
229-
name="outputChunkMaxSize"
230-
control={control}
231-
render={({field}) => (
232-
<TextInput
233-
id="outputChunkMaxSize"
234-
type="number"
235-
{...field}
236-
value={
237-
field.value !== undefined && field.value !== null
238-
? field.value.toString()
239-
: ''
240-
}
241-
className={b('limit-rows')}
242-
placeholder="1000000"
243-
validationState={
244-
errors.outputChunkMaxSize ? 'invalid' : undefined
245-
}
246-
errorMessage={errors.outputChunkMaxSize?.message}
247-
errorPlacement="inside"
248-
endContent={
249-
<span className={b('postfix')}>
250-
{i18n('form.output-chunk-max-size.bytes')}
251-
</span>
252-
}
253-
/>
254-
)}
255-
/>
256-
</div>
257-
</Flex>
225+
{isQueryStreamingEnabled && (
226+
<Flex direction="row" alignItems="flex-start" className={b('dialog-row')}>
227+
<label htmlFor="outputChunkMaxSize" className={b('field-title')}>
228+
{QUERY_SETTINGS_FIELD_SETTINGS.outputChunkMaxSize.title}
229+
</label>
230+
<div className={b('control-wrapper')}>
231+
<Controller
232+
name="outputChunkMaxSize"
233+
control={control}
234+
render={({field}) => (
235+
<TextInput
236+
id="outputChunkMaxSize"
237+
type="number"
238+
{...field}
239+
value={
240+
field.value !== undefined && field.value !== null
241+
? field.value.toString()
242+
: ''
243+
}
244+
className={b('limit-rows')}
245+
placeholder="1000000"
246+
validationState={
247+
errors.outputChunkMaxSize ? 'invalid' : undefined
248+
}
249+
errorMessage={errors.outputChunkMaxSize?.message}
250+
errorPlacement="inside"
251+
endContent={
252+
<span className={b('postfix')}>
253+
{i18n('form.output-chunk-max-size.bytes')}
254+
</span>
255+
}
256+
/>
257+
)}
258+
/>
259+
</div>
260+
</Flex>
261+
)}
258262
<Flex direction="row" alignItems="flex-start" className={b('dialog-row')}>
259263
<label htmlFor="pragmas" className={b('field-title')}>
260264
{QUERY_SETTINGS_FIELD_SETTINGS.pragmas.title}

0 commit comments

Comments
 (0)