From 28228b6a3e6affa34f5822e590f4e6d318ad18b7 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Tue, 3 Dec 2024 08:54:57 +0100 Subject: [PATCH] only display basecode for given file --- .../src/components/fileDisplaying/FilesContainer.vue | 5 ++++- report-viewer/src/model/MatchInSingleFile.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/report-viewer/src/components/fileDisplaying/FilesContainer.vue b/report-viewer/src/components/fileDisplaying/FilesContainer.vue index ba868150ff..f3bc3c3276 100644 --- a/report-viewer/src/components/fileDisplaying/FilesContainer.vue +++ b/report-viewer/src/components/fileDisplaying/FilesContainer.vue @@ -26,7 +26,9 @@ :highlight-language="highlightLanguage" @match-selected="(match: Match) => $emit('matchSelected', match)" class="mt-1 first:mt-0" - :base-code-matches="baseCodeMatches" + :base-code-matches=" + baseCodeMatches.filter((match) => slash(match.fileName) === file.fileName) + " /> @@ -50,6 +52,7 @@ import { FileSortingOptions } from '@/model/ui/FileSortingOptions' import { store } from '@/stores/store' import type { BaseCodeMatch } from '@/model/BaseCodeReport' import type { Match } from '@/model/Match' +import slash from 'slash' library.add(faCompressAlt) diff --git a/report-viewer/src/model/MatchInSingleFile.ts b/report-viewer/src/model/MatchInSingleFile.ts index 1c62b1cd54..5699be5537 100644 --- a/report-viewer/src/model/MatchInSingleFile.ts +++ b/report-viewer/src/model/MatchInSingleFile.ts @@ -56,4 +56,12 @@ export class MatchInSingleFile { return this._match.endInSecond.column } } + + get fileName(): string { + if (this._index === 1) { + return this._match.firstFile + } else { + return this._match.secondFile + } + } }