don't show included in when no mandatory addon

This commit is contained in:
Tobias Brunner 2025-07-16 11:00:35 +02:00
parent 6c884b7804
commit 92af0a9627
Signed by: tobru
SSH key fingerprint: SHA256:kOXg1R6c11XW3/Pt9dbLdQvOJGFAy+B2K6v6PtRWBGQ
3 changed files with 20 additions and 4 deletions

View file

@ -25,6 +25,8 @@ class DOMManager {
this.elements.addonsContainer = document.getElementById('addonsContainer');
this.elements.addonPricingContainer = document.getElementById('addonPricingContainer');
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
this.elements.planMatchStatus = document.getElementById('planMatchStatus');

View file

@ -85,14 +85,28 @@ class UIManager {
// Update addon pricing display in the results panel
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 managedServiceIncludes = domManager.get('managedServiceIncludes');
const managedServiceToggleButton = domManager.get('managedServiceToggleButton');
if (managedServiceIncludesContainer) {
// Clear existing content
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
if (mandatoryAddons && mandatoryAddons.length > 0) {
if (hasMandatoryAddons) {
mandatoryAddons.forEach(addon => {
const addonRow = document.createElement('div');
addonRow.className = 'd-flex justify-content-between small text-muted mb-1';

View file

@ -377,7 +377,7 @@ document.addEventListener('DOMContentLoaded', () => {
<div class="d-flex justify-content-between align-items-center mb-2">
<div class="d-flex align-items-center">
<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>
</button>
</div>
@ -385,7 +385,7 @@ document.addEventListener('DOMContentLoaded', () => {
</div>
<!-- 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="small text-muted mb-2">
<i class="bi bi-check-circle-fill text-success me-1"></i>