Skip to content

Map Editor in Portals - Part 1 - Model/View cleanup - #2893

Open
robyngit wants to merge 4 commits into
developfrom
feature-1995-map-editor-part1
Open

robyngit wants to merge 4 commits into
developfrom
feature-1995-map-editor-part1

Conversation

@robyngit

@robyngit robyngit commented Sep 3, 2026

Copy link
Copy Markdown
Member

This is part 1 of feature #1995, adding a map editor in the portal editor.

Part 1 cleans up the five of the models and views that will be modified while working on this feature:

PortalModel.js
PortalVizSectionModel.js
PortEditorMdSectionView.js
PortEditorSectionView.js
PortEditorSectionsView.js

Clean up includes fixing all eslint errors, adding some basic tests, adding and fixing jsdocs, replacing underscore methods with native JS methods, removing unused dependencies, and ensuring the views return the view itself from the render methods to be consistent with the rest of MetacatUI.

- On views/models that we'll touch when adding the map editor page

Issue #1995
- On views/models that we'll touch when adding the map editor page
- Fixing the linting errors also fixed some minor behavioural issues:
  - Prevent the random image counter in PortalModel from leaking globally and handle an empty configured image list
  - Bind the parent parser to the viz model, preventing sections with images from throwing errors because of the wrong this context
  - Report the caught error instead of referencing undefined variable in PortEditorMdSectionView
  - Actually emit the intended label input diagnostic in PortEditorSectionsView

Issue #1995
- Test the views and models that will be modified in #1995 (map editor)
- Test the following:
  - Existing Cesium map settings survive when the page is renamed
  - A Cesium map page can be added and removed from a portal model
  - Freeform and Cesium pages both survive saving and reloading
  - Removing a Cesium page does not remove or alter a freeform page
  - Adding a freeform page creates and selects the correct editor view
  - Removing a freeform page removes both its model and editor view
  - Clicking inside the enabled freeform option selects the freeform page type
  - Clicking the disabled metrics option does nothing
  - A Cesium page uses the visualization view and renders its map only

Issue #1995
- In views/models that will be edited to make the map editor:
  - Ensure views return this from render method for consistency with other views
  - Fix existing JSdocs, add missing JSDoc
  - Replace Underscore methods with native methods where possible
  - Remove unused dependencies and duplicate/dead code

Issue #1995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant