mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
Merge branch 'main' of https://bitbucket.org/studiotem/jandl-taskmanager-app into production
This commit is contained in:
commit
3a3e479c90
8 files changed
+76
-80
No files matched your search
@@ -179,9 +179,7 @@ $splits-headers-height: 1.5em;
|
||||
color: #999;
|
||||
text-align: right;
|
||||
font-size: 0.9em;
|
||||
// background: white;
|
||||
// remove -v
|
||||
padding-right: 2px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.vuecal__time-cell-line:before {
|
||||
@@ -189,15 +187,12 @@ $splits-headers-height: 1.5em;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
// remove -v
|
||||
border-top: 1px solid rgba(196, 196, 196, 0.3);
|
||||
// border-top: 1px solid #F5F5F5;
|
||||
border-top: 1px solid #F5F5F5;
|
||||
z-index: -1;
|
||||
}
|
||||
//add -v
|
||||
// .vuecal__time-cell-line.hour:before {
|
||||
// border-top: 1px solid #e0e0e0;
|
||||
// }
|
||||
.vuecal__time-cell-line.hour:before {
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
}
|
||||
|
||||
// Calendar cells.
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
|
||||
remove(index) {
|
||||
this.uploadedFiles.splice(index, 1)
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -51,11 +51,7 @@
|
||||
</template>
|
||||
|
||||
<template v-slot:time-cell="{ hours, minutes }">
|
||||
<span class="d-flex align-center justify-center">
|
||||
<p>{{hours}}:{{String(minutes).padStart(2, '0')}}</p>
|
||||
<div class="time-column-line"></div>
|
||||
</span>
|
||||
<!-- <span class="d-flex justify-center">
|
||||
<span class="d-flex justify-center">
|
||||
<span class="d-flex justify-center">
|
||||
<p style="margin-top: -9px">{{hours}}:{{String(minutes).padStart(2, '0')}}</p>
|
||||
<div class="time-column-line"></div>
|
||||
@@ -65,7 +61,7 @@
|
||||
<span class="vuecal__time-cell-line" style="margin-top: 25px"></span>
|
||||
<span class="vuecal__time-cell-line" style="margin-top: 50px"></span>
|
||||
<span class="vuecal__time-cell-line" style="margin-top: 75px"></span>
|
||||
</span> -->
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template v-slot:event="{ event }">
|
||||
@@ -121,24 +117,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</Vue-cal>
|
||||
<!-- <v-dialog v-model="visible" max-width="750" persistent>
|
||||
<v-card>
|
||||
<div class="d-flex justify-space-between align-center">
|
||||
<h1 class="text-red">Ste si istý, že chcete pridať timeblock po deadline ?</h1>
|
||||
|
||||
<v-icon
|
||||
@click.stop="visible = false"
|
||||
icon="mdi-close"
|
||||
size="large"
|
||||
class="mb-15"
|
||||
></v-icon>
|
||||
</div>
|
||||
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
|
||||
<v-btn class="button primary half" variant="flat">ÁNO</v-btn>
|
||||
<v-btn class="button primary half outline" @click.stop="visible = false">ZRUŠIŤ</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -196,19 +174,32 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
getDeadline(subtask) {
|
||||
if(subtask.deadline) return moment(subtask.deadline).format('DD.MM.yyyy')
|
||||
else if(!this.mastertasks) return ''
|
||||
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
|
||||
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
|
||||
},
|
||||
|
||||
isAfterDeadline(event) {
|
||||
const deadline = this.getDeadline(event.subtask)
|
||||
if (deadline) {
|
||||
return this.tmUtils.isAfter(event.date, moment(deadline, 'DD.MM.yyyy'))
|
||||
}
|
||||
return false
|
||||
|
||||
if (!deadline)
|
||||
return
|
||||
|
||||
const mDate = moment(event.date)
|
||||
const mDeadline = moment(deadline)
|
||||
const hours = event.end.getHours()
|
||||
const minutes = event.end.getMinutes()
|
||||
|
||||
mDate.hours(hours)
|
||||
mDate.minutes(minutes)
|
||||
|
||||
return mDate.isAfter(mDeadline)
|
||||
},
|
||||
|
||||
getDeadline(subtask) {
|
||||
if (subtask?.deadline)
|
||||
return subtask.deadline
|
||||
|
||||
if (!this.mastertasks)
|
||||
return null
|
||||
|
||||
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
|
||||
return masterTask.deadline
|
||||
},
|
||||
|
||||
weekChanged() {
|
||||
@@ -220,7 +211,6 @@ export default {
|
||||
const date = addDays(this.calConfig.date, newSplit - 1)
|
||||
const start = date.setHours(Math.round(event.startTimeMinutes / 60), Math.round(event.startTimeMinutes % 60), 0)
|
||||
const end = date.setHours(Math.round(event.endTimeMinutes / 60), Math.round(event.endTimeMinutes % 60), 0)
|
||||
|
||||
const split = this.splits.find(split => split.id == newSplit )
|
||||
|
||||
if(this.$route.name == 'Dashboard - Tasks') {
|
||||
@@ -251,20 +241,6 @@ export default {
|
||||
const isAfterDeadline = this.isAfterDeadline(event)
|
||||
|
||||
if(isAfterDeadline) this.$toast.error('Timeblock, ktorý ste presunuli je po deadline !')
|
||||
|
||||
// if (isAfterDeadline) {
|
||||
// this.visible = true
|
||||
// } else {
|
||||
// try {
|
||||
// const { subtask } = await this.$axios.put_auth(`v1/subtasks/${editedSubtask.id}`, editedSubtask)
|
||||
// this.$events.emit('on-subtask-edited', subtask)
|
||||
|
||||
// if (subtask.employee_id == this.$store.getters['auth/user'].id)
|
||||
// this.$events.emit('show-task-add-time-modal', { subtask })
|
||||
// } catch (error) {
|
||||
// this.$toast.error(error.message || error)
|
||||
// }
|
||||
// }
|
||||
} else if(this.$route.name == 'Dashboard - Teams') {
|
||||
const editedSubtask = {
|
||||
...event.subtask,
|
||||
|
||||
@@ -47,15 +47,7 @@ export default {
|
||||
} finally {
|
||||
file.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// async downloadAllFiles() {
|
||||
// for (const file of this.files) {
|
||||
// if (!file.isLoading) {
|
||||
// await this.downloadFile(file)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</v-col>
|
||||
<v-col cols="7">
|
||||
<v-sheet class="py-3">
|
||||
<p v-if="subtask.deadline" :class="`${tmUtils.isAfter(subtask.deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDate(subtask.deadline) }}</p>
|
||||
<p v-if="subtask.deadline" :class="`${tmUtils.isAfter(subtask.deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDate(subtask.deadline) }} {{ deadlineTime }}</p>
|
||||
<v-tooltip v-else text="Deadline z Mastertasku" location="end">
|
||||
<template v-slot:activator="{ props }">
|
||||
<span class="cursor-pointer" v-bind="props">{{ getMasterTaskDeadline(subtask) }}*</span>
|
||||
@@ -35,7 +35,14 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters('tm', ['mastertasks'])
|
||||
...mapGetters('tm', ['mastertasks']),
|
||||
|
||||
deadlineTime() {
|
||||
const time = this.subtask?._deadline_time
|
||||
if (time)
|
||||
return moment(time, 'HH:mm:ss').format('HH:mm')
|
||||
return ''
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -48,7 +55,7 @@ export default {
|
||||
getMasterTaskDeadline(subtask) {
|
||||
if(!this.mastertasks) return ''
|
||||
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
|
||||
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
|
||||
return tmUtils.formatDateTime(masterTask) ? tmUtils.formatDateTime(masterTask.deadline) : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,17 +246,30 @@ export default {
|
||||
|
||||
isAfterDeadline() {
|
||||
const deadline = this.getDeadline(this.subtask)
|
||||
if (deadline) {
|
||||
return this.tmUtils.isAfter(this.form.date, moment(deadline, 'DD.MM.yyyy'))
|
||||
}
|
||||
return false
|
||||
|
||||
if (!deadline)
|
||||
return
|
||||
|
||||
const mDate = moment(this.form.date)
|
||||
const mDeadline = moment(deadline)
|
||||
|
||||
const [hours, minutes] = this.form.ends_at_time.split(':').map(Number)
|
||||
|
||||
mDate.hours(hours)
|
||||
mDate.minutes(minutes)
|
||||
|
||||
return mDate.isAfter(mDeadline)
|
||||
},
|
||||
|
||||
getDeadline(subtask) {
|
||||
if(subtask.deadline) return moment(subtask.deadline).format('DD.MM.yyyy')
|
||||
else if(!this.mastertasks) return ''
|
||||
if (subtask?.deadline)
|
||||
return subtask.deadline
|
||||
|
||||
if (!this.mastertasks)
|
||||
return null
|
||||
|
||||
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
|
||||
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
|
||||
return masterTask.deadline
|
||||
},
|
||||
|
||||
closeModal() {
|
||||
|
||||
@@ -270,6 +270,7 @@ export default {
|
||||
return timesheet
|
||||
})
|
||||
|
||||
// const { subtask } = await this.$axios.patch_auth_form(`v1/subtasks/${this.subtask.id}`, { ...this.subtask, timesheets })
|
||||
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`, { ...this.subtask, timesheets })
|
||||
|
||||
this.$store.commit('tm/update_subtask', subtask)
|
||||
|
||||
@@ -104,6 +104,18 @@ export default {
|
||||
.catch(error => Promise.reject(toastUtils.parseAndTranslate(error)))
|
||||
},
|
||||
|
||||
async patch_auth_form(url: string, params = null, config?: any) {
|
||||
config = this._config(config)
|
||||
config.headers['Content-Type'] = 'multipart/form-data'
|
||||
const formData = this._objectToFormData(params)
|
||||
formData.append('_method', 'put')
|
||||
config.transformRequest = formData => formData
|
||||
|
||||
return axios.post(url, formData, config)
|
||||
.then(response => response.data)
|
||||
.catch(error => Promise.reject(toastUtils.parseAndTranslate(error)))
|
||||
},
|
||||
|
||||
async patch_data(url: string, params = null, config?: any) {
|
||||
return axios.patch(url, this._objectToFormData(params), config)
|
||||
.then(response => response.data.data)
|
||||
|
||||
Reference in new issue
Block a user