feat(#978): add activities map improvements - #1008
Merged
Merged
Conversation
Refactored getPropertyName to handle cases where 'kind' contains multiple comma-separated values. Now supports returning ACTUAL_TREATMENT_AREA for specific combinations and improves extensibility.
8 tasks
Added a check in getPropertyName to return default property names when the kind parameter is null or empty, preventing potential errors from invalid input.
Introduces checkbox controls to select silviculture activities and disturbances for map display. Updates components and props to manage available and selected IDs, and refines map rendering logic to filter polygons based on user selection.
Added a data-testid attribute to the select all checkbox in OpeningForestCover for improved testability.
Changed the button label to 'Hide from map' when the polygon is already shown, and 'Show on map' otherwise, in both ActivityAccordion and DisturbanceAccordion components for improved user feedback.
Changed 'Activity Treatment Units' and 'Planting' layers to use orange color scheme. Updated popup field names and values for clarity. Modified colorMap to use a single orange shade and added grey color.
Introduces specific styling for features with activity treatment properties, distinguishing 'DN' (Disturbance) and non-'DN' activities with unique colors and weights. Also refactors hover and selection logic for consistent highlighting.
Includes ATU_COMPLETION_DATE in the returned properties when querying WHSE_FOREST_VEGETATION.RSLT_ACTIVITY_TREATMENT_SVW, allowing access to treatment completion dates.
Introduced silvicultureStatusCodes and disturbanceStatusCodes constants to provide mappings from status codes to human-readable descriptions for silviculture activities and disturbance types.
Updated formatLocalDate to strip trailing 'Z' from the localDate string before parsing. This ensures correct local time formatting when the input date string includes a 'Z' (UTC indicator).
Enhanced OpeningsMapEntryPopup to display details for WHSE_FOREST_VEGETATION.RSLT_ACTIVITY_TREATMENT_SVW, including silviculture status, area, and end date. Updated MapLayer types to provide relevant properties and adjusted feature styling logic for selected and hovered states.
Adds a message to the map UI when forest cover polygons are selected, improving user feedback for the forest cover map view.
Display contextual messages on the map when activities or disturbances are selected or not selected. Updated styles to support new message types for improved user feedback.
Replaces hardcoded 'DN' with dynamic base code for silviculture activity ID checks in tooltip label and alignment logic, ensuring correct tooltip behavior based on available and selected activities.
…ccordions Tooltip labels for select-all checkboxes now display 'No polygon is available' when no polygons are present, improving user feedback in ActivityAccordion and DisturbanceAccordion components.
…der checkbox Tooltip now displays 'No polygon is available' when there are no available forest cover IDs, improving user feedback for disabled selection state.
Abradat
marked this pull request as ready for review
August 27, 2025 17:38
Abradat
requested review from
carolinemwood,
craigyu and
paulushcgcj
as code owners
August 27, 2025 17:38
Collaborator
Author
|
#1010 changes will also be included in this PR. |
Updated the weights for several MapKindType entries in kindWeightMap from 2 to 3 to ensure consistent prioritization with other layers. This change may affect rendering order or importance in map visualizations.
Eliminates the conditional 'pinned' class and its associated border styling from the map popup. This simplifies the popup appearance and logic.
Replaced regular spaces with non-breaking spaces ( ) between popup labels and their values to improve layout consistency and prevent unwanted line breaks in the OpeningsMapEntryPopup component.
If user selects a polygon and hovers over another polygon, only the hovered polygon would have outline border. By hovering out, the selected polygon will have the outline border.
Test assertions in OpeningsMapEntryPopup.test.tsx now separately check for label and value elements, reflecting changes in the component's rendering of region, district, and year created fields.
Added unit tests to verify rendering of OpeningsMapEntryPopup for various mapKindType values, including forest cover INV, RESERVE, SILV, cut block, and activity treatment. Ensures correct headers and content are displayed for each supported type.
Refines the key prop for OpeningsMapEntry to handle different map modes, ensuring correct rendering when switching between forest cover and activities maps.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements improvements to the activities map feature, adding map visualization capabilities for activities and disturbances on the activities tab of opening details. The changes include filtering and selection functionality for activities/disturbances on the map, visual styling improvements, and enhanced popup information.
- Added map integration with checkbox selection for activities and disturbances
- Implemented visual styling for different polygon types (activities vs disturbances)
- Enhanced map popup information with status code mappings and date formatting
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/types/MapLayer.ts | Updated map styling, popup properties, and feature styling logic for activities |
| frontend/src/components/OpeningsMap/index.tsx | Added activities map functionality with selection state management |
| frontend/src/components/OpeningDetails/OpeningActivities/*.tsx | Added map checkbox selection for activities and disturbances |
| frontend/src/constants/statucCodes.ts | Added status code mappings for silviculture and disturbance codes |
| frontend/src/utils/DateUtils.ts | Fixed date formatting to handle timezone suffixes |
| backend/src/main/java/.../OpenMapsService.java | Added property mapping for activity treatment data |
Comments suppressed due to low confidence (1)
frontend/src/components/OpeningsMapEntry/index.tsx:1
- The useEffect dependency was changed from selectedFeature to hoveredFeature, but the logic inside still references both selectedFeature and hoveredFeature. This could cause the effect to run unnecessarily or miss important updates.
import React, { useEffect, useState, useRef } from "react";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Renamed 'statucCodes.ts' to 'statusCodes.ts' and updated the import in OpeningsMapEntryPopup to use the correct file name.
craigyu
approved these changes
Sep 3, 2025
craigyu
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Approved with 1 small question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change implements the activities tab map improvements.
Fixes #978
Type of change
How Has This Been Tested?
Checklist
Further comments
Thanks for the PR!
Deployments, as required, will be available below:
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: