Skip to content

Commit

Permalink
Merge branch 'master' into DYN-6651-Updating-IssueTypePredicter
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGlobant20 committed May 9, 2024
2 parents 4a95328 + 8adde94 commit 62563e6
Show file tree
Hide file tree
Showing 25 changed files with 417 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Check these if you believe they are true

### Release Notes

(FILL ME IN) Brief description of the fix / enhancement. **Mandatory section**
(FILL ME IN) Brief description of the fix / enhancement. Use N/A to indicate that the changes in this pull request do not apply to Release Notes. **Mandatory section**

### Reviewers

Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/pr_description_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: PR description checker

on:
pull_request:
types: [opened, edited, reopened]

jobs:
check_release_notes:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Extract Description
id: extract_description
run: |
echo "${{ github.event.pull_request.body }}" > pr_description.txt
sed -i ':a;N;$!ba;s/\n/ /g' pr_description.txt
cat pr_description.txt
- name: Extract Release Notes
id: extract_notes
run: |
release_notes=$(grep -oP '(?s)(?<=### Release Notes)\s*([\s\S]*?)\s*(?=###)' pr_description.txt)
echo "$release_notes" > release_notes.txt
cat release_notes.txt
- name: Validate Release Notes
id: validate_notes
run: |
release_notes=$(cat release_notes.txt)
if [[ "$release_notes" == *"(FILL ME IN)"* ]]; then
echo "Error: Release notes must be filled in."
echo "Author: Please check if the text in Release Notes is the default text."
exit 1
elif [[ "$release_notes" == *"N/A"* ]]; then
echo "Release notes are not applicable for this pull request."
echo "Reviewer: Please check if this pull request have non-applicable Release notes."
exit 0
else
word_count=$(wc -w <<< "$release_notes")
if [ $word_count -ge 6 ]; then
echo "Release notes have at least 6 words."
exit 0
else
echo "Error: Release notes must have at least 6 words."
echo "Author: Please add more context of your changes."
exit 1
fi
fi
4 changes: 2 additions & 2 deletions .github/workflows/pr_jira_check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Jira ticket check

on:
pull_request:
pull_request_target:
types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
Expand All @@ -21,4 +21,4 @@ jobs:
titleRegex: '^DYN-(?<ticketNumber>\d+)'
branchRegex: '^DYN-(?<ticketNumber>\d+)'
bodyRegex: 'DYN-(?<ticketNumber>\d+)'
bodyURLRegex: 'http(s?):\/\/(jira.autodesk.com)(\/browse)\/(DYN\-)(?<ticketNumber>\d+)'
bodyURLRegex: 'http(s?):\/\/(jira.autodesk.com)(\/browse)\/(DYN\-)(?<ticketNumber>\d+)'
2 changes: 1 addition & 1 deletion src/DynamoCore/Core/UndoRedoRecorder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
Expand Down
11 changes: 8 additions & 3 deletions src/DynamoCore/Graph/Annotations/AnnotationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ public double TextBlockHeight
}
}


private double textMaxWidth;
/// <summary>
/// Returns the maxWidth of text area of the group
Expand Down Expand Up @@ -657,6 +656,9 @@ protected override bool UpdateValueCore(UpdateValueParams updateValueParams)
case nameof(AnnotationDescriptionText):
AnnotationDescriptionText = value;
break;
case nameof(IsExpanded):
IsExpanded = Convert.ToBoolean(value);
break;
}

return base.UpdateValueCore(updateValueParams);
Expand All @@ -680,6 +682,7 @@ void SerializeCore(XmlElement element, SaveContext context)
helper.SetAttribute("TextblockHeight", this.TextBlockHeight);
helper.SetAttribute("backgrouund", (this.Background == null ? "" : this.Background.ToString()));
helper.SetAttribute(nameof(IsSelected), IsSelected);
helper.SetAttribute(nameof(IsExpanded), this.IsExpanded);

//Serialize Selected models
XmlDocument xmlDoc = element.OwnerDocument;
Expand Down Expand Up @@ -711,12 +714,13 @@ protected override void DeserializeCore(XmlElement element, SaveContext context)
this.textBlockHeight = helper.ReadDouble("TextblockHeight", DoubleValue);
this.InitialTop = helper.ReadDouble("InitialTop", DoubleValue);
this.InitialHeight = helper.ReadDouble("InitialHeight", DoubleValue);
this.IsSelected = helper.ReadBoolean(nameof(IsSelected), false);
this.IsSelected = helper.ReadBoolean(nameof(IsSelected), false);
this.IsExpanded = helper.ReadBoolean(nameof(IsExpanded), true);

if (IsSelected)
DynamoSelection.Instance.Selection.Add(this);
else
DynamoSelection.Instance.Selection.Remove(this);
DynamoSelection.Instance.Selection.Remove(this);

//Deserialize Selected models
if (element.HasChildNodes)
Expand Down Expand Up @@ -756,6 +760,7 @@ protected override void DeserializeCore(XmlElement element, SaveContext context)
RaisePropertyChanged(nameof(GroupStyleId));
RaisePropertyChanged(nameof(AnnotationText));
RaisePropertyChanged(nameof(Nodes));
RaisePropertyChanged(nameof(IsExpanded));
this.ReportPosition();
}

Expand Down
12 changes: 9 additions & 3 deletions src/DynamoCore/Graph/Nodes/CustomNodes/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Dynamo.Engine;
using Dynamo.Engine.CodeGeneration;
using Dynamo.Library;
using Dynamo.Properties;
using Newtonsoft.Json;
using ProtoCore;
using ProtoCore.AST.AssociativeAST;
Expand Down Expand Up @@ -388,8 +389,13 @@ public Symbol()
RegisterAllPorts();

ArgumentLacing = LacingStrategy.Disabled;

InputSymbol = String.Empty;
InputSymbol = new TypedParameter(
Resources.InputPortAlternativeName,
"var",
-1,
null,
Resources.InputNodeRenameHint)
.ToCommentNameString();

ElementResolver = new ElementResolver();
}
Expand Down Expand Up @@ -463,7 +469,7 @@ public string InputSymbol
}

OnNodeModified();
RaisePropertyChanged("InputSymbol");
RaisePropertyChanged(nameof(InputSymbol));
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/DynamoCore/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/DynamoCore/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -911,4 +911,7 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="LegacyTraceDataWarning" xml:space="preserve">
<value>This workspace contains element binding data in a legacy format that is no longer supported in Dynamo 3.0 and higher versions. Element binding data will be saved in the new format the next time you run and save this workspace.</value>
</data>
<data name="InputNodeRenameHint" xml:space="preserve">
<value>default input name, rename me!</value>
</data>
</root>
5 changes: 4 additions & 1 deletion src/DynamoCore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -914,4 +914,7 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="LegacyTraceDataWarning" xml:space="preserve">
<value>This workspace contains element binding data in a legacy format that is no longer supported in Dynamo 3.0 and higher versions. Element binding data will be saved in the new format the next time you run and save this workspace.</value>
</data>
</root>
<data name="InputNodeRenameHint" xml:space="preserve">
<value>default input name, rename me!</value>
</data>
</root>
1 change: 1 addition & 0 deletions src/DynamoCore/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,7 @@ static Dynamo.Properties.Resources.IncorrectlyFormattedNodeLibraryWarning.get ->
static Dynamo.Properties.Resources.IncorrectVersionToOpenFile.get -> string
static Dynamo.Properties.Resources.InputLabel.get -> string
static Dynamo.Properties.Resources.InputNodeDescription.get -> string
static Dynamo.Properties.Resources.InputNodeRenameHint.get -> string
static Dynamo.Properties.Resources.InputNodeSearchTags.get -> string
static Dynamo.Properties.Resources.InputPortAlternativeName.get -> string
static Dynamo.Properties.Resources.InsertDialogBoxText.get -> string
Expand Down
63 changes: 46 additions & 17 deletions src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,25 +260,20 @@ public bool IsExpanded
get => annotationModel.IsExpanded;
set
{
annotationModel.IsExpanded = value;
InPorts.Clear();
OutPorts.Clear();
if (value)
// This change is triggered by the user interaction in the View.
// Before we updating the value in the Model and ViewModel
// we record the current state in the UndoRedoStack.
// This ensures that any modifications can be reverted by the user.
var undoRecorder = WorkspaceViewModel.Model.UndoRecorder;
using (undoRecorder.BeginActionGroup())
{
this.ShowGroupContents();
undoRecorder.RecordModificationForUndo(annotationModel);
}
else
{
this.SetGroupInputPorts();
this.SetGroupOutPorts();
this.CollapseGroupContents(true);
RaisePropertyChanged(nameof(NodeContentCount));
}
WorkspaceViewModel.HasUnsavedChanges = true;
AddGroupToGroupCommand.RaiseCanExecuteChanged();
RaisePropertyChanged(nameof(IsExpanded));
RedrawConnectors();
ReportNodesPosition();

annotationModel.IsExpanded = value;

// Methods to collapse or expand the group based on the new value of IsExpanded.
ManageAnnotationMVExpansionAndCollapse();
}
}

Expand Down Expand Up @@ -1051,6 +1046,36 @@ private void UpdateConnectorsAndPortsOnShowContents(IEnumerable<ModelBase> nodes
}
}


/// <summary>
/// Manages the expansion or collapse of the annotation group in the view model.
/// </summary>
private void ManageAnnotationMVExpansionAndCollapse()
{
if (InPorts.Any() || OutPorts.Any())
{
InPorts.Clear();
OutPorts.Clear();
}

if (annotationModel.IsExpanded)
{
this.ShowGroupContents();
}
else
{
this.SetGroupInputPorts();
this.SetGroupOutPorts();
this.CollapseGroupContents(true);
RaisePropertyChanged(nameof(NodeContentCount));
}
WorkspaceViewModel.HasUnsavedChanges = true;
AddGroupToGroupCommand.RaiseCanExecuteChanged();
RaisePropertyChanged(nameof(IsExpanded));
RedrawConnectors();
ReportNodesPosition();
}

private void UpdateFontSize(object parameter)
{
if (parameter == null) return;
Expand Down Expand Up @@ -1203,6 +1228,10 @@ private void model_PropertyChanged(object sender, System.ComponentModel.Property
RaisePropertyChanged(nameof(AnnotationModel.Position));
UpdateProxyPortsPosition();
break;
case nameof(IsExpanded):
ManageAnnotationMVExpansionAndCollapse();
break;

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/Views/Core/AnnotationView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
Expand Down
13 changes: 11 additions & 2 deletions src/Libraries/PythonNodeModels/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@
<data name="PythonScriptEditorEngineDropdownTooltip" xml:space="preserve">
<value>Select the Python version/engine to execute the script</value>
</data>
<data name="PythonScriptEditorConvertTabsToSpacesButtonTooltip" xml:space="preserve">
<value>Convert indentation tabs to spaces...</value>
</data>
<data name="PythonScriptEditorMigrationAssistantButtonTooltip" xml:space="preserve">
<value>Convert script to Python 3...</value>
</data>
Expand All @@ -214,4 +217,4 @@
<data name="PythonScriptUnsavedChangesPromptTitle" xml:space="preserve">
<value>Are you sure you want to leave?</value>
</data>
</root>
</root>
5 changes: 4 additions & 1 deletion src/Libraries/PythonNodeModels/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@
<data name="PythonScriptEditorMigrationAssistantButtonTooltip" xml:space="preserve">
<value>Convert script to Python 3...</value>
</data>
<data name="PythonScriptEditorConvertTabsToSpacesButtonTooltip" xml:space="preserve">
<value>Convert indentation tabs to spaces...</value>
</data>
<data name="PythonSearchTags" xml:space="preserve">
<value>IronPython;CPython;</value>
</data>
Expand All @@ -215,4 +218,4 @@
<data name="PythonScriptUnsavedChangesPromptTitle" xml:space="preserve">
<value>Are you sure you want to leave?</value>
</data>
</root>
</root>
Loading

0 comments on commit 62563e6

Please sign in to comment.