umap icon indicating copy to clipboard operation
umap copied to clipboard

refactor: Separate ui rendering from data updates

Open almet opened this issue 1 year ago • 0 comments

U.SCHEMA now contains an impacts key, which makes it possible to specify what part of the UI is impacted by data changes.

A new render method has been added on U.Map and U.DataLayer, which is used to rerender the proper parts of the UI depending on the passed properties.

U.FormBuilder calls this render() method (if present), during form changes.

[!Note] This approach is less specific than a previous one in order to a) not tie the schema to specific callbacks and b) not repeat properties in two different places.

The resulting code is less conservative when considering which parts of the UI are updated when receiving updates, thus rerendering parts of the UI which might not be in need of rerender. The hope is that it won't be a problem, but let's keep our eyes open.

Todo

  • [x] Sort schema keys
  • [x] Add all UI impacts on schema keys
  • [x] Update FormBuilder instanciations to remove callbacks when possible
  • [x] Ensure the tests pass
  • [x] ChoroplethLayer.onEdit is expecting to be passed the builder
  • [x] Use impacts = [] everywhere (remove [''] occurrences)
  • [ ] Make the JS unit and functional tests pass

almet avatar Mar 15 '24 14:03 almet