-
Notifications
You must be signed in to change notification settings - Fork 356
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
User/ejohn/settings #121
Merged
Merged
User/ejohn/settings #121
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fed466c
Initial settings page
83af548
Starting settings work
5593c81
Settings is working
63655d2
Remove Repository.cs from bad merge
4e7fcdf
Build fixes after rebase
373198b
Initial settings page
7769964
Starting settings work
4c23c4a
Settings is working
1ef332c
Remove Repository.cs from bad merge
a43ea27
Build fixes after rebase
b46643d
Rename 'plugin' to 'extension' in Settings code. Global rename to co…
7b6f322
Merge branch 'user/ejohn/settings' of https://github.com/microsoft/de…
4e50d9f
Fix bad merge
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/Contracts/Services/IAccountsService.cs → common/Contracts/IAccountsService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Contracts/Services/IFileService.cs → common/Contracts/IFileService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...ntracts/Services/ILocalSettingsService.cs → common/Contracts/ILocalSettingsService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/Helpers/EnumToBooleanConverter.cs → common/Helpers/EnumToBooleanConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Models/LocalSettingsOptions.cs → common/Models/LocalSettingsOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
src/Services/LocalSettingsService.cs → common/Services/LocalSettingsService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
settings/DevHome.Settings.UITest/DashboardScenarioStandard.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) Microsoft Corporation and Contributors | ||
// Licensed under the MIT license. | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using OpenQA.Selenium.Appium.Windows; | ||
|
||
namespace DevHome.Dashboard.UITest; | ||
|
||
[TestClass] | ||
public class DashboardScenarioStandard : DashboardSession | ||
{ | ||
[TestMethod] | ||
public void DashboardTest1() | ||
{ | ||
session.FindElementByName("Dashboard").Click(); | ||
WindowsElement title = session.FindElementByName("Dashboard"); | ||
Assert.AreEqual("Dashboard", title.Text); | ||
} | ||
|
||
[ClassInitialize] | ||
public static void ClassInitialize(TestContext context) | ||
{ | ||
Setup(context); | ||
} | ||
|
||
[ClassCleanup] | ||
public static void ClassCleanup() | ||
{ | ||
TearDown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) Microsoft Corporation and Contributors | ||
// Licensed under the MIT license. | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using OpenQA.Selenium.Appium; | ||
using OpenQA.Selenium.Appium.Windows; | ||
|
||
namespace DevHome.Dashboard.UITest; | ||
|
||
public class DashboardSession | ||
{ | ||
private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; | ||
private const string DevHomeAppId = "Microsoft.DevHome_8wekyb3d8bbwe!App"; | ||
|
||
#pragma warning disable SA1401 // Fields should be private | ||
#pragma warning disable CA2211 // Non-constant fields should not be visible | ||
protected static WindowsDriver<WindowsElement> session; | ||
#pragma warning restore CA2211 // Non-constant fields should not be visible | ||
#pragma warning restore SA1401 // Fields should be private | ||
|
||
public static void Setup(TestContext context) | ||
{ | ||
if (session == null) | ||
{ | ||
// Create a new session to bring up an instance of the Dev Home application | ||
// Note: Multiple calculator windows (instances) share the same process Id | ||
AppiumOptions options = new AppiumOptions(); | ||
options.AddAdditionalCapability("deviceName", "WindowsPC"); | ||
options.AddAdditionalCapability("platformName", "Windows"); | ||
options.AddAdditionalCapability("app", DevHomeAppId); | ||
|
||
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), options); | ||
Assert.IsNotNull(session); | ||
|
||
// Set implicit timeout to 1.5 seconds to make element search to retry every 500 ms for at most three times | ||
session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1.5); | ||
} | ||
} | ||
|
||
public static void TearDown() | ||
{ | ||
// Close the application and delete the session | ||
if (session != null) | ||
{ | ||
session.Quit(); | ||
session = null; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
settings/DevHome.Settings.UITest/DevHome.Dashboard.UITest.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework> | ||
<RootNamespace>Dashboard.UITest</RootNamespace> | ||
<Platforms>x86;x64;arm64</Platforms> | ||
<IsPackable>false</IsPackable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<UseWinUI>true</UseWinUI> | ||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> | ||
<ProjectPriFileName>resources.pri</ProjectPriFileName> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="coverlet.collector" Version="3.1.2" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" /> | ||
<PackageReference Include="Appium.WebDriver" Version="4.4.0" /> | ||
</ItemGroup> | ||
</Project> |
24 changes: 24 additions & 0 deletions
24
settings/DevHome.Settings.UnitTest/DevHome.SetupFlow.UnitTest.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework> | ||
<RootNamespace>Dashboard.Test</RootNamespace> | ||
<Platforms>x86;x64;arm64</Platforms> | ||
<IsPackable>false</IsPackable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<UseWinUI>true</UseWinUI> | ||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> | ||
<ProjectPriFileName>resources.pri</ProjectPriFileName> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="coverlet.collector" Version="3.1.2" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" /> | ||
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\src\DevHome.csproj" /> | ||
<ProjectReference Include="..\DevHome.Dashboard\DevHome.Dashboard.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation and Contributors | ||
// Licensed under the MIT license. | ||
|
||
using Microsoft.Windows.ApplicationModel.DynamicDependency; | ||
|
||
[assembly: WinUITestTarget(typeof(DevHome.App))] | ||
|
||
namespace DevHome.Dashboard.Test; | ||
|
||
[TestClass] | ||
public class Initialize | ||
{ | ||
[AssemblyInitialize] | ||
public static void AssemblyInitialize(TestContext context) | ||
{ | ||
// TODO: Initialize the appropriate version of the Windows App SDK. | ||
// This is required when testing MSIX apps that are framework-dependent on the Windows App SDK. | ||
Bootstrap.TryInitialize(0x00010001, out var _); | ||
} | ||
|
||
[AssemblyCleanup] | ||
public static void AssemblyCleanup() | ||
{ | ||
Bootstrap.Shutdown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (c) Microsoft Corporation and Contributors | ||
// Licensed under the MIT license. | ||
|
||
global using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
global using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework> | ||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> | ||
<RootNamespace>DevHome.Settings</RootNamespace> | ||
<Platforms>x86;x64;arm64</Platforms> | ||
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers> | ||
<Nullable>enable</Nullable> | ||
<UseWinUI>true</UseWinUI> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Remove="Views\AboutPage.xaml" /> | ||
<None Remove="Views\AccountsPage.xaml" /> | ||
<None Remove="Views\ExtensionsPage.xaml" /> | ||
<None Remove="Views\NotificationsPage.xaml" /> | ||
<None Remove="Views\PreferencesPage.xaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CommunityToolkit.Labs.WinUI.SettingsControls" Version="0.0.14" /> | ||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" /> | ||
<PackageReference Include="CommunityToolkit.WinUI.UI" Version="7.1.2" /> | ||
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.1" /> | ||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.230118.102" /> | ||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\common\DevHome.Common.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Page Update="Views\AccountsPage.xaml"> | ||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Page Update="Views\AboutPage.xaml"> | ||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Page Update="Views\NotificationsPage.xaml"> | ||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Page Update="Views\PreferencesPage.xaml"> | ||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | ||
</Page> | ||
<Page Update="Views\ExtensionsPage.xaml"> | ||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> | ||
</Page> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we come up with something other than "Common"? That could be a grab bag of a whole bunch of stuff and is ambiguous. Is this common to all plugins? Common to DevHome? Common to Windows? Also why is common not under src? Is it not src? There's common\helpers and src\helpers, common\services and src services - what's the difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dev Home is split between core app and tools. "Common" is shared between the two. "src" is just the core application source code. Ideally, the "common" code would live in "src", but then we have a circular dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be fine with actually getting rid of the "common" namespace and just making all namespaces in DevHome.Common.* be DevHome.*, but that would definitely be a separate change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect all source for shipping code to be under source, and if it's just the core application then that should be refactored into a sub folder of src for the app. Or change 'src' to be indicative that it is the app and not have a src folder.