Skip to content

Commit

Permalink
Merge pull request #1656 from NicoPennec/main
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
frankrousseau authored Jan 12, 2025
2 parents 68ea62f + 4f274ab commit 4adb708
Show file tree
Hide file tree
Showing 24 changed files with 404 additions and 544 deletions.
821 changes: 331 additions & 490 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@fullcalendar/multimonth": "6.1.15",
"@fullcalendar/vue3": "6.1.15",
"@google/model-viewer": "4.0.0",
"@sentry/vue": "8.47.0",
"@sentry/vue": "8.48.0",
"@unhead/vue": "1.11.15",
"@vuepic/vue-datepicker": "10.0.0",
"@vuepic/vue-datepicker": "11.0.1",
"async": "3.2.6",
"bowser": "2.11.0",
"chart.js": "4.4.7",
Expand All @@ -36,7 +36,7 @@
"color-string": "1.9.1",
"fabric": "cgwire/fabric.js",
"lucide-vue-next": "0.469.0",
"marked": "15.0.6",
"marked": "14.1.4",
"marked-emoji": "1.4.3",
"moment": "2.30.1",
"moment-timezone": "0.5.46",
Expand All @@ -49,7 +49,7 @@
"textarea-caret": "3.1.0",
"thenby": "1.3.4",
"three": "0.172.0",
"uuid": "11.0.4",
"uuid": "11.0.5",
"v-autosize": "2.0.1",
"vue": "3.5.13",
"vue-3-slider-component": "1.0.1",
Expand Down Expand Up @@ -82,7 +82,7 @@
"prettier": "3.4.2",
"sass": "1.83.1",
"vite": "6.0.7",
"vitest": "0.34.6",
"vitest": "2.1.8",
"vitest-localstorage-mock": "0.1.2"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
'assetTypeMap',
'currentEpisode',
'currentProduction',
'departmentMap',
'editMap',
'episodeMap',
'isCurrentUserAdmin',
Expand Down
5 changes: 3 additions & 2 deletions src/components/lists/TaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ export default {
const entity = this.shotMap.get(task.entity.id)
if (previousTask) {
const previousEntity = this.shotMap.get(previousTask.entity.id)
if (previousEntity.sequence_id !== entity.sequence_id) {
if (previousEntity?.sequence_id !== entity?.sequence_id) {
result.push(currentTasks)
currentTasks = {
name: task.sequence_name,
Expand All @@ -545,7 +545,7 @@ export default {
const entity = this.assetMap.get(task.entity.id)
if (previousTask) {
const previousEntity = this.assetMap.get(previousTask.entity.id)
if (previousEntity.asset_type_id !== entity.asset_type_id) {
if (previousEntity?.asset_type_id !== entity?.asset_type_id) {
result.push(currentTasks)
currentTasks = {
name: task.entity_type_name,
Expand Down Expand Up @@ -1102,6 +1102,7 @@ td.retake-count {
margin-bottom: 0.5em;
margin-top: 0.3em;
padding: 0 0.5em;
word-break: break-word;
}
.task-data {
padding: 0 0.1em 0 0.3em;
Expand Down
14 changes: 11 additions & 3 deletions src/components/mixins/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,15 @@ export const playerMixin = {
},

hideBars() {
this.$refs.header.style.opacity = 0
this.$refs['button-bar'].style.opacity = 0
this.$refs['video-progress'].$el.style.opacity = 0
if (this.$refs.header) {
this.$refs.header.style.opacity = 0
}
if (this.$refs['button-bar']) {
this.$refs['button-bar'].style.opacity = 0
}
if (this.$refs['video-progress']) {
this.$refs['video-progress'].$el.style.opacity = 0
}
},

updateTaskPanel() {
Expand Down Expand Up @@ -437,6 +443,7 @@ export const playerMixin = {
} else if (this.isCurrentPreviewModel) {
this.playModel()
} else {
if (!this.rawPlayer) return
this._setCurrentTimeOnHandleIn()
this.rawPlayer.play()
if (this.isComparing) {
Expand Down Expand Up @@ -588,6 +595,7 @@ export const playerMixin = {
previousFrameTime = previousFrame / this.fps
this.setFullPlayerTime(previousFrameTime)
} else {
if (!this.rawPlayer) return
this.rawPlayer.goPreviousFrame()
if (this.isComparing) this.syncComparisonPlayer()
const annotation = this.getAnnotation(this.rawPlayer.getCurrentTime())
Expand Down
8 changes: 3 additions & 5 deletions src/components/mixins/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ export const searchMixin = {
},

focusSearchField(options) {
if (this.searchField) {
this.searchField.focus(options)
}
this.searchField?.focus(options)
},

setSearchFromUrl() {
const searchQuery = this.searchField?.getValue()
const searchFromUrl = this.$route.query.search
if (!searchQuery && searchFromUrl) {
this.searchField.setValue(searchFromUrl)
this.searchField?.setValue(searchFromUrl)
}
},

setSearchInUrl() {
const searchQuery = this.searchField.getValue()
const searchQuery = this.searchField?.getValue()
if (this.$route.query.search !== searchQuery) {
this.$router.push({
query: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/EditSearchFilterGroupModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</form>

<div v-if="groupToEdit?.id" class="mt2">
$t('main.created_by'):
{{ $t('main.created_by') }}:
<people-name :person="personMap.get(groupToEdit.person_id)" />
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/EditSearchFilterModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</form>

<div v-if="searchQueryToEdit?.id" class="mt2">
$t('main.created_by'):
{{ $t('main.created_by') }}:
<people-name :person="personMap.get(searchQueryToEdit.person_id)" />
</div>

Expand Down
28 changes: 13 additions & 15 deletions src/components/pages/Asset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,23 @@
<div class="flexrow mt1">
<span
class="tag tag-standby"
v-show="
currentSection === 'casting' && currentAsset.is_casting_standby
v-if="
currentSection === 'casting' && currentAsset?.is_casting_standby
"
>
{{ $t('breakdown.fields.standby') }}
</span>
<span
class="flexrow-item mt05"
v-show="currentSection === 'schedule'"
>
{{ $t('schedule.zoom_level') }}:
</span>
<combobox-number
class="zoom-level flexrow-item"
:options="zoomOptions"
is-simple
v-model="zoomLevel"
v-show="currentSection === 'schedule'"
/>
<template v-if="currentSection === 'schedule'">
<span class="flexrow-item mt05">
{{ $t('schedule.zoom_level') }}:
</span>
<combobox-number
class="zoom-level flexrow-item"
is-simple
:options="zoomOptions"
v-model="zoomLevel"
/>
</template>
</div>

<div class="flexrow infos" v-show="currentSection === 'infos'">
Expand Down
2 changes: 2 additions & 0 deletions src/components/pages/AssetLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ export default {
background-color: var(--background);
border: 5px solid transparent;
border-radius: 1em;
height: fit-content;
transition: border-color 0.2s ease-in-out;
&.selectable-item {
Expand Down Expand Up @@ -310,6 +311,7 @@ export default {
.entity-name {
margin-left: 0.5em;
word-break: break-word;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ export default {
currentSection() {
if (
this.isTVShow &&
this.currentEpisode.id &&
this.currentEpisode?.id &&
!this.displayedAssets.find(
asset => asset.episode_id === this.currentEpisode.id
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/ProductionQuota.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
:max-quota="maxQuota"
/>
</div>
<div class="column side-column" v-if="showInfo">
<div class="column side-column" v-if="showInfo && currentPerson">
<people-quota-info
:person="currentPerson"
:year="currentYear"
Expand Down
9 changes: 6 additions & 3 deletions src/components/pages/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,17 @@
</em>
</div>

<div class="set-main-preview flexrow-item flexrow pull-right">
<div
class="set-main-preview flexrow-item flexrow pull-right"
v-if="isCurrentUserManager && $refs['preview-player']"
>
<button
:class="{
button: true,
'flexrow-item': true,
'is-loading': loading.setPreview
}"
@click="setPreview"
v-if="isCurrentUserManager"
>
<image-icon class="icon" />
<span class="text">
Expand Down Expand Up @@ -1012,9 +1014,10 @@ export default {
},
setPreview() {
const previewPlayer = this.$refs['preview-player']
if (!previewPlayer) return
this.loading.setPreview = true
this.errors.setPreview = false
const previewPlayer = this.$refs['preview-player']
const previewId = previewPlayer.currentPreview.id
this.$store
.dispatch('setPreview', {
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/TaskType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export default {
},
mounted() {
this.searchField.setValue(this.$route.query.search || '')
this.searchField?.setValue(this.$route.query.search || '')
this.clearSelectedTasks()
const isAssets = this.$route.path.includes('assets')
const isShots = this.$route.path.includes('shots')
Expand Down
4 changes: 2 additions & 2 deletions src/components/previews/PlaylistProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@mousedown="startPlaylistProgressDrag"
@touchstart="
() => {
startProgressDrag()
startPlaylistProgressDrag()
isFrameNumberVisible = true
}
"
Expand All @@ -52,7 +52,7 @@
@mousedown="startPlaylistProgressDrag"
@touchstart="
() => {
startProgressDrag
startPlaylistProgressDrag()
isFrameNumberVisible = true
}
"
Expand Down
20 changes: 14 additions & 6 deletions src/components/previews/PreviewPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
:task="task"
@comment-added="$emit('comment-added')"
@time-code-clicked="timeCodeClicked"
v-show="!isCommentsHidden"
v-if="!isCommentsHidden"
/>
</div>
</div>
Expand Down Expand Up @@ -443,7 +443,10 @@
v-if="currentPreview && !isConcept"
/>

<div class="flexrow" v-if="fullScreen && !isConcept">
<div
class="flexrow"
v-if="fullScreen && !isConcept && lastPreviewFileOptions.length"
>
<combobox-styled
class="preview-combo flexrow-item"
:options="lastPreviewFileOptions"
Expand Down Expand Up @@ -476,7 +479,7 @@
:title="$t('playlists.actions.download_file')"
v-if="
!isCurrentUserArtist ||
currentProduction.is_preview_download_allowed
currentProduction?.is_preview_download_allowed
"
>
<download-icon class="icon is-small" />
Expand Down Expand Up @@ -759,11 +762,11 @@ export default {
computed: {
...mapGetters([
'assetMap',
'currentProduction',
'getProductionBackgrounds',
'isCurrentUserArtist',
'isTVShow',
'organisation',
'productionMap',
'selectedConcepts',
'user'
]),
Expand Down Expand Up @@ -827,6 +830,10 @@ export default {
}
},
currentProduction() {
return this.productionMap.get(this.task.project_id)
},
marginBottom() {
let margin = 32 // buttons bar
if (this.isMovie) margin += 28 // progress bar
Expand Down Expand Up @@ -1473,7 +1480,7 @@ export default {
isDefaultBackground(background) {
const defaultId =
this.currentProduction.default_preview_background_file_id
this.currentProduction?.default_preview_background_file_id
return defaultId ? background.id === defaultId : background.is_default
},
Expand Down Expand Up @@ -2002,6 +2009,7 @@ export default {
watch: {
current3DAnimation() {
if (this.is3DModel) {
this.isPlaying = true
this.previewViewer.playModelAnimation(this.current3DAnimation)
}
},
Expand Down Expand Up @@ -2032,7 +2040,7 @@ export default {
}, 500)
} else if (this.is3DModel) {
this.fixCanvasSize({ width: 0, height: 0, left: 0, top: 0 })
this.previewViewer.resize()
this.previewViewer?.resize()
} else if (this.isSound || this.isFile) {
// hide canvas
this.fixCanvasSize({ width: 0, height: 0, left: 0, top: 0 })
Expand Down
1 change: 1 addition & 0 deletions src/components/previews/VideoViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export default {
this.video.addEventListener('resize', this.resetSize)
this.video.addEventListener('loadedmetadata', () => {
if (!this.video) return
this.configureVideo()
this.onWindowResize()
this.setCurrentTime(0)
Expand Down
1 change: 0 additions & 1 deletion src/components/tops/Topbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ export default {
this.$router.push({
params: {
production_id: routeProductionId,
section: this.currentProjectSection,
episode_id: this.currentEpisodeId
},
query
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/AddComment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export default {
mounted() {
const production = this.productionMap.get(this.task.project_id)
this.mode =
production.is_publish_default_for_artists && this.isCurrentUserArtist
production?.is_publish_default_for_artists && this.isCurrentUserArtist
? 'publish'
: 'status'
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/Spinner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export default {
},
computed: {
sizeStyle: function () {
sizeStyle() {
return {
width: this.size ? this.size + 'px' : 'auto'
width: this.size ? `${this.size}px` : null
}
}
}
Expand Down
Loading

0 comments on commit 4adb708

Please sign in to comment.