Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Conversation

alishaevn
Copy link
Contributor

@alishaevn alishaevn commented May 16, 2023

Story

override Hyrax::Statistics::Users::OverTime#point so the dashboard user graph does not break

the version of this method in "hyrax-v3-5-0" returns a hash that the Morris.Bar graph cannot map. this override returns an integer instead. which I believe was the initial intent.

Expected Behavior Before Changes

adding a new user would break the user graph on the admin dashboard. this is because there would now be a user to plot, but the users being returned as data had hashes instead of integers. this messed up the entire graph and it could not be presented.

I added 2 users today and the result can be seen below as the value of relation.where(query).count. the hash contains the user_id as the key, and the number 1 as the value. presumably because there is one user with that id.

example of user hash

Screenshot 2023-05-16 at 9 24 31 AM

Expected Behavior After Changes

we are now returning an integer as the user count, instead of a hash. (calling .size on the relation also returned a hash) this required converting the User::ActiveRelation into an array. we are also using .size instead of .count for performance reasons.

Screenshots / Video

image

alishaevn added 5 commits May 16, 2023 09:45
…not break

the version of this method in "hyrax-v3-5-0" returns a hash that the Morris.Bar graph cannot map. this override returns an integer instead. which I believe was the initial intent.
@alishaevn alishaevn merged commit 3b51ac5 into main May 16, 2023
@alishaevn alishaevn deleted the 411-missing-user-graph branch May 16, 2023 17:46
@alishaevn alishaevn linked an issue Jun 15, 2023 that may be closed by this pull request
1 task
alishaevn added a commit to samvera/hyrax that referenced this pull request Jun 15, 2023
…t break.

the previous version of this method returned a hash that the Morris.Bar graph cannot map. this change returns an integer instead. which I believe was the initial intent.

contributing from: notch8/palni-palci#473
orangewolf pushed a commit to samvera/hyrax that referenced this pull request Jun 30, 2023
…t break. (#6092)

the previous version of this method returned a hash that the Morris.Bar graph cannot map. this change returns an integer instead. which I believe was the initial intent.

contributing from: notch8/palni-palci#473
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analytics - User graph missing
4 participants