Skip to content

Commit

Permalink
Merge pull request #1580 from NicoPennec/fix/various
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
frankrousseau authored Nov 6, 2024
2 parents 0353321 + 6f6fd85 commit f7c0323
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 39 deletions.
1 change: 1 addition & 0 deletions src/components/lists/TaskList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ export default {
const startDate = moment(task.start_date)
const dueDate = task.due_date ? moment(task.due_date) : null
data = getDatesFromStartDate(
this.organisation,
startDate,
dueDate,
minutesToDays(this.organisation, estimation)
Expand Down
9 changes: 5 additions & 4 deletions src/components/pages/Breakdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -989,12 +989,13 @@ export default {
const entityIds = Object.keys(this.selection).filter(
key => this.selection[key]
)
for (const entityId of entityIds) {
const nbOccurences = this.casting[entityId].find(
const asset = this.casting[entityId].find(
asset => asset.asset_id === assetId
).nb_occurences
await this.removeOneAsset(assetId, entityId, nbOccurences)
)
if (asset) {
await this.removeOneAsset(assetId, entityId, asset.nb_occurences)
}
}
},
Expand Down
10 changes: 6 additions & 4 deletions src/components/pages/Shot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,21 @@
/>
<div class="break-word">
{{ asset.asset_name }}
<span v-if="asset.nb_occurences > 1">
<template v-if="asset.nb_occurences > 1">
({{ asset.nb_occurences }})
</span>
</template>
</div>
<div class="ready-for flexrow">
<div
class="ready-for flexrow"
v-if="!asset.shared && asset.ready_for"
>
<task-type-name
class="flexrow-item"
:task-type="taskTypeMap.get(asset.ready_for)"
:current-production-id="currentProduction.id"
:title="
'Ready for: ' + taskTypeMap.get(asset.ready_for).name
"
v-if="asset.ready_for"
/>
</div>
</router-link>
Expand Down
1 change: 1 addition & 0 deletions src/components/pages/TaskType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ export default {
const startDate = parseDate(task.start_date)
const dueDate = task.due_date ? parseDate(task.due_date) : null
data = getDatesFromStartDate(
this.organisation,
startDate,
dueDate,
minutesToDays(this.organisation, estimation),
Expand Down
21 changes: 10 additions & 11 deletions src/components/pages/breakdown/AssetBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
v-if="!textMode"
>
<div class="asset-wrapper">
<div class="asset-add-1" @click="addOneAsset" v-if="!readOnly">+ 1</div>
<div class="asset-add" @click="removeOneAsset" v-if="!readOnly">- 1</div>
<template v-if="!readOnly && active">
<div class="asset-add-1" @click.stop="addOneAsset">+ 1</div>
<div class="asset-add" @click.stop="removeOneAsset">- 1</div>
</template>
<div class="asset-picture" v-if="asset.preview_file_id">
<img
loading="lazy"
Expand Down Expand Up @@ -39,14 +41,13 @@
}"
v-else
>
<span class="asset-text-name flexrow-item">
<span class="asset-text-name flexrow-item filler">
{{ asset.name }} ({{ nbOccurences }})
</span>
<span class="filler"></span>
<span
class="modify-asset flexrow-item"
@click="removeOneAsset"
v-if="!readOnly"
@click.stop="removeOneAsset"
v-if="!readOnly && active"
>
- 1
</span>
Expand Down Expand Up @@ -94,13 +95,11 @@ export default {
methods: {
removeOneAsset(event) {
this.pauseEvent(event)
this.$emit('remove-one', this.asset.asset_id, this.nbOccurences)
this.$emit('remove-one', this.asset.asset_id)
},
addOneAsset(event) {
this.pauseEvent(event)
this.$emit('add-one', this.asset.asset_id, this.nbOccurences)
this.$emit('add-one', this.asset.asset_id)
},
shortenName(name) {
Expand Down Expand Up @@ -200,7 +199,7 @@ export default {
font-weight: bold;
font-size: 0.9em;
opacity: 0;
z-index: 2;
z-index: 3;
}
.asset-add-1 {
Expand Down
13 changes: 6 additions & 7 deletions src/components/pages/breakdown/ShotLine.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<template>
<div
:id="entity.id"
class="shot unselectable"
:class="{
shot: true,
selected: selected,
unselectable: true,
selected,
stdby: entity ? entity.is_casting_standby : false,
'text-mode': textMode
}"
Expand Down Expand Up @@ -391,12 +390,12 @@ export default {
this.$emit('edit-label', asset, label, this.entity.id)
},
removeOneAsset(assetId, nbOccurences) {
this.$emit('remove-one', assetId, this.entity.id, nbOccurences)
removeOneAsset(assetId) {
this.$emit('remove-one', assetId)
},
addOneAsset(assetId, nbOccurences) {
this.$emit('add-one', assetId, this.entity.id, nbOccurences)
addOneAsset(assetId) {
this.$emit('add-one', assetId)
},
onDescriptionChanged(entity, event) {
Expand Down
31 changes: 18 additions & 13 deletions src/components/tops/Topbar.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<template>
<div class="topbar">
<div
class="c-mask-user-menu"
@click="toggleUserMenu()"
v-if="!isUserMenuHidden"
></div>

<nav class="nav">
<div class="nav-left">
<a
Expand Down Expand Up @@ -137,12 +131,13 @@
</div>
</nav>

<nav
class="user-menu"
:style="{
top: isUserMenuHidden ? '-500px' : '60px'
}"
>
<div
class="c-mask-user-menu"
@click="toggleUserMenu()"
v-if="!isUserMenuHidden"
></div>

<nav class="user-menu" v-if="!isUserMenuHidden">
<ul>
<li>
<router-link
Expand Down Expand Up @@ -907,6 +902,7 @@ export default {
}
.user-menu {
animation: slide-down 0.5s ease;
background-color: $white;
box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.2);
border-left: 1px solid $white-grey;
Expand All @@ -915,12 +911,21 @@ export default {
min-width: 220px;
padding: 10px;
position: fixed;
transition: top 0.5s ease;
right: 0;
top: 60px;
width: 220px;
z-index: 203;
}
@keyframes slide-down {
from {
transform: translateY(-100%);
}
to {
transform: translateY(0);
}
}
.user-menu ul {
margin-left: 0;
}
Expand Down

0 comments on commit f7c0323

Please sign in to comment.