Skip to content

Commit

Permalink
[Workplace Search] Fix loading state bug and update button (elastic#1…
Browse files Browse the repository at this point in the history
…15068)

* 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
  • Loading branch information
scottybollinger authored and kibanamachine committed Oct 14, 2021
1 parent 874325d commit 274117b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { shallow } from 'enzyme';
import moment from 'moment';

import {
EuiButton,
EuiButtonIcon,
EuiDatePicker,
EuiDatePickerRange,
EuiSelect,
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('BlockedWindowItem', () => {

it('handles remove button click', () => {
const wrapper = shallow(<BlockedWindowItem {...props} />);
wrapper.find(EuiButton).simulate('click');
wrapper.find(EuiButtonIcon).simulate('click');

expect(removeBlockedWindow).toHaveBeenCalledWith(0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useActions, useValues } from 'kea';
import moment from 'moment';

import {
EuiButton,
EuiButtonIcon,
EuiDatePicker,
EuiDatePickerRange,
EuiFlexGroup,
Expand Down Expand Up @@ -179,9 +179,14 @@ export const BlockedWindowItem: React.FC<Props> = ({ blockedWindow, index }) =>
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton fill color="danger" onClick={() => removeBlockedWindow(index)}>
{REMOVE_BUTTON}
</EuiButton>
<EuiButtonIcon
display="base"
iconType="trash"
color="danger"
onClick={() => removeBlockedWindow(index)}
aria-label={REMOVE_BUTTON}
title={REMOVE_BUTTON}
/>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="s" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ export const SourceLogic = kea<MakeLogicType<SourceValues, SourceActions>>({
{
setContentSource: () => false,
resetSourceState: () => true,
removeContentSource: () => true,
},
],
buttonLoading: [
false,
{
setButtonNotLoading: () => false,
resetSourceState: () => false,
removeContentSource: () => true,
},
],
sectionLoading: [
Expand Down

0 comments on commit 274117b

Please sign in to comment.