Skip to content

Commit

Permalink
fix: jobExpanded
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbirdem committed Aug 1, 2024
1 parent 963441f commit 0750448
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
{{ $t('optimization.addFromMap') + $t('optimization.job') }}
</v-btn>
<!-- low priority TODO: more elegant solution for this? -->
<job-list class="content-list" v-if="mapViewData.hasRoutes()" :jobs="jobs" :jobs-shown="jobsExpanded" :map-view-data="mapViewData"
<job-list class="content-list" v-if="mapViewData.hasRoutes()" :jobs="jobs" :job-extended="jobsExpanded" :map-view-data="mapViewData"
v-show="jobsExpanded"></job-list>
<job-list class="content-list" v-else :jobs="jobs" :jobs-shown="jobsExpanded"></job-list>
<job-list class="content-list" v-else :jobs="jobs" :job-extended="jobsExpanded"></job-list>
<v-card class="content-list" v-if="!jobsExpanded" @click="jobsExpanded=!jobsExpanded">
<v-card-title>
<v-icon style="padding: 0 5px 0 7px">work</v-icon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="job-inputs">
<v-expansion-panel class="no-shadow" :value="jobExtended" :expand="true">
<v-expansion-panel class="no-shadow" :value="showJobs" :expand="true">
<v-expansion-panel-content style="background: transparent;" v-for="(j, i) in jobs" :key="i">
<div v-if="localMapViewData === null || !unassignedIds.includes(j.id)" slot="header" style="padding-bottom: 0;"><v-icon style="padding: 0 5px 0 0">work</v-icon><b>Job {{j.id}} - {{ j.location[0].toPrecision(8) }}, {{ j.location[1].toPrecision(8)}}</b></div>
<div v-else slot="header" style="padding-bottom: 0"><v-icon style="padding: 0 5px 0 0">work</v-icon><b>Job {{j.id}} - {{ j.location[0].toPrecision(8) }}, {{ j.location[1].toPrecision(8)}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import MapViewData from '@/models/map-view-data'
export default {
data: () => ({
localMapViewData: null,
jobExtended: [true]
}),
props: {
jobs: {
Type: Array,
Required: true
},
jobExtended: {
Type: Boolean,
Default: true
},
mapViewData: {
Type: MapViewData,
Required: false
Expand All @@ -24,6 +27,9 @@ export default {
}
return unassignedIds
},
showJobs () {
return [this.jobExtended]
}
},
watch: {
// Every time the response data changes the map builder is reset and the map data is reloaded
Expand Down

0 comments on commit 0750448

Please sign in to comment.