diff --git a/src/AzureNamingTool.csproj b/src/AzureNamingTool.csproj index 53bacea2..df898aba 100644 --- a/src/AzureNamingTool.csproj +++ b/src/AzureNamingTool.csproj @@ -4,7 +4,7 @@ net10.0 enable enable - 5.0.0 + 5.0.1 true $(NoWarn);CS8602;CS8600;CS1998 eca63fb9-b7f9-454f-910b-5088ae877085 diff --git a/src/Components/Modals/AddModal.razor b/src/Components/Modals/AddModal.razor index 85e7b240..bac2de24 100644 --- a/src/Components/Modals/AddModal.razor +++ b/src/Components/Modals/AddModal.razor @@ -167,12 +167,10 @@
-
- +
+ Resource Type Metadata
-
+

This section allows you to edit the Resouce Type metadata. @@ -716,5 +714,25 @@ async Task Cancel() => await ModalInstance.CancelAsync(); + + // Collapse management for sections + private HashSet collapsedSections = new HashSet { "typemetdadata" }; + + private void ToggleCollapse(string section) + { + if (collapsedSections.Contains(section)) + { + collapsedSections.Remove(section); + } + else + { + collapsedSections.Add(section); + } + } + + private string GetCollapseClass(string section) + { + return collapsedSections.Contains(section) ? "collapsed" : ""; + } } diff --git a/src/Components/Modals/EditModal.razor b/src/Components/Modals/EditModal.razor index 7c4d9ff8..2de0dce1 100644 --- a/src/Components/Modals/EditModal.razor +++ b/src/Components/Modals/EditModal.razor @@ -28,7 +28,7 @@

@if (type == "ResourceType") { - if (Convert.ToBoolean(config.ResourceTypeEditingAllowed)) + if (Convert.ToBoolean(config.ResourceTypeEditingAllowed) && !isDangerAlertDismissed) {
-
} - else + else if (!isWarningAlertDismissed) {
-
@@ -230,12 +230,10 @@
-
- +
+ Resource Type Metadata
-
+

This section allows you to edit the Resouce Type metadata. @@ -348,12 +346,10 @@

-
- +
+ Resource Type Metadata
-
+
This section allows you to view the Resouce Type metadata.
@@ -442,12 +438,10 @@ @if (type == "ResourceComponent") {
-
- +
+ Globally Optional Configuration
-
+
This section allows you to add/remove the component as OPTIONAL for all resource types.
@@ -458,7 +452,7 @@ This option will ADD the component as OPTIONAL for all resource types. - @@ -468,7 +462,7 @@ This option will REMOVE the component from OPTIONAL for all resource types. - @@ -478,12 +472,10 @@
-
- +
+ Globally Exclude Configuration
-
+
This section allows you to add/remove the component as EXCLUDE for all resource types.
@@ -494,7 +486,7 @@ This option will ADD the component as EXCLUDE for all resource types. - @@ -504,7 +496,7 @@ This option will REMOVE the component from EXCLUDE for all resource types. - @@ -517,12 +509,10 @@ @if ((type == "ResourceType") && (GeneralHelper.IsNotNull(resourceComponents))) {
-
- +
+ Optional Components
-
+
@foreach (ResourceComponent resourceComponent in resourceComponents) { if (resourceComponent.Name != "ResourceType") @@ -549,12 +539,10 @@
-
- +
+ Excluded Components
-
+
@foreach (ResourceComponent resourceComponent in resourceComponents) { //@if (resourceComponent.Name != "ResourceType") @@ -645,6 +633,8 @@ public IAdminLogService? AdminLogService { get; set; } private ServiceResponse serviceResponse = new(); + private bool isDangerAlertDismissed = false; + private bool isWarningAlertDismissed = false; private string itemName = String.Empty; private string itemDisplayName = String.Empty; private string itemShortName = String.Empty; @@ -1183,7 +1173,42 @@ async Task Cancel() => await ModalInstance.CancelAsync(); -} + + // Collapse management for sections + private HashSet collapsedSections = new HashSet + { + "typemetdadata", + "typemetdadatadisabled", + "globallyoptional", + "globallyexclude", + "optionalcomponents", + "excludedcomponents" + }; + + private void ToggleCollapse(string section) + { + if (collapsedSections.Contains(section)) + { + collapsedSections.Remove(section); + } + else + { + collapsedSections.Add(section); + } + } + private string GetCollapseClass(string section) + { + return collapsedSections.Contains(section) ? "collapsed" : ""; + } + private void DismissDangerAlert() + { + isDangerAlertDismissed = true; + } + private void DismissWarningAlert() + { + isWarningAlertDismissed = true; + } +} diff --git a/src/Components/Pages/AdminLog.razor b/src/Components/Pages/AdminLog.razor index 0b28203a..55bc5818 100644 --- a/src/Components/Pages/AdminLog.razor +++ b/src/Components/Pages/AdminLog.razor @@ -64,12 +64,12 @@
-