Skip to content

Commit b3a9dc5

Browse files
committed
added link to inspection details page
1 parent 60055fc commit b3a9dc5

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Rubberduck.Core/UI/Inspections/InspectionResultsControl.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@
278278
Visibility="{Binding CanDisableInspection, Converter={StaticResource BoolToVisibility}}"
279279
Command="{Binding DisableInspectionCommand}"
280280
Content="{Resx ResxName=Rubberduck.Resources.Inspections.InspectionsUI, Key=DisableThisInspection}" />
281+
282+
<controls:LinkButton Margin="4"
283+
Command="{Binding OpenInspectionDetailsPageCommand}"
284+
Content="{Binding InspectionDetailsUrl}" />
285+
281286
</StackPanel>
282287
</ScrollViewer>
283288
</Border>

Rubberduck.Core/UI/Inspections/InspectionResultsViewModel.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ public InspectionResultsViewModel(
144144
OpenInspectionSettings = new DelegateCommand(LogManager.GetCurrentClassLogger(), OpenSettings);
145145
CollapseAllCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteCollapseAll);
146146
ExpandAllCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteExpandAll);
147+
148+
OpenInspectionDetailsPageCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteOpenInspectionDetailsPageCommand);
147149

148150
QuickFixCommands = new List<(ICommand command, string key, Func<IQuickFix, bool> visibility)>
149151
{
@@ -195,6 +197,8 @@ public INavigateSource SelectedItem
195197
get => _selectedItem;
196198
set
197199
{
200+
SelectedInspection = null;
201+
CanQuickFix = false;
198202
if (value == _selectedItem)
199203
{
200204
return;
@@ -203,8 +207,6 @@ public INavigateSource SelectedItem
203207
_selectedItem = value;
204208
OnPropertyChanged();
205209
OnPropertyChanged(nameof(QuickFixes));
206-
SelectedInspection = null;
207-
CanQuickFix = false;
208210

209211
if (_selectedItem is IInspectionResult inspectionResult)
210212
{
@@ -225,6 +227,7 @@ public IInspection SelectedInspection
225227
{
226228
_selectedInspection = value;
227229
OnPropertyChanged();
230+
OnPropertyChanged(nameof(InspectionDetailsUrl));
228231
}
229232
}
230233

@@ -354,6 +357,7 @@ private bool InspectionFilter(IInspectionResult result)
354357
public CommandBase OpenInspectionSettings { get; }
355358
public CommandBase CollapseAllCommand { get; }
356359
public CommandBase ExpandAllCommand { get; }
360+
public CommandBase OpenInspectionDetailsPageCommand { get; }
357361

358362
private void ExecuteCollapseAll(object parameter)
359363
{
@@ -767,6 +771,12 @@ public bool CanDisableInspection
767771
}
768772
}
769773

774+
public string InspectionDetailsUrl => _selectedInspection == null
775+
? "https://rubberduckvba.com/inspections"
776+
: $"https://rubberduckvba.com/inspections/details/{_selectedInspection.AnnotationName}";
777+
778+
private void ExecuteOpenInspectionDetailsPageCommand(object parameter) => Process.Start(new ProcessStartInfo(InspectionDetailsUrl));
779+
770780
private static readonly List<(string Name, hAlignment alignment)> ResultColumns = new List<(string Name, hAlignment alignment)>
771781
{
772782
(Resources.Inspections.InspectionsUI.ExportColumnHeader_Type, hAlignment.Left),

0 commit comments

Comments
 (0)