Skip to content

Commit

Permalink
Merge pull request #1420 from NicoPennec/fix/various
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
NicoPennec authored Apr 22, 2024
2 parents 91141d2 + 9712ec6 commit 555616d
Show file tree
Hide file tree
Showing 16 changed files with 215 additions and 253 deletions.
329 changes: 163 additions & 166 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@fullcalendar/daygrid": "6.1.11",
"@fullcalendar/multimonth": "6.1.11",
"@fullcalendar/vue": "6.1.11",
"@google/model-viewer": "3.4.0",
"@sentry/vue": "7.110.1",
"@google/model-viewer": "3.5.0",
"@sentry/vue": "7.111.0",
"async": "3.2.5",
"bowser": "2.11.0",
"chart.js": "2.9.4",
Expand All @@ -43,7 +43,7 @@
"superagent": "8.1.2",
"textarea-caret": "3.1.0",
"thenby": "1.3.4",
"three": "0.162.0",
"three": "0.163.0",
"uuid": "9.0.1",
"v-autocomplete": "1.8.2",
"vue": "2.7.16",
Expand Down Expand Up @@ -81,7 +81,7 @@
"localStorage": "1.0.4",
"prettier": "3.2.5",
"sass": "1.75.0",
"vite": "5.2.8",
"vite": "5.2.10",
"vitest": "0.34.6",
"vitest-localstorage-mock": "0.1.2",
"vue-template-compiler": "2.7.16"
Expand Down
23 changes: 12 additions & 11 deletions src/components/pages/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ export default {
descriptorToEdit: {},
departmentFilter: [],
selectedDepartment: 'ALL',
taskTypeForTaskDeletion: null,
errors: {
addMetadata: false,
addThumbnails: false,
Expand Down Expand Up @@ -430,6 +431,7 @@ export default {
'assetSearchText',
'assetSearchFilterGroups',
'assetSearchQueries',
'assetSorting',
'assetTypes',
'assetValidationColumns',
'currentEpisode',
Expand All @@ -438,19 +440,17 @@ export default {
'departments',
'displayedAssetsByType',
'episodeMap',
'openProductions',
'isAssetEstimation',
'isAssetTime',
'isAssetsLoading',
'isAssetsLoadingError',
'isCurrentUserClient',
'isCurrentUserManager',
'isAssetEstimation',
'isAssetTime',
'isTVShow',
'openProductions',
'productionAssetTaskTypes',
'selectedAssets',
'assetSorting',
'taskTypeMap',
'taskTypes',
'user'
]),
Expand Down Expand Up @@ -672,9 +672,7 @@ export default {
},
confirmDeleteAllTasks(selectionOnly) {
const taskTypeId = this.taskTypes.find(
t => t.name === this.deleteAllTasksLockText
).id
const taskTypeId = this.taskTypeForTaskDeletion.id
const projectId = this.currentProduction.id
this.errors.deleteAllTasks = false
this.loading.deleteAllTasks = true
Expand Down Expand Up @@ -741,9 +739,11 @@ export default {
},
deleteAllTasksText() {
return this.$t('tasks.delete_all_text', {
name: this.deleteAllTasksLockText
})
const taskType = this.taskTypeForTaskDeletion
if (taskType) {
return this.$t('tasks.delete_all_text', { name: taskType.name })
}
return ''
},
restoreText() {
Expand Down Expand Up @@ -840,6 +840,7 @@ export default {
onDeleteAllTasksClicked(taskTypeId) {
const taskType = this.taskTypeMap.get(taskTypeId)
this.taskTypeForTaskDeletion = taskType
this.deleteAllTasksLockText = taskType.name
this.modals.isDeleteAllTasksDisplayed = true
},
Expand Down
8 changes: 1 addition & 7 deletions src/components/pages/Person.vue
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,6 @@ export default {
)
},
pendingTasks() {
return this.sortedTasks.filter(
task => task.taskStatus.is_feedback_request
)
},
todoTabs() {
const hasAvailableBoard = this.openProductions.some(
production => this.getBoardStatusesByProduction(production).length
Expand Down Expand Up @@ -958,7 +952,7 @@ export default {
}
.page-header {
margin-top: .5em;
margin-top: 0.5em;
}
.calendar {
Expand Down
16 changes: 5 additions & 11 deletions src/components/pages/production/ProductionTaskTypes.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<div>
<div>

<route-section-tabs
class="section-tabs"
:activeTab="activeTab"
Expand Down Expand Up @@ -33,10 +32,7 @@
>
{{ $t('productions.edit_error') }}
</p>
<div
class="box"
v-if="isEmpty(currentProduction.task_types)"
>
<div class="box" v-if="isEmpty(currentProduction.task_types)">
{{ $t('settings.production.empty_list') }}
</div>

Expand Down Expand Up @@ -90,10 +86,7 @@
@import-item="addTaskType"
>
<template v-slot:item-line="{ item }">
<task-type-name
class="pointer"
:task-type="item"
/>
<task-type-name class="pointer" :task-type="item" />
</template>
</setting-importer>
</div>
Expand Down Expand Up @@ -434,8 +427,9 @@ export default {
async importTaskTypesFromProduction(production) {
this.loading.import = true
const taskTypes = this.getProductionTaskTypes(production.id)
.filter(t => `${t.for_entity.toLowerCase()}s` === this.activeTab)
const taskTypes = this.getProductionTaskTypes(production.id).filter(
t => `${t.for_entity.toLowerCase()}s` === this.activeTab
)
const entityName = stringHelper.capitalize(this.activeTab).slice(0, -1)
await this[`production${entityName}TaskTypes`].forEach(async taskType => {
const scheduleItem = this.getScheduleItemForTaskType(taskTypes[0])
Expand Down
6 changes: 4 additions & 2 deletions src/components/pages/schedule/Schedule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
class="filler flexrow-item root-element-name ellipsis"
:title="rootElement.name"
:style="{
'border-left': rootElement.avatar ? null : '4px solid ' + rootElement.color,
'border-left': rootElement.avatar
? null
: '4px solid ' + rootElement.color
}"
:to="rootElement.route"
v-else
Expand Down Expand Up @@ -1596,7 +1598,7 @@ export default {
},
childrenStyle(rootElement, isMultiline = false, setBackground = false) {
let color = rootElement.color
const color = rootElement.color
if (rootElement.full_name) {
// is a person
// color = this.isDarkTheme ? '#222' : '#CCC'
Expand Down
19 changes: 10 additions & 9 deletions src/components/tops/ActionPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1266,20 +1266,21 @@ export default {
})
},
confirmAssign() {
async confirmAssign() {
if (this.selectedPersonId || this.isInDepartment) {
this.loading.assignation = true
const personId =
this.isCurrentUserManager || this.isCurrentUserSupervisor
? this.selectedPersonId
: this.user.id
this.assignSelectedTasks({
personId,
callback: () => {
this.loading.assignation = false
this.$refs['assignation-field'].clear()
}
})
this.loading.assignation = true
try {
await this.assignSelectedTasks({ personId })
this.$refs['assignation-field']?.clear()
} catch (err) {
console.error(err)
} finally {
this.loading.assignation = false
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/tops/TopbarEpisodeList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default {
border-bottom-right-radius: 5px;
text-align: left;
margin-left: -11px;
max-height: 600px;
max-height: min(80vh, 600px);
min-width: 120px;
overflow-y: auto;
padding: 5px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/tops/TopbarProductionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
margin-left: -6px;
max-height: 600px;
max-height: min(80vh, 600px);
overflow-y: auto;
position: absolute;
top: 48px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/tops/TopbarSectionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
margin-left: -6px;
max-height: 600px;
max-height: min(80vh, 600px);
min-width: 200px;
overflow-y: auto;
padding: 5px;
Expand Down
10 changes: 2 additions & 8 deletions src/components/widgets/PeopleAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

<script>
import { mapGetters } from 'vuex'
import colors from '@/lib/colors'
export default {
name: 'people-avatar',
Expand Down Expand Up @@ -72,20 +71,15 @@ export default {
},
computed: {
...mapGetters([
'isDarkTheme',
]),
...mapGetters(['isDarkTheme']),
style() {
const backgroundColor = this.isDarkTheme
? this.person.color
: this.person.color
return {
color: this.isDarkTheme ? '#333' : '#FFF',
width: `${this.size}px`,
height: `${this.size}px`,
fontSize: this.person.has_avatar ? 0 : `${this.fontSize}px`,
backgroundColor
backgroundColor: this.person.color
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/widgets/PeopleAvatarWithMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ export default {
},
computed: {
...mapGetters([
'isDarkTheme',
]),
...mapGetters(['isDarkTheme']),
style() {
return {
Expand Down
8 changes: 2 additions & 6 deletions src/components/widgets/SettingImporter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
:disabled="!importProductionId"
:is-loading="loadingImport"
:text="$t('main.import')"

@click="$emit('import-from-production', importProductionId)"
/>
</div>
Expand Down Expand Up @@ -66,7 +65,7 @@ export default {
loadingImport: {
type: Boolean,
default: true
},
}
},
mounted() {
Expand All @@ -76,10 +75,7 @@ export default {
},
computed: {
...mapGetters([
'currentProduction',
'openProductions',
]),
...mapGetters(['currentProduction', 'openProductions']),
availableProductions() {
return this.openProductions.filter(
Expand Down
2 changes: 1 addition & 1 deletion src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ export default {
},

settings: {
available_items: 'Available items',
available_items: 'Available items',
change_logo: 'Change logo',
integrations: 'Integrations',
import_from_production: 'Import from another production',
Expand Down
10 changes: 4 additions & 6 deletions src/store/api/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,10 @@ export default {
return client.pget(`/api/data/preview-files/${previewId}`)
},

assignTasks(personId, selectedTaskIds, callback) {
client.put(
`/api/actions/persons/${personId}/assign`,
{ task_ids: selectedTaskIds },
callback
)
assignTasks(personId, selectedTaskIds) {
return client.pput(`/api/actions/persons/${personId}/assign`, {
task_ids: selectedTaskIds
})
},

unassignTasks(selectedTaskIds) {
Expand Down
19 changes: 3 additions & 16 deletions src/store/modules/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,6 @@ const actions = {
})
},

/*
getTask ({ commit, rootGetters }, { taskId, callback }) {
tasksApi.getTask(taskId, (err, task) => {
if (!err) {
const taskType = rootGetters.taskTypeMap.get(task.task_type_id)
commit(EDIT_TASK_END, { task, taskType })
}
if (callback) callback(err)
})
},
*/

deleteTask({ commit }, { task, callback }) {
tasksApi.deleteTask(task, err => {
if (!err) {
Expand Down Expand Up @@ -705,11 +693,10 @@ const actions = {
})
},

assignSelectedTasks({ commit, state }, { personId, taskIds, callback }) {
assignSelectedTasks({ commit, state }, { personId, taskIds }) {
const selectedTaskIds = taskIds || Array.from(state.selectedTasks.keys())
tasksApi.assignTasks(personId, selectedTaskIds, err => {
if (!err) commit(ASSIGN_TASKS, { selectedTaskIds, personId })
if (callback) callback(err)
return tasksApi.assignTasks(personId, selectedTaskIds).then(() => {
commit(ASSIGN_TASKS, { selectedTaskIds, personId })
})
},

Expand Down

0 comments on commit 555616d

Please sign in to comment.