build(dev): rebuild, file formatting, removed console logs

This commit is contained in:
Matej Glasnák committed 2025-12-08 12:05:29 +01:00
1 parent 734a3fac6c
commit f69e55859b
34 files changed
+1537 -1177

No files matched your search

@@ -235,9 +235,6 @@ export default {
this.$events.emit('show-task-add-time-modal', { subtask });
} catch (error) {
this.$toast.error(error.message || error);
if (process.env.NODE_ENV === 'development')
/* eslint-disable */console.log(...oo_oo(`1460579881_240_12_240_58_4`,'[z-timeline.vue] Error: ', error));
}
const isAfterDeadline = this.isAfterDeadline(event);
@@ -270,9 +267,6 @@ export default {
this.$events.emit('on-subtask-edited', subtask);
} catch (error) {
this.$toast.error(error.message || error);
if (process.env.NODE_ENV === 'development')
/* eslint-disable */console.log(...oo_oo(`1460579881_275_12_275_58_4`,'[z-timeline.vue] Error: ', error));
}
}
},
@@ -372,9 +366,6 @@ export default {
this.$events.emit('show-task-add-time-modal', { subtask });
} catch (error) {
this.$toast.error(error.message || error);
if (process.env.NODE_ENV === 'development')
/* eslint-disable */console.log(...oo_oo(`1460579881_377_10_377_56_4`,'[z-timeline.vue] Error: ', error));
}
},
@@ -135,15 +135,6 @@ export default {
this.mastertasks = mastertasks;
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!');
if (process.env.NODE_ENV === 'development')
/* eslint-disable */ console.log(
...oo_oo(
`130007368_123_5_123_49_4`,
'[projects.vue] Error: ',
error,
),
);
}
setTimeout(() => {
+196 -160
View File
@@ -1,198 +1,235 @@
<template>
<div ref="page">
<A-task-filter v-if="$store.getters['tm/isInitialized']" ref="filter" :split-days="timelineData ? splitDays : null" @filter-changed="onFilterChanged" />
<Z-timeline v-if="timelineData && !hideCal" :cal-data="timelineData" :cal-config="config" :splits="splitDays" />
</div>
<div ref="page">
<A-task-filter
v-if="$store.getters['tm/isInitialized']"
ref="filter"
:split-days="timelineData ? splitDays : null"
@filter-changed="onFilterChanged"
/>
<Z-timeline
v-if="timelineData && !hideCal"
:cal-data="timelineData"
:cal-config="config"
:splits="splitDays"
/>
</div>
</template>
<script>
import ATaskFilter from './_components/a-tasks-filter.vue'
import ZTimeline from '@/plugins/tm@dashboard/_components/z-timeline.vue'
import { addDays, subDays } from 'date-fns'
import moment from 'moment'
import timelineUtils from './_utils/timeline.utils'
import { mapGetters } from 'vuex'
import FilterMixin from '../_mixins/Filter.mixin'
import ATaskFilter from './_components/a-tasks-filter.vue';
import ZTimeline from '@/plugins/tm@dashboard/_components/z-timeline.vue';
import { addDays, subDays } from 'date-fns';
import moment from 'moment';
import timelineUtils from './_utils/timeline.utils';
import { mapGetters } from 'vuex';
import FilterMixin from '../_mixins/Filter.mixin';
export default {
components: {
ATaskFilter,
ZTimeline,
},
mixins: [FilterMixin],
components: {
ATaskFilter,
ZTimeline
},
mixins: [FilterMixin],
data() {
return {
hideCal: false,
filter: null,
subtasks: null,
config: {
date: subDays(new Date(), 1),
scrollHour: 7,
},
};
},
data() {
return {
hideCal: false,
filter: null,
subtasks: null,
config: {
date: subDays(new Date(), 1),
scrollHour: 7,
}
}
},
computed: {
...mapGetters('auth', ['user']),
computed: {
...mapGetters('auth', ['user']),
splitDays() {
const days = [];
const homeoffice = {};
const schedulesCapacityBySplit = {};
splitDays() {
const days = []
const homeoffice = {}
const schedulesCapacityBySplit = {}
const now = moment();
const dailyCapacityMinutes =
(this.user.work_end - this.user.work_start) * 60;
const now = moment()
const dailyCapacityMinutes = (this.user.work_end - this.user.work_start) * 60
this.timelineData.tasks.forEach((task) => {
if (
task.type == 'non-working-hours' ||
task.subtask?.is_finished ||
task.blocker?.is_finished
)
return;
this.timelineData.tasks.forEach(task => {
if (task.type == 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished)
return
if (!schedulesCapacityBySplit[task.split])
schedulesCapacityBySplit[task.split] = 0;
if (!schedulesCapacityBySplit[task.split])
schedulesCapacityBySplit[task.split] = 0
if (now.isAfter(moment(task._real_end))) {
// Ignore elapsed task
return;
} else if (
now.isAfter(moment(task._real_start)) &&
now.isBefore(moment(task._real_end))
) {
// Task in progress
schedulesCapacityBySplit[task.split] +=
timelineUtils._getDifferenceInMinutes(task._real_end, new Date());
} else {
// Future task
schedulesCapacityBySplit[task.split] +=
timelineUtils._getDifferenceInMinutes(
task._real_end,
task._real_start,
);
}
});
if (now.isAfter(moment(task._real_end))) {
// Ignore elapsed task
return
}
else if (now.isAfter(moment(task._real_start)) && now.isBefore(moment(task._real_end))) {
// Task in progress
schedulesCapacityBySplit[task.split] += timelineUtils._getDifferenceInMinutes(task._real_end, new Date())
}
else {
// Future task
schedulesCapacityBySplit[task.split] += timelineUtils._getDifferenceInMinutes(task._real_end, task._real_start)
}
})
schedulesCapacityBySplit[1] = 0; // Set YESTERDAY value to 0
schedulesCapacityBySplit[1] = 0 // Set YESTERDAY value to 0
this.timelineData.homeoffices.forEach((task) => {
homeoffice[task.split - 1] = true;
});
this.timelineData.homeoffices.forEach(task => {
homeoffice[task.split - 1] = true
})
for (let i = 0; i < 7; i++) {
if (!schedulesCapacityBySplit[i + 1])
schedulesCapacityBySplit[i + 1] = 0;
for (let i = 0; i < 7; i++) {
if (!schedulesCapacityBySplit[i + 1])
schedulesCapacityBySplit[i + 1] = 0
let unscheduledTime;
let unscheduledTime
const date = moment(addDays(this.filter.start, i));
const date = moment(addDays(this.filter.start, i))
if (date.isBefore(moment(), 'days')) {
// Yesterday
unscheduledTime = 0;
} else if (date.isSame(moment(), 'days')) {
// Today
const elapsedMinutes = now.diff(
now.clone().startOf('day'),
'minutes',
);
const workStart =
this.user.work_start * 60 > elapsedMinutes
? this.user.work_start
: elapsedMinutes / 60;
const todayCapacityMinutes = (this.user.work_end - workStart) * 60;
unscheduledTime =
todayCapacityMinutes - schedulesCapacityBySplit[i + 1] / 60 < 0
? 0
: todayCapacityMinutes - schedulesCapacityBySplit[i + 1];
} else {
// Future
unscheduledTime =
dailyCapacityMinutes - schedulesCapacityBySplit[i + 1];
}
if (date.isBefore(moment(), 'days')) {
// Yesterday
unscheduledTime = 0
} else if (date.isSame(moment(), 'days')) {
// Today
const elapsedMinutes = now.diff(now.clone().startOf('day'), 'minutes')
const workStart = this.user.work_start * 60 > elapsedMinutes ? this.user.work_start : elapsedMinutes / 60
const todayCapacityMinutes = (this.user.work_end - workStart) * 60
unscheduledTime = todayCapacityMinutes - schedulesCapacityBySplit[i + 1] / 60 < 0 ? 0 : todayCapacityMinutes - schedulesCapacityBySplit[i + 1]
} else {
// Future
unscheduledTime = dailyCapacityMinutes - schedulesCapacityBySplit[i + 1]
}
if (isNaN(unscheduledTime)) unscheduledTime = dailyCapacityMinutes;
if (isNaN(unscheduledTime))
unscheduledTime = dailyCapacityMinutes
days.push({
id: i + 1,
name: this.filter.employee.name,
surname: this.filter.employee.surname,
fullname: `${this.filter.employee.name} ${this.filter.employee.surname}`,
initials:
this.filter.employee.name.charAt(0).toUpperCase() +
this.filter.employee.surname.charAt(0).toUpperCase(),
unscheduledTime: (unscheduledTime / 60).toFixed(1),
scheduledTime: (schedulesCapacityBySplit[i + 1] / 60).toFixed(1),
date: addDays(this.filter.start, i),
isHomeoffice: homeoffice[i] ? true : false,
isWeekend: timelineUtils.isWeekend(addDays(this.filter.start, i)),
});
}
days.push({
id: i + 1,
name: this.filter.employee.name,
surname: this.filter.employee.surname,
fullname: `${this.filter.employee.name} ${this.filter.employee.surname}`,
initials: this.filter.employee.name.charAt(0).toUpperCase() + this.filter.employee.surname.charAt(0).toUpperCase(),
unscheduledTime: (unscheduledTime / 60).toFixed(1),
scheduledTime: (schedulesCapacityBySplit[i + 1] / 60).toFixed(1),
date: addDays(this.filter.start, i),
isHomeoffice: homeoffice[i] ? true : false,
isWeekend: timelineUtils.isWeekend(addDays(this.filter.start, i))
})
}
return days;
},
return days
},
unscheduledTime() {
if (!this.subtasks) return 0;
unscheduledTime() {
if (!this.subtasks) return 0
return timelineUtils.getUnscheduledTime(this.subtasks);
},
return timelineUtils.getUnscheduledTime(this.subtasks)
},
timelineData() {
if (!this.subtasks || !this.filter) return null;
const { tasks, blockers, nonWorkingHours, homeoffices } =
timelineUtils.generateTimelineTasks(
this.subtasks,
new Date(this.filter.start),
this.filter.employee,
);
timelineData() {
if (!this.subtasks || !this.filter)
return null
return {
name: this.filter.employee.name,
surname: this.filter.employee.surname,
unscheduledTime: this.unscheduledTime,
tasks: [...tasks, ...blockers, ...nonWorkingHours],
homeoffices,
};
},
},
const { tasks, blockers, nonWorkingHours, homeoffices } = timelineUtils.generateTimelineTasks(this.subtasks, new Date(this.filter.start), this.filter.employee)
mounted() {
this.$events.on('on-subtask-edited', () => {
this.onFilterChanged(this.filter);
});
return {
name: this.filter.employee.name,
surname: this.filter.employee.surname,
unscheduledTime: this.unscheduledTime,
tasks: [...tasks, ...blockers, ...nonWorkingHours],
homeoffices
}
}
},
this.$events.on('on-subtask-deleted', () => {
this.onFilterChanged(this.filter);
});
mounted() {
this.$events.on('on-subtask-edited', () => {
this.onFilterChanged(this.filter)
})
this.$events.on('on-blocker-edited', () => {
this.onFilterChanged(this.filter);
});
this.$events.on('on-subtask-deleted', () => {
this.onFilterChanged(this.filter)
})
this.$events.on('on-blocker-deleted', () => {
this.onFilterChanged(this.filter);
});
},
this.$events.on('on-blocker-edited', () => {
this.onFilterChanged(this.filter)
})
unmounted() {
this.$events.off('on-subtask-edited');
this.$events.off('on-subtask-deleted');
this.$events.off('on-blocker-edited');
this.$events.off('on-blocker-deleted');
},
this.$events.on('on-blocker-deleted', () => {
this.onFilterChanged(this.filter)
})
},
methods: {
async onFilterChanged(filter) {
this.filter = filter;
const urlQueryObject = {};
unmounted() {
this.$events.off('on-subtask-edited')
this.$events.off('on-subtask-deleted')
this.$events.off('on-blocker-edited')
this.$events.off('on-blocker-deleted')
},
if (filter.start)
urlQueryObject.start = moment(filter.start).format('YYYY-MM-DD');
if (filter.end)
urlQueryObject.end = moment(filter.end).format('YYYY-MM-DD');
if (filter.employee) urlQueryObject.employee_id = filter.employee.id;
methods: {
async onFilterChanged(filter) {
this.filter = filter
const urlQueryObject = {}
const queryParameters = new URLSearchParams(urlQueryObject).toString();
if (filter.start) urlQueryObject.start = moment(filter.start).format('YYYY-MM-DD')
if (filter.end) urlQueryObject.end = moment(filter.end).format('YYYY-MM-DD')
if (filter.employee) urlQueryObject.employee_id = filter.employee.id
try {
const { subtasks, blockers } = await this.$axios.get_auth(
`v1/subtasks?${queryParameters}`,
);
this.config.scrollHour = this.filter?.employee.work_start - 1;
this.config.date = this.filter.start;
this.subtasks = [...subtasks, ...blockers];
this.hideCal = true;
setTimeout(() => {
this.hideCal = false;
}, 0);
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!');
}
const queryParameters = new URLSearchParams(urlQueryObject).toString()
try {
const { subtasks, blockers } = await this.$axios.get_auth(`v1/subtasks?${queryParameters}`)
this.config.scrollHour = (this.filter?.employee.work_start) - 1
this.config.date = this.filter.start
this.subtasks = [...subtasks, ...blockers]
this.hideCal = true
setTimeout(() => { this.hideCal = false }, 0)
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!')
if (process.env.NODE_ENV === 'development')
/* eslint-disable */console.log(...oo_oo(`1163945854_187_5_187_46_4`,'[tasks.vue] Error: ', error))
}
setTimeout(() => {
this._initScrollListener()
}, 100)
}
}
}
setTimeout(() => {
this._initScrollListener();
}, 100);
},
},
};
</script>
<style lang="sass" scoped>
@@ -204,5 +241,4 @@ export default {
@media (max-width: 1312px)
.w-loadable
height: calc( 100% - 202px )
</style>
</style>
+89 -79
View File
@@ -1,100 +1,111 @@
<template>
<div ref="page">
<A-team-filter v-if="$store.getters['tm/isInitialized']" :split-days="calendarData ? splitDays : null" @filter-changed="onFilterChanged" />
<Z-timeline v-if="calendarData && !hideCal" :cal-data="calendarData" :cal-config="calendarConfig" :splits="splitDays" />
</div>
<div ref="page">
<A-team-filter
v-if="$store.getters['tm/isInitialized']"
:split-days="calendarData ? splitDays : null"
@filter-changed="onFilterChanged"
/>
<Z-timeline
v-if="calendarData && !hideCal"
:cal-data="calendarData"
:cal-config="calendarConfig"
:splits="splitDays"
/>
</div>
</template>
<script>
import ATeamFilter from './_components/a-team-filter.vue'
import ZTimeline from '@/plugins/tm@dashboard/_components/z-timeline.vue'
import moment from 'moment'
import TeamsCalendar from './_mixins/TeamsCalendar.mixin'
import FilterMixin from '../_mixins/Filter.mixin'
import { mapGetters } from 'vuex'
import ATeamFilter from './_components/a-team-filter.vue';
import ZTimeline from '@/plugins/tm@dashboard/_components/z-timeline.vue';
import moment from 'moment';
import TeamsCalendar from './_mixins/TeamsCalendar.mixin';
import FilterMixin from '../_mixins/Filter.mixin';
import { mapGetters } from 'vuex';
export default {
components: {
ATeamFilter,
ZTimeline,
},
mixins: [TeamsCalendar, FilterMixin],
components: {
ATeamFilter,
ZTimeline,
},
mixins: [TeamsCalendar, FilterMixin],
data() {
return {
hideCal: false,
data() {
return {
hideCal: false,
filter: null,
subtasks: null,
blockers: null,
calendarConfig: {
date: new Date(),
scrollHour: 7,
},
};
},
filter: null,
subtasks: null,
blockers: null,
calendarConfig: {
date: new Date(),
scrollHour: 7,
}
}
},
computed: {
...mapGetters('auth', ['user']),
},
computed: {
...mapGetters('auth', ['user']),
},
mounted() {
this.$events.on('on-subtask-edited', () => {
this.onFilterChanged(this.filter);
});
mounted() {
this.$events.on('on-subtask-edited', () => {
this.onFilterChanged(this.filter)
})
this.$events.on('on-subtask-deleted', () => {
this.onFilterChanged(this.filter);
});
this.$events.on('on-subtask-deleted', () => {
this.onFilterChanged(this.filter)
})
this.$events.on('on-blocker-edited', () => {
this.onFilterChanged(this.filter);
});
this.$events.on('on-blocker-edited', () => {
this.onFilterChanged(this.filter)
})
this.$events.on('on-blocker-deleted', () => {
this.onFilterChanged(this.filter);
});
},
this.$events.on('on-blocker-deleted', () => {
this.onFilterChanged(this.filter)
})
},
unmounted() {
this.$events.off('on-subtask-edited');
this.$events.off('on-subtask-deleted');
this.$events.off('on-blocker-edited');
this.$events.off('on-blocker-deleted');
},
unmounted() {
this.$events.off('on-subtask-edited')
this.$events.off('on-subtask-deleted')
this.$events.off('on-blocker-edited')
this.$events.off('on-blocker-deleted')
},
methods: {
async onFilterChanged(filter) {
this.filter = filter;
methods: {
async onFilterChanged(filter) {
this.filter = filter
const urlQueryObject = {};
const urlQueryObject = {}
if (filter.start)
urlQueryObject.start = moment(filter.start).format('YYYY-MM-DD');
if (filter.end)
urlQueryObject.end = moment(filter.end).format('YYYY-MM-DD');
if (filter.team) urlQueryObject.team_id = filter.team.id;
if (filter.start) urlQueryObject.start = moment(filter.start).format('YYYY-MM-DD')
if (filter.end) urlQueryObject.end = moment(filter.end).format('YYYY-MM-DD')
if (filter.team) urlQueryObject.team_id = filter.team.id
const queryParameters = new URLSearchParams(urlQueryObject).toString();
const queryParameters = new URLSearchParams(urlQueryObject).toString()
try {
const { subtasks, blockers } = await this.$axios.get_auth(
`v1/subtasks?${queryParameters}`,
);
this.subtasks = subtasks;
this.blockers = blockers;
this.hideCal = true;
setTimeout(() => {
this.hideCal = false;
}, 0);
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!');
}
try {
const { subtasks, blockers } = await this.$axios.get_auth(`v1/subtasks?${queryParameters}`)
this.subtasks = subtasks
this.blockers = blockers
this.hideCal = true
setTimeout(() => { this.hideCal = false }, 0)
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!')
if (process.env.NODE_ENV === 'development')
/* eslint-disable */console.log(...oo_oo(`1416174149_89_5_89_46_4`,'[teams.vue] Error: ', error))
}
setTimeout(() => {
this._initScrollListener()
}, 100)
}
}
}
setTimeout(() => {
this._initScrollListener();
}, 100);
},
},
};
</script>
<style lang="sass" scoped>
@@ -106,5 +117,4 @@ export default {
@media (max-width: 1312px)
.w-loadable
height: calc( 100% - 202px )
</style>
</style>