refactor(gantt): extract GanttBarDateType as reusable type

This commit is contained in:
kolaente
2026-02-18 22:33:24 +01:00
parent 6f8be0905f
commit ceb62c63d3
2 changed files with 5 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ import {getHexColor} from '@/models/task'
import type {ITask, ITaskPartialWithId} from '@/modelTypes/ITask'
import type {DateISO} from '@/types/DateISO'
import type {GanttFilters} from '@/views/project/helpers/useGanttFilters'
import type {GanttBarModel} from '@/composables/useGanttBar'
import type {GanttBarModel, GanttBarDateType} from '@/composables/useGanttBar'
import GanttChartBody from '@/components/gantt/GanttChartBody.vue'
import GanttRow from '@/components/gantt/GanttRow.vue'
@@ -164,7 +164,7 @@ function transformTaskToGanttBar(t: ITask): GanttBarModel {
let startDate: Date
let endDate: Date
let dateType: 'both' | 'startOnly' | 'endOnly'
let dateType: GanttBarDateType
if (effectiveStartDate && effectiveEndDate) {
// Both dates available

View File

@@ -1,5 +1,7 @@
import { ref } from 'vue'
export type GanttBarDateType = 'both' | 'startOnly' | 'endOnly'
export interface GanttBarModel {
id: string
start: Date
@@ -8,7 +10,7 @@ export interface GanttBarModel {
label?: string
color?: string
hasActualDates?: boolean
dateType?: 'both' | 'startOnly' | 'endOnly'
dateType?: GanttBarDateType
isDone?: boolean
task?: unknown
}