/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/containers/Tenant/Query/QueryEditorControls/utils/getChangedQueryExecutionSettingsDescription.ts
34 строки
1 KB
Anton Standrik
feat: add rows limit to query settings (#1291)
23 сен 2024, 16:26
Не верифицирован
23 сен 2024, 16:26
1728e61
Код
Авторство
О чём код?
import type {QuerySettings} from '../../../../../types/store/query'; import {QUERY_SETTINGS_FIELD_SETTINGS} from '../../QuerySettingsDialog/constants'; import getChangedQueryExecutionSettings from './getChangedQueryExecutionSettings'; export default function getChangedQueryExecutionSettingsDescription({ currentSettings, defaultSettings, }: { currentSettings: QuerySettings; defaultSettings: QuerySettings; }): Record<string, string> { const keys = getChangedQueryExecutionSettings(currentSettings, defaultSettings); const result: Record<string, string> = {}; keys.forEach((key) => { const settings = QUERY_SETTINGS_FIELD_SETTINGS[key]; const currentValue = currentSettings[key]; if ('options' in settings) { const content = settings.options.find( (option) => option.value === currentValue, )?.content; if (content) { result[settings.title] = content; } } else if (currentValue) { result[settings.title] = String(currentValue); } }); return result; }