mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-11 17:48:44 -05:00
refactor(gantt): extract GanttBarDateType as reusable type
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user