Skip to content
Snippets Groups Projects
Commit e8d0b3d4 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: inform user if links cannot be added and are empty

parent 21ba687d
No related branches found
No related tags found
No related merge requests found
<template> <template>
<fieldset> <fieldset>
<ul class="tw-flex tw-flex-col tw-gap-3 tw-p-0 tw-m-0 *:tw-block"> <ul class="tw-flex tw-flex-col tw-gap-3 tw-p-0 tw-m-0 *:tw-block empty:tw-hidden">
<li v-for="(link, index) in links" :key="index"> <li v-for="(link, index) in links" :key="index">
<ALinkEditor <ALinkEditor
v-model="links[index]" v-model="links[index]"
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<ALinkEditor v-model="newLink" @check="maybeAddLink" /> <ALinkEditor v-model="newLink" @check="maybeAddLink" />
</li> </li>
</ul> </ul>
<p v-if="disabled && links.length === 0">{{ t('link.noneSet') }}</p>
</fieldset> </fieldset>
</template> </template>
...@@ -23,6 +24,7 @@ import { MappedErrorDetail } from '@rokoli/bnb' ...@@ -23,6 +24,7 @@ import { MappedErrorDetail } from '@rokoli/bnb'
import { DefaultArray, ErrorDetailArray } from '@rokoli/bnb/drf' import { DefaultArray, ErrorDetailArray } from '@rokoli/bnb/drf'
import { nextTick, ref } from 'vue' import { nextTick, ref } from 'vue'
import { useI18n } from '@/i18n'
import { Link } from '@/types' import { Link } from '@/types'
import ALinkEditor from '@/components/generic/ALinkEditor.vue' import ALinkEditor from '@/components/generic/ALinkEditor.vue'
...@@ -34,6 +36,7 @@ const props = defineProps<{ ...@@ -34,6 +36,7 @@ const props = defineProps<{
}>() }>()
const emit = defineEmits<{ save: [] }>() const emit = defineEmits<{ save: [] }>()
const { t } = useI18n()
const newLink = ref<Link>({ typeId: null, url: '' }) const newLink = ref<Link>({ typeId: null, url: '' })
async function maybeAddLink() { async function maybeAddLink() {
......
...@@ -350,6 +350,7 @@ export default { ...@@ -350,6 +350,7 @@ export default {
link: { link: {
urlExample: 'z.B. https://aura.radio', urlExample: 'z.B. https://aura.radio',
noneSet: 'Es wurden keine Links zugewiesen.',
fields: { fields: {
typeId: 'Linktyp', typeId: 'Linktyp',
url: 'Web Adresse', url: 'Web Adresse',
......
...@@ -351,6 +351,7 @@ export default { ...@@ -351,6 +351,7 @@ export default {
link: { link: {
urlExample: 'i.e. https://aura.radio', urlExample: 'i.e. https://aura.radio',
noneSet: 'No links have been assigned.',
fields: { fields: {
typeId: 'Link type', typeId: 'Link type',
url: 'Web Address', url: 'Web Address',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment