mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Subtask] Fixed timesheets
This commit is contained in:
1 parent
a9ce7c348e
commit
68b6e6f75a
5 files changed
+13
-12
No files matched your search
@@ -86,6 +86,10 @@ export default {
|
|||||||
this.$events.on('show-task-add-time-modal', ({subtask}) => {
|
this.$events.on('show-task-add-time-modal', ({subtask}) => {
|
||||||
this.$refs['z-task-add-time-modal'].showModal({ subtask })
|
this.$refs['z-task-add-time-modal'].showModal({ subtask })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.$events.on('on-subtask-edited', () => {
|
||||||
|
this.$store.dispatch('tm/reloadSubtasks')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -99,6 +99,15 @@ export default {
|
|||||||
]).then(() => commit('initialized'))
|
]).then(() => commit('initialized'))
|
||||||
},
|
},
|
||||||
|
|
||||||
|
reloadSubtasks({dispatch}: {dispatch: any}) {
|
||||||
|
return Promise.all([
|
||||||
|
dispatch('loadMastertasks'),
|
||||||
|
dispatch('loadProjects'),
|
||||||
|
dispatch('loadUnscheduledSubtasks'),
|
||||||
|
dispatch('loadOngoingSubtasks')
|
||||||
|
])
|
||||||
|
},
|
||||||
|
|
||||||
loadMastertasks({commit}: {commit: any}) {
|
loadMastertasks({commit}: {commit: any}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.get_auth_data('v1/mastertasks')
|
axios.get_auth_data('v1/mastertasks')
|
||||||
|
|||||||
@@ -123,12 +123,7 @@ export default {
|
|||||||
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${task.id}`, task)
|
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${task.id}`, task)
|
||||||
|
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
this.$store.commit('tm/update_subtask', subtask)
|
|
||||||
this.$events.emit('on-subtask-edited', subtask)
|
this.$events.emit('on-subtask-edited', subtask)
|
||||||
|
|
||||||
this.$store.dispatch('tm/loadMastertasks')
|
|
||||||
this.$store.dispatch('tm/loadUnscheduledSubtasks')
|
|
||||||
this.$store.dispatch('tm/loadOngoingSubtasks')
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error.message || error)
|
this.$toast.error(error.message || error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,10 +126,6 @@ export default {
|
|||||||
|
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
this.$events.emit('on-subtask-edited', subtask)
|
this.$events.emit('on-subtask-edited', subtask)
|
||||||
|
|
||||||
this.$store.dispatch('tm/loadMastertasks')
|
|
||||||
this.$store.dispatch('tm/loadUnscheduledSubtasks')
|
|
||||||
this.$store.dispatch('tm/loadOngoingSubtasks')
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error.message || error)
|
this.$toast.error(error.message || error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ export default {
|
|||||||
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${tempSubtask.id}`, tempSubtask)
|
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${tempSubtask.id}`, tempSubtask)
|
||||||
|
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.$store.dispatch('tm/loadMastertasks')
|
|
||||||
this.$store.dispatch('tm/loadUnscheduledSubtasks')
|
|
||||||
this.$store.dispatch('tm/loadOngoingSubtasks')
|
|
||||||
this.$emit('on-subtask-edited', subtask)
|
this.$emit('on-subtask-edited', subtask)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
|
|||||||
Reference in new issue
Block a user