diff --git a/src/components/pages/ProductionSchedule.vue b/src/components/pages/ProductionSchedule.vue index d27545647..312b292d9 100644 --- a/src/components/pages/ProductionSchedule.vue +++ b/src/components/pages/ProductionSchedule.vue @@ -25,6 +25,14 @@ v-model="zoomLevel" @update:model-value="onZoomLevelChanged" /> + { + const taskType = this.taskTypeMap.get(item.task_type_id) + if (taskType?.for_entity) { + types.add(taskType.for_entity) + } + }) + return Array.from(types).sort() + }, + + entityTypeOptions() { + const options = [{ label: this.$t('main.all'), value: null }] + this.availableEntityTypes.forEach(type => { + options.push({ label: type, value: type }) + }) + return options + }, + + filteredScheduleItems() { + if (!this.entityType) { + return this.scheduleItems + } + return this.scheduleItems.filter(item => { + const taskType = this.taskTypeMap.get(item.task_type_id) + return taskType && taskType.for_entity === this.entityType + }) } }, @@ -769,12 +807,15 @@ export default { 'updateTask' ]), - updateRoute({ mode, version, zoom }) { + updateRoute({ mode, type, version, zoom }) { const query = { ...this.$route.query } if (mode !== undefined) { query.mode = mode || undefined } + if (type !== undefined) { + query.type = type || undefined + } if (version !== undefined) { query.version = version || undefined } @@ -876,12 +917,16 @@ export default { await this.loadData() const mode = this.$route.query.mode + const type = this.$route.query.type const version = this.$route.query.version const zoom = Number(this.$route.query.zoom) this.mode = this.modeOptions.map(o => o.value).includes(mode) ? mode : DEFAULT_MODE + this.entityType = this.entityTypeOptions.map(o => o.value).includes(type) + ? type + : null this.version = this.versionOptions.map(o => o.value).includes(version) ? version : DEFAULT_VERSION @@ -965,7 +1010,9 @@ export default { : this.loadSequenceScheduleItems : taskTypeElement.for_entity === 'Shot' ? this.loadSequenceScheduleItems - : this.loadAssetTypeScheduleItems + : taskTypeElement.for_entity === 'Sequence' + ? this.loadSequenceScheduleItems + : this.loadAssetTypeScheduleItems const parameters = { production: this.currentProduction, taskType: this.taskTypeMap.get(taskTypeElement.task_type_id) @@ -1839,6 +1886,10 @@ export default { this.updateRoute({ zoom }) }, + onEntityTypeChanged(type) { + this.updateRoute({ type }) + }, + onModeChanged(mode) { this.updateRoute({ mode }) this.closeSidePanel() diff --git a/src/locales/en.js b/src/locales/en.js index fab34dbc9..9b19ddab6 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -701,6 +701,7 @@ export default { empty_comment: 'Empty comment', empty_schedule: 'There are no tasks or they don\'t have start dates.', end_date: 'End date', + entities: 'Entities', estimation: 'Estimation', estimation_short: 'Est.', expand_all: 'Expand all',