[Bugfix] Cannot read properties of null (.split())

This commit is contained in:
Matej Glasnák committed 2024-09-18 17:59:56 +02:00
1 parent 2ffa3e24c8
commit e1e46a5c0b
87 files changed
+186 -78

No files matched your search

@@ -49,7 +49,7 @@
</v-menu>
</div>
</div>
</v-app-bar>
</template>
@@ -75,6 +75,9 @@ export default {
this.$toast.success('Boli ste odhlásený')
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[a-header.vue] Error: ', error)
}
},
@@ -30,11 +30,14 @@ export default {
async mounted() {
this.loader = this.$loading.show()
try {
await this.$store.dispatch('tm/initialize')
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[app.layout.vue] Error: ', error)
} finally {
this.loader?.hide()
}
@@ -48,6 +48,9 @@ export default {
this.$router.push({name: 'Forgot success', query: {email: this.credentials.email}})
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[a-forgot-password-form.vue] Error: ', error)
}
}
}
@@ -50,6 +50,9 @@ export default {
this.$router.push({ name: 'Dashboard - Tasks'})
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[a-login-form.vue] Error: ', error)
}
}
}
@@ -61,6 +61,9 @@ export default {
this.$toast.success('Your password has been successfully changed.')
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[a-reset-password-form.vue] Error: ', error)
}
}
}
+5 -2
View File
@@ -35,7 +35,7 @@ export default {
this.$events.on('onSearch', (search) => {
if (!search?.length)
return
this.search = search
this.onSearch(search)
})
@@ -65,7 +65,7 @@ export default {
this.$events.off('on-mastertask-edited')
this.$events.off('on-mastertask-deleted')
},
methods: {
onSearch: debounce(async function (search, reset = true) {
try {
@@ -76,6 +76,9 @@ export default {
this.searchResults = {mastertasks: mastertasks.data, subtasks: subtasks.data, teams: teams.data}
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[serach.vue] Error: ', error)
this.searchResults = {error}
}
}, 300)
@@ -60,7 +60,7 @@ export default {
const maxSize = 50 * 1024 * 1024
const oversizedFiles = files.filter(file => file.size > maxSize)
if (oversizedFiles.length > 0) {
this.$toast.error('File is too large. Maximum file size is 50 MB.')
this.$toast.error('File is too large. Maximum file size is 50 MB.')
return
}
@@ -238,6 +238,9 @@ 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')
console.log('[z-timeline.vue] Error: ', error)
}
const isAfterDeadline = this.isAfterDeadline(event)
@@ -263,6 +266,9 @@ export default {
this.$events.emit('on-subtask-edited', subtask)
} catch (error) {
this.$toast.error(error.message || error)
if (process.env.NODE_ENV === 'development')
console.log('[z-timeline.vue] Error: ', error)
}
}
},
@@ -345,6 +351,9 @@ 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')
console.log('[z-timeline.vue] Error: ', error)
}
},
@@ -118,6 +118,9 @@ export default {
this.mastertasks = mastertasks
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!')
if (process.env.NODE_ENV === 'development')
console.log('[projects.vue] Error: ', error)
}
setTimeout(() => {
@@ -179,6 +179,9 @@ export default {
setTimeout(() => { this.hideCal = false }, 0)
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!')
if (process.env.NODE_ENV === 'development')
console.log('[tasks.vue] Error: ', error)
}
setTimeout(() => {
+5 -2
View File
@@ -9,7 +9,7 @@
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 TeamsCalendar from './_mixins/TeamsCalendar.mixin'
import FilterMixin from '../_mixins/Filter.mixin'
import { mapGetters } from 'vuex'
@@ -64,7 +64,7 @@ export default {
this.$events.off('on-blocker-deleted')
},
methods: {
methods: {
async onFilterChanged(filter) {
this.filter = filter
@@ -84,6 +84,9 @@ export default {
setTimeout(() => { this.hideCal = false }, 0)
} catch (error) {
this.$toast.error('Nepodarilo sa nacitat data!')
if (process.env.NODE_ENV === 'development')
console.log('[teams.vue] Error: ', error)
}
setTimeout(() => {
@@ -44,6 +44,9 @@ export default {
FileSaver.saveAs(blob, file.name)
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-files.vue] Error: ', error)
} finally {
file.isLoading = false
}
@@ -124,6 +124,9 @@ export default {
}
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-blocker-modal.vue] Error: ', error)
}
},
@@ -146,6 +149,9 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-blocker-modal.vue] Error: ', error)
}
},
@@ -45,17 +45,20 @@ export default {
},
async deleteBlocker() {
if (this.isDeleting) return
if (this.isDeleting) return
this.isDeleting = true
try {
await this.$axios.delete_auth(`v1/blockers/${this.blocker.id}`)
this.$emit('on-blocker-deleted', this.blocker)
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-delete-blocker-modal.vue] Error: ', error)
} finally {
this.isDeleting = false
}
@@ -47,6 +47,9 @@ export default {
this.$events.emit('close-both-modals')
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-complete-master-task-modal.vue] Error: ', error)
}
}
}
@@ -45,7 +45,7 @@ export default {
},
async deleteMasterTask() {
if (this.isDeleting) return
if (this.isDeleting) return
this.isDeleting = true
@@ -55,6 +55,9 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-delete-master-task-modal.vue] Error: ', error)
} finally {
this.isDeleting = false
}
@@ -53,7 +53,7 @@ export default {
async deleteMember() {
this.team.employees = [...this.team.employees].filter(employee => employee.id !== this.member.id)
try {
if (this.team.id) {
const { team } = await this.$axios.put_auth(`v1/teams/${this.team.id}`, this.team)
@@ -67,6 +67,9 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-delete-team-member-modal.vue] Error: ', error)
}
},
@@ -306,6 +306,9 @@ export default {
this.editMode = editMode || !this.mastertask.id
} catch (error) {
this.$toast.error(error.message || error)
if (process.env.NODE_ENV === 'development')
console.log('[z-master-task-modal.vue] Error: ', error)
}
},
@@ -343,6 +346,9 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-master-task-modal.vue] Error: ', error)
} finally {
this.isSaving = false
}
@@ -361,8 +367,8 @@ export default {
},
addTask() {
this.$events.emit('show-subtask-modal', {
subtask: {
this.$events.emit('show-subtask-modal', {
subtask: {
master_task_id: this.mastertask.id,
project_code: this.mastertask.project_code
}
@@ -375,6 +381,7 @@ export default {
_mergeDeadlineTimeDate() {
const date = new Date(this.mastertask.deadline)
console.log('z-master-task-modal', this.subtask)
const timeParts = this.mastertask._deadline_time.split(':')
date.setHours(parseInt(timeParts[0]))
date.setMinutes(parseInt(timeParts[1]))
@@ -23,7 +23,7 @@
<template v-if="subtask.timesheets.length">
<div v-for="timesheet in subtask.timesheets" :key="timesheet.id" class="d-flex align-center mb-3">
<v-icon @click.stop="deleteTimesheet(timesheet)" class="circle-border cursor-pointer mr-2" icon="mdi-minus" size="medium" />
<div class="d-flex align-center flex-start width-100">
<p class="task-badge rounded-pill">{{ timesheet.time }}</p>
<!-- <p class="ml-5">{{ timesheet.employee_name }} ({{ moment(timesheet.timestamp).format('D.M.YYYY') }})</p> -->
@@ -139,16 +139,20 @@ export default {
return timesheet
})
const { subtask } = await this.$axios.put_auth(`v1/subtasks/${data.id}`, data)
this.closeModal()
this.$events.emit('on-subtask-edited', subtask)
} catch (error) {
this.$toast.error(error.message || error)
if (process.env.NODE_ENV === 'development')
console.log('[a-task-spent-time.vue] Error: ', error)
}
},
_mergeDeadlineTimeDate() {
const date = new Date(this.subtask.deadline)
console.log('a-task-spent-time', this.subtask)
const timeParts = this.subtask._deadline_time.split(':')
date.setHours(parseInt(timeParts[0]))
@@ -213,6 +213,9 @@ 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')
console.log('[a-task-timeblocks.vue] Error: ', error)
}
},
@@ -242,6 +245,9 @@ export default {
this.$events.emit('on-subtask-edited', subtask)
} catch (error) {
this.$toast.error(error.message || error)
if (process.env.NODE_ENV === 'development')
console.log('[a-task-timeblocks.vue] Error: ', error)
}
},
@@ -49,6 +49,9 @@ export default {
this.$emit('on-subtask-edited', subtask)
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-complete-task-modal.vue] Error: ', error)
}
},
@@ -45,18 +45,21 @@ export default {
},
async deleteTask() {
if (this.isDeleting) return
if (this.isDeleting) return
this.isDeleting = true
try {
await this.$axios.delete_auth(`v1/subtasks/${this.subtask.id}`)
this.$store.commit('tm/delete_subtask', this.subtask)
this.closeModal()
this.$emit('on-subtask-deleted', this.subtask)
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-delete-task-modal.vue] Error: ', error)
} finally {
this.isDeleting = false
}
@@ -70,6 +70,9 @@ export default {
this.$events.emit('on-subtask-edited', subtask)
} catch (error) {
this.$toast.error(error.message || error)
if (process.env.NODE_ENV === 'development')
console.log('[z-delete-timeblock-modal.vue] Error: ', error)
}
},
}
@@ -80,6 +80,9 @@ export default {
this.$events.emit('on-subtask-edited', subtask)
} catch (error) {
this.$toast.error(error.message || error)
if (process.env.NODE_ENV === 'development')
console.log('[z-task-add-time-modal.vue] Error: ', error)
}
},
+12 -4
View File
@@ -222,7 +222,9 @@ export default {
this.$events.on('on-subtask-edited', (subtask) => {
if (subtask?.id !== this.subtask?.id) return
const data = JSON.parse(JSON.stringify(subtask))
const splittedDeadline = data.deadline.split(' ')
const splittedDeadline = data.deadline?.split(' ') || []
data.deadline = splittedDeadline[0]
data._deadline_time = splittedDeadline[1]
this.subtask = this._enrichTask(data)
@@ -260,7 +262,7 @@ export default {
}]
this.$nextTick(() => {
this.v$.$reset()
this.setFocusEvent()
this.setFocusEvent()
})
try {
@@ -312,8 +314,10 @@ export default {
}
this.editMode = editMode || !this.subtask.id
} catch (error) {
console.error('ERROR', error)
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-task-modal.vue] Error: ', error)
}
},
@@ -372,6 +376,9 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-task-modal.vue] Error: ', error)
} finally {
this.isSaving = false
}
@@ -396,6 +403,7 @@ export default {
_mergeDeadlineTimeDate() {
const date = new Date(this.subtask.deadline)
console.log('z-task-modal', this.subtask)
const timeParts = this.subtask._deadline_time.split(':')
date.setHours(parseInt(timeParts[0]))
@@ -590,7 +598,7 @@ export default {
position: relative
border-top: 1px solid #e0e0e0
padding: 20px 0 10px 0
.splitted-time-inputs
display: flex !important
flex-direction: row !important
@@ -42,7 +42,7 @@ export default {
},
async deleteTeam() {
if (this.isDeleting) return
if (this.isDeleting) return
this.isDeleting = true
try {
@@ -52,6 +52,9 @@ export default {
this.$store.commit('tm/delete_team', this.team)
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-delete-team-modal.vue] Error: ', error)
} finally {
this.isDeleting = false
}
@@ -99,6 +99,9 @@ export default {
}
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-team-modal.vue] Error: ', error)
}
},
@@ -113,7 +116,7 @@ export default {
try {
if (this.team.id) {
const { team } = await this.$axios.put_auth(`v1/teams/${this.team.id}`, this.team)
const fullTeamResource = await this.$axios.get_auth_data(`v1/teams/${team.id}`)
this.$store.commit('tm/update_team', fullTeamResource)
} else {
@@ -126,6 +129,9 @@ export default {
this.closeModal()
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[z-team-modal.vue] Error: ', error)
}
},
@@ -50,6 +50,7 @@ export default {
async updateUserInfo() {
if (!(await this.v$.$validate())) return
console.log('my-profile', this.subtask)
const [sHours, sMinutes] = this.form.work_start.split(':');
const [eHours, eMinutes] = this.form.work_end.split(':');
@@ -64,6 +65,9 @@ export default {
this.$toast.success('Profil bol úspešne zmenený')
} catch (error) {
this.$toast.error(this.$parseError(error))
if (process.env.NODE_ENV === 'development')
console.log('[my-profile.vue] Error: ', error)
}
},