Split Edit and Add constraints

This commit is contained in:
Matthias 2023-05-07 09:16:25 +02:00
parent 727e1318cc
commit 8d5363d0f3
2 changed files with 14 additions and 8 deletions

View File

@ -2,6 +2,7 @@
<edit-value
v-model="plotStore.plotConfigName"
:allow-edit="allowEdit"
:allow-add="allowEdit"
editable-name="plot configuration"
@rename="plotStore.renamePlotConfig"
@delete="plotStore.deletePlotConfig"

View File

@ -22,7 +22,9 @@
>
<DeleteIcon :size="16" />
</b-button>
</template>
<b-button
v-if="allowAdd && !(addNew || editing)"
size="sm"
:title="`Add new ${editableName}.`"
class="ms-1"
@ -30,7 +32,6 @@
@click="addNewClick"
><AddIcon :size="16" />
</b-button>
</template>
<template v-if="allowEdit && (addNew || editing)">
<b-button
size="sm"
@ -66,6 +67,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
allowAdd: {
type: Boolean,
default: false,
},
editableName: {
type: String,
required: true,