IQSS / dataverse-metrics

Aggregate and visualize metrics for installations of Dataverse around the world
https://dataverse.org/metrics
Apache License 2.0
8 stars 9 forks source link

Wrong links in tree selection when two or more levels deep #81

Closed PaulBoon closed 1 year ago

PaulBoon commented 1 year ago

When viewing the 'local' metrics and there are several levels nested dataverses (collections) the links are wrong when more then one level deep. When selecting the link (when already one level deep) the resulting page is not showing the expected result, instead the 'parentAlias' URL parameter seems to be appended more than once.

Susspected code is in installationplots.js The updateNames function does: node.name = "<a href='" + window.location + "?parentAlias=" + node.alias + "'>" + node.alias + "</a>"; Possible solution is to replace window.location with window.location.href.split("?")[0]

qqmyers commented 1 year ago

Seems like a reasonable fix. It looks like the error is whenever moving from one collection to another, i.e. whenever parentAlias is a param (is that only when going to a deeper collection due to how the tree widget works?) In any case. I think a PR for this makes sense.

PaulBoon commented 1 year ago

@qqmyers, @pdurbin Maybe it would be a good time to merge/close PRs and make a new release?

pdurbin commented 1 year ago

@PaulBoon fine by me but the code in this repo was pretty heavily rewritten by @qqmyers so I'll defer to him. It's good to know people are using it! https://dataverse.org/metrics is still running the older version of the code. (I assume you're using the "single installation" flavor rather than aggregating across installations.) Thanks for the pull request!

qqmyers commented 1 year ago

Closed by #82