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

#2725: member management page - [NL] #2837

Merged
merged 37 commits into from
Oct 3, 2024
Merged

Conversation

CocoByte
Copy link
Contributor

@CocoByte CocoByte commented Sep 21, 2024

Ticket 2725

Resolves #2725

Change

  • Created the initial members management page features according to the ACs in the ticket
  • Added unit tests

Context for reviewers

Setup

Code is deployed on sandbox-nl

Since we don't have fixtures for this yet, you will need to setup a portfolio, assign a few domains to it, and give users portfolio permissions.

To do this, navigate to /admin and do the following (NOTE: if the database has not been reset, these are likely already done.);

  • Enable the org model waffle flags.
  • Create a portfolio
  • Create a suborg
  • Open a few domains and assign them to the portfolio & suborg
  • Go to /admin and Create a couple portfolio permissions (one with admin, and one without), assigning these permissions to the portfolio you made earlier. Also invite a user to the portfolio.

Code Review Verification Steps

---- BEGIN ----

After completing setup, navigate to /domains and verify...

  • That /domains loads fine (indicating you completed setup correctly)

Navigate to /members (in the url) and verify the following (NOTE: you might wish to open a separate tab to change permissions in order to test these scenarios)...

  • You can only view the members page (and members link in the top nav) if you have the "View Members" permission explicitly assigned in members portfolio (being admin is not enough to see this page). (See Ticket AC: "admin roles do not naturally have the ability to see all users and/or manage them. This has to be layered on")
  • The members table has manage (gear) icons that appear if the you have permissions to edit/manage members (Portfolio Permissions) AND permissions to change users (permissions in your User model -- NOTE: full access groups AND analysts can change users. If you remove both of these groups, the only way to enable the "Manage" setting on the members page is to add "Registrar | Users| Change users" as a custom permission). A view icon appears if you do not have these permissions (view members / view users only)
  • The members table shows member email, last active date or that the user is just in the invited state
  • search bar, sort, pagination and overall formatting such as title is included
  • the add a new member button is shown but does nothing
  • "admin" tags are displayed for anyone with the role "admin"
  • the users that show on this table are both those who have UserPortfolioPermissions and those who have just been invited to the portfolio

One final AC to check:
In /admin, verify that...

  • Portfolio Permissions no longer has "Read Only Admin" in the list of available roles

---- DONE ----

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
  • Added at least 2 developers as PR reviewers (only 1 will need to approve)
  • Messaged on Slack or in standup to notify the team that a PR is ready for review
  • Changes to “how we do things” are documented in READMEs and or onboarding guide
  • If any model was updated to modify/add/delete columns, makemigrations was ran and the associated migrations file has been commited.

Ensured code standards are met (Original Developer)

  • All new functions and methods are commented using plain language
  • Did dependency updates in Pipfile also get changed 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)

  • 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)
  • Add at least 1 designer as PR reviewer

As a code reviewer, I have

Reviewed, tested, and left feedback about the changes

  • Pulled this branch locally and tested it
  • Reviewed this code and left comments
  • Checked that all code is adequately covered by tests
  • Made it clear which comments need to be addressed before this work is merged
  • If any model was updated to modify/add/delete columns, makemigrations was ran and the associated migrations file has been commited.

Ensured code standards are met (Code reviewer)

  • All new functions and methods are commented using plain language
  • Interactions with external systems are wrapped in try/except
  • Error handling exists for unusual or missing values
  • (Rarely needed) Did dependency updates in Pipfile also get changed in requirements.txt?

Validated user-facing changes as a developer

  • 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)

  • Tested with multiple browsers, the suggestion is to use ones that the developer didn't (check off which ones were used)

    • Chrome
    • Microsoft Edge
    • FireFox
    • Safari
  • (Rarely needed) Tested as both an analyst and applicant user

Note: Multiple code reviewers can share the checklists above, a second reviewers should not make a duplicate checklist

As a designer reviewer, I have

Verified that the changes match the design intention

  • Checked that the design translated visually
  • Checked behavior
  • Checked different states (empty, one, some, error)
  • Checked for landmarks, page heading structure, and links
  • Tried to break the intended flow

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

Screenshots

Copy link

🥳 Successfully deployed to developer sandbox nl.

Copy link

🥳 Successfully deployed to developer sandbox nl.

Copy link

🥳 Successfully deployed to developer sandbox nl.

Copy link

🥳 Successfully deployed to developer sandbox nl.

@CocoByte CocoByte changed the title [IGNORE] Issue #2725: member management page - [NL] Issue #2725: member management page - [NL] Sep 25, 2024
Copy link

🥳 Successfully deployed to developer sandbox nl.

1 similar comment
Copy link

🥳 Successfully deployed to developer sandbox nl.

src/registrar/views/portfolio_members_json.py Outdated Show resolved Hide resolved
src/registrar/views/portfolio_members_json.py Outdated Show resolved Hide resolved
src/registrar/views/portfolio_members_json.py Outdated Show resolved Hide resolved
src/registrar/views/portfolio_members_json.py Outdated Show resolved Hide resolved
src/registrar/views/portfolio_members_json.py Outdated Show resolved Hide resolved
src/registrar/views/portfolios.py Outdated Show resolved Hide resolved
src/registrar/assets/js/get-gov.js Outdated Show resolved Hide resolved
src/registrar/assets/js/get-gov.js Outdated Show resolved Hide resolved
src/registrar/tests/test_views_portfolio.py Outdated Show resolved Hide resolved
@@ -666,6 +667,194 @@ def test_organization_members_waffle_flag_on_shows_nav_link(self):
self.assertContains(home, "Hotel California")
self.assertContains(home, "Members")

@less_console_noise_decorator
Copy link
Contributor

Choose a reason for hiding this comment

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

We are missing test_views_members_json (see similar test files)

@rachidatecs
Copy link
Contributor

Mostly nitpicks but overall great work @CocoByte!

Co-authored-by: Rachid Mrad <107004823+rachidatecs@users.noreply.github.com>
Copy link

github-actions bot commented Oct 1, 2024

🥳 Successfully deployed to developer sandbox nl.

@CocoByte
Copy link
Contributor Author

CocoByte commented Oct 1, 2024

Thank you @zandercymatics and @rachidatecs for the thorough review and polishing :)

Copy link

github-actions bot commented Oct 1, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Oct 1, 2024

🥳 Successfully deployed to developer sandbox nl.

@zandercymatics
Copy link
Contributor

zandercymatics commented Oct 2, 2024

@rachidatecs / @CocoByte Adding those missing unit tests. Kept it simple for now. I also fixed a few bugs with the search, sort, etc

Copy link

github-actions bot commented Oct 2, 2024

🥳 Successfully deployed to developer sandbox nl.

1 similar comment
Copy link

github-actions bot commented Oct 2, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Oct 2, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Oct 2, 2024

🥳 Successfully deployed to developer sandbox nl.

@rachidatecs rachidatecs changed the title Issue #2725: member management page - [NL] #2725: member management page - [NL] Oct 2, 2024
from django_webtest import WebTest # type: ignore


class GetPortfolioMembersJsonTest(TestWithUser, WebTest):
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a teardown class and cleanup the data

Copy link
Contributor

@rachidatecs rachidatecs left a comment

Choose a reason for hiding this comment

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

Add a teardown class for the new test class

@CocoByte CocoByte merged commit 9aa3504 into main Oct 3, 2024
9 of 10 checks passed
@CocoByte CocoByte deleted the nl/2725-member-management-page branch October 3, 2024 16:19
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.

Member Management Page (part 1)
3 participants