datalad / datalad-catalog

Create a user-friendly data catalog from structured metadata
https://datalad-catalog.netlify.app
MIT License
14 stars 12 forks source link

Changes approach for setting the required tabs from URL parameters #358

Closed jsheunis closed 9 months ago

jsheunis commented 9 months ago

This PR is in response to: https://github.com/psychoinformatics-de/sfb1451-projects-catalog/issues/33, which exists as a result of a regression introduced in https://github.com/datalad/datalad-catalog/pull/350/commits/d25dcd24e721dfad155b66e6031daa1c0b7abcee

This issue has in the past resulted in erratic tab selection, and it relates to a number of previous issues:

The new update discards the use of $refs for finding available tabs because of an issue with asynchronous loading of $root, the dataset component and its subcomponents, and $refs. It can happen that $refs might or might not be defined at the time when created() or mounted() is called in the vue app life cycle. For a more useful description, see https://stackoverflow.com/questions/54355375/vue-js-refs-are-undefined-even-though-this-refs-shows-theyre-there.

Instead, the new method determines the available tabs from the root component data, and accesses this list both on 'created()' and on 'beforeRouteUpdate()' in order to check the provided URL parameter against this list.

codecov-commenter commented 9 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (d25dcd2) 86.19% compared to head (625afc2) 86.19%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #358 +/- ## ======================================= Coverage 86.19% 86.19% ======================================= Files 43 43 Lines 2709 2709 ======================================= Hits 2335 2335 Misses 374 374 ``` | [Flag](https://app.codecov.io/gh/datalad/datalad-catalog/pull/358/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/datalad/datalad-catalog/pull/358/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | `79.07% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jsheunis commented 9 months ago

A sneaky but very small addition to the PR is: 922fc67d6217c635e627a49e8978679c459b629e

In response to: https://github.com/psychoinformatics-de/sfb1451-projects-catalog/issues/31