diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9c5d0e2702..ce2c4ac022 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
### Features
### UI Improvements
+1. [15040](https://github.com/influxdata/influxdb/pull/15040): Redesign check builder UI to fill the screen and make more room for composing message templates
1. [14990](https://github.com/influxdata/influxdb/pull/14990): Move Tokens tab from Settings to Load Data page
1. [14990](https://github.com/influxdata/influxdb/pull/14990): Expose all Settings tabs in navigation menu
diff --git a/ui/src/alerting/components/builder/AlertBuilder.scss b/ui/src/alerting/components/builder/AlertBuilder.scss
index c9a83b6695..8fe79186a4 100644
--- a/ui/src/alerting/components/builder/AlertBuilder.scss
+++ b/ui/src/alerting/components/builder/AlertBuilder.scss
@@ -3,7 +3,19 @@
------------------------------------------------------------------------------
*/
+.alert-builder {
+ padding: 0 $ix-marg-c;
+ background-color: $g2-kevlar;
+}
+
+.alert-builder--controls {
+ border-bottom: 0;
+ padding-right: $ix-marg-c;
+}
+
.alert-builder--card {
+ margin-bottom: $ix-marg-c;
+
.builder-card--contents {
min-height: 100%;
padding: 16px;
@@ -11,6 +23,16 @@
.builder-card--header {
justify-content: center;
}
+
+ &.alert-builder--meta-card {
+ flex: 1 0 320px !important;
+ }
+ &.alert-builder--message-card {
+ flex: 3 0 480px !important;
+ }
+ &.alert-builder--conditions-card {
+ flex: 2 0 510px !important;
+ }
}
.cf-empty-state.alert-builder--card__empty {
@@ -19,18 +41,35 @@
justify-content: center;
}
-.alert-builder--message-template {
- .cf-text-area--container.cf-input-md {
- height: auto;
- }
+.alert-builder--message-template.cf-text-area--container.cf-input-md {
+ height: auto;
+
textarea {
- height: 90px;
+ height: 120px;
+ font-family: $code-font;
+ }
+}
+
+.alert-builder--message-help {
+ padding: 0 $ix-marg-c;
+
+ p {
+ font-size: 13px;
+ font-weight: 500;
+ }
+
+ code {
+ background-color: $g2-kevlar;
+ color: $c-potassium;
+ padding: 2px 4px;
+ border-radius: 3px;
+ user-select: text;
}
}
.alert-builder--check-type-selector {
- margin: $ix-marg-c;
+ margin-bottom: $ix-marg-c;
}
.alert-builder--tag-row {
diff --git a/ui/src/alerting/components/builder/AlertBuilder.tsx b/ui/src/alerting/components/builder/AlertBuilder.tsx
index ce9cb126ac..b1c431315f 100644
--- a/ui/src/alerting/components/builder/AlertBuilder.tsx
+++ b/ui/src/alerting/components/builder/AlertBuilder.tsx
@@ -3,47 +3,19 @@ import React, {FC} from 'react'
// Components
import FancyScrollbar from 'src/shared/components/fancy_scrollbar/FancyScrollbar'
-import BuilderCard from 'src/timeMachine/components/builderCard/BuilderCard'
import CheckMetaCard from 'src/alerting/components/builder/CheckMetaCard'
+import CheckMessageCard from 'src/alerting/components/builder/CheckMessageCard'
import CheckConditionsCard from 'src/alerting/components/builder/CheckConditionsCard'
-import CheckMatchingRulesCard from 'src/alerting/components/builder/CheckMatchingRulesCard'
const AlertBuilder: FC = () => {
return (
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/ui/src/alerting/components/builder/CheckConditionsCard.tsx b/ui/src/alerting/components/builder/CheckConditionsCard.tsx
index 226a310768..b18e9b8af1 100644
--- a/ui/src/alerting/components/builder/CheckConditionsCard.tsx
+++ b/ui/src/alerting/components/builder/CheckConditionsCard.tsx
@@ -13,6 +13,7 @@ import {
} from '@influxdata/clockface'
import ThresholdConditions from 'src/alerting/components/builder/ThresholdConditions'
import DeadmanConditions from 'src/alerting/components/builder/DeadmanConditions'
+import BuilderCard from 'src/timeMachine/components/builderCard/BuilderCard'
// Actions & Selectors
import {changeCheckType} from 'src/timeMachine/actions'
@@ -33,50 +34,55 @@ type Props = DispatchProps & StateProps
const CheckConditionsCard: FC = ({check, changeCheckType}) => {
return (
- <>
-
-
-
- Threshold
-
-
- Deadman
-
-
-
-
- {check.type === 'deadman' ? (
-
- ) : (
-
- )}
-
- >
+
+
+
+
+
+
+ Threshold
+
+
+ Deadman
+
+
+
+
+ {check.type === 'deadman' ? (
+
+ ) : (
+
+ )}
+
+
+
)
}
diff --git a/ui/src/alerting/components/builder/CheckMatchingRulesCard.tsx b/ui/src/alerting/components/builder/CheckMatchingRulesCard.tsx
index c7face6088..c95179d8c3 100644
--- a/ui/src/alerting/components/builder/CheckMatchingRulesCard.tsx
+++ b/ui/src/alerting/components/builder/CheckMatchingRulesCard.tsx
@@ -5,8 +5,7 @@ import {get} from 'lodash'
// Components
import MatchingRuleCard from 'src/alerting/components/builder/MatchingRuleCard'
-import {SpinnerContainer} from '@influxdata/clockface'
-import {TechnoSpinner} from '@influxdata/clockface'
+import {SpinnerContainer, TechnoSpinner} from '@influxdata/clockface'
// Actions
import {getActiveTimeMachine} from 'src/timeMachine/selectors'
diff --git a/ui/src/alerting/components/builder/CheckMessageCard.tsx b/ui/src/alerting/components/builder/CheckMessageCard.tsx
new file mode 100644
index 0000000000..51c6c30f0c
--- /dev/null
+++ b/ui/src/alerting/components/builder/CheckMessageCard.tsx
@@ -0,0 +1,98 @@
+// Libraries
+import React, {FC} from 'react'
+import {connect} from 'react-redux'
+
+// Components
+import {
+ ComponentSize,
+ TextArea,
+ AutoComplete,
+ Wrap,
+} from '@influxdata/clockface'
+import BuilderCard from 'src/timeMachine/components/builderCard/BuilderCard'
+
+// Actions & Selectors
+import {updateTimeMachineCheck} from 'src/timeMachine/actions'
+import {getActiveTimeMachine} from 'src/timeMachine/selectors'
+
+// Types
+import {Check, AppState} from 'src/types'
+
+interface DispatchProps {
+ onUpdateTimeMachineCheck: typeof updateTimeMachineCheck
+}
+
+interface StateProps {
+ check: Partial
+}
+
+type Props = DispatchProps & StateProps
+
+const CheckMessageCard: FC = ({check, onUpdateTimeMachineCheck}) => {
+ const handleChange = (
+ e: React.ChangeEvent
+ ) => {
+ onUpdateTimeMachineCheck({[e.target.name]: e.target.value})
+ }
+
+ return (
+
+
+
+
+
+
+ You can use any columns from your query as well as the following:
+
+
+ {'${r._check_name}'} The name of this check
+
+
+ {'${r._level}'} Indicates the level of the check
+
+
+ {'${string(v: r.numericColumn)}'} Functions can be used{' '}
+ as well
+
+
+
+
+ )
+}
+
+const mstp = (state: AppState): StateProps => {
+ const {
+ alerting: {check},
+ } = getActiveTimeMachine(state)
+
+ return {check}
+}
+
+const mdtp: DispatchProps = {
+ onUpdateTimeMachineCheck: updateTimeMachineCheck,
+}
+
+export default connect(
+ mstp,
+ mdtp
+)(CheckMessageCard)
diff --git a/ui/src/alerting/components/builder/CheckMetaCard.tsx b/ui/src/alerting/components/builder/CheckMetaCard.tsx
index cd6e076ab0..06605e2ae4 100644
--- a/ui/src/alerting/components/builder/CheckMetaCard.tsx
+++ b/ui/src/alerting/components/builder/CheckMetaCard.tsx
@@ -3,19 +3,12 @@ import React, {FC} from 'react'
import {connect} from 'react-redux'
// Components
-import {
- Form,
- ComponentSize,
- TextArea,
- AutoComplete,
- Wrap,
- ComponentColor,
- Grid,
-} from '@influxdata/clockface'
+import {Form, ComponentSize, ComponentColor, Grid} from '@influxdata/clockface'
import {Input} from '@influxdata/clockface'
import DashedButton from 'src/shared/components/dashed_button/DashedButton'
import CheckTagRow from 'src/alerting/components/builder/CheckTagRow'
import DurationSelector from 'src/timeMachine/components/DurationSelector'
+import BuilderCard from 'src/timeMachine/components/builderCard/BuilderCard'
// Actions & Selectors
import {updateTimeMachineCheck} from 'src/timeMachine/actions'
@@ -68,78 +61,65 @@ const CheckMetaCard: FC = ({
}
return (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- onUpdateTimeMachineCheck({offset})}
- />
-
-
-
-
-
- {check.tags &&
- check.tags.map((t, i) => (
-
+
+
+
+
- ))}
-
- >
+
+
+
+
+
+
+
+
+
+
+
+ onUpdateTimeMachineCheck({offset})
+ }
+ />
+
+
+
+
+
+ {check.tags &&
+ check.tags.map((t, i) => (
+
+ ))}
+
+
+
)
}
diff --git a/ui/src/alerting/components/builder/DeadmanConditions.tsx b/ui/src/alerting/components/builder/DeadmanConditions.tsx
index 76f5c9a071..c15615146a 100644
--- a/ui/src/alerting/components/builder/DeadmanConditions.tsx
+++ b/ui/src/alerting/components/builder/DeadmanConditions.tsx
@@ -12,6 +12,7 @@ import {
InputType,
Input,
FlexDirection,
+ InfluxColors,
} from '@influxdata/clockface'
import CheckLevelsDropdown from 'src/alerting/components/builder/CheckLevelsDropdown'
@@ -42,82 +43,73 @@ const DeadmanConditions: FC = ({
onUpdateTimeMachineCheck({level})
}
return (
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
)
}
diff --git a/ui/src/alerting/components/builder/ThresholdStatement.tsx b/ui/src/alerting/components/builder/ThresholdStatement.tsx
index d482eada00..f1d68e83be 100644
--- a/ui/src/alerting/components/builder/ThresholdStatement.tsx
+++ b/ui/src/alerting/components/builder/ThresholdStatement.tsx
@@ -13,6 +13,7 @@ import {
ButtonType,
FlexDirection,
ComponentColor,
+ InfluxColors,
} from '@influxdata/clockface'
// Types
@@ -59,61 +60,52 @@ const ThresholdStatement: FC = ({
}
return (
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
- {children}
-
+
+
-
-
+
-
-
-
+
+ {children}
+
+
+
+
+
+
)
}
diff --git a/ui/src/timeMachine/components/TimeMachineAlerting.tsx b/ui/src/timeMachine/components/TimeMachineAlerting.tsx
index 01505d7980..5c75249c87 100644
--- a/ui/src/timeMachine/components/TimeMachineAlerting.tsx
+++ b/ui/src/timeMachine/components/TimeMachineAlerting.tsx
@@ -14,7 +14,7 @@ import HelpButton from 'src/alerting/components/builder/HelpButton'
const TimeMachineAlerting: FunctionComponent = () => {
return (