Skip to content

Commit

Permalink
Merge pull request #2099 from jplag/report-viewer/basecode-all-files-bug
Browse files Browse the repository at this point in the history
Dont display basecode in all files
  • Loading branch information
tsaglam authored Dec 13, 2024
2 parents 697c5d3 + 28228b6 commit 4bd4024
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
"
/>
</VueDraggableNext>
</ScrollableComponent>
Expand All @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions report-viewer/src/model/MatchInSingleFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

0 comments on commit 4bd4024

Please sign in to comment.