mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
feat(router, sidebar, modal): add 'Tasks Concepts' route and update sidebar/menu items; enhance task modal save functionality
This commit is contained in:
1 parent
205b3a7e42
commit
18bcf6706d
5 files changed
+387
-20
No files matched your search
@@ -273,12 +273,18 @@
|
||||
/>
|
||||
</v-card-actions>
|
||||
|
||||
<v-btn class="button primary" v-if="!isSaving" @click="save()">{{
|
||||
<v-btn class="button primary" :disabled="isSaving" @click="save()">{{
|
||||
subtask.id ? 'UPRAVIŤ' : 'VYTVORIŤ'
|
||||
}}</v-btn>
|
||||
<v-btn class="button primary disabled" v-else disabled>{{
|
||||
$t('Ukladám...')
|
||||
}}</v-btn>
|
||||
|
||||
<template v-if="!subtask.id">
|
||||
<v-btn
|
||||
class="button primary outline mt-2"
|
||||
@click="save()"
|
||||
:disabled="isSaving"
|
||||
>ULOŽIŤ KONCEPT</v-btn
|
||||
>
|
||||
</template>
|
||||
</v-card>
|
||||
|
||||
<v-card v-else height="100%" class="d-flex flex-column scrolling">
|
||||
@@ -699,7 +705,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async save() {
|
||||
async save(concept = false) {
|
||||
this.wasFormValidationTriggered = true;
|
||||
if (!(await this.validateAllFields())) return;
|
||||
|
||||
@@ -731,9 +737,14 @@ export default {
|
||||
};
|
||||
});
|
||||
|
||||
const payload = { ...this.subtask, timesheets, timeblocks };
|
||||
if (concept) {
|
||||
payload.concept = true;
|
||||
}
|
||||
|
||||
const { subtask } = await this.$axios.patch_auth_form(
|
||||
`v1/subtasks/${this.subtask.id}`,
|
||||
{ ...this.subtask, timesheets, timeblocks },
|
||||
payload,
|
||||
);
|
||||
localStorage.removeItem('subtaskData');
|
||||
|
||||
@@ -765,6 +776,9 @@ export default {
|
||||
...this.subtask,
|
||||
employees: validEmployees,
|
||||
};
|
||||
if (concept) {
|
||||
subtaskCopy.concept = true;
|
||||
}
|
||||
delete subtaskCopy._master_task;
|
||||
const { subtasks } = await this.$axios.post_auth(
|
||||
`v1/mastertasks/${this.subtask.master_task_id}/subtasks`,
|
||||
|
||||
Reference in new issue
Block a user