Skip to content

Map Editor in Portals - Part 2 - Add/Remove Map page in Portal Editor - #2894

Merged
robyngit merged 10 commits into
developfrom
feature-1995-map-editor-part2
Sep 29, 2026
Merged

robyngit merged 10 commits into
developfrom
feature-1995-map-editor-part2

Conversation

@robyngit

@robyngit robyngit commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

This PR adds support for adding, renaming, and removing Cesium map pages in the Portal Editor, along with the model and view setup needed for future map editing.

  • Add basic MapEditorView that lists the map's layers
  • Use PortalOption to parse, validate, and serialize portal <options> elements
  • Add the pathway for serializing the current Map config into the appropriate Portal <option>. At this stage, it just returns the original unchanged map configuration (the same behaviour before this updated)
  • Add tests for section editing, option handling, and XML round trips

Part of #1995

@robyngit
robyngit force-pushed the feature-1995-map-editor-part2 branch 3 times, most recently from 00abd6e to 617c68d Compare September 22, 2026 19:32
@robyngit
robyngit force-pushed the feature-1995-map-editor-part2 branch 3 times, most recently from 348a95f to 484f0c1 Compare September 23, 2026 15:20
@robyngit
robyngit marked this pull request as ready for review September 23, 2026 17:18
@robyngit
robyngit requested a review from DarianGill September 23, 2026 17:18
@robyngit
robyngit force-pushed the feature-1995-map-editor-part2 branch from 1682383 to 0ea1b54 Compare September 24, 2026 22:31
Base automatically changed from feature-1995-map-editor-part1 to develop September 24, 2026 22:34
@robyngit
robyngit force-pushed the feature-1995-map-editor-part2 branch 2 times, most recently from d69b3e0 to 68507e8 Compare September 24, 2026 22:37

@DarianGill DarianGill left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks like a solid foundation to me! I noted a few minor things below, but am not sure if you just intend to get to them in a future part, so am approving now so as to keep you unblocked.

I can confirm all 3027 tests pass locally for me and I was able to make a portal with a map page that I could rename. As I was making that portal, I expected the new map page to automatically open the rename input (as new freeform pages do). Is there a reason you chose not to implement that behavior? I think it'd be nice for consistency and because I doubt anyone wants their map to be "Untitled." 😁

Also, npm run format changes line 588 in XMLUtilities.spec.js.

Comment thread src/js/views/portals/editor/PortEditorMapSectionView.js Outdated
Comment thread src/js/models/portals/PortalVizSectionModel.js Outdated
Comment thread src/js/views/portals/editor/PortEditorSectionView.js Outdated
- Allow adding and removing Cesium map pages in the portal editor
- Serialize new visualization sections with required labels and type metadata
- Add a skeleton PortEditorMapSectionView
- Add model and editor tests plus Cesium section SVG

Issue #1995
- Give Cesium visualization section its own map model
- Add a skeleton MapEditorView to render map editor UI (independent from portals)
- Render map layers list as initial test
- Test map model creation and editor ownership

Issue #1995
- PortalOption handles parsing, updating DOM, and validation
- Add cData function to XML utils
- Add corresponding unit tests

Issue #1995
- In PortalModel, parse options using the new model and its methods
- Add pathway to serialize mapConfig (though currently it just returns the incoming config unchanged)
- Add tests

Issue #1995
- Fix the map container class and remove extra markup
- Add basic styles and clarify that maps are not yet editable

Issue #1995
@robyngit
robyngit force-pushed the feature-1995-map-editor-part2 branch from 68507e8 to 9544f1c Compare September 29, 2026 13:35
- Catch invalid map JSON when loading the portal
- Show an error when the map JSON is invalid
- Prevent replacing the original config with an empty config when the map JSON is invalid

Issue #1995
- When mapConfig JSON is invalid, show error on map editor section rather than preventing edits to the entire portal
- Include tests for new error handling

Issue #1995
- Use a single listener to handle both Freeform and map availability updates

Issue #1995
- Autofocus the tab name field when adding a new map page
- Don't assign the PortEditorSectionView class to PortEditorMapSectionView
- Use BASE_CLASS constant for CSS class names in PortEditorMapSectionView
- Format the XML Utilities test file

Issue #1995
@robyngit

Copy link
Copy Markdown
Member Author

Made all your suggested changes @DarianGill ! Thanks for a very thoughtful review

@robyngit
robyngit merged commit 3207654 into develop Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants