[Master task modal] Improved performance

This commit is contained in:
Matej Glasnák committed 2023-02-22 19:16:31 +01:00
1 parent 1e86dbbbb3
commit b72e26a006
1 file changed
+10 -9
@@ -61,7 +61,7 @@
<v-btn class="button primary" @click="save()">Ukončiť mastertask</v-btn> <v-btn class="button primary" @click="save()">Ukončiť mastertask</v-btn>
</div> </div>
<A-tasks-table :tasks="masterTask.subtasks" :employees="employees" /> <A-tasks-table :tasks="masterTask.subtasks" :employees="enrichedEmployees" />
<div class="d-flex align-center "> <div class="d-flex align-center ">
<v-btn class="subtask-btn w-100" @click="addTask()" ><v-icon class="mx-1" icon="mdi-plus" />Pridať task</v-btn> <v-btn class="subtask-btn w-100" @click="addTask()" ><v-icon class="mx-1" icon="mdi-plus" />Pridať task</v-btn>
@@ -90,6 +90,7 @@ import '@vueup/vue-quill/dist/vue-quill.snow.css'
import SelectsMixin from './_mixins/selects.mixin' import SelectsMixin from './_mixins/selects.mixin'
import ATasksTable from './_components/a-tasks-table.vue' import ATasksTable from './_components/a-tasks-table.vue'
import AMastertaskDescription from './_components/a-mastertask-description.vue' import AMastertaskDescription from './_components/a-mastertask-description.vue'
import { mapGetters } from 'vuex'
export default { export default {
// MIXINS // MIXINS
@@ -115,15 +116,20 @@ export default {
visible: false, visible: false,
errorUtils, errorUtils,
v$: useVuelidate(), v$: useVuelidate(),
teams: null,
projects: null,
employees: null,
masterTask: null, masterTask: null,
showAddEmployeeInput: false, showAddEmployeeInput: false,
date: null, date: null,
} }
}, },
computed: {
...mapGetters('tm', [
'teams',
'projects',
'enrichedEmployees'
])
},
validations() { validations() {
return { return {
masterTask: { masterTask: {
@@ -170,11 +176,6 @@ export default {
this.masterTask = null this.masterTask = null
try { try {
this.teams = await this.$axios.get_auth_data('v1/teams')
this.projects = await this.$axios.get_auth_data('v1/projects')
const employees = await this.$axios.get_auth_data('v1/employees')
this.employees = tmUtils.enrichEmployeesByFullName(employees)
if (masterTask?.id) { if (masterTask?.id) {
this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTask.id}`) this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTask.id}`)