Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alerting] Create alert design cleanup #56929

Merged
merged 9 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -590,12 +590,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 @@ -604,17 +605,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 @@ -631,7 +635,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 @@ -834,6 +838,7 @@ export const AlertForm = ({
<Fragment>{alertTypeDetails}</Fragment>
) : (
<Fragment>
<EuiHorizontalRule />
<EuiTitle size="s">
<h5 id="alertTypeTitle">
<FormattedMessage
Expand Down