Skip to content

Commit e8a506c

Browse files
committed
feat: show error if form failed
1 parent f870c5e commit e8a506c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/handler/FormHandler.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
>
2323
<p v-html="modulesStore.state.modules[module][`help_text_${action}`]"></p>
2424
</sl-details>
25+
26+
<div v-if="state.formfailed" class="errorwrapper">
27+
<sl-alert open variant="warning">
28+
<sl-icon slot="icon" name="info-circle"></sl-icon>
29+
30+
{{ $t("error") }}
31+
</sl-alert>
32+
</div>
33+
2534
<div v-if="!state.loading" class="scroll-content">
2635
<vi-form
2736
ref="viform"
@@ -39,6 +48,7 @@
3948
:params="state.params"
4049
:debug="appStore.state.debug"
4150
:readonly="!state.canEdit"
51+
@failed="formfailed"
4252
></vi-form>
4353
<template v-for="handler in state.conf?.['editViews']" :key="handler['module']">
4454
<sl-details
@@ -225,6 +235,7 @@ const state = reactive({
225235
}
226236
return params
227237
}),
238+
formfailed: null,
228239
})
229240
230241
const viform = ref(null)
@@ -336,6 +347,10 @@ function getEditView(handler) {
336347
return currentModule["handlerComponent"]
337348
}
338349
350+
function formfailed(error) {
351+
state.formfailed = error
352+
}
353+
339354
watch(
340355
() => props.errors,
341356
(newVal, oldVal) => {
@@ -455,4 +470,8 @@ sl-details {
455470
height: auto;
456471
}
457472
}
473+
474+
.errorwrapper {
475+
padding: 20px;
476+
}
458477
</style>

src/translations/de.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default {
8080
local: "Suche wird in der Liste ausgeführt",
8181
database: "Suche wird online ausgeführt",
8282
},
83+
error: "Ein Fehler ist aufgetreten",
8384
noaccess: {
8485
title: "Nicht genügend Berechtigungen",
8586
descr: "Dieser Nutzer hat nicht genügend Berechtigungen.",

0 commit comments

Comments
 (0)