Resolve "Mark finished houses"
see #72
Explanation of the Changes
src/map/AddressMarker.vue
-
Added
done
prop to Props interface:+ done: boolean
- Introduced a new boolean property
done
to indicate the completion status of an address marker.
- Introduced a new boolean property
-
Default value for
done
prop:+ done: () => false
- Set the default value of
done
tofalse
.
- Set the default value of
-
Template update for
done
prop:+ done: props.done
- Updated the
class
binding to include thedone
property, so the marker's appearance changes based on its completion status.
- Updated the
-
CSS styles for the
done
class:+ &.done { + background: #4caf50; + color: white; + }
- Added styles for the
done
class 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
useEventDetailStore
composable to access the completion status data.
- Imported the
-
Retrieved
completedTargetIds
:+const { completedTargetIds } = useEventDetailStore()
- Extracted
completedTargetIds
fromuseEventDetailStore
, which contains the IDs of completed targets.
- Extracted
-
Passed
done
prop toAddressMarker
:+ :done="completedTargetIds.includes(address.osm_id.toString())"
- Set the
done
prop on theAddressMarker
component based on whether theaddress.osm_id
is incompletedTargetIds
.
- Set the
src/pages/event-map/detail/area/street/EventAreaStreetMap.vue
-
Imported
useEventDetailStore
:+import { useEventDetailStore } from '../../EventDetailStoreMixin'
- Imported the
useEventDetailStore
composable to access the completion status data.
- Imported the
-
Retrieved
completedTargetIds
:+const { completedTargetIds } = useEventDetailStore()
- Extracted
completedTargetIds
fromuseEventDetailStore
, which contains the IDs of completed targets.
- Extracted
-
Passed
done
prop toAddressMarker
:+ :done="completedTargetIds.includes(address.osm_id.toString())"
- Set the
done
prop on theAddressMarker
component based on whether theaddress.osm_id
is 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)