cessda / cessda.cvs.two

Apache License 2.0
0 stars 2 forks source link

Filter over languages doesn't work very well in Home and Editor #786

Closed pakoselo closed 7 months ago

pakoselo commented 8 months ago

Steps to reproduce:

  1. Click on languages list and select any language. System filters vocabularies translated to this language, also if there is vocabulary with source language as well. (Step 1. can be repeated several times for different languages - everything work as expected)
  2. Click on any vocabulary.
  3. Return to home.
  4. Try to filter languages. Doesn't work. System still shows only English results. (Step 4. can be repeated several times for different languages - doesn't work as expected). Unless user hits F5 or any other refresh button in browser, everything starts working again. It also starts working if user clicks on vocabuylary and return back, the filter will be active again.

related to #809

Stifo commented 8 months ago

also, when clicking on 'Home' instead of step 2) the search language changes to English while the search results are left intact. either the language should not change to english or the results should be updated for english. i suggest to keep the selection of actual search language.

Stifo commented 8 months ago

had a look at the problem trying to trace the cause. the root of the problem is that there's a search invoked two times, while correct results from the first search are replaced by results of the second search. the second search ommits selected language, therefore it always shows the same results regardless of the selected language.

i have not yet figured out, what executes the second search. it looks like it's invoked implicitly by the framework. there's a new instance of the navbar component initialized with default attributes, which are used in the second search. initialization of the new navbar is an initiator of the second search, but the reason for initializing navbar second time is unknown. there's a lot of async calls flying around, which makes it hard to figure out.