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

Make org/user data available via reports interface #4262

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

svenaas
Copy link
Contributor

@svenaas svenaas commented Oct 3, 2023

Work to satisfy #4258, adding new reports with orgs and user/org/role information available as CSVs for import into ZenDesk. These reports are presented in the Admin UI as well (slightly differently), with the CSV downloads available from this interface, or potentially via direct calls to the API.

Changes proposed in this pull request:

  • Move the existing /organizations-report to /reports/published-sites
  • Add a new organizations report (that includes all orgs, not just those with published sites) at /reports/organizations
  • Add a new users report that includes associated organizations and roles at /reports/users

security considerations

None. The data presented is only available to authenticated admin/support users, and only represents data already available to those users.

@svenaas svenaas marked this pull request as ready for review October 4, 2023 19:27
@svenaas svenaas requested review from a team and Ephraim-G October 4, 2023 19:29
Ephraim-G
Ephraim-G previously approved these changes Oct 4, 2023
@svenaas svenaas force-pushed the 4258-user-org-reporting branch from dc042eb to e103e11 Compare October 5, 2023 12:11
@svenaas svenaas requested a review from a team October 5, 2023 12:15
drewbo
drewbo previously approved these changes Oct 5, 2023
Copy link
Contributor

@drewbo drewbo left a comment

Choose a reason for hiding this comment

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

Redeployed and tested on dev. Added another org to see multiple org users. Everything looks good. The only minor (optional) thing is I'd name the columns "Github email" and "UAA email" for consistency with the users view. Good to go once rebased

@svenaas
Copy link
Contributor Author

svenaas commented Oct 5, 2023

The only minor (optional) thing is I'd name the columns "Github email" and "UAA email" for consistency with the users view.

I agree with that. But the CSV export just has an "Email" (UAA) column for ZenDesk convenience as of this writing. Does that seem OK to you, @drewbo?

@svenaas
Copy link
Contributor Author

svenaas commented Oct 5, 2023

@drewbo, I changed the email column names and order in the users report to match the users administration page — that needs a re-review. But you can't just read that change because I also rebased this down to three discrete commits (you'd probably go with one, and I can do that if you prefer).

@svenaas
Copy link
Contributor Author

svenaas commented Oct 5, 2023

Hold off on that, please; test is behaving differently in Concourse because I wasn't careful about ordering. Fixing that now.

@svenaas svenaas force-pushed the 4258-user-org-reporting branch 3 times, most recently from 641a3e1 to 6c896e6 Compare October 5, 2023 18:58
Copy link
Contributor

@drewbo drewbo left a comment

Choose a reason for hiding this comment

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

Can you change the new report commits to feat(admin): type? I'm not positive how the changelog will handle that but it better reflects those changes

@svenaas svenaas force-pushed the 4258-user-org-reporting branch from 6c896e6 to b64e898 Compare October 5, 2023 19:24
@svenaas
Copy link
Contributor Author

svenaas commented Oct 5, 2023

Yes. Done.

@svenaas svenaas requested a review from drewbo October 5, 2023 19:25
Copy link
Contributor

@drewbo drewbo left a comment

Choose a reason for hiding this comment

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

One last code piece I should have checked earlier: can you abstract the downloadCSV function to accept the csv as input, and put this in a util file? (otherwise it's duplicated three times)

@svenaas
Copy link
Contributor Author

svenaas commented Oct 5, 2023

Yeah, sure (sigh) that's a good idea. I should have thought of that as I based two new Svelte files on the first one.

@svenaas svenaas force-pushed the 4258-user-org-reporting branch from b64e898 to 7c93682 Compare October 5, 2023 20:49
@svenaas
Copy link
Contributor Author

svenaas commented Oct 5, 2023

OK, @drewbo, it's in helpers now; please take a particular look at the way I'm defining the helper function and passing parameters in. Do you think this refactoring is good, or do you think it would be better to go a step further and make a CSVDownloadButton Svelte component? Because I could try that too.

@svenaas svenaas requested a review from drewbo October 5, 2023 20:53
@svenaas svenaas merged commit 160e605 into main Oct 5, 2023
3 checks passed
@svenaas svenaas deleted the 4258-user-org-reporting branch October 5, 2023 21:32
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

Successfully merging this pull request may close these issues.

4 participants