diff --git a/src/components/pages/ProductionSchedule.vue b/src/components/pages/ProductionSchedule.vue index d27545647..904c6204d 100644 --- a/src/components/pages/ProductionSchedule.vue +++ b/src/components/pages/ProductionSchedule.vue @@ -32,6 +32,15 @@ :options="modeOptions" @update:model-value="onModeChanged" /> + +
+
{ + const taskType = this.taskTypeMap.get(item.task_type_id) + if (taskType && taskType.for_entity) { + types.add(taskType.for_entity) + } + }) + return Array.from(types).sort() + }, + + entityFilterOptions() { + const options = [ + { label: this.$t('schedule.all_entities'), value: 'ALL' } + ] + this.availableEntityTypes.forEach(type => { + options.push({ label: type, value: type }) + }) + return options + }, + + filteredScheduleItems() { + if (this.entityTypeFilter === 'ALL') { + return this.scheduleItems + } + return this.scheduleItems.filter(item => { + const taskType = this.taskTypeMap.get(item.task_type_id) + return taskType && taskType.for_entity === this.entityTypeFilter + }) + }, }, methods: { @@ -769,7 +810,7 @@ export default { 'updateTask' ]), - updateRoute({ mode, version, zoom }) { + updateRoute({ mode, version, zoom, entityTypes }) { const query = { ...this.$route.query } if (mode !== undefined) { @@ -781,6 +822,9 @@ export default { if (zoom !== undefined) { query.zoom = String(zoom) } + if (entityTypes !== undefined) { + query.entityTypes = entityTypes || undefined + } if (JSON.stringify(query) !== JSON.stringify(this.$route.query)) { this.$router.push({ query }) @@ -888,6 +932,13 @@ export default { this.zoomLevel = this.zoomOptions.map(o => o.value).includes(zoom) ? zoom : DEFAULT_ZOOM + + const entityType = this.$route.query.entityType + if (entityType) { + this.entityTypeFilter = entityType + } else { + this.entityTypeFilter = 'ALL' + } }, convertScheduleItems(taskTypeElement, scheduleItems) { @@ -965,7 +1016,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) @@ -1851,6 +1904,13 @@ export default { this.refreshSchedule() }, + onEntityFilterChanged() { + const entityType = this.entityTypeFilter !== 'ALL' + ? this.entityTypeFilter + : undefined + this.updateRoute({ entityType }) + }, + refreshSchedule() { this.scheduleItems.forEach(item => { if (!item.expanded) { @@ -2427,5 +2487,7 @@ export default { width: 90px; } } + + // Entity filter styling to match navigation menu } diff --git a/src/locales/en.js b/src/locales/en.js index fab34dbc9..9cfbaea48 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -1584,7 +1584,10 @@ export default { new: 'new schedule', name: 'version name', locked: 'locked version' - } + }, + entities: 'Entities', + all_entities: 'All', + selected: 'selected' }, team_schedule: {