Skip to content

Commit 6fa8ae2

Browse files
committed
fix: review
1 parent 7be0b29 commit 6fa8ae2

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
useTypedDispatch,
2121
useTypedSelector,
2222
} from '../../../../utils/hooks';
23+
import type {ResourcePoolValue} from '../../../../utils/query';
2324
import {
2425
QUERY_MODES,
2526
RESOURCE_POOL_NO_OVERRIDE_VALUE,
@@ -166,7 +167,7 @@ function QuerySettingsForm({initialValues, onSubmit, onClose}: QuerySettingsForm
166167
name="resourcePool"
167168
control={control}
168169
render={({field}) => (
169-
<QuerySettingsSelect<string>
170+
<QuerySettingsSelect<ResourcePoolValue>
170171
id="resourcePool"
171172
setting={field.value ?? RESOURCE_POOL_NO_OVERRIDE_VALUE}
172173
disabled={

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type {
88
TransactionMode,
99
} from '../../../../types/store/query';
1010
import {cn} from '../../../../utils/cn';
11+
import type {ResourcePoolValue} from '../../../../utils/query';
1112

1213
import i18n from './i18n';
1314

@@ -19,7 +20,7 @@ export const getOptionHeight = () => -1;
1920

2021
const b = cn('ydb-query-settings-select');
2122

22-
type SelectType = QueryMode | TransactionMode | StatisticsMode | TracingLevel | string;
23+
type SelectType = QueryMode | TransactionMode | StatisticsMode | TracingLevel | ResourcePoolValue;
2324
type QuerySettingSelectOption<T> = SelectOption<T> & {isDefault?: boolean};
2425

2526
interface QuerySettingsSelectProps<T extends SelectType> {

src/utils/query.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ export const defaultPragma = 'PRAGMA OrderedColumns;';
306306
// Special marker meaning "do not override resource pool in request params"
307307
export const RESOURCE_POOL_NO_OVERRIDE_VALUE = '__no_pool_override__';
308308

309+
export type ResourcePoolValue = typeof RESOURCE_POOL_NO_OVERRIDE_VALUE | string;
310+
309311
export const DEFAULT_QUERY_SETTINGS = {
310312
queryMode: QUERY_MODES.query,
311313
transactionMode: TRANSACTION_MODES.implicit,

tests/suites/tenant/queryEditor/models/SettingsDialog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ export class SettingsDialog {
8989
return options;
9090
}
9191

92-
async changeResourcePool(value: string) {
92+
async changeResourcePool(label: string) {
9393
await this.resourcePoolSelect.waitFor({state: 'visible', timeout: VISIBILITY_TIMEOUT});
9494
await this.resourcePoolSelect.click();
9595
await this.selectPopup.waitFor({state: 'visible', timeout: VISIBILITY_TIMEOUT});
96-
await this.page.locator(`.ydb-query-settings-select__item_type_${value}`).click();
96+
await this.selectPopup.getByText(label, {exact: true}).click();
9797
await this.page.waitForTimeout(1000);
9898
}
9999

0 commit comments

Comments
 (0)