cycleplanet / cycle-planet

Official Cycle Planet repo, an open source and non-profit network of long distance cyclers and those who want to host them.
https://cycleplanet.org/
MIT License
10 stars 4 forks source link

allCountries issue #15

Closed bidsinga closed 2 years ago

bidsinga commented 2 years ago

The allCountries used to store all Country_data, but now got replaced by just the array of country names. In a few files allCountries is still being used, probably breaking code. Those items have to be replaced, preferably by smart portions of code that only load the required data, and not the entire Country_data. The allCountriesis created in store-countries.js in the getters. It's then passed into mixin-general.js, making it available to all files who import mixin-general.

bidsinga commented 2 years ago

Some of the allCountries errors have been fixed. In the mixin-general.js there arre now 2 computed properties that can find the location based on the countrycode or countrykey. See below.

countryKeys(){ return Object.keys(this.countryCodes_rev) }, countryCodes(){ return Object.values(this.countryCodes_rev) },

Some other errors were quite difficult to transform, so I've been replacing them with a new property called allCountryData, which uses the same method but is a slight improvement ,see https://github.com/cycleplanet/cycle-planet/pull/14/commits/c9256216e1cf5d9074b06365463a95bedefab318. It would be good to have allCountryData replaced as well, as we now have to load all Country_Data still.