Skip to content

Commit

Permalink
refactor: Replace "Remediation" with "Fix" in OSS report (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asaf Agami authored Jun 16, 2022
1 parent 2f8b268 commit c6fd56c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Snyk Changelog

## [1.1.21]

### Changed
- Replace the word "Remediation" with "Fix" in OSS report

## [1.1.20]

### Fixed
Expand Down
5 changes: 3 additions & 2 deletions Snyk.VisualStudio.Extension.Shared/CLI/Vulnerability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ public class Vulnerability : IComparable<Vulnerability>
public Identifiers Identifiers { get; set; }

/// <summary>
/// Gets a value indicating whether remediation.
/// Gets a string with the fixed versions from <see cref="FixedIn"/> separated by a comma,
/// or an empty string if <see cref="FixedIn"/> is null or empty.
/// </summary>
public string FixedInRemediation => this.FixedIn == null ? string.Empty : string.Join(", ", this.FixedIn);
public string FixedInDisplayText => this.FixedIn == null ? string.Empty : string.Join(", ", this.FixedIn);

/// <summary>
/// Gets a value indicating whether URL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>

<c:TextField Grid.Row="0" Grid.ColumnSpan="2" Text="Detailed paths and remediation" FontSize="16" Margin="5, 10, 5, 5"/>
<c:TextField Grid.Row="0" Grid.ColumnSpan="2" Text="Detailed paths and fix" FontSize="16" Margin="5, 10, 5, 5"/>

<c:TextField Grid.Row="1" Grid.Column="0" Text="Remediation:" FontWeight="Bold" FontSize="12" Margin="5, 5, 5, 5"/>
<c:TextField Grid.Row="1" Grid.Column="1" x:Name="remediation" Text="" FontSize="12" Margin="5, 5, 5, 5" TextWrapping="Wrap"/>
<c:TextField Grid.Row="1" Grid.Column="0" Text="Fix:" FontWeight="Bold" FontSize="12" Margin="5, 5, 5, 5"/>
<c:TextField Grid.Row="1" Grid.Column="1" x:Name="fix" Text="" FontSize="12" Margin="5, 5, 5, 5" TextWrapping="Wrap"/>

<c:TextField Grid.Row="2" Grid.Column="0" Text="Introduced through:" FontWeight="Bold" FontSize="12" Margin="5, 5, 5, 5"/>
<c:TextField Grid.Row="2" Grid.Column="1" x:Name="detaiedIntroducedThrough" Text="" FontSize="12" Margin="5, 5, 5, 5" TextWrapping="Wrap"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public Vulnerability Vulnerability

this.introducedThrough.Text = introducedThroughText;
this.exploitMaturity.Text = vulnerability.Exploit;
this.fixedIn.Text = string.IsNullOrWhiteSpace(vulnerability.FixedInRemediation)
? $"There is no fixed version for {vulnerability.Name}" : vulnerability.FixedInRemediation;
this.fixedIn.Text = string.IsNullOrWhiteSpace(vulnerability.FixedInDisplayText)
? $"There is no fixed version for {vulnerability.Name}" : vulnerability.FixedInDisplayText;

string detaiedIntroducedThroughText = vulnerability.From != null && vulnerability.From.Length != 0
? string.Join(" > ", vulnerability.From) : string.Empty;

this.detaiedIntroducedThrough.Text = detaiedIntroducedThroughText;

this.remediation.Text = vulnerability.FixedIn != null && vulnerability.FixedIn.Length != 0
this.fix.Text = vulnerability.FixedIn != null && vulnerability.FixedIn.Length != 0
? "Upgrade to " + string.Join(" > ", vulnerability.FixedIn) : string.Empty;

this.overview.Html = new MarkdownSharp.Markdown().Transform(vulnerability.Description);
Expand Down

0 comments on commit c6fd56c

Please sign in to comment.