|
|
@ -1,3 +1,7 @@ |
|
|
|
|
|
|
|
Array.prototype.pushToBeginning = function (toPush) { |
|
|
|
|
|
|
|
return this.unshift.apply(this, [toPush]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const TimeTrack = { |
|
|
|
const TimeTrack = { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -156,7 +160,7 @@ const TimeTrack = { |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
createTracker() { |
|
|
|
createTracker() { |
|
|
|
this.tickets.push({ |
|
|
|
this.tickets.pushToBeginning({ |
|
|
|
tracking: false, |
|
|
|
tracking: false, |
|
|
|
number: '#', |
|
|
|
number: '#', |
|
|
|
trackingStarted: null, |
|
|
|
trackingStarted: null, |
|
|
@ -167,7 +171,7 @@ const TimeTrack = { |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
createTimeBox() { |
|
|
|
createTimeBox() { |
|
|
|
this.tickets.push({ |
|
|
|
this.tickets.pushToBeginning({ |
|
|
|
tracking: false, |
|
|
|
tracking: false, |
|
|
|
number: 'Timebox ', |
|
|
|
number: 'Timebox ', |
|
|
|
trackingStarted: null, |
|
|
|
trackingStarted: null, |
|
|
@ -229,7 +233,7 @@ const TimeTrack = { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ticket.history.push(historyEntry); |
|
|
|
ticket.history.pushToBeginning(historyEntry); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ticket.trackingStarted = null; |
|
|
|
ticket.trackingStarted = null; |
|
|
@ -376,7 +380,7 @@ const TimeTrack = { |
|
|
|
Object.assign(restoredTracker, this.trashed); |
|
|
|
Object.assign(restoredTracker, this.trashed); |
|
|
|
this.trashed = {}; |
|
|
|
this.trashed = {}; |
|
|
|
|
|
|
|
|
|
|
|
this.tickets.push(restoredTracker); |
|
|
|
this.tickets.pushToBeginning(restoredTracker); |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
archiveTracker(index) { |
|
|
|
archiveTracker(index) { |
|
|
@ -384,12 +388,12 @@ const TimeTrack = { |
|
|
|
this.stopActiveTracker(); |
|
|
|
this.stopActiveTracker(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.archive.push(this.tickets[index]); |
|
|
|
this.archive.pushToBeginning(this.tickets[index]); |
|
|
|
this.tickets.splice(index, 1); |
|
|
|
this.tickets.splice(index, 1); |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
reactivateTicket(index) { |
|
|
|
reactivateTicket(index) { |
|
|
|
this.tickets.push(this.archive[index]); |
|
|
|
this.tickets.pushToBeginning(this.archive[index]); |
|
|
|
this.archive.splice(index, 1); |
|
|
|
this.archive.splice(index, 1); |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -402,7 +406,7 @@ const TimeTrack = { |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
bookTimeManually(ticket, minutes) { |
|
|
|
bookTimeManually(ticket, minutes) { |
|
|
|
ticket.history.push({ |
|
|
|
ticket.history.pushToBeginning({ |
|
|
|
trackingStarted: moment(), |
|
|
|
trackingStarted: moment(), |
|
|
|
trackingStopped: moment(), |
|
|
|
trackingStopped: moment(), |
|
|
|
manually: true, |
|
|
|
manually: true, |
|
|
@ -440,9 +444,9 @@ const TimeTrack = { |
|
|
|
|
|
|
|
|
|
|
|
ticketCollection.forEach((ticket) => { |
|
|
|
ticketCollection.forEach((ticket) => { |
|
|
|
if (ticket.archived || (ticket.active && ticket.active === false)) { |
|
|
|
if (ticket.archived || (ticket.active && ticket.active === false)) { |
|
|
|
archive.push(ticket); |
|
|
|
archive.pushToBeginning(ticket); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
tickets.push(ticket) |
|
|
|
tickets.pushToBeginning(ticket) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -530,7 +534,7 @@ const TimeTrack = { |
|
|
|
if (existingEntry) { |
|
|
|
if (existingEntry) { |
|
|
|
existingEntry.minutes = Number(existingEntry.minutes) + Number(newEntry.minutes); |
|
|
|
existingEntry.minutes = Number(existingEntry.minutes) + Number(newEntry.minutes); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
collection.push(newEntry); |
|
|
|
collection.pushToBeginning(newEntry); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -548,7 +552,7 @@ const TimeTrack = { |
|
|
|
if (existingEntry) { |
|
|
|
if (existingEntry) { |
|
|
|
existingEntry.minutes = Number(existingEntry.minutes) + Number(newEntry.minutes); |
|
|
|
existingEntry.minutes = Number(existingEntry.minutes) + Number(newEntry.minutes); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
collection.push(newEntry); |
|
|
|
collection.pushToBeginning(newEntry); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -609,7 +613,7 @@ const TimeTrack = { |
|
|
|
id: getRandomID() |
|
|
|
id: getRandomID() |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.snippets.push(newSnippet); |
|
|
|
this.snippets.pushToBeginning(newSnippet); |
|
|
|
this.loadSnippet(this.snippets[this.snippets.length-1]); |
|
|
|
this.loadSnippet(this.snippets[this.snippets.length-1]); |
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -696,7 +700,7 @@ const TimeTrack = { |
|
|
|
this.selectedTracker.tasks = []; |
|
|
|
this.selectedTracker.tasks = []; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.selectedTracker.tasks.push({ |
|
|
|
this.selectedTracker.tasks.pushToBeginning({ |
|
|
|
name: this.newTaskInput, |
|
|
|
name: this.newTaskInput, |
|
|
|
done: false, |
|
|
|
done: false, |
|
|
|
created: moment(), |
|
|
|
created: moment(), |
|
|
|