mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
bugs + CR's
This commit is contained in:
1 parent
9974d8b9e4
commit
bb7b59cc0e
15 files changed
+258
-20
No files matched your search
@@ -104,12 +104,30 @@
|
||||
<v-btn rounded class="event-footer-button me-2" :class="{'completed': event.subtask?.is_finished}" @click.stop="completeTask(event)"><img :src="require('@/plugins/app/_img/icons/checkmark-double.svg')" alt=""></v-btn>
|
||||
<v-btn rounded class="event-footer-button me-2" :class="{'completed': event._timeblock_is_finished}" @click.stop="toggleTimeblockIsFinished(event)"><img :src="require('@/plugins/app/_img/icons/checkmark.svg')" alt=""></v-btn>
|
||||
<v-btn rounded class="event-footer-button me-2" @click.stop="editTask(event)"><img :src="require('@/plugins/app/_img/icons/eye.svg')" alt=""></v-btn>
|
||||
<v-btn rounded class="event-footer-button me-2" @click.stop="deleteTask(event)"><img :src="require('@/plugins/app/_img/icons/bin.svg')" alt=""></v-btn>
|
||||
<v-btn rounded class="event-footer-button me-2" @click.stop="deleteTimeBlockInTask(event)"><img :src="require('@/plugins/app/_img/icons/bin.svg')" alt=""></v-btn>
|
||||
</template>
|
||||
</div>
|
||||
</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>
|
||||
|
||||
@@ -157,7 +175,8 @@ export default {
|
||||
},
|
||||
focusedEventId: null,
|
||||
timeCellHeight: 100,
|
||||
tmUtils
|
||||
tmUtils,
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -173,6 +192,14 @@ export default {
|
||||
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
|
||||
},
|
||||
|
||||
weekChanged() {
|
||||
const scrollContainer = this.$el.getElementsByClassName('vuecal__scrollable-body')[0]
|
||||
scrollContainer.scrollLeft = 0
|
||||
@@ -199,6 +226,7 @@ export default {
|
||||
return timesheet
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${editedSubtask.id}`, editedSubtask)
|
||||
this.$events.emit('on-subtask-edited', subtask)
|
||||
@@ -208,6 +236,24 @@ export default {
|
||||
} catch (error) {
|
||||
this.$toast.error(error.message || error)
|
||||
}
|
||||
|
||||
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,
|
||||
@@ -317,8 +363,8 @@ export default {
|
||||
this.$events.emit('show-subtask-modal', {subtask})
|
||||
},
|
||||
|
||||
deleteTask({ subtask }) {
|
||||
this.$events.emit('show-delete-task-modal', {subtask})
|
||||
deleteTimeBlockInTask({ subtask }) {
|
||||
this.$events.emit('show-delete-timeblock-modal', {subtask})
|
||||
},
|
||||
|
||||
editBlocker({ blocker }) {
|
||||
|
||||
@@ -58,6 +58,7 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
#calendar
|
||||
&:deep(.fc-media-screen)
|
||||
@@ -112,4 +113,4 @@ export default {
|
||||
right: 4px
|
||||
&:deep(.fc-daygrid-day-frame)
|
||||
min-height: 100px
|
||||
</style>
|
||||
</style>
|
||||
@@ -58,6 +58,12 @@ export default {
|
||||
mounted() {
|
||||
const monthIndex = new Date().getMonth()
|
||||
this.filter.month = monthIndex < 9 ? `0${monthIndex + 1}` : `${monthIndex + 1}`
|
||||
const savedTeamMT = localStorage.getItem('savedTeamMT')
|
||||
const savedCreatedBy = localStorage.getItem('savedCreatedBy')
|
||||
const savedEmployee = localStorage.getItem('savedEmployee')
|
||||
if(savedTeamMT) this.filter.teamId = JSON.parse(savedTeamMT)
|
||||
if(savedCreatedBy) this.filter.createdById = JSON.parse(savedCreatedBy)
|
||||
if(savedEmployee) this.filter.employeeId = JSON.parse(savedEmployee)
|
||||
},
|
||||
|
||||
computed: {
|
||||
@@ -88,6 +94,9 @@ export default {
|
||||
filter: {
|
||||
handler() {
|
||||
this.$emit('filterChanged', this.filter)
|
||||
localStorage.setItem('savedTeamMT', this.filter.teamId)
|
||||
localStorage.setItem('savedCreatedBy', this.filter.createdById)
|
||||
localStorage.setItem('savedEmployee', this.filter.employeeId)
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -59,6 +59,19 @@ export default {
|
||||
// };
|
||||
// });
|
||||
return this.mastertasks.map(event => {
|
||||
// const currentDate = new Date()
|
||||
// const eventDeadline = new Date(event.deadline)
|
||||
|
||||
// const isEventOnCurrentDate =
|
||||
// eventDeadline.getFullYear() === currentDate.getFullYear() &&
|
||||
// eventDeadline.getMonth() === currentDate.getMonth() &&
|
||||
// eventDeadline.getDate() === currentDate.getDate()
|
||||
|
||||
// console.log("isEventOnCurrentDate:", isEventOnCurrentDate)
|
||||
// console.log("eventDeadline:", eventDeadline)
|
||||
|
||||
// const backgroundColor = isEventOnCurrentDate ? 'red' : event.color
|
||||
// console.log("backgroundColor:", backgroundColor)
|
||||
return {
|
||||
id: event.id,
|
||||
title: `${event.project_code} - ${event.name}`,
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<v-row class="px-10 py-8 subheader">
|
||||
<v-autocomplete
|
||||
:custom-filter="customFilter"
|
||||
:match-any="true" v-model="selectedTeam"
|
||||
:match-any="true"
|
||||
v-model="selectedTeam"
|
||||
class="subheader-input"
|
||||
:items="teams"
|
||||
item-title="name"
|
||||
@@ -68,8 +69,9 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// TODO automaticky preselect
|
||||
this.selectedTeam = this.teams[1].id
|
||||
const savedTeam = localStorage.getItem('selectedTeam')
|
||||
if(savedTeam) this.selectedTeam = JSON.parse(savedTeam)
|
||||
else this.selectedTeam = this.teams[0]?.id
|
||||
|
||||
this.$nextTick(() => this._updateFilters())
|
||||
},
|
||||
@@ -98,6 +100,8 @@ export default {
|
||||
if (!this.filter.start || !this.filter.end || !this.filter.team) return
|
||||
|
||||
this.$emit('filter-changed', this.filter)
|
||||
|
||||
localStorage.setItem('selectedTeam', this.filter.team.id)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
id: index + 1,
|
||||
name: employee.name,
|
||||
employee_id: employee.id,
|
||||
// date: this.filter.start,
|
||||
date: this.filter.start,
|
||||
fullname: `${employee.name} ${employee.surname}`,
|
||||
initials: employee.name.charAt(0).toUpperCase() + employee.surname.charAt(0).toUpperCase(),
|
||||
unscheduledTime: unscheduledTime > 0 ? (unscheduledTime / 60).toFixed(1) : 0,
|
||||
|
||||
Reference in new issue
Block a user