fixes to mandatory addon display

This commit is contained in:
Tobias Brunner 2025-07-16 11:38:49 +02:00
parent 27c41a6187
commit d3e0fdd941
Signed by: tobru
SSH key fingerprint: SHA256:kOXg1R6c11XW3/Pt9dbLdQvOJGFAy+B2K6v6PtRWBGQ
3 changed files with 15 additions and 16 deletions

View file

@ -66,4 +66,13 @@
.btn-success.shadow:hover {
transform: translateY(-1px);
box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.2) !important;
}
/* Ensure collapse starts properly hidden */
#managedServiceIncludes {
transition: all 0.35s ease;
}
#managedServiceIncludes:not(.show) {
display: none;
}

View file

@ -87,20 +87,16 @@ class UIManager {
updateAddonPricingDisplay(domManager, mandatoryAddons, selectedOptionalAddons) {
// 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
// Show/hide the toggle button based on mandatory addons
const hasMandatoryAddons = mandatoryAddons && mandatoryAddons.length > 0;
if (managedServiceIncludes) {
managedServiceIncludes.style.display = hasMandatoryAddons ? 'block' : 'none';
}
// Only control button visibility - let Bootstrap handle collapse behavior completely
if (managedServiceToggleButton) {
managedServiceToggleButton.style.display = hasMandatoryAddons ? 'inline-block' : 'none';
}
@ -111,7 +107,7 @@ class UIManager {
const addonRow = document.createElement('div');
addonRow.className = 'd-flex justify-content-between small text-muted mb-1';
addonRow.innerHTML = `
<span><i class="bi bi-check-circle text-success me-1"></i>${addon.name}</span>
<span>Add-on: ${addon.name}</span>
<span>CHF ${addon.price}</span>
`;
managedServiceIncludesContainer.appendChild(addonRow);