Skip to content

Commit

Permalink
fix: replace issues link with support link (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asaf Agami authored Oct 26, 2022
1 parent 0339ebf commit 291007e
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Snyk.VisualStudio.Extension.Shared.UI
{
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Microsoft.VisualStudio.Imaging;
using Microsoft.VisualStudio.Shell;
Expand All @@ -13,14 +14,18 @@
/// </summary>
public class VsInfoBarService : IVsInfoBarUIEvents
{
private const string ContactSupport = "contactSupport";
private const string KnownCaveats = "knownCaveats";
private const string SupportLink = "https://support.snyk.io/hc/en-us/requests/new";
private const string KnownCaveatsLink = "https://docs.snyk.io/ide-tools/visual-studio-extension/troubleshooting-and-known-issues-with-visual-studio-extension";
private readonly ISnykServiceProvider serviceProvider;

private uint cookie;

/// <summary>
/// Cache/save all displayed messages for prevent display same message multiple times.
/// </summary>
private IDictionary<string, IVsInfoBarUIElement> messagesCache;
private readonly IDictionary<string, IVsInfoBarUIElement> messagesCache;

/// <summary>
/// Initializes a new instance of the <see cref="VsInfoBarService"/> class.
Expand Down Expand Up @@ -56,14 +61,14 @@ public void OnActionItemClicked(IVsInfoBarUIElement infoBarUIElement, IVsInfoBar
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

if (actionItem.ActionContext == "submitIssue")
if (actionItem.ActionContext == ContactSupport)
{
System.Diagnostics.Process.Start("https://github.com/snyk/snyk-visual-studio-plugin/issues");
Process.Start(SupportLink);
}

if (actionItem.ActionContext == "knownCaveats")
if (actionItem.ActionContext == KnownCaveats)
{
System.Diagnostics.Process.Start("https://github.com/snyk/snyk-visual-studio-plugin#known-caveats");
Process.Start(KnownCaveatsLink);
}

return Task.CompletedTask;
Expand All @@ -83,8 +88,8 @@ public void ShowErrorInfoBar(string message) => ThreadHelper.JoinableTaskFactory
}

var text = new InfoBarTextSpan(message);
var submitIssueLink = new InfoBarHyperlink("Submit an issue", "submitIssue");
var knownCaveatsLink = new InfoBarHyperlink("Known Caveats", "knownCaveats");
var submitIssueLink = new InfoBarHyperlink("Contact support", ContactSupport);
var knownCaveatsLink = new InfoBarHyperlink("Known Caveats", KnownCaveats);

var spans = new InfoBarTextSpan[] { text };
var actions = new InfoBarActionItem[] { knownCaveatsLink, submitIssueLink, };
Expand Down

0 comments on commit 291007e

Please sign in to comment.