From c6d04a91952f04b887bd8454a31a96b16ab245b2 Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Fri, 25 Jun 2021 21:57:57 +0100 Subject: [PATCH 1/4] [ML] Converts management app jobs list pages to new layout (#103117) * [ML] Converts management app jobs list pages to new layout * i[ML] Fix translations * [ML] Set acccessDenied default state back to false * [ML] Remove headers for error states and text updates following review Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../public/application/access_denied/page.tsx | 63 ++++------- .../components/access_denied_page.tsx | 80 +++++-------- .../components/insufficient_license_page.tsx | 104 +++++++---------- .../jobs_list_page/jobs_list_page.tsx | 106 ++++++++---------- .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - 6 files changed, 140 insertions(+), 215 deletions(-) diff --git a/x-pack/plugins/ml/public/application/access_denied/page.tsx b/x-pack/plugins/ml/public/application/access_denied/page.tsx index fa535eb1bd53a4..bc0d17e96fe714 100644 --- a/x-pack/plugins/ml/public/application/access_denied/page.tsx +++ b/x-pack/plugins/ml/public/application/access_denied/page.tsx @@ -5,21 +5,11 @@ * 2.0. */ -import React, { Fragment } from 'react'; +import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { - EuiCallOut, - EuiPage, - EuiPageBody, - EuiPageContentBody, - EuiPageContentHeader, - EuiPageContentHeaderSection, - EuiSpacer, - EuiText, - EuiTitle, -} from '@elastic/eui'; + +import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPageContent, EuiSpacer } from '@elastic/eui'; import { NavigationMenu } from '../components/navigation_menu'; import { HelpMenu } from '../components/help_menu'; import { useMlKibana } from '../contexts/kibana'; @@ -30,44 +20,35 @@ export const Page = () => { } = useMlKibana(); const helpLink = docLinks.links.ml.guide; return ( - + <> - - - - - -

+ + + + + -

-
-
-
- - - - + + } + body={

-
-
-
-
-
+ } + /> + + + -
+ ); }; diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx index 0d785f1918b0b5..4858db1ee55bce 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx @@ -5,59 +5,39 @@ * 2.0. */ -import React, { Fragment } from 'react'; +import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import { - EuiCallOut, - EuiPage, - EuiPageBody, - EuiPageContentBody, - EuiPageContentHeader, - EuiPageContentHeaderSection, - EuiSpacer, - EuiText, - EuiTitle, -} from '@elastic/eui'; +import { EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; export const AccessDeniedPage = () => ( - - - - - - -

- -

-
-
-
- - - - -

- -

-
-
-
-
-
-
+ <> + + + + + } + body={ +

+ +

+ } + /> +
+ ); diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx index 22951e950045b8..6d0c3639d939c8 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx @@ -5,78 +5,54 @@ * 2.0. */ -import React, { FC, Fragment } from 'react'; +import React, { FC } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; import { CoreStart } from 'kibana/public'; -import { - EuiCallOut, - EuiPage, - EuiPageBody, - EuiPageContentBody, - EuiPageContentHeader, - EuiPageContentHeaderSection, - EuiSpacer, - EuiText, - EuiTitle, - EuiLink, -} from '@elastic/eui'; +import { EuiEmptyPrompt, EuiLink, EuiPageContent } from '@elastic/eui'; interface Props { basePath: CoreStart['http']['basePath']; } export const InsufficientLicensePage: FC = ({ basePath }) => ( - - - - - - -

- -

-
-
-
- - - - -

- - - - ), - }} - /> -

-
-
-
-
-
-
+ <> + + + + + } + body={ +

+ + + + ), + }} + /> +

+ } + /> +
+ ); diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx index ca62ef9aaf0af1..77f0e6123dfad2 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx @@ -8,18 +8,15 @@ import React, { useEffect, useState, Fragment, FC, useMemo, useCallback } from 'react'; import { Router } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; import { CoreStart } from 'kibana/public'; import { EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiPageContent, EuiPageContentBody, + EuiPageHeader, EuiSpacer, EuiTabbedContent, - EuiText, - EuiTitle, EuiTabbedContentTab, } from '@elastic/eui'; @@ -176,6 +173,19 @@ export const JobsListPage: FC<{ defaultMessage: 'Analytics jobs docs', }); + const docsLink = ( + + {currentTabId === 'anomaly_detection_jobs' ? anomalyDetectionDocsLabel : analyticsDocsLabel} + + ); + function renderTabs() { return ( - + } + description={ + + } + rightSideItems={[docsLink]} + bottomBorder + /> + + + + - - - -

- {i18n.translate('xpack.ml.management.jobsList.jobsListTitle', { - defaultMessage: 'Machine Learning Jobs', - })} -

-
- - - {currentTabId === 'anomaly_detection_jobs' - ? anomalyDetectionDocsLabel - : analyticsDocsLabel} - - -
-
- - - - {i18n.translate('xpack.ml.management.jobsList.jobsListTagline', { - defaultMessage: 'View machine learning analytics and anomaly detection jobs.', - })} - - - - - {spacesEnabled && ( - <> - setShowSyncFlyout(true)}> - {i18n.translate('xpack.ml.management.jobsList.syncFlyoutButton', { - defaultMessage: 'Synchronize saved objects', - })} - - {showSyncFlyout && } - - - )} - {renderTabs()} - -
+ {spacesEnabled && ( + <> + setShowSyncFlyout(true)}> + {i18n.translate('xpack.ml.management.jobsList.syncFlyoutButton', { + defaultMessage: 'Synchronize saved objects', + })} + + {showSyncFlyout && } + + + )} + {renderTabs()} +
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 3cf0891bc73b20..22967ad94a0833 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -13627,7 +13627,6 @@ "xpack.maps.visTypeAlias.description": "マップを作成し、複数のレイヤーとインデックスを使用して、スタイルを設定します。", "xpack.maps.visTypeAlias.title": "マップ", "xpack.ml.accessDenied.description": "ML プラグインへのアクセスパーミッションがありません", - "xpack.ml.accessDenied.label": "パーミッションがありません", "xpack.ml.accessDeniedLabel": "アクセスが拒否されました", "xpack.ml.accessDeniedTabLabel": "アクセス拒否", "xpack.ml.actions.applyEntityFieldsFiltersTitle": "値でフィルター", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 3a1836cc250143..b1846be15ffa9f 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -13805,7 +13805,6 @@ "xpack.maps.visTypeAlias.description": "使用多个图层和索引创建地图并提供样式。", "xpack.maps.visTypeAlias.title": "Maps", "xpack.ml.accessDenied.description": "您无权访问 ML 插件", - "xpack.ml.accessDenied.label": "权限不足", "xpack.ml.accessDeniedLabel": "访问被拒绝", "xpack.ml.accessDeniedTabLabel": "访问被拒绝", "xpack.ml.actions.applyEntityFieldsFiltersTitle": "筛留值", From df8787b104efd9185a15d29bd5682826e5d0ceaa Mon Sep 17 00:00:00 2001 From: Michael Marcialis Date: Fri, 25 Jun 2021 20:58:52 -0400 Subject: [PATCH 2/4] Home & Kibana Overview Page Template Update (#103003) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * apply page template comp to kibana overview * apply page template comp to home page * clean up * strip null actions from array * update snapshot and remove outdated import * fix tests and update snapshots * update tests and snapshots * Switch to KibanaPageTemplate; use template=“empty” * update snapshots * make `EuiCard` transparent * updated snapshots * restored data-test-subj="homeApp" * change scope of styles * update snapshots --- .../__snapshots__/home.test.js.snap | 1344 ++++++-------- .../public/application/components/_home.scss | 16 - .../components/_solutions_section.scss | 4 - .../public/application/components/home.js | 99 +- .../application/components/home.test.js | 2 +- .../public/components/_overview.scss | 22 +- .../__snapshots__/add_data.test.tsx.snap | 2 +- .../public/components/add_data/add_data.tsx | 2 +- .../getting_started.test.tsx.snap | 24 +- .../getting_started/getting_started.tsx | 2 +- .../__snapshots__/overview.test.tsx.snap | 1641 +++++++---------- .../components/overview/overview.test.tsx | 2 +- .../public/components/overview/overview.tsx | 261 +-- .../public/overview_page/index.ts | 2 +- .../overview_page_actions.test.tsx.snap | 101 + .../index.ts | 2 +- .../overview_page_actions.test.tsx | 51 + .../overview_page_actions.tsx | 88 + .../overview_page_header.test.tsx.snap | 69 - .../_overview_page_header.scss | 14 - .../overview_page_header/index.scss | 1 - .../overview_page_header.test.tsx | 38 - .../overview_page_header.tsx | 141 -- 23 files changed, 1743 insertions(+), 2185 deletions(-) create mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_actions/__snapshots__/overview_page_actions.test.tsx.snap rename src/plugins/kibana_react/public/overview_page/{overview_page_header => overview_page_actions}/index.ts (89%) create mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.test.tsx create mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.tsx delete mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_header/__snapshots__/overview_page_header.test.tsx.snap delete mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_header/_overview_page_header.scss delete mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_header/index.scss delete mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.test.tsx delete mode 100644 src/plugins/kibana_react/public/overview_page/overview_page_header/overview_page_header.tsx diff --git a/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap index b949fa7995d303..153438b34eb475 100644 --- a/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/home.test.js.snap @@ -1,819 +1,707 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`home change home route should render a link to change the default route in advanced settings if advanced settings is enabled 1`] = ` -
- + />, + "rightSideItems": Array [], } - /> -
+ - - - - - - - - -
-
+ + + + + + + +