You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the startup process consists of many setup processes including the initialization of the app config, the setup of the database, the creation of routes and the navigation links. Working towards having a single application which serves any customer and only loads data from a different database, this initial setup needs to be adjusted.
When the website is opened for the first time on a device, only the _user DB should be available to check whether the user has valid login credentials. The AppConfig needs to be available because it holds the link to the database.
When the user successfully logs in for the first time, the correct database can be fetched. This allows to retrieve the configuration of the application together with all the other entities. At this point the app should wait until the configuration was loaded from the database. After this is done, the router and the navigation can be set up.
For further logins from the same device, the login process can also work against the local database and all the steps that need the configuration from the database can already run before the user is logged in.
Steps to do:
Evaluate which services need to be available for the initial login process
Make sure the session only uses the _user DB for the initial login
Provide a hook which executes asynchronous tasks that have to be run after the user successfully logged in for the first time but before the application can be used (load config, init routing, init navigationbar, ...)
Add the config and all dependent services to the previously implemented hook
If the local DB is already present, the previously described tasks can already run before the user is logged in, but they still need to be finished before the application is ready to use
this.router.navigate([], { relativeTo: this.activatedRoute }); needs to be called once in the startup process after routes are initialized from the config
The config currently always emits the defaulConfig on startup (config is a BehaviorSubject) this should be changed to the defaultConfig being provided through a demo data generator service to not interfere with the production mode
Maybe adjust the config service so it only emits new values when the new config actually differs to prevent unnecessary reloads/initializations
create a clear concept of runtime dependencies (e.g. login -> load config -> init routes -> apply new routes) to cleanup app component and make the dependencies more visible.
Currently, the startup process consists of many setup processes including the initialization of the app config, the setup of the database, the creation of routes and the navigation links. Working towards having a single application which serves any customer and only loads data from a different database, this initial setup needs to be adjusted.
When the website is opened for the first time on a device, only the
_user
DB should be available to check whether the user has valid login credentials. TheAppConfig
needs to be available because it holds the link to the database.When the user successfully logs in for the first time, the correct database can be fetched. This allows to retrieve the configuration of the application together with all the other entities. At this point the app should wait until the configuration was loaded from the database. After this is done, the router and the navigation can be set up.
For further logins from the same device, the login process can also work against the local database and all the steps that need the configuration from the database can already run before the user is logged in.
Steps to do:
_user
DB for the initial loginCleanup from PR #594
The text was updated successfully, but these errors were encountered: