Loading front/Application/UI/UConfirmDialog.vue +76 Changes for front/Application/UI/UConfirmDialog.vue: 76 added lines, 0 removed lines. Original line number Diff line number Diff line <template> <div class="modal fade" tabindex="-1" ref="modalEl" aria-hidden="true" > <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ title }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body">{{ message }}</div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button> <button type="button" class="btn btn-danger" @click="confirmAction">Confirmer</button> </div> </div> </div> </div> </template> <script> import { Modal } from "bootstrap"; export default { data() { return { modal: null, // Instance Bootstrap Modal resolveFn: null, // Fonction pour résoudre la promesse message: "", // Message affiché title: "Confirmation", // Titre modal }; }, mounted() { // Crée l'instance Bootstrap Modal this.modal = new Modal(this.$refs.modalEl, { backdrop: "static", keyboard: true, }); // Si la modal est fermée manuellement → annuler la promesse this.$refs.modalEl.addEventListener("hidden.bs.modal", () => { if (this.resolveFn) { this.resolveFn(false); this.resolveFn = null; } }); }, methods: { /** * Ouvre la modal et retourne une Promise */ open(message, title = "Confirmation") { this.message = message; this.title = title; this.modal.show(); return new Promise((resolve) => { this.resolveFn = resolve; }); }, /** * Confirme l'action et résout la Promise */ confirmAction() { if (this.resolveFn) this.resolveFn(true); this.resolveFn = null; this.modal.hide(); }, }, }; </script> front/Mission/Mission.vue +110 −22 Changes for front/Mission/Mission.vue: 110 added lines, 22 removed lines. Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ data-content="Êtes-vous sur de vouloir supprimer la mission ?" data-title="Suppression de la mission" @click.prevent="supprimer">Supprimer</a> </div> </div> </div> Loading Loading @@ -188,6 +190,8 @@ data-content="Êtes-vous sur de vouloir supprimer le volume horaire ?" data-title="Suppression du volume horaire" @click.prevent="volumeHoraireSupprimer">Supprimer</a> </td> </tr> </tbody> Loading @@ -197,19 +201,24 @@ </template> </u-modal> <u-confirm-dialog ref="confirmDialog"/> </template> <script> export default { name: 'Mission', props: { mission: {required: true} }, data() { return { boxOne: '', boxTwo: '', validationText: this.calcValidation(this.mission.validation), saisieUrl: unicaenVue.url('mission/saisie/:mission', {mission: this.mission.id}), Loading Loading @@ -254,44 +263,123 @@ export default { this.refresh(); }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { this.$emit('supprimer', this.mission); }); const url = event.currentTarget.href; const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment supprimer cette mission ?", "Confirmer la suppression" ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); } } }, valider(event) async valider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment valider cette mission ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment dévalider cette mission ?", "Confirmer la dévalidation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireSupprimer(event) async volumeHoraireSupprimer(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment valider cette mission ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireValider(event) async volumeHoraireValider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment valider les volumes horaires ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireDevalider(event) async volumeHoraireDevalider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment dévalider cette mission ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, refresh() { Loading front/Mission/SuiviEvent.vue +32 −6 Changes for front/Mission/SuiviEvent.vue: 32 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ </button> </div> </div> <u-confirm-dialog ref="confirmDialog"/> </template> <script> Loading Loading @@ -65,11 +66,24 @@ export default { }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment supprimer ces heures ?", "Confirmer la suppression" ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, valider(event) Loading @@ -79,11 +93,23 @@ export default { }); }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment dévalider ces heures ?", "Confirmer la dévalidation" ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, }, Loading front/autoload.js +1 Changes for front/autoload.js: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ export default { /* UI components */ UHeures: 'Application/UI/UHeures', UInputFloat: 'Application/UI/UInputFloat', UConfirmDialog: 'Application/UI/UConfirmDialog', /* App common components */ Utilisateur: 'Application/Utilisateur', Loading package-lock.json +31 Changes for package-lock.json: 31 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ "version": "21.0.0", "license": "ISC", "dependencies": { "bootstrap": "^5.3.8", "dotenv": "16.4.7", "sass": "1.72.0", "unicaen-vue": "file:./vendor/unicaen/vue" Loading Loading @@ -106,6 +107,17 @@ "node": ">= 8" } }, "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" } }, "node_modules/@rollup/pluginutils": { "version": "5.1.4", "license": "MIT", Loading Loading @@ -305,6 +317,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/bootstrap": { "version": "5.3.8", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/twbs" }, { "type": "opencollective", "url": "https://opencollective.com/bootstrap" } ], "license": "MIT", "peerDependencies": { "@popperjs/core": "^2.11.8" } }, "node_modules/bootstrap-vue-next": { "version": "0.26.20", "resolved": "https://registry.npmjs.org/bootstrap-vue-next/-/bootstrap-vue-next-0.26.20.tgz", Loading Loading
front/Application/UI/UConfirmDialog.vue +76 Changes for front/Application/UI/UConfirmDialog.vue: 76 added lines, 0 removed lines. Original line number Diff line number Diff line <template> <div class="modal fade" tabindex="-1" ref="modalEl" aria-hidden="true" > <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">{{ title }}</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body">{{ message }}</div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button> <button type="button" class="btn btn-danger" @click="confirmAction">Confirmer</button> </div> </div> </div> </div> </template> <script> import { Modal } from "bootstrap"; export default { data() { return { modal: null, // Instance Bootstrap Modal resolveFn: null, // Fonction pour résoudre la promesse message: "", // Message affiché title: "Confirmation", // Titre modal }; }, mounted() { // Crée l'instance Bootstrap Modal this.modal = new Modal(this.$refs.modalEl, { backdrop: "static", keyboard: true, }); // Si la modal est fermée manuellement → annuler la promesse this.$refs.modalEl.addEventListener("hidden.bs.modal", () => { if (this.resolveFn) { this.resolveFn(false); this.resolveFn = null; } }); }, methods: { /** * Ouvre la modal et retourne une Promise */ open(message, title = "Confirmation") { this.message = message; this.title = title; this.modal.show(); return new Promise((resolve) => { this.resolveFn = resolve; }); }, /** * Confirme l'action et résout la Promise */ confirmAction() { if (this.resolveFn) this.resolveFn(true); this.resolveFn = null; this.modal.hide(); }, }, }; </script>
front/Mission/Mission.vue +110 −22 Changes for front/Mission/Mission.vue: 110 added lines, 22 removed lines. Original line number Diff line number Diff line Loading @@ -95,6 +95,8 @@ data-content="Êtes-vous sur de vouloir supprimer la mission ?" data-title="Suppression de la mission" @click.prevent="supprimer">Supprimer</a> </div> </div> </div> Loading Loading @@ -188,6 +190,8 @@ data-content="Êtes-vous sur de vouloir supprimer le volume horaire ?" data-title="Suppression du volume horaire" @click.prevent="volumeHoraireSupprimer">Supprimer</a> </td> </tr> </tbody> Loading @@ -197,19 +201,24 @@ </template> </u-modal> <u-confirm-dialog ref="confirmDialog"/> </template> <script> export default { name: 'Mission', props: { mission: {required: true} }, data() { return { boxOne: '', boxTwo: '', validationText: this.calcValidation(this.mission.validation), saisieUrl: unicaenVue.url('mission/saisie/:mission', {mission: this.mission.id}), Loading Loading @@ -254,44 +263,123 @@ export default { this.refresh(); }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { this.$emit('supprimer', this.mission); }); const url = event.currentTarget.href; const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment supprimer cette mission ?", "Confirmer la suppression" ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); } } }, valider(event) async valider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment valider cette mission ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.href; if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment dévalider cette mission ?", "Confirmer la dévalidation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireSupprimer(event) async volumeHoraireSupprimer(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/supprimer/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment valider cette mission ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireValider(event) async volumeHoraireValider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/valider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment valider les volumes horaires ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, volumeHoraireDevalider(event) async volumeHoraireDevalider(event) { event.currentTarget.href = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); popConfirm(event.currentTarget, (response) => { const url = unicaenVue.url('mission/volume-horaire/devalider/:missionVolumeHoraire', {missionVolumeHoraire: event.currentTarget.dataset.id}); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment dévalider cette mission ?", "Confirmer la validation" ); if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.$emit('refresh', response.data); }); } } }, refresh() { Loading
front/Mission/SuiviEvent.vue +32 −6 Changes for front/Mission/SuiviEvent.vue: 32 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ </button> </div> </div> <u-confirm-dialog ref="confirmDialog"/> </template> <script> Loading Loading @@ -65,11 +66,24 @@ export default { }); }, supprimer(event) async supprimer(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment supprimer ces heures ?", "Confirmer la suppression" ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, valider(event) Loading @@ -79,11 +93,23 @@ export default { }); }, devalider(event) async devalider(event) { popConfirm(event.currentTarget, (response) => { const url = event.currentTarget.dataset.url; const confirmed = await this.$refs.confirmDialog.open( "Voulez-vous vraiment dévalider ces heures ?", "Confirmer la dévalidation" ); if (!url) { console.error("Aucune URL trouvée sur le bouton !"); return; } if (confirmed) { const response = await unicaenVue.axios.get(url); if (response && response.data) { this.suivi.refresh(); }); } } }, }, Loading
front/autoload.js +1 Changes for front/autoload.js: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ export default { /* UI components */ UHeures: 'Application/UI/UHeures', UInputFloat: 'Application/UI/UInputFloat', UConfirmDialog: 'Application/UI/UConfirmDialog', /* App common components */ Utilisateur: 'Application/Utilisateur', Loading
package-lock.json +31 Changes for package-lock.json: 31 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ "version": "21.0.0", "license": "ISC", "dependencies": { "bootstrap": "^5.3.8", "dotenv": "16.4.7", "sass": "1.72.0", "unicaen-vue": "file:./vendor/unicaen/vue" Loading Loading @@ -106,6 +107,17 @@ "node": ">= 8" } }, "node_modules/@popperjs/core": { "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" } }, "node_modules/@rollup/pluginutils": { "version": "5.1.4", "license": "MIT", Loading Loading @@ -305,6 +317,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/bootstrap": { "version": "5.3.8", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/twbs" }, { "type": "opencollective", "url": "https://opencollective.com/bootstrap" } ], "license": "MIT", "peerDependencies": { "@popperjs/core": "^2.11.8" } }, "node_modules/bootstrap-vue-next": { "version": "0.26.20", "resolved": "https://registry.npmjs.org/bootstrap-vue-next/-/bootstrap-vue-next-0.26.20.tgz", Loading