Skip to content

Commit

Permalink
Merge pull request #1588 from NicoPennec/fix/various
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
frankrousseau authored Nov 19, 2024
2 parents f26d4dc + 620e53a commit 7b211b2
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/components/lists/TaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
:value="task.difficulty"
@input="updateDifficulty($event)"
v-if="isInDepartment(task) && selectionGrid[task.id]"
v-models="task.difficulty"
v-model="task.difficulty"
/>
<span
class="difficulty number-cell"
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/EditBackgroundModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
v-model.trim="form.name"
/>
<boolean-field
class="mb2"
is-field
:label="$t('backgrounds.fields.is_default')"
@enter="confirmClicked"
v-model="form.is_default"
Expand Down
1 change: 1 addition & 0 deletions src/components/modals/EditTaskTypeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@enter="confirmClicked"
/>
<boolean-field
is-field
:label="$t('task_types.fields.allow_timelog')"
@enter="confirmClicked"
v-model="form.allow_timelog"
Expand Down
8 changes: 3 additions & 5 deletions src/components/pages/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
<boolean-field
class="selector"
:label="$t('notifications.read')"
:is-field="false"
is-small
@input="value => toggleNotificationRead(notification, value)"
:value="notification.read ? 'true' : 'false'"
Expand Down Expand Up @@ -476,7 +475,7 @@ export default {
}
},
loadFollowingNotifications() {
async loadFollowingNotifications() {
if (!this.loading.more && !this.loading.notifications) {
this.loading.more = true
const params = {
Expand All @@ -490,9 +489,8 @@ export default {
if (this.parameters.watchingMode) {
params.watching = this.parameters.watchingMode === 'watching'
}
this.loadMoreNotifications().then(() => {
this.loading.more = false
})
await this.loadMoreNotifications(params)
this.loading.more = false
}
},
Expand Down
14 changes: 8 additions & 6 deletions src/components/pages/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,14 @@ export default {
},
previewOptions() {
return this.taskPreviews.map(preview => {
return {
label: `v${preview.revision}`,
value: preview.id
}
})
return [...this.taskPreviews]
.sort((a, b) => b.revision - a.revision)
.map(preview => {
return {
label: `v${preview.revision}`,
value: preview.id
}
})
},
isPreviewButtonVisible() {
Expand Down
12 changes: 6 additions & 6 deletions src/components/previews/PreviewPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -914,12 +914,12 @@ export default {
lastPreviewFileOptions() {
if (!this.lastPreviewFiles) return []
return this.lastPreviewFiles.map(previewFile => {
return {
label: `v${previewFile.revision}`,
value: previewFile.id
}
})
return [...this.lastPreviewFiles]
.sort((a, b) => b.revision - a.revision)
.map(preview => ({
value: preview.id,
label: `v${preview.revision}`
}))
},
previewFileOptions() {
Expand Down
17 changes: 13 additions & 4 deletions src/components/sides/TaskInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"
:is-movie-preview="isMoviePreview"
:is-set-frame-thumbnail-loading="loading.setFrameThumbnail"
:production-id="currentProductionId"
:team="currentTeam"
@export-task="onExportClick"
@set-frame-thumbnail="onSetCurrentFrameAsThumbnail"
/>
Expand Down Expand Up @@ -466,6 +468,7 @@ export default {
...mapGetters([
'isSavingCommentPreview',
'currentEpisode',
'currentProduction',
'getTaskComment',
'getTaskComments',
'getTaskPreviews',
Expand Down Expand Up @@ -509,6 +512,10 @@ export default {
return this[`selected${this.entityType}s`]
},
currentProductionId() {
return this.task?.project_id || this.currentProduction?.id
},
currentTeam() {
if (!this.task) return []
const production = this.productionMap.get(this.task.project_id)
Expand Down Expand Up @@ -715,10 +722,12 @@ export default {
previewOptions() {
if (!this.taskPreviews) return []
return this.taskPreviews.map(preview => ({
value: preview.id,
label: `v${preview.revision}`
}))
return [...this.taskPreviews]
.sort((a, b) => b.revision - a.revision)
.map(preview => ({
value: preview.id,
label: `v${preview.revision}`
}))
},
selectedTasksToDisplay() {
Expand Down
90 changes: 41 additions & 49 deletions src/components/tops/ActionPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,26 @@
class="flexcolumn flexrow-item is-wide"
v-if="selectedBar === 'assignation'"
>
<div class="assignation flexrow-item">
<span v-show="isCurrentUserArtist">
{{ $tc('tasks.to_myself') }}
</span>
<div class="mb05" v-if="isCurrentUserArtist">
{{ $tc('tasks.to_myself') }}
</div>
<div class="flexrow mb05">
<div
class="mb05"
v-else-if="isCurrentUserManager || isCurrentUserSupervisor"
>
<people-field
class="flexrow-item is-wide assignation-field"
class="is-wide assignation-field"
ref="assignation-field"
:people="currentTeam"
:placeholder="$t('tasks.assign_explaination')"
big
wide
v-model="person"
v-show="isCurrentUserManager || isCurrentUserSupervisor"
/>
</div>
<div v-if="loading.assignation">
<div class="flexrow-item">
<spinner :size="20" class="spinner" />
</div>
<div class="flexrow-item">&nbsp;</div>

<div class="flexrow-item mt1 mb1" v-if="loading.assignation">
<spinner :size="20" class="spinner" />
</div>
<div class="flexrow-item is-wide" v-if="!loading.assignation">
<button
Expand All @@ -387,7 +385,7 @@
</button>
</div>
<div
class="flexrow-item is-wide has-text-centered flexrow"
class="flexrow-item is-wide flexrow"
v-if="
!loading.assignation &&
(isCurrentUserManager || isSupervisorInDepartment)
Expand All @@ -400,9 +398,7 @@
>
{{ $t('tasks.clear_assignations') }}
</button>
<span>
{{ $t('main.or') }}
</span>
{{ $t('main.or') }}
<button
class="button is-link clear-assignation-button"
@click="clearAllAssignations"
Expand Down Expand Up @@ -615,7 +611,7 @@
type="hidden"
id="projectid"
name="projectid"
:value="currentProduction ? currentProduction.id : null"
:value="productionId"
/>
<input
type="hidden"
Expand Down Expand Up @@ -810,7 +806,6 @@ import { mapGetters, mapActions } from 'vuex'
import { intersection } from '@/lib/array'
import func from '@/lib/func'
import { sortPeople } from '@/lib/sorting'
import BuildFilterModal from '@/components/modals/BuildFilterModal.vue'
import ButtonSimple from '@/components/widgets/ButtonSimple.vue'
Expand All @@ -835,6 +830,14 @@ export default {
isSetFrameThumbnailLoading: {
type: Boolean,
default: false
},
productionId: {
type: String,
default: null
},
team: {
type: Array,
default: () => []
}
},
Expand Down Expand Up @@ -930,16 +933,12 @@ export default {
'assetMap',
'assetCustomActions',
'assetsByType',
'currentProduction',
'isCurrentUserArtist',
'isCurrentUserManager',
'isCurrentUserSupervisor',
'isShowAssignations',
'nbSelectedTasks',
'nbSelectedValidations',
'organisation',
'peopleWithoutBot',
'personMap',
'productionMap',
'selectedAssets',
'selectedConcepts',
Expand Down Expand Up @@ -968,6 +967,7 @@ export default {
currentEntityType() {
if (this.isCurrentViewAsset) return 'asset'
if (this.isCurrentViewShot) return 'shot'
if (this.isCurrentViewSequence) return 'sequence'
if (this.isCurrentViewEdit) return 'edit'
return 'episode'
},
Expand All @@ -981,22 +981,23 @@ export default {
},
currentTeam() {
let team = this.currentProduction
? sortPeople(
this.currentProductionTeam
.map(personId => this.personMap.get(personId))
.filter(person => person && !person.is_bot)
)
: [...this.peopleWithoutBot]
if (this.isCurrentUserSupervisor && this.user.departments.length > 0) {
team = team.filter(person =>
person.departments.some(department =>
this.user.departments.includes(department)
)
)
}
return team
const isSupervisorWithDepartments =
this.isCurrentUserSupervisor && this.user.departments.length > 0
return this.team.filter(person => {
if (!person?.is_bot) {
if (isSupervisorWithDepartments) {
return (
person.departments.length === 0 ||
person.departments.some(department =>
this.user.departments.includes(department)
)
)
}
return true
}
return false
})
},
defaultCustomAction() {
Expand Down Expand Up @@ -1152,10 +1153,6 @@ export default {
return this.person ? this.person.id : null
},
currentProductionTeam() {
return this.currentProduction ? this.currentProduction.team || [] : []
},
isInDepartment() {
return this.selectedTaskIds.every(taskId => {
const task = this.taskMap.get(taskId)
Expand Down Expand Up @@ -1336,7 +1333,7 @@ export default {
this.loading.taskCreation = true
this.createSelectedTasks({
type,
projectId: this.currentProduction.id
projectId: this.productionId
})
.then(() => {
this.loading.taskCreation = false
Expand Down Expand Up @@ -1494,7 +1491,7 @@ export default {
originurl: this.currentUrl,
originserver: this.currentHost,
selection: this.selectedTaskIds,
productionid: this.currentProduction.id,
productionid: this.productionId,
userid: this.user.id,
useremail: this.user.email
},
Expand Down Expand Up @@ -1741,11 +1738,6 @@ export default {
z-index: 1000;
}
div.assignation {
margin-right: 1em;
padding-right: 0;
}
.hidden {
display: none;
}
Expand Down

0 comments on commit 7b211b2

Please sign in to comment.