diff --git a/app/src/plugins/app/_config/App.vue b/app/src/plugins/app/_config/App.vue index d8eb8ba..d2f4d98 100644 --- a/app/src/plugins/app/_config/App.vue +++ b/app/src/plugins/app/_config/App.vue @@ -55,24 +55,24 @@ export default { this.$refs['z-delete-task-modal'].showModal(task) }) - this.$events.on('show-delete-master-task-modal', ({masterTask}) => { - this.$refs['z-delete-master-task-modal'].showModal(masterTask) + this.$events.on('show-delete-master-task-modal', ({mastertask}) => { + this.$refs['z-delete-master-task-modal'].showModal(mastertask) }) - this.$events.on('show-task-modal', ({task, editMode, masterTask}) => { + this.$events.on('show-task-modal', ({task, editMode, mastertask}) => { if(task && task.id) { const id = task.id this.$router.push({ query: { 'task': id }}) } - this.$refs['z-task-modal'].showModal(task, editMode, masterTask) + this.$refs['z-task-modal'].showModal(task, editMode, mastertask) }) - this.$events.on('show-master-task-modal', ({ masterTask, editMode }) => { - if (masterTask && masterTask.id) { - const id = masterTask.id + this.$events.on('show-master-task-modal', ({ mastertask, editMode }) => { + if (mastertask && mastertask.id) { + const id = mastertask.id this.$router.push({ query: { 'master-task': id } }) } - this.$refs['z-master-task-modal'].showModal(masterTask, editMode) + this.$refs['z-master-task-modal'].showModal(mastertask, editMode) }) this.$events.on('show-complete-task-modal', ({ subtask }) => { @@ -90,6 +90,14 @@ export default { this.$events.on('on-subtask-edited', () => { this.$store.dispatch('tm/reloadSubtasks') }) + + this.$events.on('on-mastertask-edited', () => { + this.$store.dispatch('tm/reloadMastertasks') + }) + + this.$events.on('on-mastertask-deleted', () => { + this.$store.dispatch('tm/reloadMastertasks') + }) }, methods: { @@ -105,19 +113,19 @@ export default { this.$events.emit('on-subtask-edited', task) }, - onMasterTaskDeleted(masterTask){ - this.$events.emit('on-master-task-deleted', masterTask) + onMasterTaskDeleted(mastertask){ + this.$events.emit('on-master-task-deleted', mastertask) }, - onMasterTaskEdited(masterTask){ - this.$events.emit('on-master-task-edited', masterTask) + onMasterTaskEdited(mastertask){ + this.$events.emit('on-mastertask-edited', mastertask) } }, watch: { '$route'() { if (this.$route.query['master-task']) { - this.$events.emit('show-master-task-modal', { masterTask: { id: this.$route.query['master-task'] }, editMode: false }) + this.$events.emit('show-master-task-modal', { mastertask: { id: this.$route.query['master-task'] }, editMode: false }) } } } diff --git a/app/src/plugins/app@vendor/vue-cal/utils/date.js b/app/src/plugins/app@vendor/vue-cal/utils/date.js index e6d7a89..eec9b14 100644 --- a/app/src/plugins/app@vendor/vue-cal/utils/date.js +++ b/app/src/plugins/app@vendor/vue-cal/utils/date.js @@ -110,6 +110,8 @@ export default class DateUtils { } getWeek (date) { + console.log(date) + console.log('kokot') const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())) const dayNum = d.getUTCDay() || 7 d.setUTCDate(d.getUTCDate() + 4 - dayNum) diff --git a/app/src/plugins/tm@_store/store/index.ts b/app/src/plugins/tm@_store/store/index.ts index b4bbfe3..919f8e1 100644 --- a/app/src/plugins/tm@_store/store/index.ts +++ b/app/src/plugins/tm@_store/store/index.ts @@ -108,10 +108,16 @@ export default { ]) }, + reloadMastertasks({dispatch}: {dispatch: any}) { + return Promise.all([ + dispatch('loadMastertasks') + ]) + }, + loadMastertasks({commit}: {commit: any}) { return new Promise((resolve, reject) => { - axios.get_auth_data('v1/mastertasks') - .then(mastertasks => { + axios.get_auth('v1/mastertasks') + .then(({ mastertasks }) => { commit('set_mastertasks', mastertasks) resolve(mastertasks) }) @@ -208,7 +214,11 @@ export default { enrichedEmployees: (state: any) => { if (!state.employees) return [] - return state.employees.map(employee => ({...employee, _fullName: `${ employee.name } ${ employee.surname }`})) + return state.employees.map(employee => ({ + ...employee, + _fullName: `${ employee.name } ${ employee.surname }`, + _initials: employee.name.charAt(0) + employee.surname.charAt(0) + })).sort((a, b) => a.name < b.name ? -1 : 1) }, teams: (state: any) => { diff --git a/app/src/plugins/tm@_utils/tm.utils.ts b/app/src/plugins/tm@_utils/tm.utils.ts index 3cfc31c..bc09bc1 100644 --- a/app/src/plugins/tm@_utils/tm.utils.ts +++ b/app/src/plugins/tm@_utils/tm.utils.ts @@ -1,8 +1,12 @@ import moment from 'moment' export default { - enrichEmployeesByFullName(employees) { - return employees.map(employee => ({...employee, _fullName: `${ employee.name } ${ employee.surname }`})) + enrichEmployees(employees) { + return employees.map(employee => ({ + ...employee, + _fullName: `${ employee.name } ${ employee.surname }`, + _initials: employee.name.charAt(0) + employee.surname.charAt(0) + })) }, formatDateTime(date) { diff --git a/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue b/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue index 004e244..cfea543 100644 --- a/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue +++ b/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue @@ -44,9 +44,10 @@ export default { }, mounted() { - const currentYear = new Date().getFullYear() + const currentYear = new Date().getFullYear() + const monthIndex = typeof this.month == 'string' ? parseInt(this.month) - 1 : this.month - 1 this.calendarOptions.events = this.events - this.$refs.fullCalendar?.getApi().gotoDate(new Date(currentYear, this.month, 1)) + this.$refs.fullCalendar?.getApi().gotoDate(new Date(currentYear, monthIndex, 1)) }, watch: { diff --git a/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue b/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue index f0d6b79..a14823e 100644 --- a/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue +++ b/app/src/plugins/tm@dashboard/projects/_components/a-project-filter.vue @@ -1,18 +1,18 @@ @@ -26,31 +26,36 @@ export default { data() { return { months: [ - { title: 'Január', value: 0 }, - { title: 'Február', value: 1 }, - { title: 'Marec', value: 2 }, - { title: 'Apríl', value: 3 }, - { title: 'Máj', value: 4 }, - { title: 'Jún', value: 5 }, - { title: 'Júl', value: 6 }, - { title: 'August', value: 7 }, - { title: 'September', value: 8 }, - { title: 'Október', value: 9 }, - { title: 'November', value: 10 }, - { title: 'December', value: 11 } + { title: 'Január', value: '01' }, + { title: 'Február', value: '02' }, + { title: 'Marec', value: '03' }, + { title: 'Apríl', value: '04' }, + { title: 'Máj', value: '05' }, + { title: 'Jún', value: '06' }, + { title: 'Júl', value: '07' }, + { title: 'August', value: '08' }, + { title: 'September', value: '09' }, + { title: 'Október', value: '10' }, + { title: 'November', value: '11' }, + { title: 'December', value: '12' } ], filter: { - selectedProject: null, - selectedTeam: null, - selectedEmployee: null, - selectedAssignedBy: null, - selectedMonth: new Date().getMonth(), - showFinishedTasks: false + projectId: null, + teamId: null, + employeeId: null, + createdById: null, + month: null, + isFinished: false } } }, + mounted() { + const monthIndex = new Date().getMonth() + this.filter.month = monthIndex < 9 ? `0${monthIndex + 1}` : `${monthIndex + 1}` + }, + computed: { ...mapGetters('tm', [ 'teams', diff --git a/app/src/plugins/tm@dashboard/projects/projects.vue b/app/src/plugins/tm@dashboard/projects/projects.vue index 072c384..c762b58 100644 --- a/app/src/plugins/tm@dashboard/projects/projects.vue +++ b/app/src/plugins/tm@dashboard/projects/projects.vue @@ -1,12 +1,14 @@ \ No newline at end of file diff --git a/app/src/plugins/tm@modal/_components/read-only/z-deadline.vue b/app/src/plugins/tm@modal/_components/read-only/z-deadline.vue new file mode 100644 index 0000000..16461e9 --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-deadline.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/_components/read-only/z-description.vue b/app/src/plugins/tm@modal/_components/read-only/z-description.vue new file mode 100644 index 0000000..9fafaa3 --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-description.vue @@ -0,0 +1,27 @@ + + + diff --git a/app/src/plugins/tm@modal/_components/z-files.vue b/app/src/plugins/tm@modal/_components/read-only/z-files.vue similarity index 100% rename from app/src/plugins/tm@modal/_components/z-files.vue rename to app/src/plugins/tm@modal/_components/read-only/z-files.vue diff --git a/app/src/plugins/tm@modal/_components/read-only/z-planned-time.vue b/app/src/plugins/tm@modal/_components/read-only/z-planned-time.vue new file mode 100644 index 0000000..431ca24 --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-planned-time.vue @@ -0,0 +1,28 @@ + + + diff --git a/app/src/plugins/tm@modal/_components/read-only/z-remaining-time.vue b/app/src/plugins/tm@modal/_components/read-only/z-remaining-time.vue new file mode 100644 index 0000000..2cf3b51 --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-remaining-time.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/src/plugins/tm@modal/_components/read-only/z-spent-time.vue b/app/src/plugins/tm@modal/_components/read-only/z-spent-time.vue new file mode 100644 index 0000000..b61b02e --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-spent-time.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/_components/read-only/z-status.vue b/app/src/plugins/tm@modal/_components/read-only/z-status.vue new file mode 100644 index 0000000..f0acf77 --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-status.vue @@ -0,0 +1,29 @@ + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/_components/read-only/z-team.vue b/app/src/plugins/tm@modal/_components/read-only/z-team.vue new file mode 100644 index 0000000..6642a23 --- /dev/null +++ b/app/src/plugins/tm@modal/_components/read-only/z-team.vue @@ -0,0 +1,48 @@ + + + + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/blocker/z-blocker-modal.vue b/app/src/plugins/tm@modal/blocker/z-blocker-modal.vue index c74c0b9..d5d7139 100644 --- a/app/src/plugins/tm@modal/blocker/z-blocker-modal.vue +++ b/app/src/plugins/tm@modal/blocker/z-blocker-modal.vue @@ -139,11 +139,11 @@ export default { try { const employees = await this.$axios.get_auth_data('v1/employees') - this.employees = tmUtils.enrichEmployeesByFullName(employees) + this.employees = tmUtils.enrichEmployees(employees) if (blocker?.id) { const b = await this.$axios.get_auth_data(`v1/blockers/${blocker.id}`) - this.blocker = {...b, employees: tmUtils.enrichEmployeesByFullName(b.employees)} + this.blocker = {...b, employees: tmUtils.enrichEmployees(b.employees)} } else { this.blocker = {employees: []} } diff --git a/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue b/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue index a096c4e..43f3bb8 100644 --- a/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue +++ b/app/src/plugins/tm@modal/master-task/_components/a-mastertask-description.vue @@ -1,153 +1,44 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts b/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts index 78697b4..31170b2 100644 --- a/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts +++ b/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts @@ -1,7 +1,7 @@ export default { computed: { employeesOptions() { - const selectedEmployees = [...this.masterTask.employees].map(employee => employee.id) + const selectedEmployees = [...this.mastertask.employees].map(employee => employee.id) const employees = this.employees.filter( (employee) => !selectedEmployees.includes(employee.id) @@ -19,26 +19,26 @@ export default { methods: { onProjectSelected({ key }) { const project = this.projects.find(project => project.id == key) - this.masterTask.project_code = project.code - this.masterTask.project_id = project.id + this.mastertask.project_code = project.code + this.mastertask.project_id = project.id }, onMasterTaskSelected({ key }) { - const mastertask = this.mastertasks.find(masterTask => masterTask.id == key) + const mastertask = this.mastertasks.find(mastertask => mastertask.id == key) this.task.master_task = mastertask this.task.project_code = mastertask.project_code }, onEmployeeSelected({ key }) { const employee = this.employees.find(employee => employee.id == key) - this.masterTask.employees.push(employee) + this.mastertask.employees.push(employee) this.showAddEmployeeInput = false }, onEmployeeDurationChanged() { let totalDuration = 0 - this.masterTask.employees = this.masterTask.employees.map(employee => { + this.mastertask.employees = this.mastertask.employees.map(employee => { if (typeof employee.duration == 'string') { totalDuration += parseInt(employee.duration) employee.duration = parseInt(employee.duration) @@ -50,16 +50,16 @@ export default { return employee }) - this.masterTask.duration = totalDuration + this.mastertask.duration = totalDuration } }, watch: { - 'masterTask.team_id'(value, oldValue) { + 'mastertask.team_id'(value, oldValue) { if (!value || !oldValue) return - this.masterTask.team = this.teams.find(team => team.id == value) - this.masterTask.employees = this.masterTask.team.employees + this.mastertask.team = this.teams.find(team => team.id == value) + this.mastertask.employees = this.mastertask.team.employees } } } \ No newline at end of file diff --git a/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue index a32a696..c85f3d8 100644 --- a/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-delete-master-task-modal.vue @@ -2,7 +2,7 @@
-

Ste si istý, že chcete zmazať {{ masterTask.name }}?

+

Ste si istý, že chcete zmazať {{ mastertask.name }}?

- + - + - + - + - + - + - @@ -21,7 +21,7 @@ import ATaskPlannedTime from './_components/a-task-planned-time.vue' import ATaskSpentTime from './_components/a-task-spent-time.vue' import ATaskRemainingTime from './_components/a-task-remaining-time.vue' import ATaskDescription from './_components/a-task-description.vue' -import ZFiles from '@/plugins/tm@modal/_components/z-files.vue' +import ZFiles from '@/plugins/tm@modal/_components/read-only/z-files.vue' export default { emits: ['close-modal'], diff --git a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue index f967872..b920349 100644 --- a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue @@ -2,7 +2,7 @@
-

Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z masterTasku {{ subtask?.master_task?.name || subtask.master_task }}?

+

Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku {{ subtask?.master_task?.name || subtask.master_task }}?

-

Ste si istý, že chcete zmazať task z masterTasku {{ task.project_code }}?

+

Ste si istý, že chcete zmazať task z mastertasku {{ task.project_code }}?

- + -