diff --git a/src/components/Workflows.vue b/src/components/Workflows.vue index 9ad66e6..773a57c 100644 --- a/src/components/Workflows.vue +++ b/src/components/Workflows.vue @@ -50,6 +50,7 @@ } workflowsStore.runs = await api.getRuns() + workflowsStore.latestRuns = await api.getLatestRuns() workflowsStore.gt = await api.getGroundTruth() workflowsStore.workflows = await api.getWorkflows() @@ -58,6 +59,11 @@ if (!workflowsStore.gt.find(gt => gt.id === gtId)) console.log(gtId) }) + workflowsStore.latestRuns.forEach(run => { + const gtId = mapGtId(run.metadata.gt_workspace.id) + + if (!workflowsStore.gt.find(gt => gt.id === gtId)) console.log(gtId) + }) const releasesObj = workflowsStore.runs.reduce((acc, cur) => { acc[cur.metadata.release_info.tag_name] = cur.metadata.release_info diff --git a/src/helpers/api.ts b/src/helpers/api.ts index 98dc337..dccf74c 100644 --- a/src/helpers/api.ts +++ b/src/helpers/api.ts @@ -38,8 +38,14 @@ async function getLatestRuns(gtId?: string, workflowId?: string): Promise EvaluationRun[] getLatestRuns: () => EvaluationRun[], @@ -19,6 +20,7 @@ export default reactive<{ gt: [], workflows: [], runs: [], + latestRuns: [], releases: [], getRuns(gtId: string, workflowId?: string) { return this.runs @@ -32,12 +34,7 @@ export default reactive<{ ) }, getLatestRuns() { - const dates = Object.keys(this.runs.reduce((acc, cur) => { - acc[normalizeDate(cur.metadata.timestamp)] = null - return acc - }, <{ [key: string]: null}>{})) - - return this.runs.filter(({ metadata }) => normalizeDate(metadata.timestamp) === dates[dates.length - 1]) + return this.latestRuns }, getGtById(id: string): GroundTruth | null { return this.gt.find((item) => item.id === id) ?? null