Skip to content

Commit

Permalink
Move create/skip toggle in scrollable area
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Oct 16, 2024
1 parent 44fb0c4 commit 94ff605
Showing 1 changed file with 77 additions and 84 deletions.
161 changes: 77 additions & 84 deletions public/pages/workflow_detail/workflow_inputs/workflow_inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiPanel,
EuiSpacer,
EuiStepsHorizontal,
EuiText,
EuiTitle,
Expand Down Expand Up @@ -711,98 +710,92 @@ export function WorkflowInputs(props: WorkflowInputsProps) {
</EuiModalFooter>
</EuiModal>
)}
{onIngestAndUnprovisioned && (
<>
<EuiSpacer size="m" />
<BooleanField
fieldPath="ingest.enabled"
enabledOption={{
id: INGEST_OPTION.CREATE,
label: (
<EuiFlexGroup direction="column" gutterSize="none">
<EuiText color="default">
Create an ingest pipeline
</EuiText>
<EuiText size="xs" color="subdued">
Configure and ingest data into an index.
</EuiText>
</EuiFlexGroup>
),
}}
disabledOption={{
id: INGEST_OPTION.SKIP,
label: (
<EuiFlexGroup direction="column" gutterSize="none">
<EuiText color="default">
Skip ingestion pipeline
</EuiText>
<EuiText size="xs" color="subdued">
Use an existing index with data ingested.
</EuiText>
</EuiFlexGroup>
),
}}
showLabel={false}
/>
</>
)}
</EuiFlexItem>
{!onIngestAndDisabled && (
<>
<EuiFlexItem grow={false}>
<EuiTitle>
<h2>
{onIngestAndUnprovisioned ? (
'Define ingest pipeline'
) : onIngestAndProvisioned ? (
<EuiFlexGroup
direction="row"
justifyContent="spaceBetween"
<EuiFlexItem grow={false} style={{ marginBottom: '-8px' }}>
<EuiTitle>
<h2>
{onIngestAndUnprovisioned ? (
'Define ingest pipeline'
) : onIngestAndProvisioned ? (
<EuiFlexGroup direction="row" justifyContent="spaceBetween">
<EuiFlexItem grow={false}>Edit ingest pipeline</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButtonEmpty
color="danger"
onClick={() => setIsModalOpen(true)}
>
<EuiFlexItem grow={false}>
Edit ingest pipeline
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButtonEmpty
color="danger"
onClick={() => setIsModalOpen(true)}
>
<EuiIcon type="trash" />
{` `}Delete resources
</EuiSmallButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
) : (
'Define search pipeline'
)}
</h2>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem
grow={true}
style={{
overflowY: 'scroll',
overflowX: 'hidden',
}}
>
{onIngest ? (
<EuiIcon type="trash" />
{` `}Delete resources
</EuiSmallButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
) : (
'Define search pipeline'
)}
</h2>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem
grow={true}
style={{
overflowY: 'scroll',
overflowX: 'hidden',
}}
>
{onIngest ? (
<>
{onIngestAndUnprovisioned && (
<>
<BooleanField
fieldPath="ingest.enabled"
enabledOption={{
id: INGEST_OPTION.CREATE,
label: (
<EuiFlexGroup direction="column" gutterSize="none">
<EuiText color="default">
Create an ingest pipeline
</EuiText>
<EuiText size="xs" color="subdued">
Configure and ingest data into an index.
</EuiText>
</EuiFlexGroup>
),
}}
disabledOption={{
id: INGEST_OPTION.SKIP,
label: (
<EuiFlexGroup direction="column" gutterSize="none">
<EuiText color="default">
Skip ingestion pipeline
</EuiText>
<EuiText size="xs" color="subdued">
Use an existing index with data ingested.
</EuiText>
</EuiFlexGroup>
),
}}
showLabel={false}
/>
</>
)}
{!onIngestAndDisabled && (
<IngestInputs
setIngestDocs={props.setIngestDocs}
uiConfig={props.uiConfig}
setUiConfig={props.setUiConfig}
workflow={props.workflow}
/>
) : (
<SearchInputs
uiConfig={props.uiConfig}
setUiConfig={props.setUiConfig}
setQuery={props.setQuery}
setQueryResponse={props.setQueryResponse}
/>
)}
</EuiFlexItem>
</>
)}
</>
) : (
<SearchInputs
uiConfig={props.uiConfig}
setUiConfig={props.setUiConfig}
setQuery={props.setQuery}
setQueryResponse={props.setQueryResponse}
/>
)}
</EuiFlexItem>
<EuiFlexItem grow={false} style={{ marginBottom: '-10px' }}>
<EuiFlexGroup direction="column" gutterSize="none">
<EuiFlexItem>
Expand Down

0 comments on commit 94ff605

Please sign in to comment.