Skip to content

Commit

Permalink
[qa] avoid an silent error during loading
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoPennec committed Sep 29, 2023
1 parent 746076f commit d6bfb2d
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/components/lists/TaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,8 @@ export default {
displayedTasks() {
if (this.tasks && this.tasks.length > 0) {
return this.tasks.slice(0, 60 * this.page)
} else {
return []
}
return []
},
tasksByParent() {
Expand Down Expand Up @@ -507,10 +506,9 @@ export default {
getTaskName(task) {
if (this.entityType === 'Shot') {
return task.sequence_name + ' / ' + this.getEntity(task.entity.id).name
} else {
return task.entity_name
return `${task.sequence_name} / ${this.getEntity(task.entity.id).name}`
}
return task.entity_name
},
isTaskChanged(task, data) {
Expand Down Expand Up @@ -629,7 +627,7 @@ export default {
formatDate(date) {
if (date) return moment(date).format('YYYY-MM-DD')
else return ''
return ''
},
isEstimationBurned(task) {
Expand All @@ -650,7 +648,7 @@ export default {
},
getEntity(entityId) {
return this[`${this.entityType.toLowerCase()}Map`].get(entityId)
return this[`${this.entityType.toLowerCase()}Map`].get(entityId) || {}
},
onKeyDown(event) {
Expand Down Expand Up @@ -720,7 +718,7 @@ export default {
},
scrollToLine(taskId) {
const taskLine = this.$refs['task-' + taskId]
const taskLine = this.$refs[`task-${taskId}`]
if (taskLine && this.$refs.body) {
const margin = 30
const rect = taskLine[0].getBoundingClientRect()
Expand All @@ -744,16 +742,14 @@ export default {
} else if (this.isCurrentUserSupervisor) {
if (this.user.departments.length === 0) {
return true
} else {
const taskType = this.taskTypeMap.get(task.task_type_id)
return (
taskType.department_id &&
this.user.departments.includes(taskType.department_id)
)
}
} else {
return false
const taskType = this.taskTypeMap.get(task.task_type_id)
return (
taskType.department_id &&
this.user.departments.includes(taskType.department_id)
)
}
return false
},
resetSelection() {
Expand Down Expand Up @@ -788,7 +784,7 @@ export default {
.map(personId => {
const person = this.personMap.get(personId)
if (person) return person.name
else return ''
return ''
})
.join(', ')
Expand Down

0 comments on commit d6bfb2d

Please sign in to comment.