Web: only show tasks table if there is job data to show

Without this, the tasks table would be shown (off-screen, so you'd have
to scroll to see it) when there is an active job ID, but no data loaded
due to the backend being unavailable.
This commit is contained in:
Sybren A. Stüvel 2022-05-19 15:42:57 +02:00
parent d5be85daad
commit 22ce5a3e13

View File

@ -4,7 +4,7 @@
</div> </div>
<div class="col col-2"> <div class="col col-2">
<job-details :jobData="jobs.activeJob" /> <job-details :jobData="jobs.activeJob" />
<tasks-table v-if="jobID" ref="tasksTable" :jobID="jobID" :taskID="taskID" @tableRowClicked="onTableTaskClicked" /> <tasks-table v-if="hasJobData" ref="tasksTable" :jobID="jobID" :taskID="taskID" @tableRowClicked="onTableTaskClicked" />
</div> </div>
<div class="col col-3"> <div class="col col-3">
<task-details :taskData="tasks.activeTask" /> <task-details :taskData="tasks.activeTask" />
@ -55,6 +55,11 @@ export default {
notifs: useNotifs(), notifs: useNotifs(),
showFooterPopup: false, showFooterPopup: false,
}), }),
computed: {
hasJobData() {
return !objectEmpty(this.jobs.activeJob);
},
},
mounted() { mounted() {
window.jobsView = this; window.jobsView = this;
window.footerPopup = this.$refs.footerPopup; window.footerPopup = this.$refs.footerPopup;