1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix bug in computation of cronJob statuses

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-03-09 14:58:54 -05:00
parent d9721bfc75
commit f17acccda1

View File

@ -4,16 +4,17 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx";
import computeStatusCountsForOwnersInjectable from "../../utils/compute-status-counts.injectable";
import cronJobStoreInjectable from "./store.injectable";
const totalStatusesForCronJobsInSelectedNamespacesInjectable = getInjectable({
id: "total-statuses-for-cron-jobs-in-selected-namespaces",
instantiate: (di) => {
const cronJobStore = di.inject(cronJobStoreInjectable);
const computeStatusCountsForOwners = di.inject(computeStatusCountsForOwnersInjectable);
return computed(() => computeStatusCountsForOwners(cronJobStore.contextItems));
return computed(() => new Map(cronJobStore.contextItems.map(cronJob => [
cronJob.getId(),
[cronJob.getStatus()],
])));
},
});