Merge pull request #4139 from Keirua/fix/confirm-on-delete-champ

#4137 - Ajout d'un confirm à la suppression d'un champ
This commit is contained in:
Paul Chavard 2019-07-31 12:31:44 +02:00 committed by GitHub
commit 6f3fde21f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View file

@ -68,9 +68,13 @@ const TypeDeChamp = sortableElement(
<div className="flex justify-start delete">
<button
className="button small icon-only danger"
onClick={() =>
dispatch({ type: 'removeTypeDeChamp', params: { typeDeChamp } })
}
onClick={() => {
if (confirm('Êtes vous sûr de vouloir supprimer ce champ ?'))
dispatch({
type: 'removeTypeDeChamp',
params: { typeDeChamp }
});
}}
>
<FontAwesomeIcon icon="trash" title="Supprimer" />
</button>