()
| 6758 | // Repopulate all parent model dropdowns to ensure consistency |
| 6759 | await populateParentModelFilter(); // Filter dropdown |
| 6760 | if (sourceDropdownId === 'model-parent') { |
| 6761 | await populateParentModelDropdown(newParentName, 'model-parent'); |
| 6762 | } else if (sourceDropdownId === 'multi-parent') { |
| 6763 | await populateParentModelDropdown(newParentName, 'multi-parent'); |
| 6764 | } else if (sourceDropdownId === 'parent-select') { |
| 6765 | // Filter dropdown - already repopulated by populateParentModelFilter |
| 6766 | const parentSelect = document.getElementById('parent-select'); |
| 6767 | if (parentSelect) { |
| 6768 | parentSelect.value = newParentName; |
| 6769 | } |
| 6770 | } else { |
| 6771 | // Fallback: manually add to the source dropdown if it's not one of the standard ones |
| 6772 | const parentSelect = document.getElementById(sourceDropdownId); |
| 6773 | if (parentSelect) { |
| 6774 | const optionExists = Array.from(parentSelect.options).some(opt => opt.value === newParentName); |
| 6775 | if (!optionExists) { |
| 6776 | const option = document.createElement('option'); |
| 6777 | option.value = newParentName; |
| 6778 | option.textContent = newParentName; |
| 6779 | parentSelect.appendChild(option); |
| 6780 | } |
| 6781 | parentSelect.value = newParentName; |
| 6782 | } |
no outgoing calls
no test coverage detected