Skip to content

Commit

Permalink
[DYN-6455] Add warning text to selection node's initial warning (#14833)
Browse files Browse the repository at this point in the history
* Fix PostDiff job

* Update Selection.cs

* made the warning persistent and then add removal code
  • Loading branch information
zeusongit authored and QilongTang committed Feb 29, 2024
1 parent d88a835 commit 16dead3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Libraries/CoreNodeModels/Selection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ protected SelectionBase(

Prefix = prefix;

State = ElementState.Warning;
Warning(Resources.SelectionNodeNothingSelected, true);

ShouldDisplayPreviewCore = true;
}

Expand All @@ -183,7 +183,7 @@ protected SelectionBase(

Prefix = prefix;

State = ElementState.Warning;
Warning(Resources.SelectionNodeNothingSelected);

ShouldDisplayPreviewCore = true;

Expand Down Expand Up @@ -220,9 +220,13 @@ public override void ClearErrorsAndWarnings()
private void SetSelectionNodeState()
{
if (null == selectionResults || selectionResults.Count == 0)
{
State = ElementState.Warning;
else if (State == ElementState.Warning)
State = ElementState.Active;
}
else if (State == ElementState.Warning || State == ElementState.PersistentWarning)
{
base.ClearErrorsAndWarnings();
}
}

public bool CanBeginSelect()
Expand Down

0 comments on commit 16dead3

Please sign in to comment.