-
Notifications
You must be signed in to change notification settings - Fork 6
HTM-1538: Removed toolbar state, use toolmanager for state #1066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
projects/core/src/lib/components/feature-info/feature-info/feature-info.component.ts
Fixed
Show fixed
Hide fixed
...ts/core/src/lib/components/feature-info/feature-info-dialog/feature-info-dialog.component.ts
Fixed
Show fixed
Hide fixed
Test Results 1 files ± 0 214 suites - 1 8m 47s ⏱️ +10s Results for commit 98b4f7a. ± Comparison against base commit 328e55f. This pull request removes 5 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the toolbar state management system by removing the dedicated NgRx toolbar state and instead using the ToolManager for tracking tool activation status. The main architectural change involves adding an owner property to tools to identify which component owns them, and providing new observable streams and methods on MapService to check tool status.
Key Changes:
- Replaced toolbar NgRx state (actions, selectors, reducer, effects) with ToolManager-based state management
- Added
ownerproperty toToolConfigModelto track tool ownership by component - Introduced
getToolStatusChanged$()andsomeToolsEnabled$()methods on MapService - Migrated all toolbar components to use MapService methods instead of NgRx actions/selectors
- Updated components to use Angular signals where appropriate
Reviewed Changes
Copilot reviewed 47 out of 49 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/map/src/lib/openlayers-map/open-layers-tool-manager.ts | Enhanced to store tool owner information and emit status changes via observable; added debug logging capabilities |
| projects/map/src/lib/models/tools/tool-config.model.ts | Added required owner property to track which component owns a tool |
| projects/map/src/lib/models/tools-status.model.ts | New model defining tool status structure with owner information |
| projects/map/src/lib/models/tool-manager.model.ts | Updated interface to make toolId optional and renamed method to getToolStatusChanged$ |
| projects/map/src/lib/map-service/map.service.ts | Added new methods for tool status management: getToolStatusChanged$, someToolsEnabled$, enableTool, disableTool |
| projects/core/src/lib/test-helpers/map-service.mock.spec.ts | Added createMapServiceMockWithDrawingTools helper and updated mock to include new MapService methods |
| projects/core/src/lib/map/services/drawing.service.ts | Updated to use new getToolStatusChanged$ method and added owner to tool configurations |
| projects/core/src/lib/map/index.ts | Removed export of deleted MapDrawingButtonsComponent |
| projects/core/src/lib/map/application-map.module.ts | Removed MapDrawingButtonsComponent from module declarations |
| projects/core/src/lib/components/toolbar/toolbar.module.ts | Removed toolbar state imports (StoreModule, EffectsModule, reducer, effects) |
| projects/core/src/lib/components/toolbar/switch3d/switch3d.component.ts | Migrated from toolbar selectors to use MapService.someToolsEnabled$ |
| projects/core/src/lib/components/toolbar/switch3d/switch3d.component.spec.ts | Updated test to remove toolbar selector dependencies |
| projects/core/src/lib/components/toolbar/streetview/streetview.component.ts | Migrated to MapService and Angular signals; removed toolbar state dependencies |
| projects/core/src/lib/components/toolbar/streetview/streetview.component.spec.ts | Updated test to remove toolbar state mock setup |
| projects/core/src/lib/components/toolbar/streetview/streetview.component.html | Updated to use signal-based template syntax |
| projects/core/src/lib/components/toolbar/state/* | Deleted all toolbar state files (state, selectors, reducer, effects, actions) |
| projects/core/src/lib/components/toolbar/models/* | Deleted ToolbarToolModel and ToolbarComponentEnum |
| projects/core/src/lib/components/toolbar/measure/measure.component.ts | Migrated to MapService and signals; removed toolbar state dependencies |
| projects/core/src/lib/components/toolbar/measure/measure.component.spec.ts | Updated test to remove toolbar selector dependencies |
| projects/core/src/lib/components/toolbar/measure/measure.component.html | Updated to use signal-based template syntax |
| projects/core/src/lib/components/toolbar/coordinate-link-window/coordinate-link-window.component.ts | Migrated to MapService with signals |
| projects/core/src/lib/components/toolbar/coordinate-link-window/coordinate-link-window.component.spec.ts | Updated test to remove toolbar state dependencies |
| projects/core/src/lib/components/toolbar/coordinate-link-window/coordinate-link-window.component.html | Updated to use signal-based template syntax |
| projects/core/src/lib/components/toolbar/clicked-coordinates/clicked-coordinates.component.ts | Migrated to MapService and signals |
| projects/core/src/lib/components/toolbar/clicked-coordinates/clicked-coordinates.component.spec.ts | Updated test to remove toolbar state dependencies |
| projects/core/src/lib/components/toolbar/clicked-coordinates/clicked-coordinates.component.html | Updated to use signal-based template syntax |
| projects/core/src/lib/components/toolbar/scale-bar/scale-bar.component.ts | Added owner property to tool configuration |
| projects/core/src/lib/components/toolbar/mouse-coordinates/mouse-coordinates.component.ts | Added owner property to tool configuration |
| projects/core/src/lib/components/filter/spatial-filter-form-draw-geometries/map-drawing-buttons/* | Moved MapDrawingButtonsComponent to filter module with updated imports |
| projects/core/src/lib/components/filter/filter-component.module.ts | Added MapDrawingButtonsComponent to declarations |
| projects/core/src/lib/components/feature-info/feature-info/feature-info.component.ts | Updated to use MapService and added tool activation logic based on dialog visibility |
| projects/core/src/lib/components/feature-info/feature-info/feature-info.component.spec.ts | Updated test to remove toolbar state dependencies |
| projects/core/src/lib/components/feature-info/feature-info-dialog/feature-info-dialog.component.ts | Added distinctUntilChanged import |
| projects/core/src/lib/components/edit/state/edit.effects.ts | Removed toolbar-related effect |
| projects/core/src/lib/components/edit/services/edit-map-tool.service.ts | Removed toolbar state dependencies and added owner property to tools |
| projects/core/src/lib/components/edit/edit/edit.component.ts | Added subscription to tool status and removed toolbar action dispatches |
| projects/core/src/lib/components/edit/edit-dialog/edit-dialog.component.ts | Removed toolbar action dispatches |
| projects/core/src/lib/components/drawing/drawing/drawing.component.spec.ts | Updated to use new test helper for drawing tools |
projects/core/src/lib/components/toolbar/switch3d/switch3d.component.ts
Outdated
Show resolved
Hide resolved
projects/map/src/lib/openlayers-map/open-layers-tool-manager.ts
Outdated
Show resolved
Hide resolved
projects/core/src/lib/components/feature-info/feature-info/feature-info.component.ts
Outdated
Show resolved
Hide resolved
projects/core/src/lib/components/feature-info/feature-info/feature-info.component.ts
Outdated
Show resolved
Hide resolved
...ts/core/src/lib/components/feature-info/feature-info-dialog/feature-info-dialog.component.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 46 out of 48 changed files in this pull request and generated 4 comments.
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Uh oh!
There was an error while loading. Please reload this page.