Skip to content

Commit

Permalink
[ML] Swim lane pagination for viewing by job id (#76847)
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Sep 7, 2020
1 parent f5b4aac commit 15603c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {

import { MlTooltipComponent } from '../../application/components/chart_tooltip';
import { SwimLanePagination } from './swimlane_pagination';
import { SWIMLANE_TYPE } from './explorer_constants';
import { ViewBySwimLaneData } from './explorer_utils';

/**
Expand Down Expand Up @@ -94,7 +93,6 @@ export const SwimlaneContainer: FC<
(showSwimlane || isLoading) &&
swimlaneLimit !== undefined &&
onPaginationChange &&
props.swimlaneType === SWIMLANE_TYPE.VIEW_BY &&
fromPage &&
perPage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,8 @@ const ExplorerUrlStateManager: FC<ExplorerUrlStateManagerProps> = ({ jobsWithTim
loadExplorerData({
...loadExplorerDataConfig,
swimlaneLimit:
explorerState?.viewBySwimlaneData &&
isViewBySwimLaneData(explorerState?.viewBySwimlaneData)
? explorerState?.viewBySwimlaneData.cardinality
: undefined,
isViewBySwimLaneData(explorerState?.viewBySwimlaneData) &&
explorerState?.viewBySwimlaneData.cardinality,
});
}
}, [JSON.stringify(loadExplorerDataConfig)]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ export function resultsServiceProvider(mlApiServices) {
},
},
aggs: {
jobsCardinality: {
cardinality: {
field: 'job_id',
},
},
jobId: {
terms: {
field: 'job_id',
Expand Down Expand Up @@ -147,6 +152,7 @@ export function resultsServiceProvider(mlApiServices) {
});
obj.results[jobId] = resultsForTime;
});
obj.cardinality = resp.aggregations?.jobsCardinality?.value ?? 0;

resolve(obj);
})
Expand Down

0 comments on commit 15603c1

Please sign in to comment.