Bankverbindungs-Buttons bei SEPA-Mandaten ergänzen #183
This commit is contained in:
@@ -349,6 +349,35 @@ const triggerInputChange = (datapoint) => {
|
||||
}
|
||||
}
|
||||
|
||||
const getDatapointValue = (datapoint) => {
|
||||
if (datapoint.key.includes(".")) {
|
||||
const [parentKey, childKey] = datapoint.key.split(".")
|
||||
return item.value[parentKey]?.[childKey] || null
|
||||
}
|
||||
|
||||
return item.value[datapoint.key] || null
|
||||
}
|
||||
|
||||
const setDatapointValue = (datapoint, value) => {
|
||||
if (datapoint.key.includes(".")) {
|
||||
const [parentKey, childKey] = datapoint.key.split(".")
|
||||
if (!item.value[parentKey]) item.value[parentKey] = {}
|
||||
item.value[parentKey][childKey] = value
|
||||
} else {
|
||||
item.value[datapoint.key] = value
|
||||
}
|
||||
|
||||
triggerInputChange(datapoint)
|
||||
}
|
||||
|
||||
const getEntityModalCreateQuery = (datapoint) => {
|
||||
if (datapoint.entityModalCreateQueryFunction) {
|
||||
return datapoint.entityModalCreateQueryFunction(item.value)
|
||||
}
|
||||
|
||||
return datapoint.entityModalCreateQuery || {}
|
||||
}
|
||||
|
||||
|
||||
const createItem = async () => {
|
||||
let ret = null
|
||||
@@ -595,6 +624,13 @@ const updateItem = async () => {
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
<EntityModalButtons
|
||||
v-if="datapoint.entityModalButtonsType"
|
||||
:type="datapoint.entityModalButtonsType"
|
||||
:id="getDatapointValue(datapoint)"
|
||||
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||
/>
|
||||
</InputGroup>
|
||||
<InputGroup class="w-full" v-else>
|
||||
<UInput
|
||||
@@ -708,6 +744,13 @@ const updateItem = async () => {
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
<EntityModalButtons
|
||||
v-if="datapoint.entityModalButtonsType"
|
||||
:type="datapoint.entityModalButtonsType"
|
||||
:id="getDatapointValue(datapoint)"
|
||||
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||
/>
|
||||
</InputGroup>
|
||||
</UFormField>
|
||||
</div>
|
||||
@@ -828,6 +871,13 @@ const updateItem = async () => {
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
<EntityModalButtons
|
||||
v-if="datapoint.entityModalButtonsType"
|
||||
:type="datapoint.entityModalButtonsType"
|
||||
:id="getDatapointValue(datapoint)"
|
||||
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||
/>
|
||||
</InputGroup>
|
||||
<InputGroup class="w-full" v-else>
|
||||
<UInput
|
||||
@@ -941,6 +991,13 @@ const updateItem = async () => {
|
||||
color="white"
|
||||
icon="i-heroicons-x-mark"
|
||||
/>
|
||||
<EntityModalButtons
|
||||
v-if="datapoint.entityModalButtonsType"
|
||||
:type="datapoint.entityModalButtonsType"
|
||||
:id="getDatapointValue(datapoint)"
|
||||
:create-query="getEntityModalCreateQuery(datapoint)"
|
||||
@return-data="(data) => setDatapointValue(datapoint, data.id)"
|
||||
/>
|
||||
</InputGroup>
|
||||
</UFormField>
|
||||
</UForm>
|
||||
|
||||
Reference in New Issue
Block a user