This commit is contained in:
romankko2 committed 2023-07-21 16:23:26 +02:00
1 parent 0e8e3a8b32
commit 1032a30031
15 files changed
+56 -27

No files matched your search

@@ -66,6 +66,8 @@ export default {
this.uploadedFiles = [...this.uploadedFiles, ...files] this.uploadedFiles = [...this.uploadedFiles, ...files]
this.$emit('files-uploaded', this.uploadedFiles) this.$emit('files-uploaded', this.uploadedFiles)
this.$refs.fileUpload.value = ''
}, },
remove(index) { remove(index) {
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750" max-height="90%" height="700px"> <v-dialog v-model="visible" max-width="750" max-height="90%" height="700px" persistent>
<W-loadable :content="blocker" class="h-100"> <W-loadable :content="blocker" class="h-100">
<v-card height="100%" class="d-flex flex-column"> <v-card height="100%" class="d-flex flex-column">
<div class="d-flex justify-space-between align-center modal-header"> <div class="d-flex justify-space-between align-center modal-header">
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750"> <v-dialog v-model="visible" max-width="750" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete zmazať <b>{{ blocker.name }}</b>?</h1> <h1>Ste si istý, že chcete zmazať <b>{{ blocker.name }}</b>?</h1>
@@ -12,7 +12,7 @@
></v-icon> ></v-icon>
</div> </div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view"> <v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="deleteBlocker()">ÁNO</v-btn> <v-btn class="button primary half" variant="flat" @click="deleteBlocker()" :disabled="isDeleting">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn> <v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@@ -26,7 +26,8 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
blocker: null blocker: null,
isDeleting: false
} }
}, },
@@ -41,6 +42,10 @@ export default {
}, },
async deleteBlocker() { async deleteBlocker() {
if (this.isDeleting) return
this.isDeleting = true
try { try {
await this.$axios.delete_auth(`v1/blockers/${this.blocker.id}`) await this.$axios.delete_auth(`v1/blockers/${this.blocker.id}`)
@@ -48,6 +53,8 @@ export default {
this.closeModal() this.closeModal()
} catch (error) { } catch (error) {
this.$toast.error(error) this.$toast.error(error)
} finally {
this.isDeleting = false
} }
} }
} }
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750"> <v-dialog v-model="visible" max-width="750" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete zmazať <b>{{ mastertask.name }}</b>?</h1> <h1>Ste si istý, že chcete zmazať <b>{{ mastertask.name }}</b>?</h1>
@@ -12,7 +12,7 @@
></v-icon> ></v-icon>
</div> </div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view"> <v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="deleteMasterTask()">ÁNO</v-btn> <v-btn class="button primary half" variant="flat" @click="deleteMasterTask()" :disabled="isDeleting">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn> <v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@@ -26,7 +26,8 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
mastertask: null mastertask: null,
isDeleting: false
} }
}, },
@@ -41,12 +42,18 @@ export default {
}, },
async deleteMasterTask() { async deleteMasterTask() {
if (this.isDeleting) return
this.isDeleting = true
try { try {
await this.$axios.delete_auth(`v1/mastertasks/${this.mastertask.id}`) await this.$axios.delete_auth(`v1/mastertasks/${this.mastertask.id}`)
this.$emit('on-mastertask-deleted', this.mastertask) this.$emit('on-mastertask-deleted', this.mastertask)
this.closeModal() this.closeModal()
} catch (error) { } catch (error) {
this.$toast.error(error) this.$toast.error(error)
} finally {
this.isDeleting = false
} }
} }
} }
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="500" > <v-dialog v-model="visible" max-width="500" persistent>
<v-card> <v-card>
<h1 class="text-h5"> <h1 class="text-h5">
Chcete túto osobu odstrániť z tímu? Chcete túto osobu odstrániť z tímu?
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750" max-height="90%" height="700px"> <v-dialog v-model="visible" max-width="750" max-height="90%" height="700px" persistent>
<W-loadable :content="mastertask" class="h-100"> <W-loadable :content="mastertask" class="h-100">
<v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling"> <v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling">
<div class="d-flex justify-space-between align-center modal-header"> <div class="d-flex justify-space-between align-center modal-header">
@@ -304,10 +304,10 @@ export default {
}, },
_mergeDeadlineTimeDate() { _mergeDeadlineTimeDate() {
const date = new Date(this.mastertask.deadline); const date = new Date(this.mastertask.deadline)
const timeParts = this.mastertask._deadline_time.split(':'); const timeParts = this.mastertask._deadline_time.split(':')
date.setHours(parseInt(timeParts[0])); date.setHours(parseInt(timeParts[0]))
date.setMinutes(parseInt(timeParts[1])); date.setMinutes(parseInt(timeParts[1]))
this.mastertask.deadline = date this.mastertask.deadline = date
}, },
@@ -339,7 +339,7 @@ export default {
const hours = date.getHours() const hours = date.getHours()
const minutes = date.getMinutes() const minutes = date.getMinutes()
this.mastertask._deadline_time = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`; this.mastertask._deadline_time = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`
}) })
} }
} }
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750"> <v-dialog v-model="visible" max-width="750" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Vytvoriť</h1> <h1>Vytvoriť</h1>
@@ -35,7 +35,7 @@
</v-col> </v-col>
</v-row> </v-row>
<v-dialog max-width="750" v-model="showModal"> <v-dialog max-width="750" v-model="showModal" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Pridať odpracovaný čas</h1> <h1>Pridať odpracovaný čas</h1>
@@ -25,7 +25,7 @@
</v-col> </v-col>
</v-row> </v-row>
<v-dialog max-width="750" v-model="showModal"> <v-dialog max-width="750" v-model="showModal" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Pridať dátum</h1> <h1>Pridať dátum</h1>
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750"> <v-dialog v-model="visible" max-width="750" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku <b>{{ subtask?.master_task?.name || subtask.master_task }}</b>?</h1> <h1>Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku <b>{{ subtask?.master_task?.name || subtask.master_task }}</b>?</h1>
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750"> <v-dialog v-model="visible" max-width="750" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete zmazať task z mastertasku <b>{{ subtask.project_code }}</b>?</h1> <h1>Ste si istý, že chcete zmazať task z mastertasku <b>{{ subtask.project_code }}</b>?</h1>
@@ -12,7 +12,7 @@
></v-icon> ></v-icon>
</div> </div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view"> <v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="deleteTask()">ÁNO</v-btn> <v-btn class="button primary half" variant="flat" @click="deleteTask()" :disabled="isDeleting">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn> <v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@@ -26,7 +26,8 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
subtask: null subtask: null,
isDeleting: false
} }
}, },
@@ -41,6 +42,10 @@ export default {
}, },
async deleteTask() { async deleteTask() {
if (this.isDeleting) return
this.isDeleting = true
try { try {
await this.$axios.delete_auth(`v1/subtasks/${this.subtask.id}`) await this.$axios.delete_auth(`v1/subtasks/${this.subtask.id}`)
@@ -49,6 +54,8 @@ export default {
this.closeModal() this.closeModal()
} catch (error) { } catch (error) {
this.$toast.error(error) this.$toast.error(error)
} finally {
this.isDeleting = false
} }
} }
} }
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog max-width="750" v-model="visible"> <v-dialog max-width="750" v-model="visible" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1>Pridať odpracovaný čas</h1> <h1>Pridať odpracovaný čas</h1>
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750" max-height="90%" height="700px"> <v-dialog v-model="visible" max-width="750" max-height="90%" height="700px" persistent>
<W-loadable :content="subtask" class="h-100"> <W-loadable :content="subtask" class="h-100">
<v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling"> <v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling">
<div class="d-flex justify-space-between align-center modal-header"> <div class="d-flex justify-space-between align-center modal-header">
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750"> <v-dialog v-model="visible" max-width="750" persistent>
<v-card> <v-card>
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<h1> <h1>
@@ -9,7 +9,7 @@
</div> </div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view"> <v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="deleteTeam()">ÁNO</v-btn> <v-btn class="button primary half" variant="flat" @click="deleteTeam()" :disabled="isDeleting">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn> <v-btn class="button primary half outline" @click.stop="closeModal()">ZRUŠIŤ</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
@@ -23,7 +23,8 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
team: null team: null,
isDeleting: false
} }
}, },
@@ -38,6 +39,9 @@ export default {
}, },
async deleteTeam() { async deleteTeam() {
if (this.isDeleting) return
this.isDeleting = true
try { try {
await this.$axios.delete_auth(`v1/teams/${this.team.id}`) await this.$axios.delete_auth(`v1/teams/${this.team.id}`)
this.visible = false this.visible = false
@@ -45,6 +49,8 @@ export default {
this.$store.commit('tm/delete_team', this.team) this.$store.commit('tm/delete_team', this.team)
} catch (error) { } catch (error) {
this.$toast.error(error) this.$toast.error(error)
} finally {
this.isDeleting = false
} }
} }
} }
@@ -1,5 +1,5 @@
<template> <template>
<v-dialog v-model="visible" max-width="750" max-height="90%" height="700px"> <v-dialog v-model="visible" max-width="750" max-height="90%" height="700px" persistent>
<W-loadable :content="team" class="h-100"> <W-loadable :content="team" class="h-100">
<v-card height="100%" class="d-flex flex-column"> <v-card height="100%" class="d-flex flex-column">
<div class="d-flex justify-space-between align-center modal-header"> <div class="d-flex justify-space-between align-center modal-header">