Skip to content

Commit 72bc293

Browse files
authored
fix: title for OSS issue tree node (#353)
1 parent 606af38 commit 72bc293

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Snyk Security Changelog
22

3+
## [2.1.1]
4+
### Changed
5+
### Fixed
6+
- Title for OSS issue tree node.
7+
38
## [2.1.0]
49
### Changed
510
- New Summary Panel for scan information and Net New Issues filtering.
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using System.Linq;
34

45
namespace Snyk.VisualStudio.Extension.UI.Tree
56
{
67
public class OssFileTreeNode : FileTreeNode
78
{
89
public OssFileTreeNode(TreeNode parent) : base(parent) { }
9-
public override string Title => this.ProjectName.Replace("/", "\\") + "\\" + this.DisplayTargetFile;
10+
11+
public override string Title
12+
{
13+
get
14+
{
15+
var mainDirUri = new Uri(FolderName);
16+
var fileUri = new Uri(FileName);
17+
var relativeUri = mainDirUri.MakeRelativeUri(fileUri);
18+
return Uri.UnescapeDataString(relativeUri.ToString()).Replace("/", "\\");
19+
}
20+
}
21+
1022
public override string Icon => SnykIconProvider.GetPackageManagerIcon(this.PackageManager);
11-
private string ProjectName => this.IssueList.FirstOrDefault()?.AdditionalData?.ProjectName ?? "";
1223
private string PackageManager => this.IssueList.FirstOrDefault()?.AdditionalData?.PackageManager ?? "";
13-
private string DisplayTargetFile => Path.GetFileName(this.IssueList.FirstOrDefault()?.AdditionalData?.DisplayTargetFile ?? "");
1424
}
1525
}

0 commit comments

Comments
 (0)