Skip to content

Commit f0ae82f

Browse files
committed
feat: unassigned jobs have different color markers
references #447
1 parent f8131aa commit f0ae82f

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

src/fragments/html-marker/HtmlMarker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<div :style="{background: color}" class="custom-html-icon-div">
44
<img alt="Map marker icon"v-if="markerImg" class="custom-html-icon-img" :src="markerImg">
5-
<div v-else-if="markerNumber" class="custom-html-icon-txt" :class="{'double-digit-text': doubleDigitText, 'triple-digit-text': tripleDigitText, 'four-digit-text': fourDigitText}">{{markerNumber}} </div>
5+
<div v-else-if="markerNumber" class="custom-html-icon-txt" :style="{color: textColor}" :class="{'double-digit-text': doubleDigitText, 'triple-digit-text': tripleDigitText, 'four-digit-text': fourDigitText}">{{markerNumber}} </div>
66
</div>
77
</div>
88
</template>

src/fragments/html-marker/html-marker.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
margin-left: 7px;
2424
margin-top: 7px;
2525
height: 21px;
26-
font-weight: 600;
27-
color:white
26+
font-weight: 600
2827
}
2928

3029
.custom-html-icon-txt.double-digit-text {

src/fragments/html-marker/html-marker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ export default {
44
Type: String,
55
default: 'white'
66
},
7+
textColor: {
8+
Type: String,
9+
default: 'white'
10+
},
711
markerImg: {
812
type: String,
913
required: false

src/fragments/map-view/map-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export default {
399399
markers = this.$root.appHooks.run('markersCreated', markers)
400400
return markers
401401
} else if (markersMapViewData.jobs.length || markersMapViewData.vehicles.length) {
402-
return GeoUtils.buildOptimizationMarkers(markersMapViewData.jobs, markersMapViewData.vehicles)
402+
return GeoUtils.buildOptimizationMarkers(markersMapViewData.jobs, markersMapViewData.vehicles, this.localMapViewData.rawData.unassigned)
403403
}
404404
},
405405
/**

src/support/geo-utils.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,18 @@ const geoUtils = {
606606
}
607607
return lng
608608
},
609-
buildOptimizationMarkers(jobs, vehicles) {
610-
const markers = []
609+
buildOptimizationMarkers(jobs, vehicles, unassignedJobs) {
610+
let markers = []
611+
let unassignedJobIds = []
612+
for (const uaj of unassignedJobs) {
613+
unassignedJobIds.push(uaj.id)
614+
}
611615
for (const job of jobs) {
612616
if (job.lng && job.lat) {
613617
// Build the marker
614618
let propsData = {
615-
color: theme.dark,
619+
color: unassignedJobIds.includes(job.id) ? theme.neutral : theme.dark,
620+
textColor: unassignedJobIds.includes(job.id) ? 'black' : 'white',
616621
markerNumber: job.id.toString()
617622
}
618623
const htmlMarkerClass = Vue.extend(HtmlMarker)

0 commit comments

Comments
 (0)