From 075e9931fca5cfc909cfb71844176d94bc045866 Mon Sep 17 00:00:00 2001 From: Bryan Soltis Date: Thu, 24 Aug 2023 09:33:12 -0500 Subject: [PATCH 1/3] 2023-08-24 - BryanSoltis - v3.0.2 Updates - Updated Generate page multi-select logic --- src/Helpers/GeneralHelper.cs | 1 + src/Pages/Generate.razor | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Helpers/GeneralHelper.cs b/src/Helpers/GeneralHelper.cs index 5fe8932..3cd6195 100644 --- a/src/Helpers/GeneralHelper.cs +++ b/src/Helpers/GeneralHelper.cs @@ -124,6 +124,7 @@ public static string SetTextEnabledClass(bool enabled) public static string[] FormatResoureType(string type) { String[] returntype = new String[3]; + returntype[0] = type; // Make sure it is a full resource type name if (type.Contains("(")) { diff --git a/src/Pages/Generate.razor b/src/Pages/Generate.razor index ee4c883..af3955c 100644 --- a/src/Pages/Generate.razor +++ b/src/Pages/Generate.razor @@ -781,21 +781,18 @@ multiselectedResourceTypes = (List)result.Data; if (GeneralHelper.IsNotNull(multiselectedResourceTypes)) { - if (GeneralHelper.IsNotNull(multiselectedResourceTypes)) + if (multiselectedResourceTypes.Count > 0) { - if (multiselectedResourceTypes.Count > 0) + ResourceType currentmultiresourcertype = servicesData.ResourceTypes!.Find((t) => t.Id == Convert.ToInt32(multiselectedResourceTypes![0].ToString()))!; + if (GeneralHelper.IsNotNull(currentmultiresourcertype)) { - ResourceType currentmultiresourcertpe = servicesData.ResourceTypes!.Find((t) => t.Id == Convert.ToInt32(multiselectedResourceTypes![0].ToString()))!; - if (GeneralHelper.IsNotNull(currentmultiresourcertpe)) - { - OnTypeChanged(currentmultiresourcertpe.Resource); - } - componentsVisible = ""; - } - else - { - componentsVisible = "collapse"; + await OnTypeChanged(currentmultiresourcertype.Resource); } + componentsVisible = ""; + } + else + { + componentsVisible = "collapse"; } } } @@ -814,7 +811,7 @@ componentsVisible = "collapse show"; } - private async void OnTypeChanged(string value) + private async Task OnTypeChanged(string value) { try { @@ -829,7 +826,7 @@ if (!String.IsNullOrEmpty(selectedResourceTypeDisplayName)) { selectedResourceTypeFull = GeneralHelper.FormatResoureType(selectedResourceTypeDisplayName); - if(GeneralHelper.IsNotNull(selectedResourceTypeFull[1])) + if (GeneralHelper.IsNotNull(selectedResourceTypeFull[1])) { selectedResourceType = selectedResourceTypeFull[1]; } From adc99ae7269a6ed3739bbdef682af19c3f430d30 Mon Sep 17 00:00:00 2001 From: Bryan Soltis Date: Wed, 30 Aug 2023 08:34:37 -0500 Subject: [PATCH 2/3] 2023-08-30 - BryanSoltis - v3.0.2 Updates - Updated Configuration Reset to retasin admin users configuration --- src/Helpers/ConfigurationHelper.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Helpers/ConfigurationHelper.cs b/src/Helpers/ConfigurationHelper.cs index e428cb7..5b1f4e0 100644 --- a/src/Helpers/ConfigurationHelper.cs +++ b/src/Helpers/ConfigurationHelper.cs @@ -537,10 +537,15 @@ public static bool ResetSiteConfiguration() // Get all the files in the repository folder DirectoryInfo repositoryDir = new("repository"); // Filter out the appsettings.json to retain admin credentials - foreach (FileInfo file in repositoryDir.GetFiles().Where(x => x.Name != "appsettings.json")) + string[] protectedfilenames = { "adminusers.json", "appsettings.json" }; + foreach (FileInfo file in repositoryDir.GetFiles()) { - // Copy the repository file to the settings folder - file.CopyTo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings/" + file.Name), true); + //Only copy non-admin files + if (!protectedfilenames.Contains(file.Name.ToLower())) + { + // Copy the repository file to the settings folder + file.CopyTo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings/" + file.Name), true); + } } // Clear the cache From 5e06332ae3ef68ce492f30eac870684236e2fa5b Mon Sep 17 00:00:00 2001 From: Bryan Soltis Date: Tue, 5 Sep 2023 08:36:34 -0500 Subject: [PATCH 3/3] - Updated version --- src/AzureNamingTool.csproj | 2 +- src/programsettings.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AzureNamingTool.csproj b/src/AzureNamingTool.csproj index 579903e..2198866 100644 --- a/src/AzureNamingTool.csproj +++ b/src/AzureNamingTool.csproj @@ -1,7 +1,7 @@  - 3.0.1 + 3.0.2 net7.0 enable enable diff --git a/src/programsettings.json b/src/programsettings.json index 27ef7f0..cf7ab0d 100644 --- a/src/programsettings.json +++ b/src/programsettings.json @@ -1,5 +1,5 @@ { "FeedbackURL": "https://forms.office.com/r/M2EZLg6zKq", "latestNewsEnabled": "false", - "toolVersion":"3.0.1" + "toolVersion":"3.0.2" }