From 448fdb2d3b772b4a860b4c38fdccc28c098c0391 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 8 Mar 2024 14:55:15 +0800 Subject: [PATCH] remove hide import Signed-off-by: Hailong Cui --- .../saved_objects_table.test.tsx.snap | 1 - .../objects_table/components/header.test.tsx | 19 ----------- .../objects_table/components/header.tsx | 32 ++++++++----------- .../objects_table/saved_objects_table.tsx | 5 --- 4 files changed, 13 insertions(+), 44 deletions(-) diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap index 914660040f2b..c501b2c7457b 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap @@ -203,7 +203,6 @@ exports[`SavedObjectsTable should render normally 1`] = ` >
{ onRefresh: () => {}, totalCount: 4, filteredCount: 2, - title: '', }; const component = shallow(
); @@ -48,21 +47,3 @@ describe('Header', () => { expect(component).toMatchSnapshot(); }); }); - -describe('Header - workspace enabled', () => { - it('should hide `Import` button for application home state', () => { - const props = { - onExportAll: () => {}, - onImport: () => {}, - onRefresh: () => {}, - totalCount: 4, - filteredCount: 2, - hideImport: true, - title: 'Saved Objectes', - }; - - const component = shallow(
); - - expect(component.find('EuiButtonEmpty[data-test-subj="importObjects"]').exists()).toBe(false); - }); -}); diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx index 2e19f897342c..a22e349d5240 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx @@ -45,15 +45,11 @@ export const Header = ({ onImport, onRefresh, filteredCount, - hideImport, - title, }: { onExportAll: () => void; onImport: () => void; onRefresh: () => void; filteredCount: number; - hideImport?: boolean; - title: string; }) => ( @@ -86,21 +82,19 @@ export const Header = ({ /> - {!hideImport && ( - - - - - - )} + + + + + {this.renderFlyout()} @@ -1006,8 +1003,6 @@ export class SavedObjectsTable extends Component