Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage dashboard - bar chart click function broken #3443

Open
gjacob24 opened this issue Jul 31, 2024 · 1 comment
Open

Usage dashboard - bar chart click function broken #3443

gjacob24 opened this issue Jul 31, 2024 · 1 comment

Comments

@gjacob24
Copy link
Contributor

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
v4.1.1

Expected behaviour:
If a user clicks on one of the bars in the chart graph representing 'No. of users joined during last year' or 'No. plans during last year', it should take them to the list of users/plans created in that month

Actual behaviour:
The following error is thrown when you click on a bar in the abovementioned charts:
Uncaught TypeError: chart.getElementAtEvent is not a function

Steps to reproduce:
Note: this requires admin permissions
Admin menu > Usage
Click on 'Statistics on your Users'
Click on a bar in the chart titled 'No. of users joined during last year' or 'No. of plans during last year'

@gjacob24
Copy link
Contributor Author

This issue was reported by one of the DMPonline users. I have created a PR with a fix (#3444).

Problem and proposed solution - after chart.js was upgraded to version 3, the function getElementAtEvent was replaced by getElementsAtEventForMode but this change was not reflected in the code. Once this change is made in app/javascript/src/usage/index.js, it works as expected.

Note: do not test this with super admin permissions because it does not filter the plans properly because the org is not passed in the query. Test only with admin account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant