diff --git a/Source/Foundation/Microsoft.Tools.TeamMate.Foundation.csproj b/Source/Foundation/Microsoft.Tools.TeamMate.Foundation.csproj index fb842c2..01243b2 100644 --- a/Source/Foundation/Microsoft.Tools.TeamMate.Foundation.csproj +++ b/Source/Foundation/Microsoft.Tools.TeamMate.Foundation.csproj @@ -20,7 +20,7 @@ true 467;618 full - x64 + AnyCPU 7.3 prompt diff --git a/Source/TeamFoundation.WebApi/Microsoft.Tools.TeamMate.TeamFoundation.WebApi.csproj b/Source/TeamFoundation.WebApi/Microsoft.Tools.TeamMate.TeamFoundation.WebApi.csproj index 3a43873..2e6d9e4 100644 --- a/Source/TeamFoundation.WebApi/Microsoft.Tools.TeamMate.TeamFoundation.WebApi.csproj +++ b/Source/TeamFoundation.WebApi/Microsoft.Tools.TeamMate.TeamFoundation.WebApi.csproj @@ -20,7 +20,7 @@ DEBUG;TRACE 467;618 full - x64 + AnyCPU 7.3 prompt diff --git a/Source/TeamMate.sln b/Source/TeamMate.sln index dc5cdf8..cf3e60a 100644 --- a/Source/TeamMate.sln +++ b/Source/TeamMate.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33627.172 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{04FA9F2B-E302-475F-B060-79D22E9C2D15}" EndProject @@ -57,16 +57,16 @@ Global {01FCF244-D4B2-43DD-BB77-9D4946868299}.Release|x64.Build.0 = Release|x64 {01FCF244-D4B2-43DD-BB77-9D4946868299}.Release|x86.ActiveCfg = Release|Any CPU {01FCF244-D4B2-43DD-BB77-9D4946868299}.Release|x86.Build.0 = Release|Any CPU - {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|Any CPU.ActiveCfg = Debug|x64 + {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|Any CPU.Build.0 = Debug|x64 {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|ARM.ActiveCfg = Debug|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|ARM.Build.0 = Debug|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|ARM64.ActiveCfg = Debug|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|ARM64.Build.0 = Debug|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|x64.ActiveCfg = Debug|x64 {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|x64.Build.0 = Debug|x64 - {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|x86.ActiveCfg = Debug|Any CPU - {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|x86.Build.0 = Debug|Any CPU + {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|x86.ActiveCfg = Debug|x64 + {1967369E-0368-4888-B743-B16ABAE28B1F}.Debug|x86.Build.0 = Debug|x64 {1967369E-0368-4888-B743-B16ABAE28B1F}.Release|Any CPU.ActiveCfg = Release|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Release|Any CPU.Build.0 = Release|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Release|ARM.ActiveCfg = Release|Any CPU @@ -77,16 +77,16 @@ Global {1967369E-0368-4888-B743-B16ABAE28B1F}.Release|x64.Build.0 = Release|x64 {1967369E-0368-4888-B743-B16ABAE28B1F}.Release|x86.ActiveCfg = Release|Any CPU {1967369E-0368-4888-B743-B16ABAE28B1F}.Release|x86.Build.0 = Release|Any CPU - {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|Any CPU.ActiveCfg = Debug|x64 + {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|Any CPU.Build.0 = Debug|x64 {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|ARM.ActiveCfg = Debug|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|ARM.Build.0 = Debug|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|ARM64.ActiveCfg = Debug|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|ARM64.Build.0 = Debug|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|x64.ActiveCfg = Debug|x64 {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|x64.Build.0 = Debug|x64 - {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|x86.ActiveCfg = Debug|Any CPU - {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|x86.Build.0 = Debug|Any CPU + {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|x86.ActiveCfg = Debug|x64 + {5BB3A276-4460-4C5F-B842-42E4618DD034}.Debug|x86.Build.0 = Debug|x64 {5BB3A276-4460-4C5F-B842-42E4618DD034}.Release|Any CPU.ActiveCfg = Release|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Release|Any CPU.Build.0 = Release|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Release|ARM.ActiveCfg = Release|Any CPU @@ -97,16 +97,16 @@ Global {5BB3A276-4460-4C5F-B842-42E4618DD034}.Release|x64.Build.0 = Release|x64 {5BB3A276-4460-4C5F-B842-42E4618DD034}.Release|x86.ActiveCfg = Release|Any CPU {5BB3A276-4460-4C5F-B842-42E4618DD034}.Release|x86.Build.0 = Release|Any CPU - {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|Any CPU.Build.0 = Debug|Any CPU + {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|Any CPU.ActiveCfg = Debug|x64 + {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|Any CPU.Build.0 = Debug|x64 {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|ARM.ActiveCfg = Debug|Any CPU {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|ARM.Build.0 = Debug|Any CPU {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|ARM64.ActiveCfg = Debug|Any CPU {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|ARM64.Build.0 = Debug|Any CPU {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|x64.ActiveCfg = Debug|x64 {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|x64.Build.0 = Debug|x64 - {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|x86.ActiveCfg = Debug|Any CPU - {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|x86.Build.0 = Debug|Any CPU + {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|x86.ActiveCfg = Debug|x64 + {888E7687-95F8-4049-94DF-9DD3398B5592}.Debug|x86.Build.0 = Debug|x64 {888E7687-95F8-4049-94DF-9DD3398B5592}.Release|Any CPU.ActiveCfg = Release|Any CPU {888E7687-95F8-4049-94DF-9DD3398B5592}.Release|Any CPU.Build.0 = Release|Any CPU {888E7687-95F8-4049-94DF-9DD3398B5592}.Release|ARM.ActiveCfg = Release|Any CPU diff --git a/Source/TeamMate/Controls/TileCollectionView.xaml b/Source/TeamMate/Controls/TileCollectionView.xaml index 746085a..22366e0 100644 --- a/Source/TeamMate/Controls/TileCollectionView.xaml +++ b/Source/TeamMate/Controls/TileCollectionView.xaml @@ -70,6 +70,9 @@ + + @@ -967,7 +968,6 @@ - @@ -984,6 +984,7 @@ + PreserveNewest diff --git a/Source/TeamMate/ViewModels/PullRequestQueryTileViewModel.cs b/Source/TeamMate/ViewModels/PullRequestQueryTileViewModel.cs index a7e6d3f..d3bfc79 100644 --- a/Source/TeamMate/ViewModels/PullRequestQueryTileViewModel.cs +++ b/Source/TeamMate/ViewModels/PullRequestQueryTileViewModel.cs @@ -6,7 +6,7 @@ namespace Microsoft.Tools.TeamMate.ViewModels { public class PullRequestQueryTileViewModel : TileViewModel { - private PullRequestQueryViewModel QueryModel + public PullRequestQueryViewModel QueryModel { get { return this.Query as PullRequestQueryViewModel; } } diff --git a/Source/TeamMate/ViewModels/TileCollectionViewModel.cs b/Source/TeamMate/ViewModels/TileCollectionViewModel.cs index e7adbf9..5ea0295 100644 --- a/Source/TeamMate/ViewModels/TileCollectionViewModel.cs +++ b/Source/TeamMate/ViewModels/TileCollectionViewModel.cs @@ -156,15 +156,24 @@ private void InvalidateItemCountSummary() { lock (invalidateItemCountSummaryLock) { - var allWorkItems = GetItemsTowardsCount(); - var workItemsByState = allWorkItems.GroupBy(wi => wi.WorkItemState).ToDictionary(g => g.Key, g => g.ToArray()); - - var summary = this.ItemCountSummary; - UpdateCounter(summary.GlobalCounter, allWorkItems); - UpdateCounter(summary.ActiveCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Active)); - UpdateCounter(summary.ResolvedCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Resolved)); - UpdateCounter(summary.ClosedCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Closed)); - UpdateCounter(summary.UnknownCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Unknown)); + { + var allWorkItems = GetWorkItemsTowardsCount(); + var workItemsByState = allWorkItems.GroupBy(wi => wi.WorkItemState).ToDictionary(g => g.Key, g => g.ToArray()); + + var summary = this.ItemCountSummary; + UpdateCounter(summary.GlobalCounter, allWorkItems); + UpdateCounter(summary.ActiveCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Active)); + UpdateCounter(summary.ResolvedCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Resolved)); + UpdateCounter(summary.ClosedCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Closed)); + UpdateCounter(summary.UnknownCounter, workItemsByState.TryGetValueOrDefault(WorkItemState.Unknown)); + } + { + var allPullRequests = GetPullRequestsTowardsCount(); + var pullRequestsByState = allPullRequests.GroupBy(wi => wi.IsRead).ToDictionary(g => g.Key, g => g.ToArray()); + + var summary = this.ItemCountSummary; + UpdateCounter(summary.PullRequestsCounter, pullRequestsByState.TryGetValueOrDefault(false)); + } } } catch (Exception e) @@ -181,15 +190,29 @@ private static void UpdateCounter(Counter counter, ICollection items) + { + // items can be null by design, it is an optimization if there are no items + int count = (items != null) ? items.Count : 0; + bool isRead = (items != null) ? !items.Any(wi => !wi.IsRead) : true; + + counter.UpdateCount(count, isRead); + } - private IList GetItemsTowardsCount() + private IList GetWorkItemsTowardsCount() { - // TODO: Get PullRequests too? How do these surface in the UI? var allWorkItems = Tiles.OfType().Where(wiq => wiq.IncludeInItemCountSummary) .Select(q => q.WorkItemQuery.WorkItems).Where(items => items != null).SelectMany(w => w).Distinct().ToArray(); return allWorkItems; } + private IList GetPullRequestsTowardsCount() + { + var allPullRequests = Tiles.OfType().Where(wiq => wiq.IncludeInItemCountSummary) + .Select(q => q.QueryModel.PullRequests).Where(items => items != null).SelectMany(w => w).Distinct().ToArray(); + + return allPullRequests; + } private TileViewModel CreateTileViewModel(TileInfo tileInfo) { diff --git a/Source/TeamMate/ViewModels/TileViewModel.cs b/Source/TeamMate/ViewModels/TileViewModel.cs index 430da5c..8284666 100644 --- a/Source/TeamMate/ViewModels/TileViewModel.cs +++ b/Source/TeamMate/ViewModels/TileViewModel.cs @@ -28,8 +28,8 @@ public TileInfo TileInfo // On purpose not use the property as we don't want to fire an event here. Also, do this before creating // the query! - this.showNotifications = (this.TileInfo != null) ? this.tileInfo.ShowNotifications : false; - this.includeInItemCountSummary = (this.TileInfo != null) ? this.tileInfo.IncludeInItemCountSummary : false; + this.showNotifications = this.TileInfo != null && this.tileInfo.ShowNotifications; + this.includeInItemCountSummary = this.TileInfo != null && this.tileInfo.IncludeInItemCountSummary; this.backgroundColor = this.GetBackgroundColor(); this.isDefaultBackgroundColor = this.IsDefaultBackColor(); this.fontColor = this.GetFontColor(); diff --git a/Source/TeamMate/Windows/OverviewWindow.xaml b/Source/TeamMate/Windows/OverviewWindow.xaml index d526157..2c33478 100644 --- a/Source/TeamMate/Windows/OverviewWindow.xaml +++ b/Source/TeamMate/Windows/OverviewWindow.xaml @@ -38,6 +38,12 @@ Image="/Resources/Icons/Bugger/GreenGift.png" Visibility="{Binding HasCountGreaterThanZero, Converter={x:Static fwc:Converters.Visibility}}" /> + DEBUG;TRACE 467;618 full - x64 + AnyCPU 7.3 prompt