From 91d48ff475075691c833ed401cfaf4013c0786d1 Mon Sep 17 00:00:00 2001 From: Scotty Bollinger Date: Thu, 14 Oct 2021 15:01:42 -0500 Subject: [PATCH] [Workplace Search] Fix loading state bug and update button (#115068) * Change source deletion to set entire page loading Do this instead of having the button loading * Replace text button with icon button for blocked windows --- .../synchronization/blocked_window_item.test.tsx | 4 ++-- .../synchronization/blocked_window_item.tsx | 13 +++++++++---- .../views/content_sources/source_logic.ts | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.test.tsx index f3c01b8d94d379..183d336ea62da0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.test.tsx @@ -16,7 +16,7 @@ import { shallow } from 'enzyme'; import moment from 'moment'; import { - EuiButton, + EuiButtonIcon, EuiDatePicker, EuiDatePickerRange, EuiSelect, @@ -53,7 +53,7 @@ describe('BlockedWindowItem', () => { it('handles remove button click', () => { const wrapper = shallow(); - wrapper.find(EuiButton).simulate('click'); + wrapper.find(EuiButtonIcon).simulate('click'); expect(removeBlockedWindow).toHaveBeenCalledWith(0); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx index 272efc6fc3c502..3399f412540040 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx @@ -11,7 +11,7 @@ import { useActions, useValues } from 'kea'; import moment from 'moment'; import { - EuiButton, + EuiButtonIcon, EuiDatePicker, EuiDatePickerRange, EuiFlexGroup, @@ -179,9 +179,14 @@ export const BlockedWindowItem: React.FC = ({ blockedWindow, index }) => /> - removeBlockedWindow(index)}> - {REMOVE_BUTTON} - + removeBlockedWindow(index)} + aria-label={REMOVE_BUTTON} + title={REMOVE_BUTTON} + /> diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts index 9dcd0824cad112..0b67e3f2da79bc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts @@ -112,6 +112,7 @@ export const SourceLogic = kea>({ { setContentSource: () => false, resetSourceState: () => true, + removeContentSource: () => true, }, ], buttonLoading: [ @@ -119,7 +120,6 @@ export const SourceLogic = kea>({ { setButtonNotLoading: () => false, resetSourceState: () => false, - removeContentSource: () => true, }, ], sectionLoading: [