Skip to content

Conversation

@RobertGlobant20
Copy link
Contributor

Purpose

I added the UI Controls for the Preferences -> Visual Settings tab.
The next functionalities were implemented:

Add new Styles
Remove existing Styles
Validate against existing Styles.
Functionality for expand/collapse WPF Expanders automatically.

I'm not including the Display Settings section since Jingyi asked me not to include it (there was no feedback from users), in case the design is ready I will include it in a different pull request.
The acceptance criteria for this task was updated some days ago so those changes will be addressed in a different pull request.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@QilongTang

FYIs

@Astul-Betizagasti

I added a new workflow (issue_type_predicte.yaml) that is using the ML.NET model for predicting the issue type (source repo), so If a new issue is created in the Dynamo repo this workflow will run and will predict if is a Wishlist issue or not. If is a Wishlist issue it will be labeled as "Wishlist" and then another workflow will move the issue to the DynamoWishlist repo. If the issue is incomplete or is not valid the label "NotMLEvaluated" will be added to the issue.

Also I added two scripts more, one will return the issue body in a json string and the other one will clan the issue body removing sections not used like "Dynamo Version" or "Stack Trace"
When testing the issue predicter workflow the issues labeled as Wishlist were not moved to the DynamoWishlist repo due that the "Move Issue by labels" workflow failed. There was a problem with the PAT used to label the issue, I was using the wrong one (no triggers actions).
I added the UI Controls for the Visual Settings tab.
The next functionalities were implemented:
- Add new Styles
- Remove existing Styles
- Validate against existing Styles.
- Functionality for expand/collapse WPF Expanders
Moving some steps located in the PreferencesView constructor to a method.
There was an extra color in DynamoModern.xaml that is not used then I remove it.
I added a new Style for the buttons Save and Cancel, since they have a specific Style
Also I modified the Style for the Add Style button since it was not following the design in hig autodesk.
Also I added a Style for the color button picker, added one text resource so it can be used in the xaml and finally I indented the xaml code.
@RobertGlobant20
Copy link
Contributor Author

This a gif of how the Visual Settings tab looks:
visual_settings_tab

I included the Display Settings sections and the two toggle buttons described in the AC
Also I did a modification so when the "Add Style" button is pressed the focus goes to the Group Name edit box.
@RobertGlobant20
Copy link
Contributor Author

Due that at the end I decided to include the Display Settings section, this is a gif of how it looks.

visual_settings_display_settings

<Content Include="sharpdx_direct3d11_effects_x86.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Resource Include="UI\Images\trash_icon.png" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. I was surprised that we did not use font awesome for this. Is this icon from UX?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I removed the png image from the project and I used the FontAwesome toolit for the trash icon, see the commit: 0fb11cd

Medium,
Large,
ExtraLarge
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a similar enum for the previous UI that we will need to obsolete? Just curious

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I obsoleted the existing enum located in DynamoCoreWpf\UI\Prompts\ChangeScaleFactorPrompt.xaml.cs file, see commit: 0fb11cd

foreach (Expander expander in parentGrid.Children)
{
if (expander != currentExpander)
expander.IsExpanded = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Although this will be covered in a different task, no harm to include and this is what I imagined how we would implement, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Astul-Betizagasti see that I implemented the expanders functionality in case you need to use it in other places.
Thanks

/// <summary>
/// This class will contain the Enum value and the corresponding description for each radio button in the Visual Settings -> Geometry Scaling section
/// </summary>
public class GeometryScalingOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you double check if all the added public classed/properties need to be public or could be internal?

Copy link
Contributor Author

@RobertGlobant20 RobertGlobant20 Apr 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I added two classes StyleItem and GeometryScalingOptions, the StyleItem class need to be public since is used in public methods that are called in the code behind (If i change to internal got several errors) also the GeometryScalingOptions need to be public because there is a public property declared (GeometryScalingOptions type) and used as a binding in the PreferencesView.xaml (also is if changed to internal I got several errors).

- Removed the png image and instead use fontawesome
- Removed duplicated resources for Show Edges and  Isolate Selected Geometry
- Obsolete a enum in ChangeScaleFactorPrompt class
- Some changes in indentation and creating region for private properties
/// This method will remove the current Style selected from the Styles list
/// </summary>
/// <param name="groupName"></param>
public void RemoveStyleEntry(string groupName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertGlobant20 I guess what I was curious was more for these utility functions, seems they can be internal since only used in DynamoCoreWpf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I modified the accesibility level for the next public methods to internal located in the PreferencesViewModel class:

  • void RemoveStyleEntry
  • bool ValidateExistingStyle
  • void ResetAddStyleControl()
  • string GetRandomHexStringColor()

Check commit: af9a3ca
Thanks

/// </summary>
/// <param name="item1"></param>
/// <returns></returns>
public bool ValidateExistingStyle(StyleItem item1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here and other placed, please go through them and validate. Just trying to avoid exposing public things if we do not have to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang I modified the accesibility level for the next public methods to internal located in the PreferencesViewModel class:

  • void RemoveStyleEntry
  • bool ValidateExistingStyle
  • void ResetAddStyleControl()
  • string GetRandomHexStringColor()

Check commit: af9a3ca
Thanks

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once current comments are addressed, LGTM

Based on Aaron's comments I changed the visibility from public to internal in 4 methods located in PreferencesViewModel.
Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the conflicts and check SonarQ check. Then LGTM

@QilongTang QilongTang merged commit 35b1985 into DynamoDS:master Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants