Skip to content

Commit

Permalink
[UiActions] fix race condition registering actions (elastic#90944)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Feb 11, 2021
1 parent 8aaf168 commit 99fc9bb
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/plugins/data/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,10 @@ export class DataPublicPlugin
});

uiActions.registerTrigger(applyFilterTrigger);

uiActions.registerAction(
createFilterAction(queryService.filterManager, queryService.timefilter.timefilter)
);

uiActions.addTriggerAction(
'SELECT_RANGE_TRIGGER',
createSelectRangeAction(() => ({
uiActions: startServices().plugins.uiActions,
}))
);

uiActions.addTriggerAction(
'VALUE_CLICK_TRIGGER',
createValueClickAction(() => ({
uiActions: startServices().plugins.uiActions,
}))
);

inspector.registerView(
getTableViewDescription(() => ({
uiActions: startServices().plugins.uiActions,
Expand Down Expand Up @@ -179,6 +164,20 @@ export class DataPublicPlugin
const search = this.searchService.start(core, { fieldFormats, indexPatterns });
setSearchService(search);

uiActions.addTriggerAction(
'SELECT_RANGE_TRIGGER',
createSelectRangeAction(() => ({
uiActions,
}))
);

uiActions.addTriggerAction(
'VALUE_CLICK_TRIGGER',
createValueClickAction(() => ({
uiActions,
}))
);

uiActions.addTriggerAction(
APPLY_FILTER_TRIGGER,
uiActions.getAction(ACTION_GLOBAL_APPLY_FILTER)
Expand Down

0 comments on commit 99fc9bb

Please sign in to comment.