-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit * Move event subscription to extension base class + add property changed filter to rules * comment updates * Update LinterExtensionBase.cs * Update InputNodesNotAllowedRule.cs * Add Deactivate method to linterExtensionBase + LinterManager tests * comment updates * Initial commit * Add issues count to WorkspaceSaving * add scrollviewer * Dispose LinterManager * Make concrete issues internal * summaries on IRuleIssue * comment updates * Update severity code icon * Serialize linter manager to dyn file * clear ruleEvaluationResults on workspace change * Remove test extension * Show names instead of GUIDs * add help doc * clean up * Handle GraphRuleEvaluationResults nodeIds changes * Update LintingViewExtension.csproj * Update LintingViewExtension.csproj * Update SerializationConverters.cs * Fix failing serialization test * comment updates * revert changes to test file * fix available linters binding * add rules back in test ext * comment updates * remove output path * Update LinterManagerTests.cs * comment updates * hide LinterViewExtension and LinterExtensionBase * Update LinterViewModel.cs
- Loading branch information
Showing
42 changed files
with
2,371 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using Dynamo.Graph.Nodes; | ||
using Dynamo.Linting.Rules; | ||
|
||
namespace Dynamo.LintingViewExtension.Controls | ||
{ | ||
internal class GraphRuleIssue : IRuleIssue | ||
{ | ||
public string Id { get; } | ||
public LinterRule Rule { get; } | ||
public ObservableCollection<NodeModel> AffectedNodes { get; private set; } | ||
|
||
public GraphRuleIssue(string id, GraphLinterRule rule) | ||
{ | ||
Id = id; | ||
Rule = rule; | ||
AffectedNodes = new ObservableCollection<NodeModel>(); | ||
} | ||
|
||
public void AddAffectedNodes(List<NodeModel> nodes) | ||
{ | ||
nodes.ForEach(x => AffectedNodes.Add(x)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using Dynamo.Graph.Nodes; | ||
using Dynamo.Linting.Rules; | ||
|
||
namespace Dynamo.LintingViewExtension | ||
{ | ||
public interface IRuleIssue | ||
{ | ||
/// <summary> | ||
/// Collection of nodeIds affected by this rule issue | ||
/// </summary> | ||
ObservableCollection<NodeModel> AffectedNodes { get; } | ||
|
||
/// <summary> | ||
/// Id of the rule this issue comes from | ||
/// </summary> | ||
string Id { get; } | ||
|
||
/// <summary> | ||
/// Rule this issue comes from | ||
/// </summary> | ||
LinterRule Rule { get; } | ||
|
||
/// <summary> | ||
/// Adds a list of affected nodes to this issue | ||
/// </summary> | ||
/// <param name="nodes"></param> | ||
void AddAffectedNodes(List<NodeModel> nodes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<UserControl x:Class="Dynamo.LintingViewExtension.Controls.IssueGroup" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Dynamo.LintingViewExtension.Controls" | ||
xmlns:converter="clr-namespace:Dynamo.LintingViewExtension.Converters" | ||
xmlns:severity="clr-namespace:Dynamo.Linting.Interfaces;assembly=DynamoCore" | ||
xmlns:fa="http://schemas.fontawesome.io/icons/" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800"> | ||
|
||
<UserControl.Resources> | ||
<ResourceDictionary> | ||
<converter:SeverityCodeToColorConverter x:Key="SeverityCodeToColorConverter" /> | ||
<converter:SeverityCodeToIconConverter x:Key="SeverityCodeToIconConverter" /> | ||
<converter:CollectionToVisibilityConverter x:Key="CollectionToVisibilityConverter" /> | ||
|
||
<Style TargetType="{x:Type TextBlock}"> | ||
<Setter Property="Foreground" | ||
Value="White" /> | ||
<Setter Property="FontSize" | ||
Value="12" /> | ||
</Style> | ||
</ResourceDictionary> | ||
</UserControl.Resources> | ||
|
||
<UserControl.Template> | ||
<ControlTemplate TargetType="{x:Type UserControl}"> | ||
<Grid DataContext="{ | ||
Binding RelativeSource={ | ||
RelativeSource FindAncestor, AncestorType=local:IssueGroup}}"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="16" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
|
||
<fa:ImageAwesome Height="15" | ||
Grid.Column="0" | ||
Icon="{Binding SeverityCode, Converter={StaticResource SeverityCodeToIconConverter}}" | ||
Foreground="{Binding SeverityCode, Converter={StaticResource SeverityCodeToColorConverter}}"> | ||
</fa:ImageAwesome> | ||
<TextBlock Text="{Binding Description, FallbackValue='Header description'}" | ||
Grid.Column="1" | ||
TextWrapping="WrapWithOverflow" | ||
VerticalAlignment="Center" | ||
Margin="15 5" /> | ||
|
||
<ContentPresenter Grid.Row="1" | ||
Grid.Column="1" | ||
Margin="15 5" | ||
Visibility="{Binding NodeIds, Converter={StaticResource CollectionToVisibilityConverter}}"/> | ||
|
||
<TextBlock Text="{Binding CallToAction, FallbackValue='Call to action'}" | ||
Grid.Row="2" | ||
Grid.Column="1" | ||
TextWrapping="WrapWithOverflow" | ||
FontWeight="Bold" | ||
Margin="15 5" /> | ||
|
||
<Separator Grid.Row="3" Grid.ColumnSpan="2"/> | ||
</Grid> | ||
</ControlTemplate> | ||
</UserControl.Template> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System.Collections.Generic; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using Dynamo.Graph.Nodes; | ||
using Dynamo.Linting.Interfaces; | ||
using Dynamo.Linting.Rules; | ||
|
||
namespace Dynamo.LintingViewExtension.Controls | ||
{ | ||
/// <summary> | ||
/// Interaction logic for IssueGroup.xaml | ||
/// </summary> | ||
public partial class IssueGroup : UserControl | ||
{ | ||
#region DependencyProperties | ||
|
||
internal IEnumerable<NodeModel> IssueNodes | ||
{ | ||
get { return (IEnumerable<NodeModel>)GetValue(IssueNodesProperty); } | ||
set { SetValue(IssueNodesProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty IssueNodesProperty = DependencyProperty.Register( | ||
nameof(IssueNodes), | ||
typeof(IEnumerable<NodeModel>), | ||
typeof(IssueGroup) | ||
); | ||
|
||
public string Description | ||
{ | ||
get { return (string)GetValue(DescriptionProperty); } | ||
set { SetValue(DescriptionProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( | ||
nameof(Description), | ||
typeof(string), | ||
typeof(IssueGroup) | ||
); | ||
|
||
public string CallToAction | ||
{ | ||
get { return (string)GetValue(CallToActionProperty); } | ||
set { SetValue(CallToActionProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty CallToActionProperty = DependencyProperty.Register( | ||
nameof(CallToAction), | ||
typeof(string), | ||
typeof(IssueGroup) | ||
); | ||
|
||
public SeverityCodesEnum SeverityCode | ||
{ | ||
get { return (SeverityCodesEnum)GetValue(SeverityCodeProperty); } | ||
set { SetValue(SeverityCodeProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty SeverityCodeProperty = DependencyProperty.Register( | ||
nameof(SeverityCode), | ||
typeof(SeverityCodesEnum), | ||
typeof(IssueGroup) | ||
); | ||
|
||
#endregion DependencyProperties | ||
|
||
public IssueGroup() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
Oops, something went wrong.