✨ feat(Product.php): Ajoute la liaison ManyToMany avec l'entité Options ✨ feat(Devis.php): Ajoute la propriété isNotAddCaution pour masquer la caution ♻️ refactor(.env): Met à jour les URLs de SIGN, STRIPE et CONTRAT ✨ feat(workflow.twig): Adapte le workflow et supprime l'étape de caution ✨ feat(NewDevisType.php): Ajoute un champ pour gérer
25 lines
843 B
JavaScript
25 lines
843 B
JavaScript
|
|
export class ProductAddOption extends HTMLButtonElement {
|
|
constructor() {
|
|
super();
|
|
this.addEventListener('click', this.handleClick.bind(this));
|
|
}
|
|
|
|
handleClick(e) {
|
|
e.preventDefault();
|
|
|
|
const inputId = this.getAttribute('data-input-id');
|
|
const baseUrl = this.getAttribute('data-url');
|
|
const input = document.getElementById(inputId);
|
|
|
|
if (input && input.value) {
|
|
// The base URL comes from Twig path() which includes ?act=addOption
|
|
// We safely append the idOption parameter
|
|
window.location.href = `${baseUrl}&idOption=${input.value}`;
|
|
} else {
|
|
// Visual feedback could be added here (e.g., shake effect or border color)
|
|
alert("Veuillez sélectionner une option avant d'ajouter.");
|
|
}
|
|
}
|
|
}
|