Skip to content

Commit 32c2437

Browse files
authored
[ML] Swim lane pagination for viewing by job id (#76847) (#76858)
1 parent e653b6d commit 32c2437

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { ExplorerSwimlane, ExplorerSwimlaneProps } from './explorer_swimlane';
1919

2020
import { MlTooltipComponent } from '../components/chart_tooltip';
2121
import { SwimLanePagination } from './swimlane_pagination';
22-
import { SWIMLANE_TYPE } from './explorer_constants';
2322
import { ViewBySwimLaneData } from './explorer_utils';
2423

2524
/**
@@ -91,7 +90,6 @@ export const SwimlaneContainer: FC<
9190
(showSwimlane || isLoading) &&
9291
swimlaneLimit !== undefined &&
9392
onPaginationChange &&
94-
props.swimlaneType === SWIMLANE_TYPE.VIEW_BY &&
9593
fromPage &&
9694
perPage;
9795

x-pack/plugins/ml/public/application/routing/routes/explorer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,8 @@ const ExplorerUrlStateManager: FC<ExplorerUrlStateManagerProps> = ({ jobsWithTim
218218
loadExplorerData({
219219
...loadExplorerDataConfig,
220220
swimlaneLimit:
221-
explorerState?.viewBySwimlaneData &&
222-
isViewBySwimLaneData(explorerState?.viewBySwimlaneData)
223-
? explorerState?.viewBySwimlaneData.cardinality
224-
: undefined,
221+
isViewBySwimLaneData(explorerState?.viewBySwimlaneData) &&
222+
explorerState?.viewBySwimlaneData.cardinality,
225223
});
226224
}
227225
}, [JSON.stringify(loadExplorerDataConfig)]);

x-pack/plugins/ml/public/application/services/results_service/results_service.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export function resultsServiceProvider(mlApiServices) {
8888
},
8989
},
9090
aggs: {
91+
jobsCardinality: {
92+
cardinality: {
93+
field: 'job_id',
94+
},
95+
},
9196
jobId: {
9297
terms: {
9398
field: 'job_id',
@@ -148,6 +153,7 @@ export function resultsServiceProvider(mlApiServices) {
148153
});
149154
obj.results[jobId] = resultsForTime;
150155
});
156+
obj.cardinality = resp.aggregations?.jobsCardinality?.value ?? 0;
151157

152158
resolve(obj);
153159
})

0 commit comments

Comments
 (0)