Skip to content

Commit

Permalink
[Alerting] Create alert design cleanup (#56929)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreadelrio committed Feb 12, 2020
1 parent a5d661c commit 0faab4a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
import {
EuiFlexItem,
EuiFlexGroup,
EuiFormLabel,
EuiExpression,
EuiPopover,
EuiPopoverTitle,
Expand Down Expand Up @@ -327,7 +328,15 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
<EuiSpacer />
</Fragment>
) : null}
<EuiFlexGroup gutterSize="s" wrap>
<EuiSpacer size="l" />
<EuiFormLabel>
<FormattedMessage
defaultMessage="Select Index to query:"
id="xpack.triggersActionsUI.sections.alertAdd.selectIndex"
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<EuiFlexGroup wrap>
<EuiFlexItem grow={false}>
<EuiPopover
id="indexPopover"
Expand All @@ -340,7 +349,7 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
defaultMessage: 'index',
}
)}
value={index || firstFieldOption.text}
value={index ? index.join(' ') : firstFieldOption.text}
isActive={indexPopoverOpen}
onClick={() => {
setIndexPopoverOpen(true);
Expand Down Expand Up @@ -370,6 +379,8 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
</div>
</EuiPopover>
</EuiFlexItem>
</EuiFlexGroup>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<WhenExpression
aggType={aggType ?? DEFAULT_VALUES.AGGREGATION_TYPE}
Expand All @@ -391,6 +402,8 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
/>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<GroupByExpression
groupBy={groupBy || DEFAULT_VALUES.GROUP_BY}
Expand All @@ -407,6 +420,16 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent<IndexThr
}
/>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="xl" />
<EuiFormLabel>
<FormattedMessage
defaultMessage="Define the alert condition:"
id="xpack.triggersActionsUI.sections.alertAdd.conditionPrompt"
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<ThresholdExpression
thresholdComparator={thresholdComparator ?? DEFAULT_VALUES.THRESHOLD_COMPARATOR}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ export const ThresholdVisualization: React.FunctionComponent<Props> = ({
>
{error}
</EuiCallOut>
<EuiSpacer size="l" />
</Fragment>
);
}
Expand Down Expand Up @@ -248,7 +247,7 @@ export const ThresholdVisualization: React.FunctionComponent<Props> = ({
<div data-test-subj="alertVisualizationChart">
<EuiSpacer size="l" />
{alertVisualizationDataKeys.length ? (
<Chart size={['100%', 300]} renderer="canvas">
<Chart size={['100%', 200]} renderer="canvas">
<Settings
theme={[customTheme(), chartsTheme]}
xDomain={domain}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.actConnectorModal {
z-index: 9000;
}

.euiComboBoxOptionsList {
z-index: 10000;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import {
EuiFormRow,
EuiComboBox,
EuiKeyPadMenuItem,
EuiLink,
EuiFieldNumber,
EuiSelect,
EuiIconTip,
EuiAccordion,
EuiButtonIcon,
EuiEmptyPrompt,
EuiButtonEmpty,
EuiHorizontalRule,
} from '@elastic/eui';
import { loadAlertTypes } from '../../lib/alert_api';
import { loadActionTypes, loadAllActions } from '../../lib/action_connector_api';
Expand Down Expand Up @@ -595,12 +595,13 @@ export const AlertForm = ({

const alertTypeDetails = (
<Fragment>
<EuiHorizontalRule />
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem>
<EuiTitle size="s" data-test-subj="selectedAlertTypeTitle">
<h5 id="selectedAlertTypeTitle">
<FormattedMessage
defaultMessage="Trigger: {alertType}"
defaultMessage="{alertType}"
id="xpack.triggersActionsUI.sections.alertForm.selectedAlertTypeTitle"
values={{ alertType: alertTypeModel ? alertTypeModel.name : '' }}
/>
Expand All @@ -609,17 +610,20 @@ export const AlertForm = ({
</EuiFlexItem>
{canChangeTrigger ? (
<EuiFlexItem grow={false}>
<EuiLink
<EuiButtonIcon
iconType="cross"
color="danger"
aria-label={i18n.translate(
'xpack.triggersActionsUI.sections.alertForm.changeAlertTypeAriaLabel',
{
defaultMessage: 'Delete',
}
)}
onClick={() => {
setAlertProperty('alertTypeId', null);
setAlertTypeModel(null);
}}
>
<FormattedMessage
defaultMessage="Change"
id="xpack.triggersActionsUI.sections.alertForm.changeAlertTypeLink"
/>
</EuiLink>
/>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
Expand All @@ -636,7 +640,7 @@ export const AlertForm = ({
{selectedGroupActions}
{isAddActionPanelOpen ? (
<Fragment>
<EuiTitle size="s">
<EuiTitle size="xs">
<h5 id="alertActionTypeTitle">
<FormattedMessage
defaultMessage="Actions: Select an action type"
Expand Down Expand Up @@ -839,6 +843,7 @@ export const AlertForm = ({
<Fragment>{alertTypeDetails}</Fragment>
) : (
<Fragment>
<EuiHorizontalRule />
<EuiTitle size="s">
<h5 id="alertTypeTitle">
<FormattedMessage
Expand Down

0 comments on commit 0faab4a

Please sign in to comment.