mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
refactor(task-modal): remove unused timeblock data and streamline employee-specific timeblock handling
This commit is contained in:
1 parent
bb5e97f022
commit
9cbead59bb
2 files changed
+9
-7
No files matched your search
@@ -106,7 +106,6 @@
|
||||
ref="employeeTimeblockRef"
|
||||
v-model="newTimeblock"
|
||||
:employee="employee"
|
||||
:all-timeblocks="allTimeblocksForModal"
|
||||
:deletable="false"
|
||||
:index="0"
|
||||
/>
|
||||
@@ -233,11 +232,6 @@ export default {
|
||||
: this.HOUR_WIDTH;
|
||||
},
|
||||
|
||||
// All timeblocks for modal (includes existing timeblocks from this subtask)
|
||||
allTimeblocksForModal() {
|
||||
return this.timeblocks || [];
|
||||
},
|
||||
|
||||
// Computed property to trigger reactivity when existingTimeblocksData changes
|
||||
existingTimeblocksDataReactive() {
|
||||
// This forces Vue to track changes to existingTimeblocksData
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
:model-value="timeblock"
|
||||
:employee="selectedEmployee"
|
||||
:all-employee-timeblocks="timeblocks"
|
||||
:all-timeblocks="allTimeblocks"
|
||||
:all-timeblocks="allTimeblocksForCurrentEmployee"
|
||||
:deleted-timeblock-ids="deletedTimeblockIds"
|
||||
:current-index="index"
|
||||
:deletable="timeblocks.length > 1"
|
||||
@@ -94,6 +94,14 @@ const selectedEmployee = computed(() => {
|
||||
return employees.find((emp: any) => emp.id === props.employeeData.id) || null;
|
||||
});
|
||||
|
||||
// Filter allTimeblocks to only include timeblocks for current employee
|
||||
const allTimeblocksForCurrentEmployee = computed(() => {
|
||||
if (!props.employeeData.id) return [];
|
||||
return props.allTimeblocks.filter(
|
||||
(tb) => tb.employee_id === props.employeeData.id,
|
||||
);
|
||||
});
|
||||
|
||||
// Watch for when employee is selected and ensure at least one timeblock exists
|
||||
watch(
|
||||
() => props.employeeData.id,
|
||||
|
||||
Reference in new issue
Block a user