Skip to content
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

Dyn 5339 backup settings #13853

Merged
merged 15 commits into from
Mar 31, 2023
Merged

Dyn 5339 backup settings #13853

merged 15 commits into from
Mar 31, 2023

Conversation

jesusalvino
Copy link
Contributor

@jesusalvino jesusalvino commented Mar 27, 2023

Purpose

Implement the improvement https://jira.autodesk.com/browse/DYN-5339

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

@RobertGlobant20
@Enzo707

@jesusalvino
Copy link
Contributor Author

backupLocation

@QilongTang
Copy link
Contributor

Hi @jesusalvino There was one failure in tests: Dynamo.Tests.Configuration.PreferenceSettingsTests.TestImportCopySettings

@QilongTang QilongTang added this to the 2.18.0 milestone Mar 28, 2023
@jesusalvino
Copy link
Contributor Author

Hi @jesusalvino There was one failure in tests: Dynamo.Tests.Configuration.PreferenceSettingsTests.TestImportCopySettings

fixed.

/// <summary>
/// Returns path of the Backup location
/// </summary>
string BackupLocation { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remind me if we can add things to the interface in core? I think this is API breaking right? @mjkkirschner @pinzart

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keeping the property in the class.


if (dynamoViewModel.Model.UpdateBackupLocation(newBackupLocation))
{
CanResetBackupLocation = !dynamoViewModel.Model.IsDefaultBackupLocation();
Copy link
Contributor

@QilongTang QilongTang Mar 29, 2023

Choose a reason for hiding this comment

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

if CanResetBackupLocation = !dynamoViewModel.Model.IsDefaultBackupLocation(); is always valid, I would put it in the getter and remove the setter for that property. Looks like you dont have to set it to a different value here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if CanResetBackupLocation = !dynamoViewModel.Model.IsDefaultBackupLocation(); is always valid, I would put it in the getter and remove the setter for that property. Looks like you dont have to set it to a different value here

It's if true if the user select a different location than the default, is false if the user reset the location to its default value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Understood, my point is that it looks like you are setting this same !dynamoViewModel.Model.IsDefaultBackupLocation(); to it on different places, which implicate that it could just be its getter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on the result of the UpdateBackupLocation true if it's ok / false if the path is invalid, I need to set the value of CanResetBackupLocation because it enables or not the [Reset location button].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah @jesusalvino In this case, do we still need the setter? usually only a getter here would be sufficient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah @jesusalvino In this case, do we still need the setter? usually only a getter here would be sufficient

yes @QilongTang , I have just tested applying the Binding Mode and UpdateSourceTrigger in the xaml side with success, the explicit setter is necessary due to is the only way to raise the property change in order to enable or not the [Reset button] in the view immediately after the user selects a Backup folder

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you @jesusalvino I missed that point. In this case, feel free to revert the getter to previous change to align with setter. sorry for dragging the conversation. Looks good

Copy link
Contributor Author

@jesusalvino jesusalvino Mar 30, 2023

Choose a reason for hiding this comment

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

Done @QilongTang , glad to be on the same page, all the comments / inquiries always are welcome before to confirm our code

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.

A couple comments

<string>C:\Users\jesus.alvino\Documents\armadar.dyf</string>
<string>C:\Users\jesus.alvino\Documents\WatchNode-4-Dictionary.dyn</string>
<string>C:\Dynamo\test\core\WatchTree.dyn</string>
<string>C:\Users\user\Documents\dynamofile.dyn</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@QilongTang QilongTang merged commit d7bab40 into DynamoDS:master Mar 31, 2023
sm6srw pushed a commit that referenced this pull request Apr 5, 2023
* UI changes

* Backup Location as setting and minor UI changes

* Labels and PathManager engine

* Dealing with invalid Bakup location path and UI titles

* Add the Reset Backup Location button

* Adding the Run Settings Expander

* Fixing weird chars

* Don't touch the Solution

* Update Unit Test and how to use the String

* Fixing spacing

* Solving PR comments

* Excluding the solution file

* Refactoring

* back to field value instead of logic
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