Skip to content

Commit

Permalink
feat: added a new query button #238
Browse files Browse the repository at this point in the history
  • Loading branch information
vitshev committed Dec 20, 2023
1 parent cbd8eb8 commit aff1ab9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 81 deletions.
24 changes: 0 additions & 24 deletions packages/ui/src/ui/components/Inline/Inline.tsx

This file was deleted.

29 changes: 0 additions & 29 deletions packages/ui/src/ui/components/Inline/index.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {QueryEngineSelector} from './QueryEngineSelector/QueryEngineSelector';
import './QueryMetaForm.scss';
import {QueryFile} from '../../module/api';
import {NewQueryButton} from '../../NewQueryButton/NewQueryButton';
import {Inline} from '../../../../components/Inline/Inline';
import {Toolbar} from '../../../../components/WithStickyToolbar/Toolbar/Toolbar';

const block = cn('query-tracker-meta-form');
export function QueryMetaForm({
Expand Down Expand Up @@ -48,33 +48,59 @@ export function QueryMetaForm({
const queryName = draft.annotations?.title;
return (
<div className={block(null, className)}>
<Inline space="s">
<EditableAsText
withControls
className={block('control', {name: true})}
onChange={onNameChange}
text={queryName}
key={originalQuery?.id}
size="l"
>
<Text
title={queryName}
variant="body-1"
color={queryName ? 'primary' : 'secondary'}
ellipsis
>
{queryName || 'No name'}
</Text>
</EditableAsText>
<QueryEngineSelector cluster={cluster} path={path} />
<QuerySettingsButton settings={draft.settings} onChange={onSettingsChange} />
<QueryFilesButton
files={draft.files}
onChange={onFilesChange}
queryId={originalQuery?.id ?? ''}
/>
<NewQueryButton />
</Inline>
<Toolbar
itemsToWrap={[
{
name: queryName,
node: (
<EditableAsText
withControls
className={block('control', {name: true})}
onChange={onNameChange}
text={queryName}
key={originalQuery?.id}
size="l"
>
<Text
title={queryName}
variant="body-1"
color={queryName ? 'primary' : 'secondary'}
ellipsis
>
{queryName || 'No name'}
</Text>
</EditableAsText>
),
},
{
name: 'Engine',
node: <QueryEngineSelector cluster={cluster} path={path} />,
},
{
name: 'Settings',
node: (
<QuerySettingsButton
settings={draft.settings}
onChange={onSettingsChange}
/>
),
},
{
name: 'Files',
node: (
<QueryFilesButton
files={draft.files}
onChange={onFilesChange}
queryId={originalQuery?.id ?? ''}
/>
),
},
{
name: 'NewQuery',
node: <NewQueryButton />,
},
]}
/>
</div>
);
}

0 comments on commit aff1ab9

Please # to comment.