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 ( + + + +