Skip to content

Commit

Permalink
Merge pull request #17 from mspnp/dev
Browse files Browse the repository at this point in the history
2023-09-05 - BryanSoltis - v3.0.2 Updates
  • Loading branch information
BryanSoltis authored Sep 5, 2023
2 parents 9c66609 + 5e06332 commit 5f077c5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/AzureNamingTool.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<Version>3.0.1</Version>
<Version>3.0.2</Version>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
11 changes: 8 additions & 3 deletions src/Helpers/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Helpers/GeneralHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("("))
{
Expand Down
25 changes: 11 additions & 14 deletions src/Pages/Generate.razor
Original file line number Diff line number Diff line change
Expand Up @@ -781,21 +781,18 @@
multiselectedResourceTypes = (List<string>)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";
}
}
}
Expand All @@ -814,7 +811,7 @@
componentsVisible = "collapse show";
}

private async void OnTypeChanged(string value)
private async Task OnTypeChanged(string value)
{
try
{
Expand All @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion src/programsettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"FeedbackURL": "https://forms.office.com/r/M2EZLg6zKq",
"latestNewsEnabled": "false",
"toolVersion":"3.0.1"
"toolVersion":"3.0.2"
}

0 comments on commit 5f077c5

Please sign in to comment.