Skip to content

Commit

Permalink
Merge pull request #1250 from frankrousseau/master
Browse files Browse the repository at this point in the history
[tasks] Change link in entity pages
  • Loading branch information
frankrousseau authored Nov 24, 2023
2 parents 1b244d4 + 2ab35f7 commit 74d255a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/components/cells/TaskTypeCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<task-type-name
:task-type="taskType"
:production-id="productionId"
:task-id="taskId"
:disable="disable"
/>
</td>
Expand All @@ -20,6 +21,10 @@ export default {
},
props: {
taskId: {
type: String,
default: null
},
taskType: {
type: Object,
default: null
Expand Down
1 change: 1 addition & 0 deletions src/components/lists/EntityTaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
class="type"
:task-type="getTaskType(taskId)"
:production-id="currentProduction.id"
:task-id="taskId"
v-if="getTaskType(taskId)"
/>
<td class="status">
Expand Down
47 changes: 36 additions & 11 deletions src/components/widgets/TaskTypeName.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<router-link :to="taskTypePath" v-if="productionId && !isCurrentUserClient">
<router-link :to="targetRoute" v-if="productionId && !isCurrentUserClient">
<span
class="tag task-type-name"
:style="{ 'border-left': '4px solid ' + color }"
Expand Down Expand Up @@ -34,21 +34,25 @@ export default {
components: {},
props: {
taskType: {
type: Object,
default: null
},
productionId: {
type: String,
default: null
},
deletable: {
type: Boolean,
default: false
},
disable: {
type: Boolean,
default: false
},
productionId: {
type: String,
default: null
},
taskId: {
type: String,
default: null
},
taskType: {
type: Object,
default: null
}
},
Expand All @@ -60,9 +64,30 @@ export default {
else return this.taskType.color
},
taskTypePath() {
targetRoute() {
let route = {}
if (this.taskType.for_entity === 'Episode') {
if (this.taskId) {
if (this.$route.params.episode_id) {
route = {
name: 'episode-task',
params: {
production_id: this.productionId,
task_id: this.taskId,
episode_id: this.$route.params.episode_id,
type: pluralizeEntityType(this.taskType.for_entity)
}
}
} else {
route = {
name: 'task',
params: {
production_id: this.productionId,
task_id: this.taskId,
type: pluralizeEntityType(this.taskType.for_entity)
}
}
}
} else if (this.taskType.for_entity === 'Episode') {
route = {
name: 'episodes-task-type',
params: {
Expand Down

0 comments on commit 74d255a

Please sign in to comment.