From fb94fd8ffe95ddeeab295696bf07c2de1de90c6e Mon Sep 17 00:00:00 2001 From: alexpaxton Date: Thu, 8 Aug 2019 16:45:48 -0700 Subject: [PATCH] refactor(ui): Polish appearance of Alerting UI (#14602) * refactor(ui): polish appearance of alerting index view * refactor(ui): ensure alert check editor header has proper padding * refactor(ui): emphasize alerting button more * refactor(ui): style check builder control bar * refactor(ui): allow buidler card to have a customizable width * refactor(ui): expose autohide prop from dapperscrollbars within buildercardbody * refactor(ui): allow dashed button to have configurable color and size * refactor(ui): add placeholder buttons in to thresholds card * refactor(ui): add custom styles for alert builder cards * refactor(ui): increase height of status message template * refactor(ui): add empty state to matching rules card * fix(ui): reconnect checks list to redux * refactor(ui): use more appropriate copy in endpoints empty state --- ui/src/alerting/components/AlertingIndex.scss | 30 ++++++++ ui/src/alerting/components/AlertsColumn.tsx | 62 ++++++++++++++++ .../components/AlertsColumnHeader.tsx | 38 ---------- .../components/CheckAlertingButton.tsx | 26 +++---- ui/src/alerting/components/CheckCards.tsx | 2 +- ui/src/alerting/components/ChecksColumn.tsx | 7 +- .../alerting/components/EndpointsColumn.tsx | 23 +++++- .../components/builder/AlertBuilder.scss | 29 ++++++++ .../components/builder/AlertBuilder.tsx | 20 ++++-- .../builder/CheckMatchingRulesCard.tsx | 13 +++- .../components/builder/CheckMetaCard.tsx | 5 +- .../builder/CheckThresholdsCard.tsx | 37 +++++++++- .../components/notifications/RuleCards.tsx | 22 +++--- .../notifications/RuleConditions.tsx | 8 ++- .../components/notifications/RulesColumn.tsx | 17 ++--- ui/src/alerting/containers/AlertingIndex.tsx | 44 ++++++------ ui/src/dashboards/components/VEO.scss | 1 + .../dashed_button/DashedButton.scss | 71 ++++++++++++++++--- .../components/dashed_button/DashedButton.tsx | 20 +++++- ui/src/style/chronograf.scss | 2 + ui/src/timeMachine/components/Queries.scss | 11 ++- .../components/TimeMachineAlerting.tsx | 2 +- .../components/builderCard/BuilderCard.scss | 2 - .../components/builderCard/BuilderCard.tsx | 8 ++- .../builderCard/BuilderCardBody.tsx | 5 +- 25 files changed, 383 insertions(+), 122 deletions(-) create mode 100644 ui/src/alerting/components/AlertingIndex.scss create mode 100644 ui/src/alerting/components/AlertsColumn.tsx delete mode 100644 ui/src/alerting/components/AlertsColumnHeader.tsx create mode 100644 ui/src/alerting/components/builder/AlertBuilder.scss diff --git a/ui/src/alerting/components/AlertingIndex.scss b/ui/src/alerting/components/AlertingIndex.scss new file mode 100644 index 0000000000..a7dcf16203 --- /dev/null +++ b/ui/src/alerting/components/AlertingIndex.scss @@ -0,0 +1,30 @@ +.alerting-index { + > .page-contents > .container-fluid, + > .page-contents > .container-fluid > .row, + > .page-contents > .container-fluid > .row > .col-xs-12, + > .page-contents > .container-fluid > .row > .col-xs-12 > .cf-grid--container, + > .page-contents > .container-fluid > .row > .col-xs-12 > .cf-grid--container > .cf-grid--row, + > .page-contents > .container-fluid > .row > .col-xs-12 > .cf-grid--container > .cf-grid--row > .cf-grid--column { + height: 100%; + } +} + +.alerting-index--column { + height: 100%; +} + +.alert-column--empty { + min-height: 160px; + justify-content: center; +} + +.alerting-index--column-body { + flex: 1 0 0; + position: relative; +} + +.alerting-index--list, +.alerting-index--search { + padding: 18px; + padding-top: 0; +} diff --git a/ui/src/alerting/components/AlertsColumn.tsx b/ui/src/alerting/components/AlertsColumn.tsx new file mode 100644 index 0000000000..26554c9bdf --- /dev/null +++ b/ui/src/alerting/components/AlertsColumn.tsx @@ -0,0 +1,62 @@ +// Libraries +import React, {FC} from 'react' + +// Components +import { + Button, + ComponentColor, + Panel, + InfluxColors, + DapperScrollbars, + Input, + IconFont, +} from '@influxdata/clockface' + +interface Props { + title: string + testID?: string + onCreate: () => void +} + +const AlertsColumnHeader: FC = ({ + children, + onCreate, + title, + testID = '', +}) => { + return ( + + +