diff --git a/src/components/mixins/entities.js b/src/components/mixins/entities.js index cd6525221..da117c5eb 100644 --- a/src/components/mixins/entities.js +++ b/src/components/mixins/entities.js @@ -1,4 +1,4 @@ -import { mapGetters } from 'vuex' +import { mapGetters, mapActions } from 'vuex' import func from '@/lib/func' import preferences from '@/lib/preferences' @@ -70,6 +70,8 @@ export const entitiesMixin = { }, methods: { + ...mapActions(['clearSelectedTasks']), + showImportModal() { this.modals.isImportDisplayed = true }, @@ -268,6 +270,7 @@ export const entitiesMixin = { this.isSearchActive = false const searchQuery = this.searchField.getValue() || '' this.applySearch(searchQuery) + this.clearSelection() }, onChangeSortClicked(sortInfo) { @@ -284,6 +287,11 @@ export const entitiesMixin = { onKeepTaskPanelOpenChanged(keepOpen) { this.keepTaskPanelOpen = keepOpen + }, + + clearSelection() { + this[`clearSelected${this.entityTypeName}s`]() + this.clearSelectedTasks() } }, diff --git a/src/components/pages/Assets.vue b/src/components/pages/Assets.vue index 31cd6804c..b2b610d49 100644 --- a/src/components/pages/Assets.vue +++ b/src/components/pages/Assets.vue @@ -419,13 +419,10 @@ export default { if ( this.assetMap.size < 2 || this.assetValidationColumns.length === 0 || - ( - this.assetValidationColumns.length > 0 && - ( - !this.assetMap.get(this.assetMap.keys().next().value).validations || - this.assetMap.get(this.assetMap.keys().next().value).validations.size === 0 - ) - ) + (this.assetValidationColumns.length > 0 && + (!this.assetMap.get(this.assetMap.keys().next().value).validations || + this.assetMap.get(this.assetMap.keys().next().value).validations + .size === 0)) ) { setTimeout(() => { this.loadAssets().then(() => { @@ -850,6 +847,7 @@ export default { this.setAssetSearch(searchQuery) this.setSearchInUrl() } + this.clearSelection() }, saveSearchQuery(searchQuery) { diff --git a/src/components/pages/Edits.vue b/src/components/pages/Edits.vue index 3473ac6f7..df684d0a5 100644 --- a/src/components/pages/Edits.vue +++ b/src/components/pages/Edits.vue @@ -838,6 +838,7 @@ export default { if (searchQuery.length === 0 && this.isLongEditList) { this.applySearch('') } + this.clearSelection() }, saveScrollPosition(scrollPosition) { diff --git a/src/components/pages/Shots.vue b/src/components/pages/Shots.vue index d4f0d59e4..3075cb295 100644 --- a/src/components/pages/Shots.vue +++ b/src/components/pages/Shots.vue @@ -451,11 +451,15 @@ export default { } this.$refs['shot-search-field']?.setValue(searchQuery) const finalize = () => { - this.loadShots(() => { - this.$nextTick(() => { - this.onSearchChange() + this.$nextTick(() => { + // Needed to be sure the current production is set + this.loadShots(() => { this.$nextTick(() => { - this.$refs['shot-list'].selectTaskFromQuery() + // Needed to be sure the shots are loaded + this.onSearchChange() + this.$nextTick(() => { + this.$refs['shot-list'].selectTaskFromQuery() + }) }) }) }) @@ -584,6 +588,7 @@ export default { 'createTasks', 'changeShotSort', 'clearSelectedShots', + 'clearSelectedTasks', 'commentTaskWithPreview', 'deleteAllShotTasks', 'deleteShot', @@ -940,6 +945,7 @@ export default { if (searchQuery.length === 0 && this.isLongShotList) { this.applySearch('') } + this.clearSelection() }, saveScrollPosition(scrollPosition) {