From f1d5de87c0335b5c954eceef94c8c7f72278d7df Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 8 May 2023 17:11:38 +0300 Subject: Added Machine Type to TFS Lib & MS. --- .../Tango.MachineStudio.Common/MachineStudioSettings.cs | 3 +++ .../StudioApplication/DefaultStudioApplicationManager.cs | 1 + .../TFS/TeamFoundationServiceExtendedClient.cs | 5 ++++- .../Tango.MachineStudio.UI/Views/ReportIssueView.xaml | 9 +++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 25dfc2dc8..6ae71d50d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -9,6 +9,7 @@ using Tango.BL; using Tango.Integration.Operation; using Tango.Logging; using Tango.MachineStudio.Common.Web; +using Tango.PMR.Common; using Tango.PMR.Printing; using Tango.Settings; using Tango.Transport.Adapters; @@ -178,6 +179,8 @@ namespace Tango.MachineStudio.Common /// public MachineStudioTheme Theme { get; set; } + public int LastConnectedMachineType { get; set; } + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs index 78230b8a0..2efe4c719 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs @@ -402,6 +402,7 @@ namespace Tango.MachineStudio.UI.StudioApplication ConnectedMachine = connectedMachine; var settings = SettingsManager.Default.GetOrCreate(); ConnectedMachine.JobUploadStrategy = settings.JobUploadStrategy; + settings.LastConnectedMachineType = Machine.MachineType; } else { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs index b716ed1fb..7a0a9414c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs @@ -152,6 +152,8 @@ namespace Tango.MachineStudio.UI.TFS throw LogManager.Default.Log(new AuthenticationException($"User '{user_email}' is not part of the Tango VSTS team. Please contact your administrator.")); } + var settings = SettingsManager.Default.GetOrCreate(); + item.CreatedBy = currentUser; item.ChangedBy = currentUser; item.AuthorizedAs = currentUser; @@ -161,7 +163,8 @@ namespace Tango.MachineStudio.UI.TFS item.Severity = Severity.Medium; item.State = State.New; item.Type = WorkItemType.Bug; - item.Environment = SettingsManager.Default.GetOrCreate().DeploymentSlot.ToDescription(); + item.Environment = settings.DeploymentSlot.ToDescription(); + item.MachineType = (MachineType)settings.LastConnectedMachineType; foreach (var window in Application.Current.Windows.OfType().Where(x => !String.IsNullOrWhiteSpace(x.Title))) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml index aac712f59..3eeb5f901 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml @@ -12,7 +12,7 @@ xmlns:tfs="clr-namespace:Tango.TFS;assembly=Tango.TFS" xmlns:tfss="clr-namespace:Tango.MachineStudio.UI.TFS" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" - mc:Ignorable="d" Width="530" Height="660" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ReportIssueViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> + mc:Ignorable="d" Width="530" Height="700" Background="{StaticResource Dialog.Background}" d:DataContext="{d:DesignInstance Type=vm:ReportIssueViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource MainWindow.Foreground}"> @@ -43,6 +43,11 @@ + + + + + @@ -83,7 +88,7 @@ Tags (highlight selected tags) - + -- cgit v1.3.1