Skip to content

Commit

Permalink
Merge pull request #1536 from NicoPennec/fix/various
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
frankrousseau authored Sep 19, 2024
2 parents a455044 + 7cdf2b2 commit 46a434b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 53 deletions.
Binary file removed src/assets/illustrations/validated.png
Binary file not shown.
11 changes: 2 additions & 9 deletions src/components/modals/EditTaskStatusModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,14 @@
:label="$t('task_status.fields.is_client_allowed')"
@enter="confirmClicked"
v-model="form.is_client_allowed"
v-if="form.for_concept !== 'true'"
/>
<boolean-field
:label="$t('task_status.fields.is_feedback_request')"
@enter="confirmClicked"
v-model="form.is_feedback_request"
v-if="form.is_default === 'false'"
/>
<!--
<boolean-field
:label="$t('task_status.fields.for_concept')"
@enter="confirmClicked"
v-model="form.for_concept"
v-if="form.is_default === 'false'"
/>
-->
<color-field
:label="$t('task_status.fields.color')"
:colors="colors"
Expand Down Expand Up @@ -113,8 +106,8 @@
import { modalMixin } from '@/components/modals/base_modal'
import BooleanField from '@/components/widgets/BooleanField.vue'
import ComboboxBoolean from '@/components/widgets/ComboboxBoolean.vue'
import ColorField from '@/components/widgets/ColorField.vue'
import ComboboxBoolean from '@/components/widgets/ComboboxBoolean.vue'
import ModalFooter from '@/components/modals/ModalFooter.vue'
import TextField from '@/components/widgets/TextField.vue'
import TextareaField from '@/components/widgets/TextareaField.vue'
Expand Down
8 changes: 1 addition & 7 deletions src/components/pages/Task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
:comment="comment"
:fps="currentFps"
:frame="currentFrame"
:is-change="isStatusChange(index)"
:is-checkable="
user.id === comment.person?.id ||
(isCurrentUserArtist && isAssigned) ||
Expand All @@ -235,12 +236,9 @@
:is-editable="
user.id === comment.person?.id || isCurrentUserAdmin
"
:is-first="index === 0"
:is-last="index === pinnedCount"
:is-pinnable="
isDepartmentSupervisor || isCurrentUserManager
"
:is-change="isStatusChange(index)"
:revision="currentRevision"
:task="task"
:team="currentTeam"
Expand Down Expand Up @@ -781,10 +779,6 @@ export default {
this.personMap.get(personId)
)
)
},
pinnedCount() {
return this.taskComments.filter(c => c.pinned).length
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/production/ProductionTaskTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default {
async addTaskType(taskType) {
const taskTypeId = taskType && taskType.id ? taskType.id : this.taskTypeId
await this.addTaskTypeToProduction({
taskTypeId: taskTypeId,
taskTypeId,
priority: this.assetTaskTypes.length
})
try {
Expand Down Expand Up @@ -435,9 +435,9 @@ export default {
await this.loadContext()
},
async importTaskTypesFromProduction(production) {
async importTaskTypesFromProduction(productionId) {
this.loading.import = true
const taskTypes = this.getProductionTaskTypes(production.id).filter(
const taskTypes = this.getProductionTaskTypes(productionId).filter(
t => `${t.for_entity.toLowerCase()}s` === this.activeTab
)
const entityName = stringHelper.capitalize(this.activeTab).slice(0, -1)
Expand Down
7 changes: 0 additions & 7 deletions src/components/sides/TaskInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@
:is-editable="
user.id === comment.person?.id || isCurrentUserAdmin
"
:is-first="index === 0"
:is-last="index === pinnedCount"
:is-pinnable="
isDepartmentSupervisor || isCurrentUserManager
"
Expand Down Expand Up @@ -716,11 +714,6 @@ export default {
}))
},
pinnedCount() {
if (!this.taskComments) return 0
return this.taskComments.filter(c => c.pinned).length
},
selectedTasksToDisplay() {
return sortTaskNames(
Array.from(this.selectedTasks.values()),
Expand Down
5 changes: 3 additions & 2 deletions src/components/tops/ActionPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@

<div
class="menu-item mr05"
:title="$t('menu.clear_selection')"
:title="$t('main.clear_selection')"
@click="clearSelection"
>
<x-icon :title="$t('main.clear_selection')" :size="16" />
<x-icon :size="16" />
</div>
</div>
</div>
Expand Down Expand Up @@ -1522,6 +1522,7 @@ export default {
this.clearSelectedShots()
this.clearSelectedTasks()
this.clearSelectedEdits()
this.clearSelectedConcepts()
},
selectBar(barName) {
Expand Down
23 changes: 1 addition & 22 deletions src/components/widgets/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@
@time-code-clicked="onChecklistTimecodeClicked"
v-if="checklist.length > 0"
/>
<p class="has-text-centered" v-if="taskStatus.is_done && isLast">
<img
class="congrats-picture"
src="../../assets/illustrations/validated.png"
/>
</p>
<p v-if="comment.attachment_files.length > 0">
<a
:href="getAttachmentPath(attachment)"
Expand Down Expand Up @@ -429,14 +423,6 @@ export default {
type: Boolean,
default: false
},
isFirst: {
type: Boolean,
default: false
},
isLast: {
type: Boolean,
default: false
},
isPinnable: {
type: Boolean,
default: false
Expand Down Expand Up @@ -487,7 +473,6 @@ export default {
'isCurrentUserManager',
'personMap',
'productionDepartmentIds',
'taskStatusMap',
'taskTypeMap',
'user'
]),
Expand All @@ -501,8 +486,7 @@ export default {
this.comment.text.length === 0 &&
(!this.comment.checklist || this.comment.checklist.length === 0) &&
this.comment.attachment_files.length === 0 &&
this.comment.previews.length === 0 &&
!(this.isFirst && this.taskStatus.is_done)
this.comment.previews.length === 0
)
},
Expand Down Expand Up @@ -536,11 +520,6 @@ export default {
return route
},
taskStatus() {
const status = this.taskStatusMap.get(this.comment?.task_status.id)
return status || this.comment.task_status
},
isLikedBy() {
const personList = this.comment.acknowledgements.map(personId =>
this.personMap.get(personId)
Expand Down
1 change: 0 additions & 1 deletion src/store/modules/edits.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ const actions = {
editEdit({ commit, state }, data) {
commit(LOCK_EDIT, data)
commit(EDIT_EDIT_END, data)
console.log('editEdit', JSON.stringify(data, null, 2))
return editsApi.updateEdit(data).finally(() => {
setTimeout(() => {
commit(UNLOCK_EDIT, data)
Expand Down
8 changes: 6 additions & 2 deletions src/store/modules/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const actions = {

loadComment({ commit }, { commentId }) {
return tasksApi.getTaskComment({ id: commentId }).then(comment => {
commit(NEW_TASK_COMMENT_END, { comment, taskId: comment.object_id })
commit(NEW_TASK_COMMENT_END, { comment })
return comment
})
},
Expand Down Expand Up @@ -929,7 +929,7 @@ const mutations = {
task.is_subscribed = subscribed
},

[NEW_TASK_COMMENT_END](state, { comment, taskId }) {
[NEW_TASK_COMMENT_END](state, { comment, taskId = undefined }) {
const task = state.taskMap.get(taskId)
if (comment.task_status === undefined) {
const getTaskStatus = getters.getTaskStatus(state, getters)
Expand All @@ -945,6 +945,9 @@ const mutations = {
comment.person
)

if (taskId) {
taskId = comment.object_id
}
if (!state.taskComments[taskId]) state.taskComments[taskId] = []
const commentIndex = state.taskComments[taskId].findIndex(
({ id }) => id === comment.id
Expand All @@ -955,6 +958,7 @@ const mutations = {
state.taskComments[taskId].splice(commentIndex, 1, comment)
}
state.taskComments[taskId] = sortComments(state.taskComments[taskId])

if (task) {
Object.assign(task, {
task_status_id: comment.task_status_id,
Expand Down

0 comments on commit 46a434b

Please sign in to comment.