Resolve "Mark finished houses"
see #72
Explanation of the Changes
src/map/AddressMarker.vue
-
Added
doneprop to Props interface:+ done: boolean- Introduced a new boolean property
doneto indicate the completion status of an address marker.
- Introduced a new boolean property
-
Default value for
doneprop:+ done: () => false- Set the default value of
donetofalse.
- Set the default value of
-
Template update for
doneprop:+ done: props.done- Updated the
classbinding to include thedoneproperty, so the marker's appearance changes based on its completion status.
- Updated the
-
CSS styles for the
doneclass:+ &.done { + background: #4caf50; + color: white; + }- Added styles for the
doneclass to display a green background and white text when the marker is marked as done.
- Added styles for the
src/pages/event-map/detail/area/metrics/EventAreaMetricsMap.vue
-
Imported
useEventDetailStore:+import { useEventDetailStore } from '../../EventDetailStoreMixin'- Imported the
useEventDetailStorecomposable to access the completion status data.
- Imported the
-
Retrieved
completedTargetIds:+const { completedTargetIds } = useEventDetailStore()- Extracted
completedTargetIdsfromuseEventDetailStore, which contains the IDs of completed targets.
- Extracted
-
Passed
doneprop toAddressMarker:+ :done="completedTargetIds.includes(address.osm_id.toString())"- Set the
doneprop on theAddressMarkercomponent based on whether theaddress.osm_idis incompletedTargetIds.
- Set the
src/pages/event-map/detail/area/street/EventAreaStreetMap.vue
-
Imported
useEventDetailStore:+import { useEventDetailStore } from '../../EventDetailStoreMixin'- Imported the
useEventDetailStorecomposable to access the completion status data.
- Imported the
-
Retrieved
completedTargetIds:+const { completedTargetIds } = useEventDetailStore()- Extracted
completedTargetIdsfromuseEventDetailStore, which contains the IDs of completed targets.
- Extracted
-
Passed
doneprop toAddressMarker:+ :done="completedTargetIds.includes(address.osm_id.toString())"- Set the
doneprop on theAddressMarkercomponent based on whether theaddress.osm_idis incompletedTargetIds.
- Set the
Summary
The changes introduce a new done prop to the AddressMarker component, indicating whether an address marker is marked as completed. This prop is utilized in both EventAreaMetricsMap.vue and EventAreaStreetMap.vue to style markers based on their completion status, using data from the useEventDetailStore composable. The done class is styled with a green background and white text to visually distinguish completed markers.
Edited by control.alt.coop eG (Peter)