Fix Experiment progress bar for cards when archived [SCI-10333] (#7229)

This commit is contained in:
Soufiane 2024-03-13 10:30:58 +00:00 committed by GitHub
parent 14b962570e
commit 390ccc412e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 6 deletions

View file

@ -44,11 +44,11 @@
<div class="w-full h-1 bg-sn-sleepy-grey">
<div class="h-full"
:class="{
'bg-sn-black': dtComponent.viewMode == 'archived',
'bg-sn-blue': dtComponent.viewMode != 'archived'
'bg-sn-black': params.archived_on,
'bg-sn-blue': !params.archived_on
}"
:style="{
width: params.completed_tasks / params.total_tasks * 100 + '%'
width: `${progress}%`
}"></div>
</div>
</div>
@ -82,5 +82,14 @@ export default {
Description,
},
mixins: [CardSelectorMixin, workflowImgMixin],
computed: {
progress() {
const { completed_tasks: completedTasks, total_tasks: totalTasks } = this.params;
if (totalTasks === 0) return 0;
return (completedTasks / totalTasks) * 100;
}
}
};
</script>

View file

@ -7,9 +7,14 @@
}) }}
<div class="py-1">
<div class="w-24 h-1 bg-sn-light-grey">
<div class="h-full bg-sn-blue" :style="{
width: `${progress}%`
}"></div>
<div class="h-full"
:class="{
'bg-sn-black': params.data.archived_on,
'bg-sn-blue': !params.data.archived_on
}"
:style="{
width: `${progress}%`
}"></div>
</div>
</div>
</div>