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-4421 Disable the textSearch, filter and sort #12517

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ private static void PackageManagerViewModel_PropertyChanged(object sender, Syste
searchPackagesLoaded = true;

EnableNextButton(null, uiAutomationData, true, GuideFlow.FORWARD);
packageManagerViewModel.DisableSearchTextBox();

//Unsubscribe from the PropertyChanged event otherwise it will enter everytime the SearchTextBox is updated
packageManagerViewModel.PropertyChanged -= searchPackagesPropertyChanged.Invoke;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ public bool CanSetSortingKey(object par)
}

public event EventHandler<PackagePathEventArgs> RequestShowFileDialog;
public event EventHandler<PackagePathEventArgs> RequestDisableTextSearch;
public virtual void OnRequestShowFileDialog(object sender, PackagePathEventArgs e)
{
if (RequestShowFileDialog != null)
Expand Down Expand Up @@ -980,5 +981,16 @@ public void ExecuteSelected()

SearchResults[SelectedIndex].Model.Execute();
}

/// <summary>
/// Once the sample package is filled in the textbox search we rise the event to the view to disable the actions to change it , filter and sort it.
/// </summary>
public void DisableSearchTextBox()
{
if (RequestDisableTextSearch != null)
{
RequestDisableTextSearch(null, null);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
Visibility="{Binding Path=SearchText, Converter={StaticResource NonEmptyStringToCollapsedConverter}}" />

<!-- 'X' button to reset search query text -->
<Button Margin="10"
<Button Name="clearSearchTextBox" Margin="10"
HorizontalAlignment="Right"
Command="{Binding ClearSearchTextBoxCommand}"
Cursor="Hand"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,24 @@ public PackageManagerSearchView(PackageManagerSearchViewModel pm)
InitializeComponent();
ViewModel.RegisterTransientHandlers();
ViewModel.RequestShowFileDialog += OnRequestShowFileDialog;
ViewModel.RequestDisableTextSearch += ViewModel_RequestDisableTextSearch;
Logging.Analytics.TrackScreenView("PackageManager");
}

private void ViewModel_RequestDisableTextSearch(object sender, PackagePathEventArgs e)
{
this.searchTextBox.IsEnabled = false;
this.clearSearchTextBox.IsEnabled = false;
this.filterResultsButton.IsEnabled = false;
this.sortResultsButton.IsEnabled = false;
}

protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
var viewModel = DataContext as PackageManagerSearchViewModel;

ViewModel.RequestShowFileDialog -= OnRequestShowFileDialog;
ViewModel.RequestDisableTextSearch -= ViewModel_RequestDisableTextSearch;
viewModel.UnregisterTransientHandlers();

// Clears the search text so that the 'Please Wait' prompt appears next time this dialog is opened.
Expand Down