don't show included in when no mandatory addon
This commit is contained in:
parent
6c884b7804
commit
92af0a9627
3 changed files with 20 additions and 4 deletions
|
|
@ -25,6 +25,8 @@ class DOMManager {
|
||||||
this.elements.addonsContainer = document.getElementById('addonsContainer');
|
this.elements.addonsContainer = document.getElementById('addonsContainer');
|
||||||
this.elements.addonPricingContainer = document.getElementById('addonPricingContainer');
|
this.elements.addonPricingContainer = document.getElementById('addonPricingContainer');
|
||||||
this.elements.managedServiceIncludesContainer = document.getElementById('managedServiceIncludesContainer');
|
this.elements.managedServiceIncludesContainer = document.getElementById('managedServiceIncludesContainer');
|
||||||
|
this.elements.managedServiceIncludes = document.getElementById('managedServiceIncludes');
|
||||||
|
this.elements.managedServiceToggleButton = document.querySelector('button[data-bs-target="#managedServiceIncludes"]');
|
||||||
|
|
||||||
// Result display elements
|
// Result display elements
|
||||||
this.elements.planMatchStatus = document.getElementById('planMatchStatus');
|
this.elements.planMatchStatus = document.getElementById('planMatchStatus');
|
||||||
|
|
|
||||||
|
|
@ -85,14 +85,28 @@ class UIManager {
|
||||||
|
|
||||||
// Update addon pricing display in the results panel
|
// Update addon pricing display in the results panel
|
||||||
updateAddonPricingDisplay(domManager, mandatoryAddons, selectedOptionalAddons) {
|
updateAddonPricingDisplay(domManager, mandatoryAddons, selectedOptionalAddons) {
|
||||||
// Update mandatory addons in the managed service includes container
|
// Get references to the managed service includes elements
|
||||||
const managedServiceIncludesContainer = domManager.get('managedServiceIncludesContainer');
|
const managedServiceIncludesContainer = domManager.get('managedServiceIncludesContainer');
|
||||||
|
const managedServiceIncludes = domManager.get('managedServiceIncludes');
|
||||||
|
const managedServiceToggleButton = domManager.get('managedServiceToggleButton');
|
||||||
|
|
||||||
if (managedServiceIncludesContainer) {
|
if (managedServiceIncludesContainer) {
|
||||||
// Clear existing content
|
// Clear existing content
|
||||||
managedServiceIncludesContainer.innerHTML = '';
|
managedServiceIncludesContainer.innerHTML = '';
|
||||||
|
|
||||||
|
// Show/hide the entire managed service includes section based on mandatory addons
|
||||||
|
const hasMandatoryAddons = mandatoryAddons && mandatoryAddons.length > 0;
|
||||||
|
|
||||||
|
if (managedServiceIncludes) {
|
||||||
|
managedServiceIncludes.style.display = hasMandatoryAddons ? 'block' : 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (managedServiceToggleButton) {
|
||||||
|
managedServiceToggleButton.style.display = hasMandatoryAddons ? 'inline-block' : 'none';
|
||||||
|
}
|
||||||
|
|
||||||
// Add mandatory addons to the managed service includes section
|
// Add mandatory addons to the managed service includes section
|
||||||
if (mandatoryAddons && mandatoryAddons.length > 0) {
|
if (hasMandatoryAddons) {
|
||||||
mandatoryAddons.forEach(addon => {
|
mandatoryAddons.forEach(addon => {
|
||||||
const addonRow = document.createElement('div');
|
const addonRow = document.createElement('div');
|
||||||
addonRow.className = 'd-flex justify-content-between small text-muted mb-1';
|
addonRow.className = 'd-flex justify-content-between small text-muted mb-1';
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<span>Managed Service (incl. Compute)</span>
|
<span>Managed Service (incl. Compute)</span>
|
||||||
<button class="btn btn-link btn-sm p-0 ms-2 text-muted" type="button" data-bs-toggle="collapse" data-bs-target="#managedServiceIncludes" aria-expanded="false" aria-controls="managedServiceIncludes" title="Show what's included">
|
<button class="btn btn-link btn-sm p-0 ms-2 text-muted" type="button" data-bs-toggle="collapse" data-bs-target="#managedServiceIncludes" aria-expanded="false" aria-controls="managedServiceIncludes" title="Show what's included" style="display: none;">
|
||||||
<i class="bi bi-info-circle" id="managedServiceToggleIcon"></i>
|
<i class="bi bi-info-circle" id="managedServiceToggleIcon"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -385,7 +385,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- What's included in managed service (collapsible) -->
|
<!-- What's included in managed service (collapsible) -->
|
||||||
<div class="collapse" id="managedServiceIncludes">
|
<div class="collapse" id="managedServiceIncludes" style="display: none;">
|
||||||
<div class="ps-3 border-start border-2 border-success-subtle">
|
<div class="ps-3 border-start border-2 border-success-subtle">
|
||||||
<div class="small text-muted mb-2">
|
<div class="small text-muted mb-2">
|
||||||
<i class="bi bi-check-circle-fill text-success me-1"></i>
|
<i class="bi bi-check-circle-fill text-success me-1"></i>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue