From 82dce0d6765ac1af81a4bcc8336d036cb35d3310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Mon, 13 Jul 2020 20:13:31 +0100 Subject: [PATCH] chore(ui): tweak animations --- ui/src/Common/Popper.ts | 9 ++++ .../AlertGrid/AlertGroup/Alert/AlertMenu.js | 14 +++--- .../Alert/__snapshots__/index.test.js.snap | 36 ++++---------- .../__snapshots__/index.test.js.snap | 8 +--- .../__snapshots__/index.test.js.snap | 48 +++++-------------- .../AlertGroup/GroupHeader/GroupMenu.js | 14 +++--- .../__snapshots__/index.test.js.snap | 4 +- .../__snapshots__/SilenceComment.test.js.snap | 16 ++----- .../__snapshots__/index.test.js.snap | 12 ++--- .../Components/NavBar/FilterInput/History.js | 3 +- .../__snapshots__/MatchCounter.test.js.snap | 4 +- ui/src/Components/TooltipWrapper/index.js | 30 +++++++----- ui/src/Styles/Components/AlertGroup.scss | 3 +- ui/src/Styles/Components/DropdownSlide.scss | 34 +++++++------ ui/src/Styles/Components/Tooltip.scss | 15 ++++++ 15 files changed, 108 insertions(+), 142 deletions(-) create mode 100644 ui/src/Common/Popper.ts diff --git a/ui/src/Common/Popper.ts b/ui/src/Common/Popper.ts new file mode 100644 index 000000000..0aa541d35 --- /dev/null +++ b/ui/src/Common/Popper.ts @@ -0,0 +1,9 @@ +export const CommonPopperModifiers = [ + { name: "arrow", enabled: false }, + { + name: "computeStyles", + options: { + gpuAcceleration: false, + }, + }, +]; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js index 72c052a98..58b435f8a 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Alert/AlertMenu.js @@ -17,11 +17,17 @@ import { SilenceTabNames, AlertmanagerClustersToOption, } from "Stores/SilenceFormStore"; +import { CommonPopperModifiers } from "Common/Popper"; import { FetchPauser } from "Components/FetchPauser"; import { DropdownSlide } from "Components/Animations/DropdownSlide"; import { DateFromNow } from "Components/DateFromNow"; import { useOnClickOutside } from "Hooks/useOnClickOutside"; +const PopperModifiers = [ + ...CommonPopperModifiers, + { name: "offset", options: { offset: "-5px, 0px" } }, +]; + const onSilenceClick = (alertStore, silenceFormStore, group, alert) => { let clusters = {}; Object.entries(alertStore.data.clustersWithoutReadOnly).forEach( @@ -148,13 +154,7 @@ const AlertMenu = ({ )} - + {({ placement, ref, style }) => ( matches snapshot when inhibited 1`] = ` "
  • -
    +
    matches snapshot when inhibited 1`] = `
    -
    +
    matches snapshot when inhibited 1`] = ` 1 day ago -
    +
    matches snapshot when inhibited 1`] = `
    -
    +
    job: @@ -110,9 +102,7 @@ exports[` matches snapshot when inhibited 1`] = `
    -
    +
    cluster: @@ -151,9 +141,7 @@ exports[` matches snapshot with showAlertmanagers=false showReceiver=fa "
  • -
    +
    matches snapshot with showAlertmanagers=false showReceiver=fa
    -
    +
    matches snapshot with showAlertmanagers=false showReceiver=fa 1 day ago -
    +
    job: @@ -237,9 +221,7 @@ exports[` matches snapshot with showAlertmanagers=false showReceiver=fa
    -
    +
    cluster: diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap b/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap index 82f23198e..ad323767d 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/Annotation/__snapshots__/index.test.js.snap @@ -28,9 +28,7 @@ exports[` matches snapshot 1`] = ` exports[` matches snapshot when visible=false 1`] = ` " -
    +
    matches snapshot when visible=false 1`] = ` exports[` matches snapshot when visible=true 1`] = ` " -
    +
    matches snapshot 1`] = ` "