Closed frksteenhoff closed 5 years ago
Good suggestion.
for point 1: good.
for point 2: we are going to make this change only at a specific kb version (e.g. version: 2.0), and only in case the "user_info" key does not exist in the localStorage.
Therefore here I suggest that we create a conversion function that creates the "user_info" associative array, copies the values in the respective fields.
the app_config field gets updated as currently implemented for the 'legacy' knowledgebase the user_info field gets created only once and updated on respective user actions.
We will proceed with this after our oncoming update.
Branch dev_heste_kb_segmentation
(based on current master) created to implement a first version of the new implementation, not started yet.
Implemented and discussed in #114 with updates in #115, now closing.
Some parts of the data stored in local storage should only be allowed to be updated by the user and not change as a result of an update. This way we can persist the user's own data so that they don't need to input anything previously provided. As a result we need to segment the knowledgebase.
I propose two solutions
1. creating two "knowledgebases" separating app configuration and screen text from user information.
In the description the knowledgebases are named:
kb_userInfo
(only crucial user values)kb_config
(knowledgebase -- text and configurations)All in
kb_config
can/will be overwritten on update, all inkb_userInfo
will remain the same or be updated without overwrite.Content/values to persist in
kb_userInfo
:user_info.isFirstLogin
user_info.introductionCompleted
user_info.hasExternalDBRecord
user_info.receivesNotifications
settings.age.value
settings.height.value
settings.weight.value
(new array with parts ofuser_info
)settings.gender.value
settings.unit.value
settings.acclimatization
settings.explore.*
activity.selected
user_info.level
(beginner/advanced/expert) not implementedthermalindices.*
(added 01-05-2019) emptied on new calculation, no need to persistAll else go in
kb_config
, which we can update as we please without interfering with the individual user values.Possible complexities
2. Copying current contents of user's knowledgebase into the new version of knowledgebase when updating
Pseudo code:
Basically merging the new and old version of the knowledgebases (if that is possible in javascript). This makes sure that wee keep all user information while also getting the new.
Something like this procedure: https://stackoverflow.com/questions/43306832/javascript-merging-two-multidimensional-arrays-with-common-matching-elements (except we want a set join)
Possible complexities