Thought Id share a cool addition to progress bar I can up with - Once a contract is signed in my use case - there’s no need to show “not approved” option –
so I can filter as such
// Filter tb_fieldoptions based on corporate_status
const filteredOptions = tb_fieldoptions.filter(option => {
// If corporate_status is "Contract & BAA Signed" and option is "Not Approved", exclude it
if (corporate_status === "Contract & BAA Signed" && option.val === "Not Approved") {
return false; // Exclude this option
}
return true; // Include all other options
});
// Generate tbelement based on filteredOptions
let tbelement;
if (tbStyle === 'Style 1') {
tbelement = filteredOptions.map(option =>
`<li class="tb-steps" data-id="${option.key}"><em><p class="tb-dec">${option.val}</p></em></li>`).join('');
} else {
tbelement = filteredOptions.map(option =>
`<div class="tb-steps" data-id="${option.key}">${option.val}</div>`).join('');
}
//end Filter tb_fieldoptions based on corporate_status