molgenis / molgenis-emx2

MOLGENIS EMX2, the latest version of the MOLGENIS data platform.
GNU Lesser General Public License v3.0
13 stars 16 forks source link

fix(directory): filter label is applied twice #3676

Open chinook25 opened 3 months ago

chinook25 commented 3 months ago

What version of EMX2 are you using (see footer) v10.61.x

Describe the bug "Because you searched for" label is applied twice. First before and again after loading the filtered data.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://emx2.test.molgenis.org'
  2. Go to a directory demo
  3. select a filter
  4. see the label begin applied
  5. loading spinner appears
  6. filtered data appears with the labels

Expected behavior Labels are not applied before the data is filtered.

Additional context Suggest to fix this after changing the filter store to apply filter locally. This issue is caused by the fact that the directory app uses a lot of watches and computeds to tracks changes in the data. It would be nice to just addorn this info onto the biobanks/collections when filtering or if the filterstore is unchanged make it part of the retrieval functions.

konstantina-gkp commented 3 months ago

I cannot reproduce this issue. The "Because you searched for: " label is visible only in the biobank cards, after the data has been filtered. Can someone else check whether this issue still persists?

chinook25 commented 3 months ago

Can still see it if you select Material type -> Buffy Coat. Also notice the Collections available changing into Collections found before the reload.

dtroelofsprins commented 3 months ago

I can also reproduce, but it seems indeed only the Material Types filter.

chinook25 commented 3 months ago

I can also reproduce, but it seems indeed only the Material Types filter.

It does happen with all of them though, but it just happens very fast, so it's hard to tell :) The issue here is that Vue uses watchers on the relevant data here, which triggers too often. Fixing this would require us to rethink which data is watched or consider removing the watches in favour of triggering the code of the watcher manually (which would be my preverence). I do think this issue is not a huge priority though. It doesn't break anything, it's just ugly and more complex than it should be.