Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>5.0.0</Version>
<Version>5.0.1</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS8602;CS8600;CS1998</NoWarn>
<UserSecretsId>eca63fb9-b7f9-454f-910b-5088ae877085</UserSecretsId>
Expand Down
28 changes: 23 additions & 5 deletions src/Components/Modals/AddModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,10 @@
</div>
</div>
<div id="typemetdadatacontainer" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="typemetdadatalink" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#typemetdadata" role="button" aria-expanded="false" aria-controls="typemetdadata">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Resoure Type Metadata
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("typemetdadata"))" @onclick="@(() => ToggleCollapse("typemetdadata"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Resource Type Metadata
</div>
<div class="collapse modern-card-body" id="typemetdadata">
<div class="modern-card-body @(GetCollapseClass("typemetdadata"))" id="typemetdadata">
<div style="margin-bottom: 1rem;">
<p>
This section allows you to edit the Resouce Type metadata.
Expand Down Expand Up @@ -716,5 +714,25 @@


async Task Cancel() => await ModalInstance.CancelAsync();

// Collapse management for sections
private HashSet<string> collapsedSections = new HashSet<string> { "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" : "";
}
}

103 changes: 64 additions & 39 deletions src/Components/Modals/EditModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</p>
@if (type == "ResourceType")
{
if (Convert.ToBoolean(config.ResourceTypeEditingAllowed))
if (Convert.ToBoolean(config.ResourceTypeEditingAllowed) && !isDangerAlertDismissed)
{
<div class="alert alert-danger alert-dismissible fade show" style="margin-bottom: 1rem;" role="alert">
<h4>ATTENTION</h4>
Expand All @@ -41,21 +41,21 @@
</p>
</div>
<div>
<button type="button" class="close btn btn-light" data-bs-dismiss="alert" aria-label="Dismiss">
<button type="button" class="close btn btn-light" @onclick="DismissDangerAlert" aria-label="Dismiss">
<span aria-hidden="true">Dismiss</span>
</button>
</div>
</div>
}
else
else if (!isWarningAlertDismissed)
{
<div class="alert alert-warning alert-dismissible fade show" style="margin-bottom: 1rem;" role="alert">
<h4>NOTE</h4>
<div style="margin-bottom: 1rem;">
Resource Type settings are disabled by default. You can allow the editing of these values by enabling the "Resource Type Editing" setting in the Admin section.
</div>
<div>
<button type="button" class="close btn btn-light" data-bs-dismiss="alert" aria-label="Dismiss">
<button type="button" class="close btn btn-light" @onclick="DismissWarningAlert" aria-label="Dismiss">
<span aria-hidden="true">Dismiss</span>
</button>
</div>
Expand Down Expand Up @@ -230,12 +230,10 @@
</div>
</div>
<div id="typemetdadatacontainer" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="typemetdadatalink" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#typemetdadata" role="button" aria-expanded="false" aria-controls="typemetdadata">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Resoure Type Metadata
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("typemetdadata"))" @onclick="@(() => ToggleCollapse("typemetdadata"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Resource Type Metadata
</div>
<div class="collapse modern-card-body" id="typemetdadata">
<div class="modern-card-body @(GetCollapseClass("typemetdadata"))" id="typemetdadata">
<div style="margin-bottom: 1rem;">
<p>
This section allows you to edit the Resouce Type metadata.
Expand Down Expand Up @@ -348,12 +346,10 @@
</div>
</div>
<div id="typemetdadatadisabledcontainer" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="typemetdadatadisabledlink" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#typemetdadatadisabled" role="button" aria-expanded="false" aria-controls="typemetdadatadisabled">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Resoure Type Metadata
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("typemetdadatadisabled"))" @onclick="@(() => ToggleCollapse("typemetdadatadisabled"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Resource Type Metadata
</div>
<div class="collapse modern-card-body" id="typemetdadatadisabled">
<div class="modern-card-body @(GetCollapseClass("typemetdadatadisabled"))" id="typemetdadatadisabled">
<div style="margin-bottom: 1rem;">
This section allows you to view the Resouce Type metadata.
</div>
Expand Down Expand Up @@ -442,12 +438,10 @@
@if (type == "ResourceComponent")
{
<div id="globallyoptionalcontainer" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="OptionalComponents" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#globallyoptional" role="button" aria-expanded="false" aria-controls="globallyoptional">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Globally Optional Configuration
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("globallyoptional"))" @onclick="@(() => ToggleCollapse("globallyoptional"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Globally Optional Configuration
</div>
<div class="collapse modern-card-body" id="globallyoptional">
<div class="modern-card-body @(GetCollapseClass("globallyoptional"))" id="globallyoptional">
<div style="margin-bottom: 1rem;">
This section allows you to add/remove the component as OPTIONAL for all resource types.
</div>
Expand All @@ -458,7 +452,7 @@
This option will ADD the component as OPTIONAL for all resource types.
</td>
<td>
<button type="button" class="modern-btn-success w-100" @onclick="@(e => FormAction("ResourceComponent","optional-add"))" style="min-width:42px;" title="Add as OPTIONAL for all resoure types">
<button type="button" class="modern-btn-success w-100" @onclick="@(e => FormAction("ResourceComponent","optional-add"))" style="min-width:42px;" title="Add as OPTIONAL for all Resource types">
ADD
</button>
</td>
Expand All @@ -468,7 +462,7 @@
This option will REMOVE the component from OPTIONAL for all resource types.
</td>
<td>
<button type="button" class="modern-btn-danger w-100" @onclick="@(e => FormAction("ResourceComponent","optional-remove"))" style="min-width:42px;" title="Remove as OPTIONAL for all resoure types">
<button type="button" class="modern-btn-danger w-100" @onclick="@(e => FormAction("ResourceComponent","optional-remove"))" style="min-width:42px;" title="Remove as OPTIONAL for all Resource types">
REMOVE
</button>
</td>
Expand All @@ -478,12 +472,10 @@
</div>
</div>
<div id="globallyexcludecontainer" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="OptionalComponents" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#globallyexclude" role="button" aria-expanded="false" aria-controls="globallyexclude">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Globally Exclude Configuration
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("globallyexclude"))" @onclick="@(() => ToggleCollapse("globallyexclude"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Globally Exclude Configuration
</div>
<div class="collapse modern-card-body" id="globallyexclude">
<div class="modern-card-body @(GetCollapseClass("globallyexclude"))" id="globallyexclude">
<div style="margin-bottom: 1rem;">
This section allows you to add/remove the component as EXCLUDE for all resource types.
</div>
Expand All @@ -494,7 +486,7 @@
This option will ADD the component as EXCLUDE for all resource types.
</td>
<td>
<button type="button" class="modern-btn-success w-100" @onclick="@(e => FormAction("ResourceComponent","exclude-add"))" style="min-width:42px;" title="Add as EXCLUDE for all resoure types">
<button type="button" class="modern-btn-success w-100" @onclick="@(e => FormAction("ResourceComponent","exclude-add"))" style="min-width:42px;" title="Add as EXCLUDE for all Resource types">
ADD
</button>
</td>
Expand All @@ -504,7 +496,7 @@
This option will REMOVE the component from EXCLUDE for all resource types.
</td>
<td>
<button type="button" class="modern-btn-danger w-100" @onclick="@(e => FormAction("ResourceComponent","exclude-remove"))" style="min-width:42px;" title="Remove as EXCLUDE for all resoure types">
<button type="button" class="modern-btn-danger w-100" @onclick="@(e => FormAction("ResourceComponent","exclude-remove"))" style="min-width:42px;" title="Remove as EXCLUDE for all Resource types">
REMOVE
</button>
</td>
Expand All @@ -517,12 +509,10 @@
@if ((type == "ResourceType") && (GeneralHelper.IsNotNull(resourceComponents)))
{
<div id="optional" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="OptionalComponents" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#optionalcomponents" role="button" aria-expanded="false" aria-controls="optionalcomponents">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Optional Components
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("optionalcomponents"))" @onclick="@(() => ToggleCollapse("optionalcomponents"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Optional Components
</div>
<div class="collapse modern-card-body" id="optionalcomponents">
<div class="modern-card-body @(GetCollapseClass("optionalcomponents"))" id="optionalcomponents">
@foreach (ResourceComponent resourceComponent in resourceComponents)
{
if (resourceComponent.Name != "ResourceType")
Expand All @@ -549,12 +539,10 @@
</div>

<div id="excluded" class="modern-card" style="margin-bottom: 1rem;">
<div class="modern-card-header">
<a id="ExcludedComponents" class="link-dark text-decoration-none" data-bs-toggle="collapse" href="#excludedcomponents" role="button" aria-expanded="false" aria-controls="excludedcomponents">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Excluded Components
</a>
<div class="modern-card-header collapsible @(GetCollapseClass("excludedcomponents"))" @onclick="@(() => ToggleCollapse("excludedcomponents"))">
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Excluded Components
</div>
<div class="collapse modern-card-body" id="excludedcomponents">
<div class="modern-card-body @(GetCollapseClass("excludedcomponents"))" id="excludedcomponents">
@foreach (ResourceComponent resourceComponent in resourceComponents)
{
//@if (resourceComponent.Name != "ResourceType")
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1183,7 +1173,42 @@


async Task Cancel() => await ModalInstance.CancelAsync();
}

// Collapse management for sections
private HashSet<string> collapsedSections = new HashSet<string>
{
"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;
}
}
24 changes: 22 additions & 2 deletions src/Components/Pages/AdminLog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
</div>

<div class="modern-card mb-4">
<div class="modern-card-header collapsible collapsed" data-bs-toggle="collapse" data-bs-target="#adminlogfilter" aria-expanded="false">
<div class="modern-card-header collapsible @(GetCollapseClass("adminlogfilter"))" @onclick="@(() => ToggleCollapse("adminlogfilter"))">
<h3>
<span class="oi oi-chevron-bottom" aria-hidden="true"></span> Filter Data
</h3>
</div>
<div class="collapse modern-card-body" id="adminlogfilter">
<div class="modern-card-body @(GetCollapseClass("adminlogfilter"))" id="adminlogfilter">
<div class="row mb-3">
<div class="col-auto">
<label class="modern-form-label">Start Date</label>
Expand Down Expand Up @@ -272,4 +272,24 @@
enddate = DateTime.Today;
filterData = "";
}

// Collapse management for sections
private HashSet<string> collapsedSections = new HashSet<string> { "adminlogfilter" };

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" : "";
}
}
Loading
Loading