Skip to content

Commit

Permalink
Merge pull request #6048 from simfeld/fix/material-list-delete-error
Browse files Browse the repository at this point in the history
fix: error message when deleting material list
  • Loading branch information
pmattmann authored Sep 29, 2024
2 parents 3938401 + a7057ab commit a2ab70c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
9 changes: 9 additions & 0 deletions frontend/src/components/campAdmin/DialogMaterialListEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PromptEntityDelete
:entity="entityUri"
:warning-text-entity="materialList.name"
:error-handler="deleteErrorHandler"
position="top"
align="left"
/>
Expand Down Expand Up @@ -50,6 +51,14 @@ export default {
}
},
},
methods: {
deleteErrorHandler(e) {
if (e?.response?.status === 422 /* Validation Error */) {
return this.$tc('components.campAdmin.dialogMaterialListEdit.deleteError')
}
return null
},
},
}
</script>
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
"createMaterialList": "Materialliste erstellen",
"title": "Materiallisten"
},
"campMaterialListsItem": {
"deleteError": "Materialliste konnte nicht gelöscht werden. Überprüfe vor dem Löschen, dass die Liste leer ist.",
"deleteWarning": "Möchtest du diese Materialliste wirklich löschen?"
},
"campPeriods": {
"createPeriod": "Lagerabschnitt erstellen",
"title": "Lagerabschnitt | Lagerabschnitte"
Expand Down Expand Up @@ -135,7 +131,8 @@
"title": "Materialliste erstellen"
},
"dialogMaterialListEdit": {
"title": "Materialliste bearbeiten"
"title": "Materialliste bearbeiten",
"deleteError": "Materialliste konnte nicht gelöscht werden. Überprüfe vor dem Löschen, dass die Liste leer ist."
},
"dialogPeriodCreate": {
"title": "Lagerabschnitt erstellen"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
"createMaterialList": "Create material list",
"title": "Material lists"
},
"campMaterialListsItem": {
"deleteError": "Could not delete the material list. Check if the list is empty before deleting it.",
"deleteWarning": "Do you really want to delete this material list?"
},
"campPeriods": {
"createPeriod": "Create period",
"title": "Period | Periods"
Expand Down Expand Up @@ -135,7 +131,8 @@
"title": "Create material list"
},
"dialogMaterialListEdit": {
"title": "Edit material list"
"title": "Edit material list",
"deleteError": "Could not delete the material list. Check if the list is empty before deleting it."
},
"dialogPeriodCreate": {
"title": "Create period"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@
"createMaterialList": "Créer une liste de matériel",
"title": "Listes de matériel"
},
"campMaterialListsItem": {
"deleteError": "Impossible de supprimer la liste de matériel. Vérifie que la liste soit vide avant de la supprimer.",
"deleteWarning": "Veux-tu vraiment supprimer cette liste de matériel ?"
},
"campPeriods": {
"createPeriod": "Créer une période",
"title": "Période | Périodes"
Expand Down Expand Up @@ -124,7 +120,8 @@
"title": "Créer une liste de matériel"
},
"dialogMaterialListEdit": {
"title": "Modifier la liste de matériel"
"title": "Modifier la liste de matériel",
"deleteError": "Impossible de supprimer la liste de matériel. Vérifie que la liste soit vide avant de la supprimer."
},
"dialogPeriodCreate": {
"title": "Créer une période"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@
"createMaterialList": "Crea l'elenco dei materiali",
"title": "Elenchi di materiali"
},
"campMaterialListsItem": {
"deleteError": "Impossibile eliminare l'elenco dei materiali. Controlla che l'elenco sia vuoto prima di eliminarlo.",
"deleteWarning": "Vuoi davvero cancellare questo elenco di materiali?"
},
"campPeriods": {
"createPeriod": "Creare il periodo",
"title": "Periodo | Periodi"
Expand Down Expand Up @@ -116,7 +112,8 @@
"title": "Crea l'elenco dei materiali"
},
"dialogMaterialListEdit": {
"title": "Modifica elenco materiali"
"title": "Modifica elenco materiali",
"deleteError": "Impossibile eliminare l'elenco dei materiali. Controlla che l'elenco sia vuoto prima di eliminarlo."
},
"dialogPeriodCreate": {
"title": "Creare il periodo"
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/locales/rm.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
"createMaterialList": "Crear ina glista da material",
"title": "Glistas da material"
},
"campMaterialListsItem": {
"deleteError": "Impussibel da stizzar la glista da material. Verifitgescha che la glista è vida avant che stizzar.",
"deleteWarning": "Vuls ti propi stizzar questa glista da material?"
},
"campPeriods": {
"createPeriod": "Crear ina part dal champ",
"title": "Part dal champ | Parts dal champ"
Expand Down Expand Up @@ -109,7 +105,8 @@
"title": "Crear ina glista da material"
},
"dialogMaterialListEdit": {
"title": "Modifitgar la glista da material"
"title": "Modifitgar la glista da material",
"deleteError": "Impussibel da stizzar la glista da material. Verifitgescha che la glista è vida avant che stizzar."
},
"dialogPeriodCreate": {
"title": "Craer ina part dal champ"
Expand Down

0 comments on commit a2ab70c

Please sign in to comment.