Skip to content
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

Various fixes #1672

Merged
merged 8 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,752 changes: 355 additions & 2,397 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/components/mixins/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ if (PSStroke) {
}
}

if (!PSStroke.prototype.dispose) {
PSStroke.prototype.dispose = function () {
return {}
}
}

if (!PSStroke.prototype.getRelativeCenterPoint) {
PSStroke.prototype.getRelativeCenterPoint = function () {
const center = new fabric.Point(
Expand Down Expand Up @@ -84,7 +90,9 @@ export const annotationMixin = {
pencilWidth: 'big',
textColor: '#ff3860',
mouseIsDrawing: false,
mouseDrawingPressureMode: 'distance', // choose mode how we fake pressure on the mouse "fade" or "distance" or null
// choose mode how we fake pressure on the mouse:
// "fade" or "distance" or null
mouseDrawingPressureMode: 'distance',
mouseDrawingStartTime: null,
mouseDrawingMinPressure: 0.4,
mouseDrawingMaxPressure: 0.8,
Expand Down
1 change: 0 additions & 1 deletion src/components/mixins/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ export const entitiesMixin = {

onSearchChange(clearSelection = true) {
if (!this.searchField) return
this.isSearchActive = false
const searchQuery = this.searchField.getValue() || ''
this.applySearch(searchQuery)
if (clearSelection) {
Expand Down
26 changes: 17 additions & 9 deletions src/components/mixins/entity_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ import episodeStore from '@/store/modules/episodes'
import sequenceStore from '@/store/modules/sequences'
import shotStore from '@/store/modules/shots'

const entityMaps = {
asset: assetStore.cache.assetMap,
shot: shotStore.cache.shotMap,
sequence: sequenceStore.cache.sequenceMap,
episode: episodeStore.cache.episodeMap,
edit: editStore.cache.editMap
}

export const entityListMixin = {
emits: [
'change-sort',
Expand Down Expand Up @@ -516,6 +508,22 @@ export const entityListMixin = {
}
},

/*
* Get entity map for current entity type.
*
* Do not use computed property to avoid caching issues.
*/
getEntityMap() {
const entityMaps = {
asset: assetStore.cache.assetMap,
shot: shotStore.cache.shotMap,
sequence: sequenceStore.cache.sequenceMap,
episode: episodeStore.cache.episodeMap,
edit: editStore.cache.editMap
}
return entityMaps[this.type]
},

/*
* Select the task listed in the url query string (task_id field) if
* present.
Expand All @@ -524,7 +532,7 @@ export const entityListMixin = {
const taskId = this.$route.query.task_id
const task = this.taskMap.get(taskId)
if (task) {
const entityMap = entityMaps[this.type]
const entityMap = this.getEntityMap()
const entity = entityMap.get(task.entity_id)

if (entity) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,11 @@ export default {
},

watch: {
$route() {
$route(newRoute, previousRoute) {
if (!this.$route.query) return
const search = this.$route.query.search
const actualSearch = this.$refs['asset-search-field']?.getValue()
if (search !== actualSearch) {
if (search !== actualSearch && !previousRoute.query.task_id) {
this.searchField.setValue(search)
this.onSearchChange()
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/pages/Edits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<search-field
ref="edit-search-field"
:can-save="true"
:active="isSearchActive"
@change="onSearchChange"
@enter="applySearch(searchField.getValue())"
@save="saveSearchQuery"
Expand Down Expand Up @@ -326,7 +325,6 @@ export default {
],
historyEdit: {},
initialLoading: true,
isSearchActive: false,
optionalColumns: ['Description'],
pageName: 'Edits',
parsedCSV: [],
Expand Down Expand Up @@ -830,7 +828,6 @@ export default {

onSearchChange(clearSelection = true) {
if (!this.searchField) return
this.isSearchActive = false
const searchQuery = this.searchField.getValue() || ''
if (searchQuery.length !== 1 && !this.isLongEditList) {
this.applySearch(searchQuery)
Expand All @@ -851,7 +848,6 @@ export default {
applySearch(searchQuery) {
this.setEditSearch(searchQuery)
this.setSearchInUrl()
this.isSearchActive = true
},

saveSearchQuery(searchQuery) {
Expand Down Expand Up @@ -964,11 +960,11 @@ export default {
},

watch: {
$route() {
$route(nextRoute, previousRoute) {
if (!this.$route.query) return
const search = this.$route.query.search
const actualSearch = this.$refs['edit-search-field']?.getValue()
if (search !== actualSearch) {
if (search !== actualSearch && !previousRoute.query.task_id) {
this.searchField.setValue(search)
this.applySearch(search)
}
Expand Down
7 changes: 2 additions & 5 deletions src/components/pages/Episodes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<search-field
ref="episode-search-field"
:can-save="true"
:active="isSearchActive"
@change="onSearchChange"
@save="saveSearchQuery"
placeholder="ex: e01 episode=wip"
Expand Down Expand Up @@ -263,7 +262,6 @@ export default {
],
historyEdit: {},
initialLoading: true,
isSearchActive: false,
optionalColumns: ['Description'],
pageName: 'Episodes',
parsedCSV: [],
Expand Down Expand Up @@ -510,7 +508,6 @@ export default {
applySearch(searchQuery) {
this.setEpisodeSearch(searchQuery)
this.setSearchInUrl()
this.isSearchActive = true
},

saveSearchQuery(searchQuery) {
Expand Down Expand Up @@ -635,11 +632,11 @@ export default {
},

watch: {
$route() {
$route(nextRoute, previousRoute) {
if (!this.$route.query) return
const search = this.$route.query.search
const actualSearch = this.$refs['episode-search-field'].getValue()
if (search !== actualSearch) {
if (search !== actualSearch && !previousRoute.query.task_id) {
this.searchField.setValue(search)
this.applySearch(search)
}
Expand Down
7 changes: 2 additions & 5 deletions src/components/pages/Sequences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<search-field
ref="sequence-search-field"
:can-save="true"
:active="isSearchActive"
@change="onSearchChange"
@save="saveSearchQuery"
placeholder="ex: e01 sequence=wip"
Expand Down Expand Up @@ -262,7 +261,6 @@ export default {
],
historyEdit: {},
initialLoading: true,
isSearchActive: false,
optionalColumns: ['Description'],
pageName: 'Sequences',
parsedCSV: [],
Expand Down Expand Up @@ -510,7 +508,6 @@ export default {
applySearch(searchQuery) {
this.setSequenceSearch(searchQuery)
this.setSearchInUrl()
this.isSearchActive = true
},

saveSearchQuery(searchQuery) {
Expand Down Expand Up @@ -638,11 +635,11 @@ export default {
},

watch: {
$route() {
$route(newRoute, previousRoute) {
if (!this.$route.query) return
const search = this.$route.query.search
const actualSearch = this.$refs['sequence-search-field'].getValue()
if (search !== actualSearch) {
if (search !== actualSearch && !previousRoute.query.task_id) {
this.searchField.setValue(search)
this.applySearch(search)
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/pages/Shots.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<search-field
ref="shot-search-field"
:can-save="true"
:active="isSearchActive"
@change="onSearchChange"
@enter="applySearch(searchField.getValue())"
@save="saveSearchQuery"
Expand Down Expand Up @@ -374,7 +373,6 @@ export default {
deleteAllTasksLockText: null,
descriptorToEdit: {},
formData: null,
isSearchActive: false,
historyShot: {},
optionalColumns: [
'Description',
Expand Down Expand Up @@ -958,7 +956,6 @@ export default {

onSearchChange(clearSelection = true) {
if (!this.searchField) return
this.isSearchActive = false
const searchQuery = this.searchField.getValue() || ''
if (searchQuery.length !== 1 && !this.isLongShotList) {
this.applySearch(searchQuery)
Expand All @@ -979,7 +976,6 @@ export default {
applySearch(searchQuery) {
this.setShotSearch(searchQuery)
this.setSearchInUrl()
this.isSearchActive = true
},

saveSearchQuery(searchQuery) {
Expand Down Expand Up @@ -1181,11 +1177,11 @@ export default {
},

watch: {
$route() {
$route(newRoute, previousRoute) {
if (!this.$route.query) return
const search = this.$route.query.search
const actualSearch = this.$refs['shot-search-field']?.getValue()
if (search !== actualSearch) {
if (search !== actualSearch && !previousRoute.query.task_id) {
this.searchField.setValue(search)
this.applySearch(search)
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/previews/PreviewPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1754,8 +1754,10 @@ export default {
},

async extractAnnotationSnapshots() {
const annotations = this.annotations.sort((a, b) => b.time < a.time)
const files = []
const annotations = this.annotations.sort((a, b) => {
return parseInt(b.frame) < parseInt(a.frame) ? 1 : -1
})
let index = 1
for (const annotation of annotations) {
const canvas = document.getElementById('annotation-snapshot')
Expand Down
5 changes: 0 additions & 5 deletions src/components/widgets/SearchField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ export default {
type: Boolean,
default: false
},
// FIXME: property no longer used in component
active: {
type: Boolean,
default: true
},
NicoPennec marked this conversation as resolved.
Show resolved Hide resolved
focusOptions: {
type: Object
}
Expand Down
Loading