mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[timeline] delete a complete task
This commit is contained in:
1 parent
f1e3d63fc9
commit
b04ddd219d
7 files changed
+98
-55
No files matched your search
@@ -43,7 +43,8 @@
|
|||||||
"ends_at": "2023-01-08T09:00:00+00:00",
|
"ends_at": "2023-01-08T09:00:00+00:00",
|
||||||
"title": "Task DNES",
|
"title": "Task DNES",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E9FFE6"
|
"master_task_color": "#E9FFE6",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -53,7 +54,8 @@
|
|||||||
"ends_at": "2023-01-08T09:00:00+00:00",
|
"ends_at": "2023-01-08T09:00:00+00:00",
|
||||||
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#f27e57"
|
"master_task_color": "#f27e57",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -63,7 +65,8 @@
|
|||||||
"ends_at": "2023-01-08T10:45:00+00:00",
|
"ends_at": "2023-01-08T10:45:00+00:00",
|
||||||
"title": "Kratky 15min",
|
"title": "Kratky 15min",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -73,7 +76,8 @@
|
|||||||
"ends_at": "2023-01-08T10:00:00+00:00",
|
"ends_at": "2023-01-08T10:00:00+00:00",
|
||||||
"title": "Task 2",
|
"title": "Task 2",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#FDE1FF"
|
"master_task_color": "#FDE1FF",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -83,7 +87,8 @@
|
|||||||
"ends_at": "2023-01-09T12:00:00+00:00",
|
"ends_at": "2023-01-09T12:00:00+00:00",
|
||||||
"title": "Task 6",
|
"title": "Task 6",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -93,7 +98,8 @@
|
|||||||
"ends_at": "2023-01-10T16:00:00+00:00",
|
"ends_at": "2023-01-10T16:00:00+00:00",
|
||||||
"title": "Task 7",
|
"title": "Task 7",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E7DBF8"
|
"master_task_color": "#E7DBF8",
|
||||||
|
"completed": true
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -103,7 +109,8 @@
|
|||||||
"ends_at": "2023-01-08T09:00:00+00:00",
|
"ends_at": "2023-01-08T09:00:00+00:00",
|
||||||
"title": "Task 8",
|
"title": "Task 8",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -113,7 +120,8 @@
|
|||||||
"ends_at": "2023-01-09T12:00:00+00:00",
|
"ends_at": "2023-01-09T12:00:00+00:00",
|
||||||
"title": "Task 9",
|
"title": "Task 9",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E9FFE6"
|
"master_task_color": "#E9FFE6",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -123,7 +131,8 @@
|
|||||||
"ends_at": "2023-01-08T13:00:00+00:00",
|
"ends_at": "2023-01-08T13:00:00+00:00",
|
||||||
"title": "Task 10",
|
"title": "Task 10",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -11,31 +11,34 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"task_id": 1,
|
"task_id": 1,
|
||||||
"starts_at": "2023-01-10T08:01:00+00:00",
|
"starts_at": "2023-01-11T08:01:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Task DNES",
|
"title": "Task DNES",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E9FFE6"
|
"master_task_color": "#E9FFE6",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"task_id": 2,
|
"task_id": 2,
|
||||||
"starts_at": "2023-01-10T08:30:00+00:00",
|
"starts_at": "2023-01-11T08:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#f27e57"
|
"master_task_color": "#f27e57",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"task_id": 3,
|
"task_id": 3,
|
||||||
"starts_at": "2023-01-10T10:30:00+00:00",
|
"starts_at": "2023-01-11T10:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T10:45:00+00:00",
|
"ends_at": "2023-01-11T10:45:00+00:00",
|
||||||
"title": "Kratky 15min",
|
"title": "Kratky 15min",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -50,31 +53,34 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"task_id": 1,
|
"task_id": 1,
|
||||||
"starts_at": "2023-01-10T08:01:00+00:00",
|
"starts_at": "2023-01-11T08:01:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Task DNES",
|
"title": "Task DNES",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E9FFE6"
|
"master_task_color": "#E9FFE6",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"task_id": 2,
|
"task_id": 2,
|
||||||
"starts_at": "2023-01-10T08:30:00+00:00",
|
"starts_at": "2023-01-11T08:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#f27e57"
|
"master_task_color": "#f27e57",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"task_id": 3,
|
"task_id": 3,
|
||||||
"starts_at": "2023-01-10T10:30:00+00:00",
|
"starts_at": "2023-01-11T10:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T10:45:00+00:00",
|
"ends_at": "2023-01-11T10:45:00+00:00",
|
||||||
"title": "Kratky 15min",
|
"title": "Kratky 15min",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -89,31 +95,34 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"task_id": 1,
|
"task_id": 1,
|
||||||
"starts_at": "2023-01-10T08:01:00+00:00",
|
"starts_at": "2023-01-11T08:01:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Task DNES",
|
"title": "Task DNES",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E9FFE6"
|
"master_task_color": "#E9FFE6",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"task_id": 2,
|
"task_id": 2,
|
||||||
"starts_at": "2023-01-10T08:30:00+00:00",
|
"starts_at": "2023-01-11T08:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#f27e57"
|
"master_task_color": "#f27e57",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"task_id": 3,
|
"task_id": 3,
|
||||||
"starts_at": "2023-01-10T10:30:00+00:00",
|
"starts_at": "2023-01-11T10:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T10:45:00+00:00",
|
"ends_at": "2023-01-11T10:45:00+00:00",
|
||||||
"title": "Kratky 15min",
|
"title": "Kratky 15min",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -128,31 +137,34 @@
|
|||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"task_id": 1,
|
"task_id": 1,
|
||||||
"starts_at": "2023-01-10T08:01:00+00:00",
|
"starts_at": "2023-01-11T08:01:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Task DNES",
|
"title": "Task DNES",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#E9FFE6"
|
"master_task_color": "#E9FFE6",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"task_id": 2,
|
"task_id": 2,
|
||||||
"starts_at": "2023-01-10T08:30:00+00:00",
|
"starts_at": "2023-01-11T08:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T09:00:00+00:00",
|
"ends_at": "2023-01-11T09:00:00+00:00",
|
||||||
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
"title": "Kratky 30min Lorem ipsum dolor sit amet, consectetur adipiscing e",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#f27e57"
|
"master_task_color": "#f27e57",
|
||||||
|
"completed": false
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"task_id": 3,
|
"task_id": 3,
|
||||||
"starts_at": "2023-01-10T10:30:00+00:00",
|
"starts_at": "2023-01-11T10:30:00+00:00",
|
||||||
"ends_at": "2023-01-10T10:45:00+00:00",
|
"ends_at": "2023-01-11T10:45:00+00:00",
|
||||||
"title": "Kratky 15min",
|
"title": "Kratky 15min",
|
||||||
"project_code": "CO-2201",
|
"project_code": "CO-2201",
|
||||||
"master_task_color": "#57e0f2"
|
"master_task_color": "#57e0f2",
|
||||||
|
"completed": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1237,8 +1237,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
console.log(this.splitDays)
|
|
||||||
|
|
||||||
this.utils.cell = new CellUtils(this)
|
this.utils.cell = new CellUtils(this)
|
||||||
this.utils.event = new EventUtils(this, this.utils.date)
|
this.utils.event = new EventUtils(this, this.utils.date)
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="event-footer d-flex">
|
<div class="event-footer d-flex">
|
||||||
<v-btn rounded class="event-footer-button me-2" @click="this.showCompleteModal = {task: event}"><img :src="require('./_img/checkmark.svg')" alt=""></v-btn>
|
<v-btn rounded class="event-footer-button me-2" :class="{'completed': event.completed}" @click="this.showCompleteModal = {task: event}"><img :src="require('./_img/checkmark.svg')" alt=""></v-btn>
|
||||||
<v-btn rounded class="event-footer-button me-2" @click="editTask(event.id)" :style="{opacity: 0.3}"><img :src="require('./_img/pencil.svg')" alt=""></v-btn>
|
<v-btn rounded class="event-footer-button me-2" @click="editTask(event.id)" :style="{opacity: 0.3}"><img :src="require('./_img/pencil.svg')" alt=""></v-btn>
|
||||||
<v-btn rounded class="event-footer-button me-2" @click="this.showDeleteModal = {task: event}"><img :src="require('./_img/bin.svg')" alt=""></v-btn>
|
<v-btn rounded class="event-footer-button me-2" @click="this.showDeleteModal = {task: event}"><img :src="require('./_img/bin.svg')" alt=""></v-btn>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,8 +81,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</Vue-cal>
|
</Vue-cal>
|
||||||
|
|
||||||
<Z-complete-task-modal v-if="showCompleteModal" :visible="showCompleteModal ? true : false" :task="showCompleteModal.task" @close="showCompleteModal = null" />
|
<Z-complete-task-modal v-if="showCompleteModal" :visible="showCompleteModal ? true : false" :task="showCompleteModal.task" @completeTask="completeTask" @close="showCompleteModal = null" />
|
||||||
<Z-delete-task-modal v-if="showDeleteModal" :visible="showDeleteModal ? true : false" :task="showDeleteModal.task" @close="showDeleteModal = null" />
|
<Z-delete-task-modal v-if="showDeleteModal" :visible="showDeleteModal ? true : false" :task="showDeleteModal.task" @deleteTask="deleteTask" @close="showDeleteModal = null" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -146,10 +146,6 @@ export default {
|
|||||||
weekChanged() {
|
weekChanged() {
|
||||||
const scrollContainer = document.getElementsByClassName('vuecal__scrollable-body')[0]
|
const scrollContainer = document.getElementsByClassName('vuecal__scrollable-body')[0]
|
||||||
scrollContainer.scrollLeft = 0
|
scrollContainer.scrollLeft = 0
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scrollToYesterday()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async eventMoved(e) {
|
async eventMoved(e) {
|
||||||
@@ -206,6 +202,14 @@ export default {
|
|||||||
this.focusedEventId = event.task_id
|
this.focusedEventId = event.task_id
|
||||||
// console.log(`Focused: ${event.task_id}`)
|
// console.log(`Focused: ${event.task_id}`)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
completeTask(id) {
|
||||||
|
this.$emit('completeTask', id)
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteTask(id) {
|
||||||
|
this.$emit('deleteTask', id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -335,6 +339,9 @@ export default {
|
|||||||
min-height: 40px
|
min-height: 40px
|
||||||
transition: min-height .4s, height .4s, box-shadow .4s, width .4s, left .4s
|
transition: min-height .4s, height .4s, box-shadow .4s, width .4s, left .4s
|
||||||
|
|
||||||
|
// &:has(.completed)
|
||||||
|
// filter: grayscale(.9) !important
|
||||||
|
|
||||||
&:has(.non-working-event)
|
&:has(.non-working-event)
|
||||||
background: repeating-linear-gradient(135deg, rgba(215, 215, 215, 1), rgba(215, 215, 215, 1) 1px, rgba(224, 224, 224, 1) 1px, rgba(224, 224, 224, 1) 20px)
|
background: repeating-linear-gradient(135deg, rgba(215, 215, 215, 1), rgba(215, 215, 215, 1) 1px, rgba(224, 224, 224, 1) 1px, rgba(224, 224, 224, 1) 20px)
|
||||||
border: 1px solid rgba(215, 215, 215, 1)
|
border: 1px solid rgba(215, 215, 215, 1)
|
||||||
@@ -441,6 +448,9 @@ export default {
|
|||||||
min-width: fit-content
|
min-width: fit-content
|
||||||
width: fit-content
|
width: fit-content
|
||||||
|
|
||||||
|
&.completed
|
||||||
|
background: #00B3A6
|
||||||
|
|
||||||
img
|
img
|
||||||
width: 18px
|
width: 18px
|
||||||
</style>
|
</style>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<A-task-filter @weekChange="getWeekData" />
|
<A-task-filter @weekChange="getWeekData" />
|
||||||
|
|
||||||
<W-loadable :content="timelineData" class="w-loadable" empty-message="Nepodarilo sa nacitat data!">
|
<W-loadable :content="timelineData" class="w-loadable" empty-message="Nepodarilo sa nacitat data!">
|
||||||
<Z-timeline :calData="timelineData" :calConfig="config" :splits="splitDays" @eventMoved="onEventMoved" />
|
<Z-timeline :calData="timelineData" :calConfig="config" :splits="splitDays" @eventMoved="onEventMoved" @completeTask="completeTask" @deleteTask="deleteTask" />
|
||||||
</W-loadable>
|
</W-loadable>
|
||||||
|
|
||||||
<v-snackbar
|
<v-snackbar
|
||||||
@@ -144,6 +144,18 @@ export default {
|
|||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
},
|
||||||
|
|
||||||
|
completeTask(id) {
|
||||||
|
this.timelineData.tasks.filter(task => {
|
||||||
|
if (task.id == id) {
|
||||||
|
task.completed = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteTask(id) {
|
||||||
|
this.timelineData.tasks.splice(this.timelineData.tasks.findIndex(item => item.id === id), 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export default {
|
|||||||
|
|
||||||
await this.$axios.post(`v1/tasks/${task.id}`, task)
|
await this.$axios.post(`v1/tasks/${task.id}`, task)
|
||||||
this.show = false
|
this.show = false
|
||||||
|
this.$emit('completeTask', task.id)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await this.$axios.delete(`v1/tasks/${this.task.id}`)
|
await this.$axios.delete(`v1/tasks/${this.task.id}`)
|
||||||
this.show = false
|
this.show = false
|
||||||
|
this.$emit('deleteTask', this.task.id)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user