-
Notifications
You must be signed in to change notification settings - Fork 668
Linter ViewExtension #11634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
BogdanZavu
merged 39 commits into
DynamoDS:AGD-2060-Linting-API
from
SHKnudsen:LinterViewExtension
May 7, 2021
Merged
Linter ViewExtension #11634
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
ceec5d6
Initial commit
SHKnudsen 0057e7a
Move event subscription to extension base class + add property change…
SHKnudsen 668f4f9
comment updates
SHKnudsen b69a7e9
Update LinterExtensionBase.cs
SHKnudsen a1ad8c5
Update InputNodesNotAllowedRule.cs
SHKnudsen 8ba184d
Add Deactivate method to linterExtensionBase + LinterManager tests
SHKnudsen c4c8286
comment updates
SHKnudsen d7c9537
Initial commit
SHKnudsen 1a58f63
Add issues count to WorkspaceSaving
SHKnudsen d0bc4c7
add scrollviewer
SHKnudsen 3a6f7af
Dispose LinterManager
SHKnudsen 60fb830
Merge branch 'Linter-manager' into LinterViewExtension
SHKnudsen 55ea85f
Make concrete issues internal
SHKnudsen 45edd6c
summaries on IRuleIssue
SHKnudsen aa58d7c
comment updates
SHKnudsen aee31ed
Update severity code icon
SHKnudsen fafba10
Serialize linter manager to dyn file
SHKnudsen cdf0c59
clear ruleEvaluationResults on workspace change
SHKnudsen 960c5b2
Remove test extension
SHKnudsen f0790d9
Show names instead of GUIDs
SHKnudsen c89c476
add help doc
SHKnudsen 558f05d
clean up
SHKnudsen e7f2ff8
Handle GraphRuleEvaluationResults nodeIds changes
SHKnudsen f6bd740
Update LintingViewExtension.csproj
SHKnudsen 4549903
Update LintingViewExtension.csproj
SHKnudsen 145a9c7
Update SerializationConverters.cs
SHKnudsen c33a4da
Fix failing serialization test
SHKnudsen 470207b
comment updates
SHKnudsen 45c8332
revert changes to test file
SHKnudsen 5304a08
fix available linters binding
SHKnudsen 93018d3
Merge branch 'Linter-manager' into LinterViewExtension
SHKnudsen 17e9217
add rules back in test ext
SHKnudsen f0bec8c
Merge branch 'AGD-2060-Linting-API' into LinterViewExtension
SHKnudsen 69d7bf0
comment updates
SHKnudsen 4cc514a
remove output path
SHKnudsen a731f6c
Update LinterManagerTests.cs
SHKnudsen c7e3c19
comment updates
SHKnudsen 902243a
hide LinterViewExtension and LinterExtensionBase
SHKnudsen cbe848c
Update LinterViewModel.cs
SHKnudsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.