@@ -5,8 +5,7 @@ import cn from 'bem-cn-lite';
55import _ from 'lodash' ;
66import MonacoEditor from 'react-monaco-editor' ;
77import DataTable from '@yandex-cloud/react-data-table' ;
8- import { Button } from '@yandex-cloud/uikit' ;
9- import { Select } from '@yandex-cloud/uikit/build/esm/components/unstable/Select' ;
8+ import { Button , DropdownMenu } from '@yandex-cloud/uikit' ;
109import SplitPane from '../../../components/SplitPane' ;
1110
1211import SaveQuery from './SaveQuery/SaveQuery' ;
@@ -553,10 +552,18 @@ function QueryEditor(props) {
553552 } ;
554553
555554 const renderControls = ( ) => {
556- const { executeQuery, explainQuery, savedQueries} = props ;
555+ const { executeQuery, explainQuery, savedQueries, selectRunAction } = props ;
557556 const { runAction} = executeQuery ;
558557 const runIsDisabled = ! executeQuery . input || executeQuery . loading ;
559558 const runText = _ . find ( RUN_ACTIONS , { value : runAction } ) . content ;
559+
560+ const menuItems = RUN_ACTIONS . map ( ( action ) => {
561+ return {
562+ text : action . content ,
563+ action : ( ) => selectRunAction ( action . value ) ,
564+ } ;
565+ } ) ;
566+
560567 return (
561568 < div className = { b ( 'controls' ) } >
562569 < div className = { b ( 'control-run' ) } >
@@ -570,27 +577,19 @@ function QueryEditor(props) {
570577 < Icon name = "startPlay" viewBox = "0 0 16 16" width = { 16 } height = { 16 } />
571578 { runText }
572579 </ Button >
573- < Select
574- view = "action"
575- options = { RUN_ACTIONS }
576- value = { undefined }
577- disabled = { runIsDisabled }
578- pin = "brick-round"
579- // renderSwitcher={() => (
580- // <div className={b('run-switcher')}>
581- // <Button
582- // view="action"
583- // pin="brick-round"
584- // disabled={runIsDisabled}
585- // loading={executeQuery.loading}
586- // >
587- // <Icon name="chevron-down" width={16} height={16} />
588- // </Button>
589- // </div>
590- // )}
591- onUpdate = { ( value ) => {
592- props . selectRunAction ( value [ 0 ] ) ;
593- } }
580+ < DropdownMenu
581+ items = { menuItems }
582+ switcher = {
583+ < Button
584+ view = "action"
585+ pin = "brick-round"
586+ disabled = { runIsDisabled }
587+ loading = { executeQuery . loading }
588+ className = { b ( 'select-query-action' ) }
589+ >
590+ < Icon name = "chevron-down" width = { 16 } height = { 16 } />
591+ </ Button >
592+ }
594593 />
595594 </ div >
596595 < Button
0 commit comments