Skip to content

Commit

Permalink
Add consistency in form modal footer btns
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Nov 4, 2024
1 parent bdd2db4 commit e225d46
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
EuiSmallFilterButton,
EuiSuperSelectOption,
EuiCompressedSuperSelect,
EuiSmallButtonEmpty,
} from '@elastic/eui';
import { JsonField } from '../input_fields';
import {
Expand Down Expand Up @@ -297,14 +298,13 @@ export function SourceDataModal(props: SourceDataProps) {
</>
</EuiModalBody>
<EuiModalFooter>
<EuiSmallButton
<EuiSmallButtonEmpty
onClick={() => onClose()}
fill={false}
color="primary"
data-testid="closeSourceDataButton"
>
Cancel
</EuiSmallButton>
</EuiSmallButtonEmpty>
<EuiSmallButton
onClick={() => onUpdate()}
isLoading={isUpdating}
Expand All @@ -313,7 +313,7 @@ export function SourceDataModal(props: SourceDataProps) {
color="primary"
data-testid="updateSourceDataButton"
>
Update
Save
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,9 @@ export function InputTransformModal(props: InputTransformModalProps) {
}
color="warning"
/>
<EuiSpacer size="s" />
</>
)}
<EuiSpacer size="s" />
{props.context === PROCESSOR_CONTEXT.SEARCH_RESPONSE && (
<>
{OneToOneConfig}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,29 +492,31 @@ root object selector "${JSONPATH_ROOT_SELECTOR}"`}
</EuiFlexItem>
</EuiFlexGroup>
<EuiFlexItem>
{(onIngestAndNoDocs || onSearchAndNoQuery) && (
<>
<EuiCallOut
size="s"
title={
onIngestAndNoDocs
? 'No source documents detected. Fetching is unavailable.'
: 'No source query detected. Fetching is unavailable.'
}
color="warning"
/>
<EuiSpacer size="s" />
{(props.context === PROCESSOR_CONTEXT.INGEST ||
props.context ===
PROCESSOR_CONTEXT.SEARCH_RESPONSE) && (
<>
{FullResponsePathConfig}
<EuiSpacer size="s" />
</>
)}
{FetchButton}
</>
)}
<>
{(onIngestAndNoDocs || onSearchAndNoQuery) && (
<>
<EuiCallOut
size="s"
title={
onIngestAndNoDocs
? 'No source documents detected. Fetching is unavailable.'
: 'No source query detected. Fetching is unavailable.'
}
color="warning"
/>
<EuiSpacer size="s" />
</>
)}
{(props.context === PROCESSOR_CONTEXT.INGEST ||
props.context ===
PROCESSOR_CONTEXT.SEARCH_RESPONSE) && (
<>
{FullResponsePathConfig}
<EuiSpacer size="s" />
</>
)}
{FetchButton}
</>
</EuiFlexItem>
<EuiSpacer size="s" />
<EuiFlexGroup direction="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
EuiModalHeaderTitle,
EuiPopover,
EuiSpacer,
EuiSmallButtonEmpty,
} from '@elastic/eui';
import { JsonField } from '../input_fields';
import {
Expand Down Expand Up @@ -139,14 +140,13 @@ export function EditQueryModal(props: EditQueryModalProps) {
/>
</EuiModalBody>
<EuiModalFooter>
<EuiSmallButton
<EuiSmallButtonEmpty
onClick={() => props.setModalOpen(false)}
fill={false}
color="primary"
data-testid="cancelSearchQueryButton"
>
Cancel
</EuiSmallButton>
</EuiSmallButtonEmpty>
<EuiSmallButton
onClick={() => {
setFieldValue(props.queryFieldPath, tempRequest);
Expand All @@ -158,7 +158,7 @@ export function EditQueryModal(props: EditQueryModalProps) {
color="primary"
data-testid="updateSearchQueryButton"
>
Update
Save
</EuiSmallButton>
</EuiModalFooter>
</EuiModal>
Expand Down

0 comments on commit e225d46

Please sign in to comment.