mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Review]
This commit is contained in:
1 parent
79f563a82d
commit
d46a9151fc
27 files changed
+279
-339
No files matched your search
@@ -6,6 +6,7 @@
|
||||
<Z-timeline :calData="timelineData" :calConfig="config" :splits="splitDays" @eventMoved="onEventMoved" @completeTask="completeTask" @reopenTask="reopenTask" @deleteTask="deleteTask" />
|
||||
</W-loadable>
|
||||
|
||||
<!-- Kaluza: Toto vyhodit a pouzit w toast -->
|
||||
<v-snackbar
|
||||
v-model="errorToast"
|
||||
:timeout="2000"
|
||||
@@ -32,8 +33,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
timelineData: null,
|
||||
|
||||
// Kaluza: Vyhodit tieto toast veci
|
||||
errorToast: false,
|
||||
errorToastMessage: "Nepodarilo sa nacitat data!",
|
||||
|
||||
dataLoaded: false,
|
||||
splitDays: [],
|
||||
unscheduledTime: 0,
|
||||
@@ -53,12 +57,14 @@ export default {
|
||||
this.generateSplits(week.firstDay)
|
||||
this.generateNonWorkingHours(week.firstDay)
|
||||
} catch(error) {
|
||||
// Kaluza: Ked to davas do w loadable tak nepouzi toast a iba daj this.timeineData = {error} a loadable ho parsne a zobrazi
|
||||
this.timelineData = {}
|
||||
console.error(error)
|
||||
this.triggerToast("Nepodarilo sa nacitat data!")
|
||||
}
|
||||
},
|
||||
|
||||
// Kaluza: Toto prosimta premenuj lebo neviem vobec co znamena splits
|
||||
generateSplits(date) {
|
||||
this.splitDays = []
|
||||
for (let i = 0; i < 7; i++) {
|
||||
@@ -72,6 +78,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
// Kaluza: Toto nazvi nejako inak aby bolo viac jasne ze z coho to preformatovava na co
|
||||
formatData(date) {
|
||||
// format events
|
||||
this.timelineData.tasks.forEach(event => {
|
||||
@@ -130,11 +137,13 @@ export default {
|
||||
this.timelineData.tasks.push(...nonWorkingHours)
|
||||
},
|
||||
|
||||
// Kaluza: Vyhodit
|
||||
triggerToast(message) {
|
||||
this.errorToastMessage = message
|
||||
this.errorToast = true
|
||||
},
|
||||
|
||||
// Kaluza: Vyhodit ak sa nepouzije
|
||||
async onEventMoved(event) {
|
||||
console.log("drag", event)
|
||||
// try {
|
||||
@@ -153,6 +162,13 @@ export default {
|
||||
},
|
||||
|
||||
completeTask(id) {
|
||||
// Kaluza: Tu pridaj request na BE, nepouzi filter ale find a sprav to takto
|
||||
// 1. const task = this.timelineData.tasks.find(task => task.id == id)
|
||||
// 2. task.completed = true
|
||||
// 3. V tryCatch zavolaj request na BE
|
||||
// 4. Ak to spadne do catchu tak daj task.completed = false a pod tym daj this.$toast.error(error)
|
||||
|
||||
// A AKO NAD TYM ROZMYSLAM completeTask A reopenTask MOZES SPOJIT DO JEDNEJ A VZDY LEN DAS task.completed = !task.completed
|
||||
this.timelineData.tasks.filter(task => {
|
||||
if (task.id == id) {
|
||||
task.completed = true
|
||||
@@ -161,6 +177,7 @@ export default {
|
||||
},
|
||||
|
||||
reopenTask(id) {
|
||||
// Kaluza: Toto rovnakym sposobom ako complete task
|
||||
this.timelineData.tasks.filter(task => {
|
||||
if (task.id == id) {
|
||||
task.completed = false
|
||||
@@ -169,6 +186,7 @@ export default {
|
||||
},
|
||||
|
||||
deleteTask(id) {
|
||||
// Kaluza: Toto rovnako ako complete a reopen
|
||||
this.timelineData.tasks.splice(this.timelineData.tasks.findIndex(item => item.id === id), 1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user