From d57e90956fb115cf61bfb8566de5692d1e12d1c0 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Sun, 10 Sep 2023 15:19:12 +0100 Subject: [PATCH 1/3] CI - disallow PRs to master from any branch but dev --- .github/workflows/pr-branch.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/pr-branch.yml diff --git a/.github/workflows/pr-branch.yml b/.github/workflows/pr-branch.yml new file mode 100644 index 000000000..08ce8793d --- /dev/null +++ b/.github/workflows/pr-branch.yml @@ -0,0 +1,17 @@ +name: Check pull request branch +on: + pull_request_target: + types: + - opened + - reopened + - synchronize +jobs: + check-branches: + runs-on: ubuntu-latest + steps: + - name: Check branches + run: | + if [ ${{ github.head_ref }} != "development" ] && [ ${{ github.base_ref }} == "master" ]; then + echo "Merge requests to master are only allowed from development." + exit 1 + fi \ No newline at end of file From 8d5640aba3205eb5db3a4aafe3b4794cc58a98b1 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 17 Sep 2023 11:35:19 +0200 Subject: [PATCH 2/3] UI - Fixed various rename dialogs cancelling instead of submitting when pressing enter Submission wizard - Allow window to scroll when setting up layer adaption hints Local web API - Added status endpoint to determine whether webserver is running --- src/Artemis.UI.Shared/Styles/Artemis.axaml | 1 + .../Styles/ScrollViewer.axaml | 15 ++++ .../Controllers/RemoteController.cs | 6 ++ .../ProfileElementRenameView.axaml | 3 - .../ProfileElementRenameViewModel.cs | 2 - .../LayerEffectRenameView.axaml | 3 - .../LayerEffectRenameViewModel.cs | 2 - .../SidebarCategoryEditView.axaml | 5 +- .../SidebarCategoryEditView.axaml.cs | 18 ++++- .../SidebarCategoryEditViewModel.cs | 2 - .../ProfileAdaptionHintsStepView.axaml | 73 +++++++++++-------- 11 files changed, 79 insertions(+), 51 deletions(-) create mode 100644 src/Artemis.UI.Shared/Styles/ScrollViewer.axaml diff --git a/src/Artemis.UI.Shared/Styles/Artemis.axaml b/src/Artemis.UI.Shared/Styles/Artemis.axaml index d32872413..00a87c6d3 100644 --- a/src/Artemis.UI.Shared/Styles/Artemis.axaml +++ b/src/Artemis.UI.Shared/Styles/Artemis.axaml @@ -45,4 +45,5 @@ + \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Styles/ScrollViewer.axaml b/src/Artemis.UI.Shared/Styles/ScrollViewer.axaml new file mode 100644 index 000000000..db4e5985f --- /dev/null +++ b/src/Artemis.UI.Shared/Styles/ScrollViewer.axaml @@ -0,0 +1,15 @@ + + diff --git a/src/Artemis.UI/Controllers/RemoteController.cs b/src/Artemis.UI/Controllers/RemoteController.cs index 56b88ef6a..abf1e7c89 100644 --- a/src/Artemis.UI/Controllers/RemoteController.cs +++ b/src/Artemis.UI/Controllers/RemoteController.cs @@ -20,6 +20,12 @@ public class RemoteController : WebApiController _mainWindowService = mainWindowService; } + [Route(HttpVerbs.Any, "/status")] + public void GetStatus() + { + HttpContext.Response.StatusCode = 200; + } + [Route(HttpVerbs.Post, "/remote/bring-to-foreground")] public void PostBringToForeground() { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameView.axaml b/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameView.axaml index d9a846e3e..4d08b66ec 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameView.axaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameView.axaml @@ -7,9 +7,6 @@ x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.ContentDialogs.ProfileElementRenameView" x:DataType="contentDialogs:ProfileElementRenameViewModel"> - - - diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameViewModel.cs index 26a07ff15..de2b72860 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/ContentDialogs/ProfileElementRenameViewModel.cs @@ -22,7 +22,6 @@ public class ProfileElementRenameViewModel : ContentDialogViewModelBase _profileElementName = profileElement.Name; Confirm = ReactiveCommand.Create(ExecuteConfirm, ValidationContext.Valid); - Enter = ReactiveCommand.Create(() => ContentDialog?.Hide(ContentDialogResult.Primary), Confirm.CanExecute); this.ValidationRule(vm => vm.ProfileElementName, name => !string.IsNullOrWhiteSpace(name), "You must specify a valid name"); } @@ -33,7 +32,6 @@ public class ProfileElementRenameViewModel : ContentDialogViewModelBase } - public ReactiveCommand Enter { get; } public ReactiveCommand Confirm { get; } private void ExecuteConfirm() diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameView.axaml b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameView.axaml index ba9da9a27..854942d2f 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameView.axaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameView.axaml @@ -7,9 +7,6 @@ x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Tree.ContentDialogs.LayerEffectRenameView" x:DataType="contentDialogs:LayerEffectRenameViewModel"> - - - \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameViewModel.cs index 7aeb01ab1..776928ce5 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/ContentDialogs/LayerEffectRenameViewModel.cs @@ -22,7 +22,6 @@ public class LayerEffectRenameViewModel : ContentDialogViewModelBase _layerEffectName = layerEffect.Name; Confirm = ReactiveCommand.Create(ExecuteConfirm, ValidationContext.Valid); - Enter = ReactiveCommand.Create(() => ContentDialog?.Hide(ContentDialogResult.Primary), Confirm.CanExecute); this.ValidationRule(vm => vm.LayerEffectName, categoryName => !string.IsNullOrWhiteSpace(categoryName), "You must specify a valid name"); } @@ -33,7 +32,6 @@ public class LayerEffectRenameViewModel : ContentDialogViewModelBase } public ReactiveCommand Confirm { get; } - public ReactiveCommand Enter { get; } private void ExecuteConfirm() { diff --git a/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml b/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml index a27bb9281..8250fe739 100644 --- a/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml +++ b/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml @@ -7,9 +7,6 @@ x:Class="Artemis.UI.Screens.Sidebar.SidebarCategoryEditView" x:DataType="sidebar:SidebarCategoryEditViewModel"> - - - - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml.cs b/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml.cs index a9447050f..ac9c1d71a 100644 --- a/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml.cs +++ b/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditView.axaml.cs @@ -1,6 +1,7 @@ +using System.Threading.Tasks; using Artemis.UI.Shared.Extensions; -using Avalonia.Markup.Xaml; using Avalonia.ReactiveUI; +using Avalonia.Threading; using ReactiveUI; namespace Artemis.UI.Screens.Sidebar; @@ -10,7 +11,18 @@ public partial class SidebarCategoryEditView : ReactiveUserControl this.ClearAllDataValidationErrors()); + this.WhenActivated(_ => + { + this.ClearAllDataValidationErrors(); + Dispatcher.UIThread.Post(DelayedAutoFocus); + }); + } + + private async void DelayedAutoFocus() + { + // Don't ask + await Task.Delay(200); + NameTextBox.SelectAll(); + NameTextBox.Focus(); } - } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditViewModel.cs b/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditViewModel.cs index 0884562ed..5096cc2d3 100644 --- a/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditViewModel.cs +++ b/src/Artemis.UI/Screens/Sidebar/ContentDialogs/SidebarCategoryEditViewModel.cs @@ -24,7 +24,6 @@ public class SidebarCategoryEditViewModel : ContentDialogViewModelBase _categoryName = _category.Name; Confirm = ReactiveCommand.Create(ExecuteConfirm, ValidationContext.Valid); - Enter = ReactiveCommand.Create(() => ContentDialog?.Hide(ContentDialogResult.Primary), Confirm.CanExecute); this.ValidationRule(vm => vm.CategoryName, categoryName => !string.IsNullOrWhiteSpace(categoryName?.Trim()), "You must specify a valid name"); this.ValidationRule(vm => vm.CategoryName, categoryName => profileService.ProfileCategories.All(c => c.Name != categoryName?.Trim()), "You must specify a unique name"); } @@ -36,7 +35,6 @@ public class SidebarCategoryEditViewModel : ContentDialogViewModelBase } public ReactiveCommand Confirm { get; } - public ReactiveCommand Enter { get; } private void ExecuteConfirm() { diff --git a/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/Profile/ProfileAdaptionHintsStepView.axaml b/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/Profile/ProfileAdaptionHintsStepView.axaml index b85ffdb0f..5fd3cbcdb 100644 --- a/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/Profile/ProfileAdaptionHintsStepView.axaml +++ b/src/Artemis.UI/Screens/Workshop/SubmissionWizard/Steps/Profile/ProfileAdaptionHintsStepView.axaml @@ -31,37 +31,46 @@ Learn more about adaption hints - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8a4390fb805552591e3161d81ea28c0723e8cb09 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 17 Sep 2023 11:58:38 +0200 Subject: [PATCH 3/3] Meta - Upgraded Nuget packages --- src/Artemis.Core/Artemis.Core.csproj | 10 +++++----- src/Artemis.Storage/Artemis.Storage.csproj | 4 ++-- src/Artemis.UI.Linux/Artemis.UI.Linux.csproj | 2 +- src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj | 2 +- src/Artemis.UI.Shared/Artemis.UI.Shared.csproj | 4 ++-- src/Artemis.UI.Windows/Artemis.UI.Windows.csproj | 4 ++-- src/Artemis.UI/Artemis.UI.csproj | 16 +++++++--------- .../Artemis.VisualScripting.csproj | 4 ++-- .../Artemis.WebClient.Updating.csproj | 5 +++-- .../Artemis.WebClient.Workshop.csproj | 15 ++++++++------- src/Artemis.props | 4 ++-- src/Artemis.sln | 16 ++++++++-------- 12 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index 43c8f65c9..d6f7f9a4a 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -38,18 +38,18 @@ - + - - + + - + - + diff --git a/src/Artemis.Storage/Artemis.Storage.csproj b/src/Artemis.Storage/Artemis.Storage.csproj index fcb97b0c5..8baf3a9c5 100644 --- a/src/Artemis.Storage/Artemis.Storage.csproj +++ b/src/Artemis.Storage/Artemis.Storage.csproj @@ -8,7 +8,7 @@ - - + + \ No newline at end of file diff --git a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj index cb282136f..6bd6f0ef5 100644 --- a/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj +++ b/src/Artemis.UI.Linux/Artemis.UI.Linux.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj index 57649624f..464d61801 100644 --- a/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj +++ b/src/Artemis.UI.MacOS/Artemis.UI.MacOS.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj index 5e84fa443..1f60cc8ab 100644 --- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj @@ -18,10 +18,10 @@ - + - + diff --git a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj index bd7210217..fd242524d 100644 --- a/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj +++ b/src/Artemis.UI.Windows/Artemis.UI.Windows.csproj @@ -31,9 +31,9 @@ - + - + diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index b468d03f6..47ba8ebb3 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -30,22 +30,20 @@ - - + + - - + - - + + - - - + + diff --git a/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj b/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj index 379f1ad87..229cd61b8 100644 --- a/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj +++ b/src/Artemis.VisualScripting/Artemis.VisualScripting.csproj @@ -12,9 +12,9 @@ - + - + diff --git a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj index 515d3bb6c..5d929b8d6 100644 --- a/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj +++ b/src/Artemis.WebClient.Updating/Artemis.WebClient.Updating.csproj @@ -5,14 +5,15 @@ net7.0 enable enable + x64 - + - + diff --git a/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj b/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj index 391d5c4b5..ab2dc0658 100644 --- a/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj +++ b/src/Artemis.WebClient.Workshop/Artemis.WebClient.Workshop.csproj @@ -5,18 +5,19 @@ net7.0 enable enable + x64 - + - + - + - - - - + + + + diff --git a/src/Artemis.props b/src/Artemis.props index 5ac28492e..de3c77fbe 100644 --- a/src/Artemis.props +++ b/src/Artemis.props @@ -2,8 +2,8 @@ 11.0.4 11.0.2 - 2.0.1 + 2.0.4 2.0.0-prerelease.101 - 2.88.3 + 2.88.5 \ No newline at end of file diff --git a/src/Artemis.sln b/src/Artemis.sln index 7f25476e6..ce19ea4e3 100644 --- a/src/Artemis.sln +++ b/src/Artemis.sln @@ -68,14 +68,14 @@ Global {412B921A-26F5-4AE6-8B32-0C19BE54F421}.Debug|x64.Build.0 = Debug|x64 {412B921A-26F5-4AE6-8B32-0C19BE54F421}.Release|x64.ActiveCfg = Release|x64 {412B921A-26F5-4AE6-8B32-0C19BE54F421}.Release|x64.Build.0 = Release|x64 - {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Debug|x64.Build.0 = Debug|Any CPU - {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Release|x64.ActiveCfg = Release|Any CPU - {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Release|x64.Build.0 = Release|Any CPU - {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Debug|x64.ActiveCfg = Debug|Any CPU - {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Debug|x64.Build.0 = Debug|Any CPU - {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Release|x64.ActiveCfg = Release|Any CPU - {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Release|x64.Build.0 = Release|Any CPU + {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Debug|x64.ActiveCfg = Debug|x64 + {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Debug|x64.Build.0 = Debug|x64 + {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Release|x64.ActiveCfg = Release|x64 + {7C8C6F50-0CC8-45B3-B608-A7218C005E4B}.Release|x64.Build.0 = Release|x64 + {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Debug|x64.ActiveCfg = Debug|x64 + {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Debug|x64.Build.0 = Debug|x64 + {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Release|x64.ActiveCfg = Release|x64 + {2B982C2E-3CBC-4DAB-9167-CCCA4C78E92B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE