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

ALSO-5603 Add parameter hiding autocomplete options from the UI #13834

Merged
merged 5 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@ public struct StartConfiguration
/// If true, Analytics and Usage options are hidden from UI
/// </summary>
public bool HideReportOptions { get; set; }

/// <summary>
/// If true, autocomplete method options are hidden from UI
/// </summary>
public bool HideAutocompleteMethodOptions { 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.

@pinzart @mjkkirschner Is this allowed to add new params in this class?

Copy link
Contributor

@pinzart90 pinzart90 Mar 17, 2023

Choose a reason for hiding this comment

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

https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules
looks at DISALLOWED: Adding an instance field to a struct that has no nonpublic fields

If a struct has only public fields or has no fields at all...
Adding any new fields - public or nonpublic - to such a struct is a source breaking change for these callers, as the compiler will now require the additional fields to be initialized.

}

public static DynamoViewModel Start(StartConfiguration startConfiguration = new StartConfiguration())
Expand Down Expand Up @@ -750,6 +755,8 @@ protected DynamoViewModel(StartConfiguration startConfiguration)
model.RequestNotification += model_RequestNotification;

preferencesViewModel = new PreferencesViewModel(this);
preferencesViewModel.HideAutocompleteMethodOptions = startConfiguration.HideAutocompleteMethodOptions;



if (!DynamoModel.IsTestMode && !DynamoModel.IsHeadless)
Expand Down
2 changes: 2 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ public bool PersistExtensionsIsChecked

#region [ Node Autocomplete ]

public bool HideAutocompleteMethodOptions { get; set; }

/// <summary>
/// Controls the IsChecked property in the "Node autocomplete" toogle button
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,11 @@
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0"
<Label Grid.Row="0" Visibility="{Binding HideAutocompleteMethodOptions, Converter={StaticResource InverseBoolToVisibilityCollapsedConverter}}"
Margin="-8,15,10,3"
Content="{x:Static p:Resources.PreferencesNodeAutocompleteMethod}"
Foreground="{StaticResource PreferencesWindowFontColor}"/>
<Grid Grid.Row="1">
<Grid Grid.Row="1" Visibility="{Binding HideAutocompleteMethodOptions, Converter={StaticResource InverseBoolToVisibilityCollapsedConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="colObjectType" Width="Auto"/>
<ColumnDefinition x:Name="colMachineLearning" Width="Auto"/>
Expand Down