Skip to content

Commit

Permalink
2024-03-07 BRyanSoltis - v4.1.0 Updates
Browse files Browse the repository at this point in the history
### FEATURES
- Updated site to allow uppercase/lowercase characters for resources
- Updated Generate page messaging for resource types that only allow lowercase characters

### BUG FIXES
- Updated modal messaging
- Updated Configuration page to add component options at end of list
  • Loading branch information
BryanSoltis committed Mar 7, 2024
1 parent 38597a0 commit 0f51c6e
Show file tree
Hide file tree
Showing 31 changed files with 850 additions and 152 deletions.
2 changes: 1 addition & 1 deletion src/AzureNamingTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>4.0.1</Version>
<Version>4.1.0</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<UserSecretsId>eca63fb9-b7f9-454f-910b-5088ae877085</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
2 changes: 2 additions & 0 deletions src/AzureNamingTool.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<ActiveDebugProfile>http</ActiveDebugProfile>
<NameOfLastUsedPublishProfile>C:\Projects\AzureNamingTool\.github\workflows\codeql.yml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
Expand Down
41 changes: 23 additions & 18 deletions src/Components/Modals/AddModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@


@code {
[CascadingParameter] BlazoredModalInstance ModalInstance { get; set; } = new();
[Parameter] public ThemeInfo theme { get; set; } = new();
[CascadingParameter] BlazoredModalInstance ModalInstance { get; set; } = new();
[Parameter] public ThemeInfo theme { get; set; } = new();

[Parameter] public int id { get; set; } = 0;
[Parameter] public string title { get; set; } = String.Empty;
[Parameter] public string message { get; set; } = String.Empty;
[Parameter] public string type { get; set; } = String.Empty;
[Parameter] public string parentcomponent { get; set; } = String.Empty;
[Parameter] public string headerstyle { get; set; } = String.Empty;
[Parameter] public bool admin { get; set; } = false;
[Parameter] public ServicesData servicesData { get; set; } = new();
[Parameter] public int id { get; set; } = 0;
[Parameter] public string title { get; set; } = String.Empty;
[Parameter] public string message { get; set; } = String.Empty;
[Parameter] public string type { get; set; } = String.Empty;
[Parameter] public string parentcomponent { get; set; } = String.Empty;
[Parameter] public string headerstyle { get; set; } = String.Empty;
[Parameter] public bool admin { get; set; } = false;
[Parameter] public ServicesData servicesData { get; set; } = new();


private ServiceResponse serviceResponse = new();
Expand Down Expand Up @@ -260,9 +260,14 @@
{
if ((!String.IsNullOrEmpty(itemName)) && (!String.IsNullOrEmpty(itemShortName)))
{
if(itemShortName.Any(Char.IsWhiteSpace))
{
toastService.ShowError("You must enter a valid short name with no spaces!");
break;
}

if (await ValidationHelper.ValidateShortName(type, itemShortName, this.parentcomponent))
{
itemShortName = itemShortName.ToLower();
string normailzedname = GeneralHelper.NormalizeName(itemName, true);
switch (type)
{
Expand All @@ -280,7 +285,7 @@
ResourceEnvironment resourceEnvironment = new ResourceEnvironment()
{
Name = itemName,
ShortName = itemShortName.ToLower()
ShortName = itemShortName

};
serviceResponse = await ResourceEnvironmentService.PostItem(resourceEnvironment);
Expand All @@ -301,7 +306,7 @@
ResourceLocation resourceLocation = new ResourceLocation()
{
Name = itemName,
ShortName = itemShortName.ToLower()
ShortName = itemShortName

};
serviceResponse = await ResourceLocationService.PostItem(resourceLocation);
Expand All @@ -322,7 +327,7 @@
ResourceOrg resourceOrg = new ResourceOrg()
{
Name = itemName,
ShortName = itemShortName.ToLower()
ShortName = itemShortName

};
serviceResponse = await ResourceOrgService.PostItem(resourceOrg);
Expand All @@ -343,7 +348,7 @@
ResourceProjAppSvc resourceProjAppSvc = new ResourceProjAppSvc()
{
Name = itemName,
ShortName = itemShortName.ToLower()
ShortName = itemShortName

};
serviceResponse = await ResourceProjAppSvcService.PostItem(resourceProjAppSvc);
Expand All @@ -364,7 +369,7 @@
ResourceUnitDept resourceUnitDept = new ResourceUnitDept()
{
Name = itemName,
ShortName = itemShortName.ToLower()
ShortName = itemShortName

};
serviceResponse = await ResourceUnitDeptService.PostItem(resourceUnitDept);
Expand All @@ -385,7 +390,7 @@
ResourceFunction resourceFunction = new ResourceFunction()
{
Name = itemName,
ShortName = itemShortName.ToLower()
ShortName = itemShortName

};
serviceResponse = await ResourceFunctionService.PostItem(resourceFunction);
Expand All @@ -406,7 +411,7 @@
CustomComponent customComponent = new CustomComponent()
{
Name = itemName,
ShortName = itemShortName.ToLower(),
ShortName = itemShortName,
ParentComponent = GeneralHelper.NormalizeName(this.parentcomponent, true),
MinLength = itemMinLength,
MaxLength = itemMaxLength
Expand Down
34 changes: 34 additions & 0 deletions src/Components/Pages/Admin.razor
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,30 @@
</div>
</div>
</div>
<!--
// TO DO: Implement retention of the selected values
<div class="card mb-3" style="width:auto;">
<div class="card-header bg-default text-dark">
<a class="text-decoration-none text-dark" data-bs-toggle="collapse" style="display:block;font-weight:bold;" href="#retaingenerateselections" role="button" aria-expanded="false" aria-controls="retaingenerateselections">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Retain Generate Selections
</a>
</div>
<div class="collapse show card card-body @theme.ThemeStyle" id="retaingenerateselections">
<div class="mb-3">
<p>
Enable/Disable <span class="fw-bold">Retaining of selections after name generation</span> for all users.
</p>
</div>
<div>
<label class="switch" title="Retain Generate Seelctions">
<input type="checkbox" checked="@retaingenerateselections" @oninput='args => SettingChanged(args, "retaingenerateselections")'>
<span class="slider round"></span>
</label>
<span class="align-text-top"> Enable</span>
</div>
</div>
</div>
-->
<div class="card mb-3" style="width:auto;">
<div class="card-header bg-default text-dark">
<a class="text-decoration-none text-dark" data-bs-toggle="collapse" style="display:block;font-weight:bold;" href="#connectivitycheck" role="button" aria-expanded="false" aria-controls="connectivitycheck">
Expand Down Expand Up @@ -594,6 +618,7 @@
private bool instructionsenabled = false;
private bool generatednameslogenabled = false;
private bool latestnewsenabled = false;
private bool retaingenerateselections = false;
private string currentgenerationwebhook = String.Empty;
private string versionalert = String.Empty;
private string appversion = String.Empty;
Expand Down Expand Up @@ -628,6 +653,7 @@
instructionsenabled = Convert.ToBoolean(ConfigurationHelper.GetAppSetting("InstructionsEnabled"));
generatednameslogenabled = Convert.ToBoolean(ConfigurationHelper.GetAppSetting("GeneratedNamesLogEnabled"));
latestnewsenabled = Convert.ToBoolean(ConfigurationHelper.GetAppSetting("LatestNewsEnabled"));
retaingenerateselections = Convert.ToBoolean(ConfigurationHelper.GetAppSetting("RetainGenerateSelections"));
currentgenerationwebhook = ConfigurationHelper.GetAppSetting("GenerationWebhook", true);
currentidentityheadername = ConfigurationHelper.GetAppSetting("IdentityHeaderName", true);
if (GeneralHelper.IsNotNull(identityProviderDetails))
Expand Down Expand Up @@ -955,6 +981,7 @@
ConfigurationHelper.SetAppSetting("InstructionsEnabled", resetconfig.InstructionsEnabled!, false);
ConfigurationHelper.SetAppSetting("GeneratedNamesLogEnabled", resetconfig.GeneratedNamesLogEnabled!, false);
ConfigurationHelper.SetAppSetting("LatestNewsEnabled", resetconfig.LatestNewsEnabled!, false);
ConfigurationHelper.SetAppSetting("RetainGenerateSelections", resetconfig.RetainGenerateSelections!, false);
ConfigurationHelper.SetAppSetting("ConnectivityCheckEnabled", resetconfig.ConnectivityCheckEnabled!, false);
ConfigurationHelper.SetAppSetting("GenerationWebhook", String.Empty, true);
NavigationManager.NavigateTo("admin?reset=true", true);
Expand Down Expand Up @@ -1116,6 +1143,13 @@
message.Message = "Latest News Enabled setting updated to " + e.Value?.ToString()!.ToUpper() ?? "" + "!";
}
break;
case "retaingenerateselections":
if (GeneralHelper.IsNotNull(e.Value))
{
ConfigurationHelper.SetAppSetting("RetainGenerateSelections", e.Value!.ToString() ?? "");
message.Message = "Retain Generate Selections setting updated to " + e.Value?.ToString()!.ToUpper() ?? "" + "!";
}
break;
}
message.Type = MessageTypesEnum.SUCCESS;
message.Header = "SUCCESS";
Expand Down
Loading

0 comments on commit 0f51c6e

Please sign in to comment.