diff --git a/src/App.vue b/src/App.vue index 1c6c42bd3..5230533af 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1738,6 +1738,67 @@ tbody:last-child .empty-line:last-child { display: none; } +th .input-editor, +td .input-editor { + background: transparent; + border: 1px solid transparent; + color: $grey-strong; + height: 100%; + padding: 0.5rem; + width: 100%; + z-index: 100; + + &:active, + &:focus, + &:hover { + background: transparent; + background: white; + } + + &:active, + &:focus { + border: 1px solid $green; + } + + &:hover { + border: 1px solid $light-green; + } + + &:invalid, + &.error { + color: $red; + } +} + +.dark { + th .input-editor, + td .select select, + td .input-editor { + color: $white; + + option { + background: $dark-grey-light; + color: $white; + } + + &:focus, + &:active, + &:hover { + background: $dark-grey-light; + } + } +} + +td.frames, +td.framein, +td.frameout, +td.max-retakes, +td.resolution, +td.fps { + height: 3.1rem; + padding: 0; +} + .resizable { th { .resizable-knob { diff --git a/src/components/lists/AssetList.vue b/src/components/lists/AssetList.vue index a111e3d6b..dd6134a30 100644 --- a/src/components/lists/AssetList.vue +++ b/src/components/lists/AssetList.vue @@ -114,6 +114,7 @@ > {{ $t('assets.fields.description') }} + + + {{ $t('shots.fields.resolution') }} + + @@ -215,7 +228,7 @@ v-for="(group, k) in displayedAssets" v-if="!isLoading && isListVisible" > - + + + + + + + + + {{ $t('shots.fields.resolution') }} + + + + + + + + + {{ $t('shots.fields.resolution') }} + + + + + + + + + { return { @@ -270,7 +282,11 @@ export default { name: this.assetToEdit.name, description: this.assetToEdit.description, source_id: this.assetToEdit.source_id || this.assetToEdit.episode_id, - data: { ...this.assetToEdit.data } || {}, + data: + { + ...this.assetToEdit.data, + resolution: this.assetToEdit.data.resolution || '' + } || {}, is_shared: String(this.assetToEdit.is_shared === true) } } diff --git a/src/components/modals/EditEditModal.vue b/src/components/modals/EditEditModal.vue index bd0bc5a80..6d00fe628 100644 --- a/src/components/modals/EditEditModal.vue +++ b/src/components/modals/EditEditModal.vue @@ -30,6 +30,12 @@ @enter="runConfirmation" v-focus /> + + + + - this.selection[key]) - .forEach(entityId => { - this.addAssetToCasting({ - entityId, - assetId, - nbOccurences: 1, - label: this.castingType === 'shot' ? 'animate' : 'fixed' - }) - delete this.saveErrors[entityId] - this.saveCasting(entityId) - .then(this.setLock) - .catch(err => { - this.saveErrors[entityId] = true - console.error(err) - }) + const entityIds = Object.keys(this.selection).filter( + key => this.selection[key] + ) + + for (const entityId of entityIds) { + this.addAssetToCasting({ + entityId, + assetId, + nbOccurences: amount, + label: this.castingType === 'shot' ? 'animate' : 'fixed' }) + + delete this.saveErrors[entityId] + + try { + await this.saveCasting(entityId) + this.setLock() + } catch (err) { + this.saveErrors[entityId] = true + console.error(err) + } + } }, - addTenAssets(assetId) { - this.isLocked = true - Object.keys(this.selection) - .filter(key => this.selection[key]) - .forEach(entityId => { - this.addAssetToCasting({ entityId, assetId, nbOccurences: 10 }) - delete this.saveErrors[entityId] - this.saveCasting(entityId) - .then(this.setLock) - .catch(err => { - this.saveErrors[entityId] = true - console.error(err) - }) - }) + async addTenAssets(assetId) { + this.addOneAsset(assetId, 10) }, confirmAssetRemoval() { @@ -974,7 +967,7 @@ export default { this.loading.remove = true this.removeAssetFromCasting({ entityId, assetId, nbOccurences }) delete this.saveErrors[entityId] - this.saveCasting(entityId) + return this.saveCasting(entityId) .then(() => { this.setLock() this.modals.isRemoveConfirmationDisplayed = false @@ -989,34 +982,27 @@ export default { }) }, - removeOneAssetFromSelection(assetId) { - Object.keys(this.selection) - .filter(key => this.selection[key]) - .forEach(entityId => { - const nbOccurences = this.casting[entityId].find( - asset => asset.asset_id === assetId - ).nb_occurences - this.removeOneAsset(assetId, entityId, nbOccurences) - }) - }, + async removeOneAssetFromSelection(assetId) { + const entityIds = Object.keys(this.selection).filter( + key => this.selection[key] + ) - removeOneAsset(assetId, entityId, nbOccurences) { - this.isLocked = true - if (this.isEpisodeCasting && nbOccurences === 1) { - this.removalData = { assetId, entityId, nbOccurences } - this.modals.isRemoveConfirmationDisplayed = true - } else { - this.saveAssetRemoval(entityId, assetId, 1) + for (const entityId of entityIds) { + const nbOccurences = this.casting[entityId].find( + asset => asset.asset_id === assetId + ).nb_occurences + await this.removeOneAsset(assetId, entityId, nbOccurences) } }, - removeTenAssets(assetId, entityId, nbOccurences) { + removeOneAsset(assetId, entityId, nbOccurences) { this.isLocked = true - if (this.isEpisodeCasting && nbOccurences < 10) { + if (this.isEpisodeCasting && nbOccurences === 1) { this.removalData = { assetId, entityId, nbOccurences } this.modals.isRemoveConfirmationDisplayed = true + return Promise.resolve() } else { - this.saveAssetRemoval(entityId, assetId, 10) + return this.saveAssetRemoval(entityId, assetId, 1) } }, @@ -1249,25 +1235,25 @@ export default { clipboard.copyCasting(selectedCasting) }, - pasteCasting() { + async pasteCasting() { const castingToPaste = clipboard.pasteCasting() if (!castingToPaste || castingToPaste.length === 0) return const selectedElements = Object.keys(this.selection).filter( key => this.selection[key] ) - selectedElements.forEach(entityId => { + for (const entityId of selectedElements) { this.setEntityCasting({ entityId, casting: castingToPaste }) delete this.saveErrors[entityId] - this.saveCasting(entityId) + await this.saveCasting(entityId) .then(this.setLock) .catch(err => { this.saveErrors[entityId] = true console.error(err) }) - }) + } return castingToPaste }, diff --git a/src/components/pages/breakdown/ShotLine.vue b/src/components/pages/breakdown/ShotLine.vue index abe81caf6..31f440eac 100644 --- a/src/components/pages/breakdown/ShotLine.vue +++ b/src/components/pages/breakdown/ShotLine.vue @@ -138,16 +138,18 @@ :key="'desc' + entity.id + '-' + descriptor.id" :style="{ 'min-width': columnWidth[descriptor.id] + ? columnWidth[descriptor.id] + 'px' + : '110px', + 'max-width': columnWidth[descriptor.id] ? columnWidth[descriptor.id] + 'px' : '110px' }" - v-for="(descriptor, j) in visibleMetadataDescriptors" + v-for="descriptor in visibleMetadataDescriptors" v-if="isShowInfosBreakdown" >