mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Anomaly Explorer - ensure viewByFieldName is retained on explorer initialize (#35260)
* Set viewBySwimlane from url on explorer initialize * remove extra line * ensure viewByFieldName passed to updateExplorer
This commit is contained in:
parent
23af014b05
commit
45d56248c0
2 changed files with 8 additions and 2 deletions
|
@ -186,6 +186,10 @@ export const Explorer = injectI18n(
|
|||
let currentSelectedCells = this.state.selectedCells;
|
||||
let currentSwimlaneViewByFieldName = this.state.swimlaneViewByFieldName;
|
||||
|
||||
if (swimlaneViewByFieldName !== undefined) {
|
||||
currentSwimlaneViewByFieldName = swimlaneViewByFieldName;
|
||||
}
|
||||
|
||||
if (selectedCells !== undefined && currentSelectedCells === null) {
|
||||
currentSelectedCells = selectedCells;
|
||||
currentSwimlaneViewByFieldName = swimlaneViewByFieldName;
|
||||
|
@ -625,6 +629,7 @@ export const Explorer = injectI18n(
|
|||
noJobsFound,
|
||||
selectedCells,
|
||||
selectedJobs,
|
||||
swimlaneViewByFieldName
|
||||
} = {
|
||||
...this.state,
|
||||
...stateUpdate
|
||||
|
@ -693,7 +698,7 @@ export const Explorer = injectI18n(
|
|||
);
|
||||
}
|
||||
|
||||
const viewBySwimlaneOptions = getViewBySwimlaneOptions(selectedJobs, this.state.swimlaneViewByFieldName);
|
||||
const viewBySwimlaneOptions = getViewBySwimlaneOptions(selectedJobs, swimlaneViewByFieldName);
|
||||
Object.assign(stateUpdate, viewBySwimlaneOptions);
|
||||
if (selectedCells !== null && selectedCells.showTopFieldValues === true) {
|
||||
// this.setState({ viewBySwimlaneData: getDefaultViewBySwimlaneData(), viewBySwimlaneDataLoading: true });
|
||||
|
|
|
@ -88,7 +88,7 @@ module.controller('MlExplorerController', function (
|
|||
|
||||
mlExplorerDashboardService.init();
|
||||
|
||||
function jobSelectionUpdate(action, { fullJobs, selectedCells, selectedJobIds }) {
|
||||
function jobSelectionUpdate(action, { fullJobs, selectedCells, selectedJobIds, swimlaneViewByFieldName }) {
|
||||
const jobs = createJobs(fullJobs).map((job) => {
|
||||
job.selected = selectedJobIds.some((id) => job.id === id);
|
||||
return job;
|
||||
|
@ -107,6 +107,7 @@ module.controller('MlExplorerController', function (
|
|||
noJobsFound,
|
||||
selectedCells,
|
||||
selectedJobs,
|
||||
swimlaneViewByFieldName
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue