From ef3455e9d0f09215ef5cd878a33424ca84cda15d Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Wed, 16 Sep 2020 15:16:01 -0400 Subject: [PATCH 1/2] Improve home screen for limited-access users --- .../__snapshots__/home.test.js.snap | 2 + .../public/application/components/home.js | 5 +- .../__snapshots__/manage_data.test.tsx.snap | 3 + .../manage_data/manage_data.test.tsx | 5 + .../components/manage_data/manage_data.tsx | 52 +++---- .../solution_panel.test.tsx.snap | 1 + .../solutions_section/solution_panel.tsx | 1 + .../feature_catalogue_registry.test.ts | 34 +++++ .../feature_catalogue_registry.ts | 7 +- src/plugins/management/public/plugin.ts | 7 +- test/functional/page_objects/home_page.ts | 8 ++ .../server/plugin.ts | 5 +- .../plugins/snapshot_restore/server/plugin.ts | 1 + .../home/feature_controls/home_security.ts | 130 ++++++++++++++++++ .../apps/home/feature_controls/index.ts | 14 ++ x-pack/test/functional/apps/home/index.ts | 14 ++ 16 files changed, 260 insertions(+), 29 deletions(-) create mode 100644 x-pack/test/functional/apps/home/feature_controls/home_security.ts create mode 100644 x-pack/test/functional/apps/home/feature_controls/index.ts create mode 100644 x-pack/test/functional/apps/home/index.ts 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 1b10756c2975c..bf1e8c8f0b401 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 @@ -164,6 +164,7 @@ exports[`home directories should not render directory entry when showOnHomePage {stackManagement ? ( - + `; + +exports[`ManageData render empty without any features 1`] = ``; diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx index 5d00370caf2cc..0e86bf7dd3d84 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.test.tsx @@ -88,4 +88,9 @@ describe('ManageData', () => { ); expect(component).toMatchSnapshot(); }); + + test('render empty without any features', () => { + const component = shallowWithIntl(); + expect(component).toMatchSnapshot(); + }); }); diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.tsx index 0dfb4f949f0c7..85f1bc04f353b 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.tsx @@ -36,31 +36,37 @@ export const ManageData: FC = ({ addBasePath, features }) => ( <> {features.length > 1 &&