feat : integrate TaskGitSection into TaskModal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-13 14:04:29 +01:00
parent 6eeacd2cb0
commit c7a0dafae8

View File

@@ -120,6 +120,13 @@
/>
</div>
<!-- Git section -->
<TaskGitSection
v-if="hasGitea && isEditing && task"
:task="task"
:gitea-url="giteaUrl"
/>
<!-- Footer -->
<div
class="mt-6 flex items-center border-t border-neutral-100 pt-5"
@@ -183,6 +190,7 @@
<script setup lang="ts">
import type { Task, TaskWrite } from '~/services/dto/task'
import { useGiteaService } from '~/services/gitea'
import type { TaskStatus } from '~/services/dto/task-status'
import type { TaskEffort } from '~/services/dto/task-effort'
import type { TaskPriority } from '~/services/dto/task-priority'
@@ -221,6 +229,13 @@ const isEditing = computed(() => !!props.task)
const isSubmitting = ref(false)
const confirmDeleteOpen = ref(false)
const giteaUrl = ref('')
const { getSettings: getGiteaSettings } = useGiteaService()
const hasGitea = computed(() => {
return !!props.task?.project?.giteaOwner && !!props.task?.project?.giteaRepo && !!giteaUrl.value
})
const form = reactive({
title: '',
description: '',
@@ -311,6 +326,17 @@ watch(() => props.task, (task) => {
}
})
onMounted(async () => {
if (props.task?.project?.giteaOwner && props.task?.project?.giteaRepo) {
try {
const settings = await getGiteaSettings()
giteaUrl.value = settings.url ?? ''
} catch {
// Gitea not available
}
}
})
const { create, update, remove } = useTaskService()
async function handleDelete() {