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

[Dev Home][File Explorer][Version Control Selection Dropdown] Dropdown selector should include "Unassigned" as an option #3932

Merged
merged 4 commits into from
Oct 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,11 @@ private void AdjustFocus(object sender)
_log.Information($"Set focus to add reposiotry card result: {isFocusSet}");
}
}

public void UnassignSourceControlProviderFromRepository(string repositoryRootPath)
{
ExtraFolderPropertiesWrapper.Unregister(repositoryRootPath);
RepoTracker.ModifySourceControlProviderForTrackedRepository(_unassigned, repositoryRootPath);
RefreshTrackedRepositories();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private void SourceControlProviderMenuFlyout_Opening(object sender, object e)
{
if (sender is MenuFlyout menuFlyout)
{
var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources");
menuFlyout.Items.Clear();

foreach (var extension in ViewModel.ExtensionService.GetInstalledExtensionsAsync(ProviderType.LocalRepository).Result)
Expand All @@ -54,10 +55,26 @@ private void SourceControlProviderMenuFlyout_Opening(object sender, object e)
};
menuItem.Click += AssignSourceControlProviderButton_Click;

var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources");
ToolTipService.SetToolTip(menuItem, stringResource.GetLocalized("PrefixForDevHomeVersion", extension.PackageDisplayName));
menuFlyout.Items.Add(menuItem);
}

var unassignMenuItem = new MenuFlyoutItem
{
Text = stringResource.GetLocalized("MenuFlyoutUnregisteredRepository_Content"),
};
unassignMenuItem.Click += UnassignFolderButton_Click;
menuFlyout.Items.Add(unassignMenuItem);
}
}

public void UnassignFolderButton_Click(object sender, RoutedEventArgs e)
{
// Extract relevant data from view and give to view model for unassign
MenuFlyoutItem menuItem = (MenuFlyoutItem)sender;
if (menuItem.DataContext is RepositoryInformation repoInfo)
{
ViewModel.UnassignSourceControlProviderFromRepository(repoInfo.RepositoryRootPath);
}
}

Expand Down
Loading