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

#2737: Members csv report - [MEOWARD] #3083

Merged
merged 51 commits into from
Nov 26, 2024
Merged

Conversation

zandercymatics
Copy link
Contributor

@zandercymatics zandercymatics commented Nov 14, 2024

Ticket

Resolves #2737

Changes

  • Adds a "export as csv" button on the members table in portfolio view
  • Consolidates the members table logic in one location rather than two places (for csv + for table)

Context for reviewers

This PR adds a export as csv button on the members page. The data on this report will be similar to that which is returned via the table, but we also include "invited by" and "invitation date" which pull from the audit log to grab this information from the PortfolioInvitation.

The member table and member csv report pull from three tables: PortfolioInvitation, UserPortfolioPermission, and DomainInvitation. The content from these three tables (Primarily PortfolioInvitation / UserPortfolioPermission) are threaded together using django annotations.

Setup

  1. Enable the organization_feature and organization_members flags
  2. Give yourself the "create and edit members" permission on your UserPortfolioPermission record, and the "admin" role
  3. Add some portfolio invitations for non-existent users
  4. Navigate to the member page

Code Review Verification Steps

As the original developer, I have

Satisfied acceptance criteria and met development standards

  • Met the acceptance criteria, or will meet them in a subsequent PR
  • Created/modified automated tests
  • Update documentation in READMEs and/or onboarding guide

Ensured code standards are met (Original Developer)

  • If any updated dependencies on Pipfile, also update dependencies in requirements.txt.
  • Interactions with external systems are wrapped in try/except
  • Error handling exists for unusual or missing values

Validated user-facing changes (if applicable)

  • Tag @dotgov-designers in this PR's Reviewers for design review. If code is not user-facing, delete design reviewer checklist
  • Verify new pages have been added to .pa11yci file so that they will be tested with our automated accessibility testing
  • Checked keyboard navigability
  • Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)

As a code reviewer, I have

Reviewed, tested, and left feedback about the changes

  • Pulled this branch locally and tested it
  • Verified code meets all checks above. Address any checks that are not satisfied
  • Reviewed this code and left comments. Indicate if comments must be addressed before code is merged
  • Checked that all code is adequately covered by tests
  • Verify migrations are valid and do not conflict with existing migrations

Validated user-facing changes as a developer

Note: Multiple code reviewers can share the checklists above, a second reviewer should not make a duplicate checklist. All checks should be checked before approving, even those labeled N/A.

  • New pages have been added to .pa11yci file so that they will be tested with our automated accessibility testing
  • Checked keyboard navigability
  • Meets all designs and user flows provided by design/product
  • Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
  • (Rarely needed) Tested as both an analyst and applicant user

As a designer reviewer, I have

Verified that the changes match the design intention

  • Checked that the design translated visually
  • Checked behavior. Comment any found issues or broken flows.
  • Checked different states (empty, one, some, error)
  • Checked for landmarks, page heading structure, and links

Validated user-facing changes as a designer

  • Checked keyboard navigability
  • Tested general usability, landmarks, page header structure, and links with a screen reader (such as Voiceover or ANDI)
  • Tested with multiple browsers (check off which ones were used)
    • Chrome
    • Microsoft Edge
    • FireFox
    • Safari
  • (Rarely needed) Tested as both an analyst and applicant user

References

Screenshots

Copy link

🥳 Successfully deployed to developer sandbox za.

Copy link

🥳 Successfully deployed to developer sandbox za.

Just need unit tests!
Copy link

🥳 Successfully deployed to developer sandbox za.

Copy link

🥳 Successfully deployed to developer sandbox za.

change_message="Created invitation",
action_time=timezone.make_aware(datetime(2023, 4, 12)),
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Curious to know why you used LogEntry in these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the Invited by field! PortfolioInvitation doesn't have a creator -- so the way to grab that without adding that to the DB is to look through our audit logs and see who was responsible for creating that record

Q,
Value,
When,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this update! it makes it more readable

Copy link
Contributor

@asaki222 asaki222 left a comment

Choose a reason for hiding this comment

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

LGTM!

@zandercymatics zandercymatics merged commit d11bffe into main Nov 26, 2024
7 of 8 checks passed
@zandercymatics zandercymatics deleted the za/2737-members-csv-report branch November 26, 2024 18:59
@zandercymatics zandercymatics restored the za/2737-members-csv-report branch November 26, 2024 19:03
Copy link

🥳 Successfully deployed to developer sandbox za.

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.

Members report export as CSV
3 participants