diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 78affbb16f..4230a2b198 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,7 +7,8 @@ body: - type: markdown attributes: value: Please make sure to [search for existing issues](https://github.com/microsoft/PowerToys/issues) before filing a new one! -- type: input +- id: version + type: input attributes: label: Microsoft PowerToys version placeholder: 0.70.0 diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml index 4ffa0bf4a9..65a0d12b6b 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml @@ -367,7 +367,7 @@ - + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml.cs index ed29e2e9f6..c01a1da87c 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/GeneralPage.xaml.cs @@ -84,6 +84,8 @@ namespace Microsoft.PowerToys.Settings.UI.Views DataContext = ViewModel; doRefreshBackupRestoreStatus(100); + + ViewModel.InitializeReportBugLink(); } private void OpenColorsSettings_Click(object sender, RoutedEventArgs e) diff --git a/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs index 8d55056f64..9079d3c58e 100644 --- a/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/GeneralViewModel.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; @@ -11,6 +12,8 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Text.Json; using System.Threading.Tasks; +using System.Web; +using CommunityToolkit.WinUI.Helpers; using global::PowerToys.GPOWrapper; using ManagedCommon; using Microsoft.PowerToys.Settings.UI.Library; @@ -18,6 +21,7 @@ using Microsoft.PowerToys.Settings.UI.Library.Helpers; using Microsoft.PowerToys.Settings.UI.Library.Interfaces; using Microsoft.PowerToys.Settings.UI.Library.Utilities; using Microsoft.PowerToys.Settings.UI.Library.ViewModels.Commands; +using Windows.System; namespace Microsoft.PowerToys.Settings.UI.ViewModels { @@ -177,7 +181,46 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels private string _settingsBackupMessage; private string _backupRestoreMessageSeverity; + private string reportBugLink; + // Gets or sets a value indicating whether run powertoys on start-up. + public string ReportBugLink + { + get => reportBugLink; + set + { + reportBugLink = value; + OnPropertyChanged(nameof(ReportBugLink)); + } + } + + public void InitializeReportBugLink() + { + var version = HttpUtility.UrlEncode(GetPowerToysVersion()); + + var gitHubURL = "https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=Issue-Bug%2CTriage-Needed&template=bug_report.yml" + + "&version=" + version; + + ReportBugLink = gitHubURL; + } + + private string GetPowerToysVersion() + { + return "0.88.0"; // Replace with the actual method to get the version. + } + + private string GetOSVersion() + { + // Implement a method to get the OS version + return "OS_VERSION_PLACEHOLDER"; + } + + private string GetDotNetVersion() + { + // Implement a method to get the .NET version + return "DOT_NET_VERSION_PLACEHOLDER"; + } + public bool Startup { get