Skip to content

Commit 8edb6db

Browse files
yaira20x5bfa
andauthored
Feature: Added an option to copy the User ID from the about page (#16213)
Co-authored-by: 0x5BFA <[email protected]>
1 parent 3495e24 commit 8edb6db

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Bug Report
2-
description: Create a bug report to help improve Files
2+
description: Create a bug report to help improve Files.
33
labels: [bug]
44
body:
55

@@ -38,7 +38,7 @@ body:
3838
id: files_version
3939
attributes:
4040
label: Files Version
41-
description: Which version of Files are you using? To copy your Files version, access it from Settings -> About -> Copy -> Files version
41+
description: Which version of Files are you using? To copy your Files version, access it from Settings -> About -> Copy -> Files version.
4242
placeholder: "e.g. 2.0.34.0"
4343
validations:
4444
required: true
@@ -48,11 +48,21 @@ body:
4848
id: windows_version
4949
attributes:
5050
label: Windows Version
51-
description: Which version of Windows are you using? To copy your Windows version, access it from Settings -> About -> Copy -> Windows version
51+
description: Which version of Windows are you using? To copy your Windows version, access it from Settings -> About -> Copy -> Windows version.
5252
placeholder: "e.g. 10.0.22621.1848"
5353
validations:
5454
required: true
5555

56+
# User ID
57+
- type: input
58+
id: user_id
59+
attributes:
60+
label: User ID
61+
description: Your User ID is a GUID that can be matched up with bug reports in Sentry. To copy your User ID, access it from Settings -> About -> Copy -> User ID.
62+
placeholder: "74750836-5885-4eeb-964f-8177cb4babf6"
63+
validations:
64+
required: false
65+
5666
# Log File
5767
- type: textarea
5868
attributes:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Feature Request
2-
description: This project thrives from differentiation from competing apps. Suggest an idea for Files
2+
description: This project thrives from differentiation from competing apps. Suggest an idea for Files.
33
labels: [feature request]
44
body:
55

@@ -23,7 +23,7 @@ body:
2323
- type: textarea
2424
attributes:
2525
label: Requirements
26-
description: Describe all the requirements to make your idea happen
26+
description: Describe all the requirements to make your idea happen.
2727
value: |
2828
- This proposal will accomplish X
2929
- This proposal will accomplish Y
@@ -36,7 +36,7 @@ body:
3636
id: files_version
3737
attributes:
3838
label: Files Version
39-
description: Which version of Files are you using? To copy your Files version, access it from Settings -> About -> Copy -> Files version
39+
description: Which version of Files are you using? To copy your Files version, access it from Settings -> About -> Copy -> Files version.
4040
placeholder: 'e.g. 2.0.36.0'
4141
validations:
4242
required: true
@@ -46,7 +46,7 @@ body:
4646
id: windows_version
4747
attributes:
4848
label: Windows Version
49-
description: Which version of Windows are you using? To copy your Windows version, access it from Settings -> About -> Copy -> Windows version
49+
description: Which version of Windows are you using? To copy your Windows version, access it from Settings -> About -> Copy -> Windows version.
5050
placeholder: "e.g. 10.0.22621.1848"
5151
validations:
5252
required: true

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3944,4 +3944,7 @@
39443944
<data name="Toolbars" xml:space="preserve">
39453945
<value>Toolbars</value>
39463946
</data>
3947+
<data name="UserID" xml:space="preserve">
3948+
<value>User ID</value>
3949+
</data>
39473950
</root>

src/Files.App/ViewModels/Settings/AboutViewModel.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ namespace Files.App.ViewModels.Settings
1616
/// </summary>
1717
public sealed class AboutViewModel : ObservableObject
1818
{
19+
// Dependency injections
20+
21+
private IGeneralSettingsService GeneralSettingsService { get; } = Ioc.Default.GetRequiredService<IGeneralSettingsService>();
22+
23+
1924
// Properties
2025

2126
public string Version
@@ -33,6 +38,7 @@ public PackageVersion AppVersion
3338

3439
public ICommand CopyAppVersionCommand { get; }
3540
public ICommand CopyWindowsVersionCommand { get; }
41+
public ICommand CopyUserIDCommand { get; }
3642
public ICommand SupportUsCommand { get; }
3743
public ICommand OpenLogLocationCommand { get; }
3844
public ICommand OpenDocumentationCommand { get; }
@@ -76,6 +82,7 @@ public AboutViewModel()
7682

7783
CopyAppVersionCommand = new RelayCommand(CopyAppVersion);
7884
CopyWindowsVersionCommand = new RelayCommand(CopyWindowsVersion);
85+
CopyUserIDCommand = new RelayCommand(CopyUserID);
7986
SupportUsCommand = new AsyncRelayCommand(SupportUs);
8087
OpenDocumentationCommand = new AsyncRelayCommand(DoOpenDocumentation);
8188
OpenDiscordCommand = new AsyncRelayCommand(DoOpenDiscord);
@@ -161,6 +168,17 @@ public void CopyWindowsVersion()
161168
Clipboard.SetContent(dataPackage);
162169
});
163170
}
171+
172+
public void CopyUserID()
173+
{
174+
SafetyExtensions.IgnoreExceptions(() =>
175+
{
176+
DataPackage dataPackage = new DataPackage();
177+
dataPackage.RequestedOperation = DataPackageOperation.Copy;
178+
dataPackage.SetText(GetUserID());
179+
Clipboard.SetContent(dataPackage);
180+
});
181+
}
164182

165183
public Task SupportUs()
166184
{
@@ -176,12 +194,18 @@ public string GetWindowsVersion()
176194
{
177195
return SystemInformation.Instance.OperatingSystemVersion.ToString();
178196
}
197+
198+
public string GetUserID()
199+
{
200+
return GeneralSettingsService.UserId;
201+
}
179202

180203
public string GetVersionsQueryString()
181204
{
182205
var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
183206
query["files_version"] = GetAppVersion();
184207
query["windows_version"] = GetWindowsVersion();
208+
query["user_id"] = GetUserID();
185209
return query.ToString() ?? string.Empty;
186210
}
187211
}

src/Files.App/Views/Settings/AboutPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<MenuFlyout>
4343
<MenuFlyoutItem Command="{x:Bind ViewModel.CopyAppVersionCommand}" Text="{helpers:ResourceString Name=AppVersion}" />
4444
<MenuFlyoutItem Command="{x:Bind ViewModel.CopyWindowsVersionCommand}" Text="{helpers:ResourceString Name=WindowsVersion}" />
45+
<MenuFlyoutItem Command="{x:Bind ViewModel.CopyUserIDCommand}" Text="{helpers:ResourceString Name=UserID}" />
4546
</MenuFlyout>
4647
</Button.Flyout>
4748
</Button>

0 commit comments

Comments
 (0)