Skip to content

Commit

Permalink
implement query area section w/ assistant bar and w/out functionality
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Sebastian <paulstn@amazon.com>
  • Loading branch information
paulstn committed Nov 6, 2023
1 parent 80f112a commit 1263c81
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 141 deletions.
12 changes: 6 additions & 6 deletions public/components/common/live_tail/live_tail_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* SPDX-License-Identifier: Apache-2.0
*/

//Define pop over interval options for live tail button in your plugin
// Define pop over interval options for live tail button in your plugin

import { EuiButton } from "@elastic/eui";
import React, { useMemo } from "react";
import { LiveTailProps } from "common/types/explorer";
import { EuiButton } from '@elastic/eui';
import React, { useMemo } from 'react';
import { LiveTailProps } from 'common/types/explorer';

//Live Tail Button
// Live Tail Button
export const LiveTailButton = ({
isLiveTailOn,
isLiveTailPopoverOpen,
Expand All @@ -20,7 +20,7 @@ export const LiveTailButton = ({
const liveButton = useMemo(() => {
return (
<EuiButton
iconType={isLiveTailOn ? "stop" : "play"}
iconType={isLiveTailOn ? 'stop' : 'clock'}
iconSide="left"
onClick={() => setIsLiveTailPopoverOpen(!isLiveTailPopoverOpen)}
data-test-subj={dataTestSubj}
Expand Down
77 changes: 77 additions & 0 deletions public/components/common/search/query_area.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import {
EuiButton,
EuiCodeEditor,
EuiContextMenuPanel,
EuiFieldText,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiPanel,
EuiPopover,
} from '@elastic/eui';
import React from 'react';

export function QueryArea({
languagePopOverButton,
isLanguagePopoverOpen,
closeLanguagePopover,
languagePopOverItems,
}: any) {
return (
<EuiPanel paddingSize="m">
<EuiFlexGroup gutterSize="m" direction="column">
<EuiFlexItem>
<EuiFlexGroup gutterSize="s" alignItems="flexStart">
<EuiFlexItem key="lang-selector" className="search-area lang-selector" grow={false}>
<EuiPopover
id="smallContextMenuExample"
button={languagePopOverButton}
isOpen={isLanguagePopoverOpen}
closePopover={closeLanguagePopover}
panelPaddingSize="none"
anchorPosition="downLeft"
>
<EuiContextMenuPanel size="s" items={languagePopOverItems} />
</EuiPopover>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton>index name here</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<EuiCodeEditor
theme="textmate"
width="100%"
height="10rem"
showPrintMargin={false}
setOptions={{
fontSize: '14px',
}}
aria-label="Code Editor"
/>
</EuiFlexItem>
<EuiFlexItem>
<EuiFlexGroup alignItems="center" gutterSize="m">
<EuiFlexItem grow={false}>
<EuiIcon type="packetbeatApp" size="m" />
</EuiFlexItem>
<EuiFlexItem>
<EuiFieldText fullWidth={true} placeholder="Ask a question" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton iconSide="right" iconType="returnKey" fill={true}>
Go
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
);
}
Loading

0 comments on commit 1263c81

Please sign in to comment.