Skip to content

Commit

Permalink
Merge pull request #1695 from NicoPennec/main
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
NicoPennec authored Feb 10, 2025
2 parents 59a5a41 + f4fbf89 commit 8d8d485
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 48 deletions.
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"color-hash": "2.0.2",
"color-string": "1.9.1",
"fabric": "cgwire/fabric.js",
"lucide-vue-next": "0.474.0",
"lucide-vue-next": "0.475.0",
"marked": "14.1.4",
"marked-emoji": "1.4.3",
"moment": "2.30.1",
Expand Down Expand Up @@ -80,9 +80,9 @@
"jsdom": "26.0.0",
"lint-staged": "15.4.3",
"localStorage": "1.0.4",
"prettier": "3.4.2",
"sass": "1.83.4",
"vite": "6.0.11",
"prettier": "3.5.0",
"sass": "1.84.0",
"vite": "6.1.0",
"vitest": "3.0.5",
"vitest-localstorage-mock": "0.1.2"
},
Expand Down
1 change: 1 addition & 0 deletions src/components/lists/EntityTaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export default {
.duedate {
max-width: 100px;
min-width: 100px;
white-space: nowrap;
}
.status {
Expand Down
24 changes: 21 additions & 3 deletions src/components/lists/TimeSpentTaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
<td class="name">
{{ task.name }}
</td>
<td class="duration">{{ task.duration / 60 }}</td>
<td class="duration">
{{ getDuration(task) }}
</td>
</router-link>
</tr>
</tbody>
Expand All @@ -51,8 +53,9 @@
import { mapGetters } from 'vuex'
import { firstBy } from 'thenby'
import { sortByName } from '@/lib/sorting'
import { getTaskPath } from '@/lib/path'
import { sortByName } from '@/lib/sorting'
import { hoursToDays } from '@/lib/time'
import ProductionName from '@/components/widgets/ProductionName.vue'
import TableInfo from '@/components/widgets/TableInfo.vue'
Expand Down Expand Up @@ -85,11 +88,19 @@ export default {
isError: {
type: Boolean,
default: false
},
unit: {
type: String,
default: 'hour'
}
},
computed: {
...mapGetters(['productionMap', 'taskTypeMap']),
...mapGetters(['organisation', 'productionMap', 'taskTypeMap']),
isHours() {
return this.unit === 'hour'
},
projects() {
const projects = {}
Expand Down Expand Up @@ -131,6 +142,13 @@ export default {
},
methods: {
getDuration(task) {
const duration = task.duration / 60
return this.isHours
? duration
: hoursToDays(this.organisation, duration).toFixed(2)
},
getTaskPath(task) {
const project = this.productionMap.get(task.project_id)
if (!project || project.project_status_name === 'Closed') {
Expand Down
2 changes: 1 addition & 1 deletion src/components/mixins/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ export const annotationMixin = {
if (!this.fabricCanvas) return
this.fabricCanvas.discardActiveObject()
const { mainObject, subObjects } = clipboard.pasteAnnotations()
if (subObjects.length > 0) {
if (subObjects?.length > 0) {
subObjects.forEach(obj => {
obj = this.applyGroupChanges(mainObject, obj)
obj.group = null
Expand Down
4 changes: 1 addition & 3 deletions src/components/pages/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,7 @@ export default {
title() {
if (this.currentEdit) {
if (this.currentEdit.episode_name) {
return (
`${this.currentEdit.episode_name} / ` + `${this.currentEdit.name}`
)
return `${this.currentEdit.episode_name} / ${this.currentEdit.name}`
} else {
return `${this.currentEdit.name}`
}
Expand Down
1 change: 1 addition & 0 deletions src/components/pages/SequenceStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class="flexrow-item mt1"
ref="sequence-search-field"
:can-save="true"
@change="onSearchChange"
@save="saveSearchQuery"
placeholder="ex: e01 s01 anim=wip"
/>
Expand Down
4 changes: 1 addition & 3 deletions src/components/pages/Shot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ export default {
`${this.currentShot.name}`
)
} else {
return (
`${this.currentShot.sequence_name} / ` + `${this.currentShot.name}`
)
return `${this.currentShot.sequence_name} / ${this.currentShot.name}`
}
} else {
return 'Loading...'
Expand Down
4 changes: 1 addition & 3 deletions src/components/pages/entities/EntityPreviewFileCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ export default {
getDownloadPath(previewFileId) {
const type = this.previewFile.extension === 'mp4' ? 'movies' : 'pictures'
return (
`/api/${type}/originals/preview-files/` + `${previewFileId}/download`
)
return `/api/${type}/originals/preview-files/${previewFileId}/download`
},
renderFileSize
Expand Down
4 changes: 1 addition & 3 deletions src/components/pages/entities/EntityPreviewFiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ export default {
if (!previewFile) return ''
const type = previewFile.extension === 'mp4' ? 'movies' : 'pictures'
return (
`/api/${type}/originals/preview-files/` + `${previewFileId}/download`
)
return `/api/${type}/originals/preview-files/${previewFileId}/download`
},
renderFileSize,
Expand Down
1 change: 1 addition & 0 deletions src/components/pages/entities/EntityTimeLogs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default {
<style lang="scss" scoped>
.date {
width: 100px;
white-space: nowrap;
}
.person {
width: 200px;
Expand Down
5 changes: 5 additions & 0 deletions src/components/sides/PeopleTimesheetInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:tasks="tasks"
:is-loading="isLoading"
:is-error="isLoadingError"
:unit="unit"
/>
</div>
</template>
Expand Down Expand Up @@ -96,6 +97,10 @@ export default {
dayOffCount: {
type: Number,
default: 0
},
unit: {
type: String,
default: 'hour'
}
},
Expand Down
7 changes: 2 additions & 5 deletions src/store/api/breakdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ export default {
},

getEpisodeCasting(episode) {
const path =
`/api/data/projects/${episode.project_id}/entities/` +
`${episode.id}/casting`
const path = `/api/data/projects/${episode.project_id}/entities/${episode.id}/casting`
return client.pget(path)
},

getShotCasting(shot) {
const path =
`/api/data/projects/${shot.project_id}/entities/` + `${shot.id}/casting`
const path = `/api/data/projects/${shot.project_id}/entities/${shot.id}/casting`
return client.pget(path)
},

Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const helpers = {
assetTypes: state.assetTypes,
taskTypes,
taskStatuses,
descriptors: production.descriptors || [],
descriptors: production?.descriptors || [],
persons,
query
})
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/edits.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const helpers = {
entryIndex: cache.editIndex,
taskTypes,
taskStatuses,
descriptors: production.descriptors || [],
descriptors: production?.descriptors || [],
persons,
query
})
Expand Down
5 changes: 2 additions & 3 deletions src/store/modules/files.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import filesApi from '@/store/api/files'

import { RESET_ALL } from '@/store/mutation-types'

import {
SET_FILE_STATUSES,
SET_OUTPUT_FILE_TYPES
SET_OUTPUT_FILE_TYPES,
RESET_ALL
} from '@/store/mutation-types'

const initialState = {
Expand Down

0 comments on commit 8d8d485

Please sign in to comment.