Skip to content

Feature: Added Discord link to About page #14821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Global/OpenHelpAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public HotKey HotKey

public Task ExecuteAsync()
{
var url = new Uri(Constants.GitHub.DocumentationUrl);
var url = new Uri(Constants.ExternalUrl.DocumentationUrl);
return Launcher.LaunchUriAsync(url).AsTask();
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Files.App/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,16 @@ public static class Filesystem
public const string CachedEmptyItemName = "fileicon_cache";
}

public static class GitHub
public static class ExternalUrl
{
public const string GitHubRepoUrl = @"https://github.com/files-community/Files";
public const string DocumentationUrl = @"https://files.community/docs";
public const string DiscordUrl = @"https://discord.gg/files";
public const string FeatureRequestUrl = @"https://github.com/files-community/Files/issues/new?labels=feature+request&template=feature_request.yml";
public const string BugReportUrl = @"https://github.com/files-community/Files/issues/new?labels=bug&template=bug_report.yml";
public const string PrivacyPolicyUrl = @"https://github.com/files-community/Files/blob/main/.github/PRIVACY.md";
public const string SupportUsUrl = @"https://github.com/sponsors/yaira2";
public const string CrowdinUrl = @"https://crowdin.com/project/files-app";
}

public static class DocsPath
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Helpers/Application/AppLifecycleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public static void HandleAppUnhandledException(Exception? ex, bool showToastNoti
{
Buttons =
{
new ToastButton("ExceptionNotificationReportButton".GetLocalizedResource(), Constants.GitHub.BugReportUrl)
new ToastButton("ExceptionNotificationReportButton".GetLocalizedResource(), Constants.ExternalUrl.BugReportUrl)
{
ActivationType = ToastActivationType.Protocol
}
Expand Down
3 changes: 3 additions & 0 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3667,4 +3667,7 @@
<data name="BackgroundRunningNotificationHeader" xml:space="preserve">
<value>Where did Files go?</value>
</data>
<data name="QuestionsAndDiscussions" xml:space="preserve">
<value>Questions &amp; discussions</value>
</data>
</root>
2 changes: 1 addition & 1 deletion src/Files.App/Utils/Taskbar/SystemTrayIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private void OnLeftClicked()

private void OnDocumentationClicked()
{
Launcher.LaunchUriAsync(new Uri(Constants.GitHub.DocumentationUrl)).AsTask();
Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.DocumentationUrl)).AsTask();
}

private void OnRestartClicked()
Expand Down
21 changes: 14 additions & 7 deletions src/Files.App/ViewModels/Settings/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class AboutViewModel : ObservableObject
public ICommand SupportUsCommand { get; }
public ICommand OpenLogLocationCommand { get; }
public ICommand OpenDocumentationCommand { get; }
public ICommand OpenDiscordCommand { get; }
public ICommand SubmitFeatureRequestCommand { get; }
public ICommand SubmitBugReportCommand { get; }
public ICommand OpenGitHubRepoCommand { get; }
Expand All @@ -38,6 +39,7 @@ public AboutViewModel()
CopyWindowsVersionCommand = new RelayCommand(CopyWindowsVersion);
SupportUsCommand = new AsyncRelayCommand(SupportUs);
OpenDocumentationCommand = new AsyncRelayCommand(DoOpenDocumentation);
OpenDiscordCommand = new AsyncRelayCommand(DoOpenDiscord);
SubmitFeatureRequestCommand = new AsyncRelayCommand(DoSubmitFeatureRequest);
SubmitBugReportCommand = new AsyncRelayCommand(DoSubmitBugReport);
OpenGitHubRepoCommand = new AsyncRelayCommand(DoOpenGitHubRepo);
Expand All @@ -53,33 +55,38 @@ private Task OpenLogLocation()

public Task DoOpenDocumentation()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.DocumentationUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.DocumentationUrl)).AsTask();
}

public Task DoOpenDiscord()
{
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.DiscordUrl)).AsTask();
}

public Task DoSubmitFeatureRequest()
{
return Launcher.LaunchUriAsync(new Uri($"{Constants.GitHub.FeatureRequestUrl}&{GetVersionsQueryString()}")).AsTask();
return Launcher.LaunchUriAsync(new Uri($"{Constants.ExternalUrl.FeatureRequestUrl}&{GetVersionsQueryString()}")).AsTask();
}

public Task DoSubmitBugReport()
{
return Launcher.LaunchUriAsync(new Uri($"{Constants.GitHub.BugReportUrl}&{GetVersionsQueryString()}")).AsTask();
return Launcher.LaunchUriAsync(new Uri($"{Constants.ExternalUrl.BugReportUrl}&{GetVersionsQueryString()}")).AsTask();
}

public Task DoOpenGitHubRepo()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.GitHubRepoUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.GitHubRepoUrl)).AsTask();
}

public Task DoOpenPrivacyPolicy()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.PrivacyPolicyUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.PrivacyPolicyUrl)).AsTask();
}


public Task DoOpenCrowdin()
{
return Launcher.LaunchUriAsync(new Uri("https://crowdin.com/project/files-app")).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.CrowdinUrl)).AsTask();
}

public void CopyAppVersion()
Expand All @@ -106,7 +113,7 @@ public void CopyWindowsVersion()

public Task SupportUs()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.SupportUsUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
}

public async Task LoadThirdPartyNoticesAsync()
Expand Down
16 changes: 16 additions & 0 deletions src/Files.App/Views/Settings/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@
Glyph="&#xE8A7;" />
</local:SettingsBlockControl>

<!-- Questions & discussions -->
<local:SettingsBlockControl
Title="{helpers:ResourceString Name=QuestionsAndDiscussions}"
HorizontalAlignment="Stretch"
ButtonCommand="{x:Bind ViewModel.OpenDiscordCommand}"
IsClickable="True">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="&#xE8F2;" />
</local:SettingsBlockControl.Icon>

<FontIcon
FontSize="14"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
Glyph="&#xE8A7;" />
</local:SettingsBlockControl>

<!-- Feedback -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=Feedback}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
Expand Down