-
-
Notifications
You must be signed in to change notification settings - Fork 151
Add display option to Assets page to allow assets to be filtered to only episode assets #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add display option to Assets page to allow assets to be filtered to only episode assets #1935
Conversation
… to be toggled off, filtering the list of assets to only those parented to the episode_id.
| // Filter the displayed assets by the display settings | ||
| displayedAssetsByTypeFiltered() { | ||
| if ( | ||
| this.displaySettings.showSharedAssets && | ||
| this.displaySettings.showLinkedAssets | ||
| ) { | ||
| return this.displayedAssetsByType | ||
| } | ||
| const episodeId = this.currentEpisode?.id | ||
|
|
||
| return this.displayedAssetsByType.map(typeList => { | ||
| return typeList.filter(asset => { | ||
| if (!this.displaySettings.showSharedAssets && asset.shared) { | ||
| return false | ||
| } | ||
| if ( | ||
| !this.displaySettings.showLinkedAssets && | ||
| !['all', asset.episode_id || 'main'].includes(episodeId) | ||
| ) { | ||
| return false | ||
| } | ||
| return true | ||
| }) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a production without episodes (eg, a feature film), it does not seem to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filter is based on the similar behaviour when you look at the task type page so they are consistent -https://github.com/cgwire/kitsu/blob/main/src/components/pages/TaskType.vue#L1331
It probably needs the checks this.isTVShow and maybe this.isEpisodesSection - and for the displaySettings too. Let me take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this issue and added a few more things.
I have updated the assets list to show the correct info at the bottom for number of assets, days spent etc. This changed from using the store assets.js and replicated the approach in the task list.
I have also added display settings to the TaskType page so you can do the same filter there for Display Breakdown Assets - to make the list of tasks consistent between Assets.vue and TaskType.vue
src/locales/en.js
Outdated
| number: 'asset | assets', | ||
| restore_text: 'Are you sure you want to restore {name} from your archive?', | ||
| restore_error: 'An error occurred while restoring this asset.', | ||
| show_linked: 'Display Linked Assets', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label seems unclear: linked by what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there is a better way of wording? These are Assets linked via breakdown (one to many) as distinct from assets linked via parenting to episode (one to one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "Display Breakdown Assets" ?
…isplay option to "Show Breakdown Assets" is ticked - similar to TaskList page component
…ottmcdonnell/kitsu into feature/display_linked_assets
… assets between the assets list page and the task type page for assets.
…ottmcdonnell/kitsu into feature/display_linked_assets
Looking at assets - assets can be assigned to one episode when created or edited which sets the parent_id for the entity, but also assets can be linked to an episode using breakdown (entity_link).
Problem
When we look at the asset list for a given episode it shows all assets linked to the episode but when you go into a task type for the asset you see only the assets parented to the episode. The lists differ.
Sometimes we want to see all assets linked to the episode via breakdown and sometimes we want to be able to see just the assets that are unique to this episode.
Solution
Option added to display settings to toggle on/off the linked assets.
filter added to view to combine filter for linked assets with shared assets.