jariarkko / psgeo

Activity location library
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Production environment settings are contained within the program code. Separation is needed. #269

Closed ralfstrandell closed 1 year ago

ralfstrandell commented 1 year ago

The domain defaults should be stored in a separate place (and not all distributed to everyone). Hence: psgeosettings.js: PsgeoSettings() returns an object with one method: initDomain. initDomain(host,path) will return domain default settings.

ralfstrandell commented 1 year ago

This has been completed for domain defaults. Will tackle other settings (where appropriate) next.

ralfstrandell commented 1 year ago

I plan to develop a psgeoGlobalDefaults object to continue the speration of settings from code. Once we have this done, the next step might be to store settings alone in JSON.

ralfstrandell commented 1 year ago

psgeoSources moved.

ralfstrandell commented 1 year ago

psgeoDomainDefaults, psgeoSources, psgeoRange (range filter settings), Finnish topographic map API key etc. all moved from code to settings. Well not strictly speaking, as they reside in psgeosettings.js now, but these would go to a JSON file in /cfg in the next phase.

Subtype groups and stat lines might also benefit from a life in /cfg

ralfstrandell commented 1 year ago

Subtype groups and stat lines moved to psgeotables.js as recommend by lead developer.

ralfstrandell commented 1 year ago

Domain Default values (a.k.a customizable settings) are now stored in cfg/psgeoDomainDefaults.json and retrieved (async functions) with await fetch in psgeoInit. Due to the nature of Settings, we really must wait for them to load before proceeding. Not supported: IE (it's 2023!) and Opera Mini (can't do anything with that size screen anyway).

ralfstrandell commented 1 year ago

This concludes separation of settings from program code.