mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ES|QL] Makes the clear control button optional (#212848)
## Summary Closes https://github.com/elastic/kibana/issues/212605 Here we are removing the clear button from the ES|QL control as clearing will result in wrong charts. I also considered the reset but when there is no changes should be hidden or disabled. This seems to me as a smaller change and taken under consideration that dashboard already allows resetting I think it is ok to remove it. We can always reconsider if any user complains. Although by removing the clearSelections from the control config removes the button the `DefaultControlApi ` was marking it as required. So I had to tweak a bit the types.
This commit is contained in:
parent
7f32eb0225
commit
f6978eaf7b
3 changed files with 2 additions and 5 deletions
|
@ -180,7 +180,7 @@ export const SearchExample = ({ data, dataView, navigation }: Props) => {
|
|||
onClick={() => {
|
||||
if (controlGroupAPI) {
|
||||
Object.values(controlGroupAPI.children$.getValue()).forEach((controlApi) => {
|
||||
(controlApi as DefaultControlApi)?.clearSelections();
|
||||
(controlApi as DefaultControlApi)?.clearSelections?.();
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
|
|
@ -96,9 +96,6 @@ export const getESQLControlFactory = (): ControlFactory<ESQLControlState, ESQLCo
|
|||
references: [],
|
||||
};
|
||||
},
|
||||
clearSelections: () => {
|
||||
// do nothing, not allowed for now;
|
||||
},
|
||||
},
|
||||
{
|
||||
...defaultControl.comparators,
|
||||
|
|
|
@ -36,7 +36,7 @@ export type DefaultControlApi = PublishesDataLoading &
|
|||
PublishesBlockingError &
|
||||
PublishesUnsavedChanges &
|
||||
Partial<PublishesTitle & PublishesDisabledActionIds & HasCustomPrepend> &
|
||||
CanClearSelections &
|
||||
Partial<CanClearSelections> &
|
||||
HasType &
|
||||
HasUniqueId &
|
||||
HasSerializableState<DefaultControlState> &
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue