[DURACOM-339] fix downloads not working when matomo is disabled#4125
[DURACOM-339] fix downloads not working when matomo is disabled#4125tdonohue merged 1 commit intoDSpace:mainfrom
Conversation
|
@AndreaBarbasso : Thanks for this early PR. I wanted to note that I gave it a quick code review and test today. The code looks good. I've also verified the following:
One brainstorm about avoiding the matomo.js download. Is there any way to "lazy load" matomo only when it's needed? I know we do that with Orejime (and Klaro in 7.x/8.x) here: https://github.com/DSpace/dspace-angular/blob/main/src/app/shared/cookies/browser-orejime.service.ts#L70-L79 I'm not sure if there's a way to just avoid importing Matomo altogether when it's disabled? (I honestly haven't looked into it closely, but I wanted to call mention this in case it helps stimulate other ideas.) |
|
@AndreaBarbasso : One last thing to note. If you find that the bug related to downloading
That's perfectly OK if we have to go that route. Mostly, we just must fix the severe error with downloading files before the Testathon. The issues with matomo.js downloading can always be fixed up during Testathon if we need more time. |
|
@tdonohue, matomo is already lazy loaded with the I'm opening this PR - thanks for your help! |
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @AndreaBarbasso ! This looks good to me then and fixes the severe bug. I'll move the other issue to a separate ticket & assign it to you to work on during Testathon.
|
Other issue was moved to #4128 |
References
Description
Fixed the bug where downloads were not working when matomo is disabled.
Instructions for Reviewers
I inserted a check for the
matomo.enabledconfiguration setting before using thematomoServiceto add thevisitorId(that's where the download was failing).List of changes in this PR:
matomo.enabledinBitstreamDownloadPageComponentto avoid calling amatomoServicemethod is matomo is disabled;Include guidance for how to test or review your PR.
You can easily check that any download now starts when matomo is disabled, and still works when matomo is enabled.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.