feat(timeline): add support for showing draft tasks in employee timeline

This commit is contained in:
Matej Glasnák committed 2026-01-19 16:23:49 +01:00
1 parent ec4175230a
commit 959e3de901
3 files changed
+9 -1

No files matched your search

@@ -25,6 +25,7 @@ export function useEmployeeTimeline(
currentTimeblock: Ref<Timeblock | null>,
otherLocalTimeblocks?: Ref<Timeblock[]>,
editingBlockerId?: Ref<number | null>,
showDraftTasks?: Ref<boolean>,
) {
// Fetch employee's tasks for the selected date
const {
@@ -107,6 +108,7 @@ export function useEmployeeTimeline(
const emp = unref(employee);
const d = unref(date);
const excludeBlockerId = editingBlockerId ? unref(editingBlockerId) : null;
const includeDrafts = showDraftTasks ? unref(showDraftTasks) : false;
if (!data || !conceptData || !emp || !d) {
return [];
@@ -115,7 +117,8 @@ export function useEmployeeTimeline(
const subtasks = [
...(data.subtasks || []),
...(data.blockers || []),
...(conceptData.subtasks || []),
// Only include concept tasks if showDraftTasks is true
...(includeDrafts ? (conceptData.subtasks || []) : []),
];
const selectedDateStr = moment(d).format('YYYY-MM-DD');
@@ -117,6 +117,7 @@
:employee="employee"
:deletable="false"
:index="0"
:show-draft-tasks="!!subtask.is_draft"
/>
</v-card-text>
@@ -77,6 +77,7 @@ interface Props {
currentIndex?: number;
deletable?: boolean;
index?: number;
showDraftTasks?: boolean; // Whether to show draft/concept tasks on timeline
}
const props = withDefaults(defineProps<Props>(), {
@@ -87,6 +88,7 @@ const props = withDefaults(defineProps<Props>(), {
currentIndex: 0,
deletable: false,
index: 0,
showDraftTasks: false,
});
const emit = defineEmits<{
@@ -238,6 +240,7 @@ const otherTimeblocksForSameDate = computed(() => {
// Use timeline composable
const editingBlockerIdRef = computed(() => props.editingBlockerId);
const showDraftTasksRef = computed(() => props.showDraftTasks);
const {
isLoading,
@@ -253,6 +256,7 @@ const {
timeblockRef,
otherTimeblocksForSameDate,
editingBlockerIdRef,
showDraftTasksRef,
);
// Force refetch when date changes