Skip to content

Commit

Permalink
added link to inspection details page
Browse files Browse the repository at this point in the history
  • Loading branch information
retailcoder committed Jul 28, 2020
1 parent 60055fc commit b3a9dc5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Rubberduck.Core/UI/Inspections/InspectionResultsControl.xaml
Expand Up @@ -278,6 +278,11 @@
Visibility="{Binding CanDisableInspection, Converter={StaticResource BoolToVisibility}}"
Command="{Binding DisableInspectionCommand}"
Content="{Resx ResxName=Rubberduck.Resources.Inspections.InspectionsUI, Key=DisableThisInspection}" />

<controls:LinkButton Margin="4"
Command="{Binding OpenInspectionDetailsPageCommand}"
Content="{Binding InspectionDetailsUrl}" />

</StackPanel>
</ScrollViewer>
</Border>
Expand Down
14 changes: 12 additions & 2 deletions Rubberduck.Core/UI/Inspections/InspectionResultsViewModel.cs
Expand Up @@ -144,6 +144,8 @@ public sealed class InspectionResultsViewModel : ViewModelBase, INavigateSelecti
OpenInspectionSettings = new DelegateCommand(LogManager.GetCurrentClassLogger(), OpenSettings);
CollapseAllCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteCollapseAll);
ExpandAllCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteExpandAll);

OpenInspectionDetailsPageCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteOpenInspectionDetailsPageCommand);

QuickFixCommands = new List<(ICommand command, string key, Func<IQuickFix, bool> visibility)>
{
Expand Down Expand Up @@ -195,6 +197,8 @@ public INavigateSource SelectedItem
get => _selectedItem;
set
{
SelectedInspection = null;
CanQuickFix = false;
if (value == _selectedItem)
{
return;
Expand All @@ -203,8 +207,6 @@ public INavigateSource SelectedItem
_selectedItem = value;
OnPropertyChanged();
OnPropertyChanged(nameof(QuickFixes));
SelectedInspection = null;
CanQuickFix = false;

if (_selectedItem is IInspectionResult inspectionResult)
{
Expand All @@ -225,6 +227,7 @@ public IInspection SelectedInspection
{
_selectedInspection = value;
OnPropertyChanged();
OnPropertyChanged(nameof(InspectionDetailsUrl));
}
}

Expand Down Expand Up @@ -354,6 +357,7 @@ private bool InspectionFilter(IInspectionResult result)
public CommandBase OpenInspectionSettings { get; }
public CommandBase CollapseAllCommand { get; }
public CommandBase ExpandAllCommand { get; }
public CommandBase OpenInspectionDetailsPageCommand { get; }

private void ExecuteCollapseAll(object parameter)
{
Expand Down Expand Up @@ -767,6 +771,12 @@ public bool CanDisableInspection
}
}

public string InspectionDetailsUrl => _selectedInspection == null
? "https://rubberduckvba.com/inspections"
: $"https://rubberduckvba.com/inspections/details/{_selectedInspection.AnnotationName}";

private void ExecuteOpenInspectionDetailsPageCommand(object parameter) => Process.Start(new ProcessStartInfo(InspectionDetailsUrl));

private static readonly List<(string Name, hAlignment alignment)> ResultColumns = new List<(string Name, hAlignment alignment)>
{
(Resources.Inspections.InspectionsUI.ExportColumnHeader_Type, hAlignment.Left),
Expand Down

0 comments on commit b3a9dc5

Please sign in to comment.