From a6da6da0d2d5e370080f08eceb4a3225c9cb0400 Mon Sep 17 00:00:00 2001 From: Marcus Markiewicz Date: Mon, 8 May 2023 12:49:14 -0400 Subject: [PATCH 01/11] PR: Customizable project for Pull Request Queries This change implements the basic logic to allow PR queries to be configured for any project. The PR query editor dialog now has a project textbox, and the query is saved with the project context. --- .../TeamFoundation.WebApi/HyperlinkFactory.cs | 4 +- .../TeamMate/Controls/GlobalCommandBar.xaml | 2 +- .../Model/ProjectContextSerializer.cs | 3 ++ Source/TeamMate/Model/PullRequestQueryInfo.cs | 2 + .../TeamMate/ViewModels/PageViewModelBase.cs | 2 +- .../ViewModels/PullRequestPageViewModel.cs | 2 +- .../ViewModels/PullRequestPickerViewModel.cs | 38 ++++++++++++++++++- .../ViewModels/PullRequestQueryViewModel.cs | 16 ++++++-- .../ViewModels/TileCollectionViewModel.cs | 2 +- .../Windows/PullRequestQueryEditorDialog.xaml | 21 +++++++--- 10 files changed, 76 insertions(+), 16 deletions(-) diff --git a/Source/TeamFoundation.WebApi/HyperlinkFactory.cs b/Source/TeamFoundation.WebApi/HyperlinkFactory.cs index a321418..d17598e 100644 --- a/Source/TeamFoundation.WebApi/HyperlinkFactory.cs +++ b/Source/TeamFoundation.WebApi/HyperlinkFactory.cs @@ -67,10 +67,10 @@ public Uri GetWorkItemUrl(int id, bool fullScreen = true) return builder.Uri; } - public Uri GetPullRequestUrl(int id, string repositoryName) + public Uri GetPullRequestUrl(int id, string projectName, string repositoryName) { UriBuilder builder = new UriBuilder(this.BaseUrl); - builder.Path = CombinePath(builder.Path, ProjectName, "_git", repositoryName, "pullrequest", id.ToString()); + builder.Path = CombinePath(builder.Path, projectName, "_git", repositoryName, "pullrequest", id.ToString()); return builder.Uri; } diff --git a/Source/TeamMate/Controls/GlobalCommandBar.xaml b/Source/TeamMate/Controls/GlobalCommandBar.xaml index eff9301..7937abf 100644 --- a/Source/TeamMate/Controls/GlobalCommandBar.xaml +++ b/Source/TeamMate/Controls/GlobalCommandBar.xaml @@ -38,7 +38,7 @@ Visibility="{Binding ElementName=self, Path=Type, Converter={x:Static fw:Converters.Visibility}, - ConverterParameter={x:Static vm:CommandBarType.CodeReviews}}"> + ConverterParameter={x:Static vm:CommandBarType.PullRequests}}">