Fix for missing Phases
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 23s
Build and Push Docker Images / build-frontend (push) Successful in 59s

This commit is contained in:
2026-03-25 15:19:33 +01:00
parent c29494dc0d
commit 01b4d0f973
2 changed files with 59 additions and 2 deletions

View File

@@ -240,9 +240,42 @@ const loadOptions = async () => {
}
}
loadOptions()
normalizeLoadedSelectValues()
const initialProjecttype = props.type === "projects" ? item.value.projecttype : null
const lastAppliedProjecttype = ref(null)
const syncProjectPhasesForProjecttype = () => {
if (props.type !== "projects") return
if (!item.value?.projecttype) return
if (!Array.isArray(loadedOptions.value.projecttypes) || !loadedOptions.value.projecttypes.length) return
const projecttypeColumn = dataType.templateColumns.find((column) => column.key === "projecttype")
if (!projecttypeColumn?.inputChangeFunction) return
const shouldSyncOnCreate = props.mode === "create" && lastAppliedProjecttype.value !== item.value.projecttype
const shouldSyncOnEdit = props.mode === "edit"
&& item.value.projecttype !== initialProjecttype
&& lastAppliedProjecttype.value !== item.value.projecttype
if (!shouldSyncOnCreate && !shouldSyncOnEdit) return
projecttypeColumn.inputChangeFunction(item.value, loadedOptions.value)
lastAppliedProjecttype.value = item.value.projecttype
}
loadOptions().then(() => {
syncProjectPhasesForProjecttype()
})
watch(
() => [item.value?.projecttype, loadedOptions.value.projecttypes?.length || 0],
() => {
syncProjectPhasesForProjecttype()
},
{ immediate: true }
)
const contentChanged = (content, datapoint) => {
if (datapoint.key.includes(".")) {
item.value[datapoint.key.split('.')[0]][datapoint.key.split('.')[1]].html = content.html
@@ -274,6 +307,9 @@ const getSelectSearchInput = (datapoint) => {
const triggerInputChange = (datapoint) => {
if (datapoint.inputChangeFunction) {
datapoint.inputChangeFunction(item.value, loadedOptions.value)
if (datapoint.key === "projecttype") {
lastAppliedProjecttype.value = item.value.projecttype
}
}
}