hajicj / rhythmify_frontend

0 stars 1 forks source link

Dashboard is not working #25

Closed kszabova closed 2 years ago

hajicj commented 2 years ago

Related to insufficient app initialization -- it is possible to access the dashboard before any chants have been loaded from the back-end. Currently, the call to ChantService.loadData() is only triggered by the data source selection component, which initializes its checked and unchecked checkboxes from local storage during its ngOnInit() and upon loading them from local storage, the SelectedDataSourceList emits an event that ChantService.loadData() is observing through combineLatest().

This means that if we were to change the default visibility of the data source selection component, this first load would not happen, and the app would not be initialized properly. This will be handled in #26.

This particular issue was resolved by changing the behavior of ChantService.loadData() to POST null instead of empty lists to office and genre filters by default if they are not provided from the filterSettingsService, and changing the corresponding back-end function in views.py to not apply office and genre filters if they are set to None. This creates and handles the initial loadData() request properly even when the first page you go to after app initialization is not the landing page that initializes the filter settings component.