From ed385be20b8319ee909a612a2af21cbeff35371d Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Mon, 30 Sep 2019 11:26:46 -0400 Subject: [PATCH 1/2] render alert icon in policy table if last snapshot failed --- .../public/app/sections/home/_home.scss | 21 ++++++++++- .../policy_list/policy_table/policy_table.tsx | 36 ++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss index c714222daa98b..05f9a6169e5e8 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss @@ -28,4 +28,23 @@ .euiToolTipAnchor { display: flex; } -} \ No newline at end of file +} + +/* + * Wraps long snapshot name with ellipsis when it is rendered with an icon + */ +.snapshotRestorePolicyTableSnapshotFailureContainer { + max-width: 200px; + > .euiFlexItem:first-child { + + } + + > .euiFlexItem:last-child { + min-width: 0; + .euiText { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx index a47b670177ca8..19239a282eb29 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_table/policy_table.tsx @@ -14,6 +14,8 @@ import { EuiToolTip, EuiButtonIcon, EuiLoadingSpinner, + EuiText, + EuiIcon, } from '@elastic/eui'; import { SlmPolicy } from '../../../../../../common/types'; @@ -94,8 +96,40 @@ export const PolicyTable: React.FunctionComponent = ({ name: i18n.translate('xpack.snapshotRestore.policyList.table.snapshotNameColumnTitle', { defaultMessage: 'Snapshot name', }), - truncateText: true, sortable: true, + render: ( + snapshotName: SlmPolicy['snapshotName'], + { lastFailure, lastSuccess }: SlmPolicy + ) => { + // Alert user if last snapshot failed + if (lastSuccess && lastFailure && lastFailure.time > lastSuccess.time) { + return ( + + + + + + + + {snapshotName} + + + ); + } + return snapshotName; + }, }, { field: 'repository', From 432656d1188f64b32ff7c58df5c7a7a80d9d1678 Mon Sep 17 00:00:00 2001 From: Alison Goryachev Date: Wed, 2 Oct 2019 09:10:31 -0400 Subject: [PATCH 2/2] remove empty css selector --- .../snapshot_restore/public/app/sections/home/_home.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss index 05f9a6169e5e8..741ee76985937 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/_home.scss @@ -35,10 +35,6 @@ */ .snapshotRestorePolicyTableSnapshotFailureContainer { max-width: 200px; - > .euiFlexItem:first-child { - - } - > .euiFlexItem:last-child { min-width: 0; .euiText {