From 490048ecc5cd385b3624c9d606c8a1a3ff0a9353 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Mon, 21 Oct 2019 13:25:47 -0400 Subject: [PATCH 1/8] Removed Flexbox around header and link elements. --- .../snapshot_details/snapshot_details.tsx | 73 ++++++++----------- 1 file changed, 32 insertions(+), 41 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx index e9ce9cbe0ac74..060a46aa98606 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx @@ -133,16 +133,16 @@ export const SnapshotDetails: React.FunctionComponent = ({ const notFound = (error as any).status === 404; const errorObject = notFound ? { - data: { - error: i18n.translate('xpack.snapshotRestore.snapshotDetails.errorSnapshotNotFound', { - defaultMessage: `Either the snapshot '{snapshotId}' doesn't exist in the repository '{repositoryName}' or the repository doesn't exist.`, - values: { - snapshotId, - repositoryName, - }, - }), - }, - } + data: { + error: i18n.translate('xpack.snapshotRestore.snapshotDetails.errorSnapshotNotFound', { + defaultMessage: `Either the snapshot '{snapshotId}' doesn't exist in the repository '{repositoryName}' or the repository doesn't exist.`, + values: { + snapshotId, + repositoryName, + }, + }), + }, + } : error; content = ( @@ -205,12 +205,12 @@ export const SnapshotDetails: React.FunctionComponent = ({ title={ snapshotDetails.isManagedRepository ? i18n.translate( - 'xpack.snapshotRestore.snapshotDetails.deleteManagedRepositorySnapshotButtonTitle', - { - defaultMessage: - 'You cannot delete a snapshot stored in a managed repository.', - } - ) + 'xpack.snapshotRestore.snapshotDetails.deleteManagedRepositorySnapshotButtonTitle', + { + defaultMessage: + 'You cannot delete a snapshot stored in a managed repository.', + } + ) : null } > @@ -256,33 +256,24 @@ export const SnapshotDetails: React.FunctionComponent = ({ maxWidth={550} > - - - -

- {snapshotId} -

-
-
- - - -

- - - -

-
-
-
- + +

+ {snapshotId} +

+

+ + + + + +

+
{tabs}
- {content} {renderFooter()} From c73499df52715b561a91f307d89e360fe5de6a89 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Mon, 21 Oct 2019 13:26:56 -0400 Subject: [PATCH 2/8] Removed unused EUI component --- .../snapshot_details/snapshot_details.tsx | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx index 060a46aa98606..955cade353d2e 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx @@ -18,7 +18,6 @@ import { EuiTab, EuiTabs, EuiText, - EuiTitle, } from '@elastic/eui'; import React, { Fragment, useState, useEffect } from 'react'; @@ -133,16 +132,16 @@ export const SnapshotDetails: React.FunctionComponent = ({ const notFound = (error as any).status === 404; const errorObject = notFound ? { - data: { - error: i18n.translate('xpack.snapshotRestore.snapshotDetails.errorSnapshotNotFound', { - defaultMessage: `Either the snapshot '{snapshotId}' doesn't exist in the repository '{repositoryName}' or the repository doesn't exist.`, - values: { - snapshotId, - repositoryName, - }, - }), - }, - } + data: { + error: i18n.translate('xpack.snapshotRestore.snapshotDetails.errorSnapshotNotFound', { + defaultMessage: `Either the snapshot '{snapshotId}' doesn't exist in the repository '{repositoryName}' or the repository doesn't exist.`, + values: { + snapshotId, + repositoryName, + }, + }), + }, + } : error; content = ( @@ -205,12 +204,12 @@ export const SnapshotDetails: React.FunctionComponent = ({ title={ snapshotDetails.isManagedRepository ? i18n.translate( - 'xpack.snapshotRestore.snapshotDetails.deleteManagedRepositorySnapshotButtonTitle', - { - defaultMessage: - 'You cannot delete a snapshot stored in a managed repository.', - } - ) + 'xpack.snapshotRestore.snapshotDetails.deleteManagedRepositorySnapshotButtonTitle', + { + defaultMessage: + 'You cannot delete a snapshot stored in a managed repository.', + } + ) : null } > From ba812156d8d37067619929eaae115545d4ec75a3 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Mon, 21 Oct 2019 18:50:51 -0400 Subject: [PATCH 3/8] Added class to include the ellipses when name is truncated. --- .../crud_app/sections/job_list/job_table/job_table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js b/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js index e1c885156faa6..9f0315e705306 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js +++ b/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js @@ -6,7 +6,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { i18n } from '@kbn/i18n'; +import { i18n } from '@kbn/i18n'; import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { @@ -278,10 +278,10 @@ export class JobTableUi extends Component { > {truncateText ? ( - + {content} - ) : content } + ) : content} ); }); From 2424c0b9e1e6d12a72cc8e3af1afd0d291bb9cb8 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Thu, 24 Oct 2019 16:45:59 -0400 Subject: [PATCH 4/8] Fixed title in policy_details.tsx --- .../policy_details/policy_details.tsx | 82 +++++++++---------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx index dfc19069b17aa..a52f06e254093 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx @@ -20,6 +20,7 @@ import { EuiContextMenu, EuiButtonIcon, EuiLink, + EuiSpacer, } from '@elastic/eui'; import { SlmPolicy } from '../../../../../../common/types'; @@ -302,51 +303,42 @@ export const PolicyDetails: React.FunctionComponent = ({ maxWidth={550} > - - - - - -

- {policyName} -

-
- - reload()} - /> - -
-
-
- {policyDetails && policyDetails.policy && policyDetails.policy.inProgress ? ( - - - - - - - - ) : null} -
- {renderTabs()} -
+ +

+ {policyName}{' '} + reload()} + /> +

+
+ {policyDetails && policyDetails.policy && policyDetails.policy.inProgress ? ( + <> + + + + + + + + ) : null} + {renderTabs()} + {renderBody()} From 00db5a9312f7c80fd75f5233243f9cb2f3337266 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Fri, 25 Oct 2019 00:47:43 -0400 Subject: [PATCH 5/8] Fixed buttons and title on policy and repository table. --- .../policy_details/policy_details.tsx | 72 ++++++++-------- .../policy_list/policy_table/policy_table.tsx | 70 +++++++--------- .../repository_table/repository_table.tsx | 84 +++++++++---------- 3 files changed, 107 insertions(+), 119 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx index a52f06e254093..fc49a1fe464ac 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/policy_list/policy_details/policy_details.tsx @@ -303,42 +303,42 @@ export const PolicyDetails: React.FunctionComponent = ({ maxWidth={550} > - -

- {policyName}{' '} - reload()} - /> -

-
- {policyDetails && policyDetails.policy && policyDetails.policy.inProgress ? ( - <> - - - - - - - - ) : null} - {renderTabs()} -
+ +

+ {policyName}{' '} + reload()} + /> +

+
+ {policyDetails && policyDetails.policy && policyDetails.policy.inProgress ? ( + <> + + + + + + + + ) : null} + {renderTabs()} + {renderBody()} 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 b544666b67159..707294a200228 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 @@ -193,13 +193,13 @@ export const PolicyTable: React.FunctionComponent = ({ content={ Boolean(inProgress) ? i18n.translate( - 'xpack.snapshotRestore.policyList.table.actionExecuteDisabledTooltip', - { defaultMessage: 'Policy is running' } - ) + 'xpack.snapshotRestore.policyList.table.actionExecuteDisabledTooltip', + { defaultMessage: 'Policy is running' } + ) : i18n.translate( - 'xpack.snapshotRestore.policyList.table.actionExecuteTooltip', - { defaultMessage: 'Run now' } - ) + 'xpack.snapshotRestore.policyList.table.actionExecuteTooltip', + { defaultMessage: 'Run now' } + ) } > = ({ }} ) : ( - undefined - ), - toolsRight: ( - - - - - - - - - - - - - ), + undefined + ), + toolsRight: [ + + + , + + + , + ], box: { incremental: true, schema: true, diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx index 119733d891ab4..5b3a171e3e787 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx @@ -133,15 +133,15 @@ export const RepositoryTable: React.FunctionComponent = ({ const label = name !== managedRepository ? i18n.translate( - 'xpack.snapshotRestore.repositoryList.table.actionRemoveTooltip', - { defaultMessage: 'Remove' } - ) + 'xpack.snapshotRestore.repositoryList.table.actionRemoveTooltip', + { defaultMessage: 'Remove' } + ) : i18n.translate( - 'xpack.snapshotRestore.repositoryList.table.deleteManagedRepositoryTooltip', - { - defaultMessage: 'You cannot delete a managed repository.', - } - ); + 'xpack.snapshotRestore.repositoryList.table.deleteManagedRepositoryTooltip', + { + defaultMessage: 'You cannot delete a managed repository.', + } + ); return ( = ({ defaultMessage="Remove repository" /> ) : ( - - )} + + )} ); }} ) : ( - undefined - ), - toolsRight: ( - - - - - - - - - - - - - ), + undefined + ), + toolsRight: [ + + + , + + + , + ], box: { incremental: true, schema: true, From 895f3250a4c51af38aed365d277ca4b62c1021ff Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Fri, 25 Oct 2019 01:16:11 -0400 Subject: [PATCH 6/8] Linting fixes. --- .../policy_list/policy_table/policy_table.tsx | 16 +++++----- .../repository_table/repository_table.tsx | 30 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) 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 707294a200228..76bc0253a207e 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 @@ -193,13 +193,13 @@ export const PolicyTable: React.FunctionComponent = ({ content={ Boolean(inProgress) ? i18n.translate( - 'xpack.snapshotRestore.policyList.table.actionExecuteDisabledTooltip', - { defaultMessage: 'Policy is running' } - ) + 'xpack.snapshotRestore.policyList.table.actionExecuteDisabledTooltip', + { defaultMessage: 'Policy is running' } + ) : i18n.translate( - 'xpack.snapshotRestore.policyList.table.actionExecuteTooltip', - { defaultMessage: 'Run now' } - ) + 'xpack.snapshotRestore.policyList.table.actionExecuteTooltip', + { defaultMessage: 'Run now' } + ) } > = ({ }} ) : ( - undefined - ), + undefined + ), toolsRight: [ = ({ const label = name !== managedRepository ? i18n.translate( - 'xpack.snapshotRestore.repositoryList.table.actionRemoveTooltip', - { defaultMessage: 'Remove' } - ) + 'xpack.snapshotRestore.repositoryList.table.actionRemoveTooltip', + { defaultMessage: 'Remove' } + ) : i18n.translate( - 'xpack.snapshotRestore.repositoryList.table.deleteManagedRepositoryTooltip', - { - defaultMessage: 'You cannot delete a managed repository.', - } - ); + 'xpack.snapshotRestore.repositoryList.table.deleteManagedRepositoryTooltip', + { + defaultMessage: 'You cannot delete a managed repository.', + } + ); return ( = ({ defaultMessage="Remove repository" /> ) : ( - - )} + + )} ); }} ) : ( - undefined - ), + undefined + ), toolsRight: [ Date: Fri, 25 Oct 2019 01:55:27 -0400 Subject: [PATCH 7/8] Removed unused references. --- .../home/repository_list/repository_table/repository_table.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx index 7681a7d1c312d..bad30ad47d3bf 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/repository_list/repository_table/repository_table.tsx @@ -9,8 +9,6 @@ import { EuiBadge, EuiButton, EuiButtonIcon, - EuiFlexGroup, - EuiFlexItem, EuiInMemoryTable, EuiLink, EuiToolTip, From 752a4fdad5360b85fddb4d0b8944f399c90aa548 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Mon, 28 Oct 2019 20:45:29 -0400 Subject: [PATCH 8/8] Added keys to arrays of elements to resolve React errors. --- .../app/sections/home/policy_list/policy_table/policy_table.tsx | 2 ++ .../home/repository_list/repository_table/repository_table.tsx | 2 ++ 2 files changed, 4 insertions(+) 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 76bc0253a207e..01fc904906bf1 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 @@ -329,6 +329,7 @@ export const PolicyTable: React.FunctionComponent = ({ ), toolsRight: [ = ({ /> , = ({ ), toolsRight: [ = ({ /> ,