Skip to content

Commit

Permalink
added the maildev method and an alert logic for the creation of new ncf
Browse files Browse the repository at this point in the history
  • Loading branch information
kiloutyg committed Jun 24, 2024
1 parent d28ab9b commit 0b42b73
Show file tree
Hide file tree
Showing 6 changed files with 1,328 additions and 1,166 deletions.
12 changes: 12 additions & 0 deletions assets/js/confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ document.addEventListener('turbo:load', function () {

const entityCreationButtons = document.querySelectorAll(".submit-entity-creation");

const ncfCreationButtons = document.querySelectorAll(".new-ncf-alert");

const confirmationHandler = (event, message) => {
const confirmed = confirm(message);
if (!confirmed) {
Expand Down Expand Up @@ -173,4 +175,14 @@ document.addEventListener('turbo:load', function () {
});
});

ncfCreationButtons.forEach((button) => {
button.addEventListener("click", (event) => {
confirmationHandler(
event,
" ⚠️ Une FNC ne doit être crée que si le défaut represente ❗ UN NOMBRE DE PIECES SUPERIEUR OU EGAL A 5 ❗ Êtes vous sûr de vouloir continuer ? "

);
});
});

});
Loading

0 comments on commit 0b42b73

Please sign in to comment.