mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Reset embedable interface + reload clears cache
This commit is contained in:
parent
c9400bad79
commit
9221eaea61
4 changed files with 7 additions and 17 deletions
|
@ -41,7 +41,6 @@ import { OptionsListControl } from '../components/options_list_control';
|
|||
import { ControlsDataViewsService } from '../../services/data_views/types';
|
||||
import { ControlsOptionsListService } from '../../services/options_list/types';
|
||||
import { OptionsListField } from '../../../common/options_list/types';
|
||||
import { OptionsListStrings } from '../components/options_list_strings';
|
||||
|
||||
const diffDataFetchProps = (
|
||||
last?: OptionsListDataFetchProps,
|
||||
|
@ -113,10 +112,6 @@ export class OptionsListEmbeddable extends Embeddable<OptionsListEmbeddableInput
|
|||
this.initialize();
|
||||
}
|
||||
|
||||
public getInputPlaceHolder = () =>
|
||||
this.reduxEmbeddableTools.getState().explicitInput.placeholder ??
|
||||
OptionsListStrings.control.getPlaceholder();
|
||||
|
||||
private initialize = async () => {
|
||||
const { selectedOptions: initialSelectedOptions } = this.getInput();
|
||||
if (!initialSelectedOptions) this.setInitializationFinished();
|
||||
|
@ -410,8 +405,9 @@ export class OptionsListEmbeddable extends Embeddable<OptionsListEmbeddableInput
|
|||
return [newFilter];
|
||||
};
|
||||
|
||||
reload = (clearCache: boolean = false) => {
|
||||
if (clearCache) this.optionsListService.clearOptionsListCache();
|
||||
reload = () => {
|
||||
// clear cache when reload is requested
|
||||
this.optionsListService.clearOptionsListCache();
|
||||
this.runOptionsListQuery();
|
||||
};
|
||||
|
||||
|
|
|
@ -156,10 +156,8 @@ export abstract class Container<
|
|||
this.updateInput(panels as Partial<TContainerInput>);
|
||||
}
|
||||
|
||||
public reload(clearCache: boolean = false) {
|
||||
Object.values(this.children).forEach((child) =>
|
||||
child instanceof ErrorEmbeddable ? child.reload() : child.reload(clearCache)
|
||||
);
|
||||
public reload() {
|
||||
Object.values(this.children).forEach((child) => child.reload());
|
||||
}
|
||||
|
||||
public async addNewEmbeddable<
|
||||
|
|
|
@ -119,8 +119,6 @@ export abstract class Embeddable<
|
|||
*
|
||||
* In case if input data did change and reload is requested input$ and output$ would still emit before `reload` is called
|
||||
*
|
||||
* @param clearCache can be passed in case there is cache that needs to cleared before reloading the data
|
||||
*
|
||||
* The order would be as follows:
|
||||
* input$
|
||||
* output$
|
||||
|
@ -128,7 +126,7 @@ export abstract class Embeddable<
|
|||
* ----
|
||||
* updated$
|
||||
*/
|
||||
public abstract reload(clearCache?: boolean): void;
|
||||
public abstract reload(): void;
|
||||
|
||||
/**
|
||||
* Merges input$ and output$ streams and debounces emit till next macro-task.
|
||||
|
|
|
@ -190,10 +190,8 @@ export interface IEmbeddable<
|
|||
/**
|
||||
* Reload the embeddable so output and rendering is up to date. Especially relevant
|
||||
* if the embeddable takes relative time as input (e.g. now to now-15).
|
||||
*
|
||||
* @param clearCache can be passed in case there is a need to clear any cache by the embeddable
|
||||
*/
|
||||
reload(clearCache?: boolean): void;
|
||||
reload(): void;
|
||||
|
||||
/**
|
||||
* An embeddable can return inspector adapters if it wants the inspector to be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue