From 0d5ecb7427ce44e050f5801a0515ee9814abfe7d Mon Sep 17 00:00:00 2001 From: Charles Nurse Date: Tue, 2 Mar 2021 12:03:26 -0800 Subject: [PATCH 1/3] Include gitignore and README files in Solution Files folder, so they are more accessible for editing --- Oqtane.sln | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Oqtane.sln b/Oqtane.sln index 2755bdb2..70e85123 100644 --- a/Oqtane.sln +++ b/Oqtane.sln @@ -16,6 +16,8 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{77EECA8C-B58E-469E-B8C5-D543AFC9A654}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig + .gitignore = .gitignore + README.md = README.md EndProjectSection EndProject Global From dbc4e3ea66c974a903e053bf5d5866ce8e3c74ec Mon Sep 17 00:00:00 2001 From: Charles Nurse Date: Tue, 2 Mar 2021 12:07:04 -0800 Subject: [PATCH 2/3] Add the Jetbrains Rider "idea" folder to gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index d47b8dcf..98408e86 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ msbuild.binlog *.binlog *.nupkg +*.idea + Oqtane.Server/appsettings.json Oqtane.Server/Data/*.mdf Oqtane.Server/Data/*.ldf From 745575c1f1671d458034f00a3bc4532032e49321 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Thu, 4 Mar 2021 08:30:09 -0500 Subject: [PATCH 3/3] Fix UX issue where the Location field was not being updated when the user selected Create Module --- .../Modules/Admin/ModuleCreator/Index.razor | 79 ++++++++++--------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/ModuleCreator/Index.razor b/Oqtane.Client/Modules/Admin/ModuleCreator/Index.razor index 66794ad5..d824e595 100644 --- a/Oqtane.Client/Modules/Admin/ModuleCreator/Index.razor +++ b/Oqtane.Client/Modules/Admin/ModuleCreator/Index.razor @@ -85,28 +85,38 @@ else } @code { - private string _moduledefinitionname = ""; + private string _moduledefinitionname = string.Empty; private string _owner = string.Empty; private string _module = string.Empty; private string _description = string.Empty; private string _template = "-"; public string _reference = Constants.Version; private string _location = string.Empty; + private Dictionary _systeminfo; public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host; - protected override void OnInitialized() + protected override async Task OnInitializedAsync() { - _moduledefinitionname = SettingService.GetSetting(ModuleState.Settings, "ModuleDefinitionName", ""); - if (string.IsNullOrEmpty(_moduledefinitionname)) + try { - _owner = ModuleState.Title; - _module = ModuleState.Title; - _description = ModuleState.Title; + _moduledefinitionname = SettingService.GetSetting(ModuleState.Settings, "ModuleDefinitionName", ""); + _systeminfo = await SystemService.GetSystemInfoAsync(); + + if (string.IsNullOrEmpty(_moduledefinitionname)) + { + _owner = ModuleState.Title; + _module = ModuleState.Title; + _description = ModuleState.Title; + } + else + { + AddModuleMessage(Localizer["Once You Have Compiled The Module And Restarted The Application You Can Activate The Module Below"], MessageType.Info); + } } - else + catch (Exception ex) { - AddModuleMessage(Localizer["Once You Have Compiled The Module And Restarted The Application You Can Activate The Module Below"], MessageType.Info); + await logger.LogError(ex, "Error Loading Module Creator"); } } @@ -123,6 +133,8 @@ else SettingService.SetSetting(settings, "ModuleDefinitionName", moduleDefinition.ModuleDefinitionName); await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId); + GetLocation(); + AddModuleMessage(Localizer["The Source Code For Your Module Has Been Created At The Location Specified Below And Must Be Compiled In Order To Make It Functional. Once It Has Been Compiled You Must Restart Your Application To Apply These Changes.", NavigateUrl("admin/system")], MessageType.Success); } else @@ -161,38 +173,31 @@ else return !string.IsNullOrEmpty(name) && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$"); } - private async void TemplateChanged(ChangeEventArgs e) + private void TemplateChanged(ChangeEventArgs e) { - try + _template = (string)e.Value; + GetLocation(); + } + + private void GetLocation() + { + _location = string.Empty; + if (_template != "-" && _systeminfo != null && _systeminfo.ContainsKey("serverpath")) { - _location = string.Empty; - _template = (string)e.Value; - if (_template != "-") + string[] path = _systeminfo["serverpath"].Split(Path.DirectorySeparatorChar); + if (_template == "internal") { - Dictionary systeminfo = await SystemService.GetSystemInfoAsync(); - if (systeminfo != null) - { - string[] path = systeminfo["serverpath"].Split(Path.DirectorySeparatorChar); - if (_template == "internal") - { - _location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 1) + - Path.DirectorySeparatorChar + "Oqtane.Client" + - Path.DirectorySeparatorChar + "Modules" + - Path.DirectorySeparatorChar + _owner + "." + _module; - } - else - { - _location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 2) + - Path.DirectorySeparatorChar + _owner + "." + _module; - } - } + _location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 1) + + Path.DirectorySeparatorChar + "Oqtane.Client" + + Path.DirectorySeparatorChar + "Modules" + + Path.DirectorySeparatorChar + _owner + "." + _module; + } + else + { + _location = string.Join(Path.DirectorySeparatorChar, path, 0, path.Length - 2) + + Path.DirectorySeparatorChar + _owner + "." + _module; } - StateHasChanged(); - } - catch (Exception ex) - { - await logger.LogError(ex, "Error Getting System Info {Error}", ex.Message); - AddModuleMessage(Localizer["Error Getting System Info"], MessageType.Error); } + StateHasChanged(); } }