Changes approach for setting the required tabs from URL parameters #358
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is in response to: sfb1451/metadata-catalog#33, which exists as a result of a regression introduced in d25dcd2
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 whencreated()
ormounted()
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.