terriajs icon indicating copy to clipboard operation
terriajs copied to clipboard

Config traits

Open zoran995 opened this issue 3 years ago • 2 comments

What this PR does

Fixes # TerriaMap PR: https://github.com/TerriaJS/TerriaMap/pull/557

Update TerriaJS config parameters to use traits system. Some of the parameters are renamed

  • showWelcomeMessage and welcomeMessageVideo are now parameters on object welcomeMessage as show and video
  • helpContent is now helpItems
  • helpContentTerms are now helpTerms (they are not strictly related to helpContent)
  • feedbackPreamble and feedbackMinLength are now parameters on object feedback as preamble and minLength
  • brandBarElements, brandBarSmallElements, displayOneBrand are now parameters on object brandBar as elements, smallElements, displayOneBrand
  • googleUrlShortenerKey is deprecated long time ago but still left as a config parameter
  • disclaimer is not used anywhere so I added it to deprecated list
  • globalDisclaimer is also not used anywhere - not sure if IT should be marked as deprecated as it is set from TerriaMap?

TODO

  • [x] Check if some conditions depend only on the existence of specific configParameter in case when it is not primitiveTrait, objectTrait will always be defined and that condition should be updated
  • [x] Convert deprecated options to the new ones - edit: added basic conversion, as I don't see that we really need anything on model level for now
  • [ ] Documentation should generate automatically (as for catalog items) - Best to do this as a separate PR
  • [ ] Introduce required option for trait system (at least for configuration if not doable for generic) - Probably best to do this as a separate PR (maybe target this one at first if this is not merged before)

p.s. this was much easier than initially expected

Checklist

  • ~[ ] There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)~ - All existing test pass
  • [x] I've updated relevant documentation in doc/.
  • [x] I've updated CHANGES.md with what I changed.

zoran995 avatar Oct 17 '21 10:10 zoran995

This is ready for review, added a basic conversion so no breaking changes are introduced in patch or minor version.

zoran995 avatar Oct 25 '21 22:10 zoran995

did another pass over this, also tried loading prod map-configs from https://github.com/TerriaJS/saas-catalogs-public, and no issue is raised to the user so I am pretty much confident that this can go without having to update the configs right away

zoran995 avatar Nov 23 '21 02:11 zoran995