Skip to content

Allow the creation of custom themes

Guillaume Remy requested to merge remyguillaume/gg-viewer:custom-theme into main

Description

For more customization for the user, this Merge-Request adds the possiblity to create custom themes from the current layertree configuration. To realize some parts of this merge-request, I needed a little refactoring, which ended up as a big refactoring.
This merge-request contains therefore a few central modifications described in the following part.

Job done

  • Add button in the themes component to create new theme. Adapt the styling in consequence.
  • Simplify the themes component with a better usage of uHtml and events.
  • Save the custom themes to the local storage, so that they will be reloaded when refreshing/refloading the application
  • Add a clone() method to all the layers classes to be able to clone the layers (this allow different configurations for layers in different themes)
  • Refactor layers objects for more clarity.
    This had a big impact in the core of the application, on some components and on unitests. But I think it's more clear now.
    That's the jod done for this:
    • Make Layer class abstract
    • Create a LayerError class
    • Create a special type (independant of the GMF themes.json format) for all layer type containing all the allowed options.
    • Create a ServerOgc class and use it in LayerWms andd LayerWmts and in the state.
    • Standardization of the constructors : minimum mandatory are id, name and order.
      The other mandatory attributes are passed in parameters.
      The optional ones in the options param.
  • Small bugfix for transparency configuration when a layer is swiped

Comments for review

@ger-benjamin I had to modify some parts of the print component and the associated Unitests. It will be great if you could make a small review of my changes and to check if the modifications I've made in the print component are ok for you, thanks!
@D0lpic I'l be happy if you could also have a look at this, thanks!

Definition of Done

For the Developer:

  • Code compiles and conforms to defined coding standards (eslint, tsc, prettier).
  • If necessary (at the developer's discretion), unit tests have been added for critical parts.
  • All unittests run without error.
  • Sonar-Scan returns no new issues or security hotspots.
  • Documentation has been updated where necessary (see documentation repository).
  • Merge-Request contains a few explanations of what was done.
  • A Reviewer has been assigned to the Merge-Request.

For the Reviewer:

  • New code was reviewed.
  • If comments could be added on unclear code, the developer has been informed.
  • If unitests could be added in certain places, the developer has been informed.
  • Merge-Request was merged on main branch.
  • All pipelines work.
  • The bugfix was tested on demo environment.
  • Application performance has not been degraded by the modifications.
Edited by Guillaume Remy

Merge request reports