From 30ac721477ea27c97818126483341aa4dff5919f Mon Sep 17 00:00:00 2001 From: Alex | Kronox Date: Sat, 21 Oct 2023 12:24:54 +0200 Subject: [PATCH] fix new tabs on comparison --- .../src/components/ComparisonsTable.vue | 7 ++++++- .../src/model/factories/ComparisonFactory.ts | 9 ++------- report-viewer/src/router/index.ts | 2 +- .../src/viewWrapper/ComparisonViewWrapper.vue | 16 +++------------- report-viewer/src/views/ComparisonView.vue | 10 ++-------- 5 files changed, 14 insertions(+), 30 deletions(-) diff --git a/report-viewer/src/components/ComparisonsTable.vue b/report-viewer/src/components/ComparisonsTable.vue index c22f40f70..36fdb83cd 100644 --- a/report-viewer/src/components/ComparisonsTable.vue +++ b/report-viewer/src/components/ComparisonsTable.vue @@ -63,7 +63,12 @@ diff --git a/report-viewer/src/model/factories/ComparisonFactory.ts b/report-viewer/src/model/factories/ComparisonFactory.ts index 355e2c795..03419f6c4 100644 --- a/report-viewer/src/model/factories/ComparisonFactory.ts +++ b/report-viewer/src/model/factories/ComparisonFactory.ts @@ -10,13 +10,8 @@ import { MetricType } from '../MetricType' * Factory class for creating Comparison objects */ export class ComparisonFactory extends BaseFactory { - public static async getComparison(id1: string, id2: string): Promise { - const filePath = store().getComparisonFileName(id1, id2) - if (!filePath) { - throw new Error('Comparison file not specified') - } - - return await this.extractComparison(JSON.parse(await this.getFile(filePath))) + public static async getComparison(fileName: string): Promise { + return await this.extractComparison(JSON.parse(await this.getFile(fileName))) } /** diff --git a/report-viewer/src/router/index.ts b/report-viewer/src/router/index.ts index 31283c13d..2db68f8f4 100644 --- a/report-viewer/src/router/index.ts +++ b/report-viewer/src/router/index.ts @@ -23,7 +23,7 @@ const router = createRouter({ component: OverviewViewWrapper }, { - path: '/comparison/:firstId/:secondId', + path: '/comparison/:comparisonFileName', name: 'ComparisonView', component: ComparisonViewWrapper, props: true diff --git a/report-viewer/src/viewWrapper/ComparisonViewWrapper.vue b/report-viewer/src/viewWrapper/ComparisonViewWrapper.vue index 96395207b..d64490bcb 100644 --- a/report-viewer/src/viewWrapper/ComparisonViewWrapper.vue +++ b/report-viewer/src/viewWrapper/ComparisonViewWrapper.vue @@ -1,11 +1,5 @@