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

Show active members in the Organization Admin #704

Merged
merged 13 commits into from
Jul 5, 2023

Conversation

faebebin
Copy link
Member

@faebebin faebebin commented Jun 27, 2023

Shows the active members, that have created a Job or a Delta for the Organization during the running stripe billing period in the admin.

The list of users in the detail view
image
(if no active members)
image

Dropped the active members count in the list_view - it would slow down too much:
It adds 4 Queries per organization. Without it is 6 Queries in total.

now:
image

before:
image

@duke-nyuki
Copy link
Collaborator

@faebebin faebebin force-pushed the QF-2604_org_active_users_detail_admin branch from 2624772 to 0887edf Compare June 27, 2023 08:05
@faebebin faebebin changed the title [WIP] Show a list of the active users in the Organization Admin [WIP] Show active users in the Organization Admin detail Jun 27, 2023
@faebebin faebebin added enhancement New feature or request minor Requires minor version change labels Jun 27, 2023
@faebebin faebebin force-pushed the QF-2604_org_active_users_detail_admin branch 2 times, most recently from a21efc8 to 575f4d2 Compare June 28, 2023 09:53
@faebebin faebebin changed the title [WIP] Show active users in the Organization Admin detail Show active users in the Organization Admin detail Jun 28, 2023
@faebebin faebebin marked this pull request as ready for review June 28, 2023 10:11
key=lambda obj: (obj.jobs_count, obj.deltas_count),
reverse=True,
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is sure potential to optimize the queries, currently is doing 45 queries for 2 active users, 41 queries for 1 active user. So it might get slow with many active users ... . Probably with some prefetch_related magic could be improved. Question is how much more effort want to put into optimizing this.

image

@faebebin
Copy link
Member Author

faebebin commented Jul 3, 2023

Decided to simplify and only show a list of Users. Dropping the jobs and deltas count per user. Will therefore force push onto this PR. Will keep the current state on this branch https://github.com/opengisch/qfieldcloud/tree/QF-2604_org_active_users_job_deltas_count_detail_admin if we need the funcionality later

@suricactus
Copy link
Collaborator

@faebebin I assume it is not ready yet?

@faebebin faebebin force-pushed the QF-2604_org_active_users_detail_admin branch from 44a410f to 7f4c68f Compare July 3, 2023 20:27
@faebebin faebebin force-pushed the QF-2604_org_active_users_detail_admin branch from d7947ec to cc0f315 Compare July 4, 2023 09:46
@faebebin faebebin changed the title Show active users in the Organization Admin detail Show active members in the Organization Admin Jul 4, 2023
@faebebin faebebin requested a review from suricactus July 4, 2023 11:21
Copy link
Collaborator

@suricactus suricactus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice and simple. Please add the users on a new line makes things easier to read.

faebebin and others added 2 commits July 5, 2023 11:02
@suricactus suricactus merged commit 216c588 into master Jul 5, 2023
9 of 10 checks passed
@suricactus suricactus deleted the QF-2604_org_active_users_detail_admin branch July 5, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Requires minor version change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants