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

#2763: Expanded row functionality - [DK] #2945

Merged
merged 26 commits into from
Oct 23, 2024
Merged

Conversation

rachidatecs
Copy link
Contributor

@rachidatecs rachidatecs commented Oct 16, 2024

Ticket

Resolves #2763

Changes

  • Revise members json API to get domains info and a permissions dict
  • Expand / close UI
  • Revise members table for better display (not scrollable) and accessibility (headers instead of scope)

Context for reviewers

Setup

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
  • 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 dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

1 similar comment
Copy link

🥳 Successfully deployed to developer sandbox dk.

@dave-kennedy-ecs dave-kennedy-ecs changed the title (draft) - #2763: Expanded row functionality - [DK] #2763: Expanded row functionality - [DK] Oct 17, 2024
Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

Copy link

🥳 Successfully deployed to developer sandbox dk.

@zandercymatics zandercymatics self-assigned this Oct 22, 2024
Copy link
Contributor

@zandercymatics zandercymatics left a comment

Choose a reason for hiding this comment

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

When clicking a domain that I am not a manager on, I get an access denied error
image

image

Also - I am assuming that this manage button is out of scope right?
image

src/registrar/assets/js/get-gov.js Show resolved Hide resolved
src/registrar/assets/js/get-gov.js Show resolved Hide resolved
src/registrar/assets/js/get-gov.js Show resolved Hide resolved
try {
if (!isNaN(parsedDate.getTime())) { // Check if the date is valid
last_active_display = parsedDate.toLocaleDateString('en-US', options);
last_active_sort_value = parsedDate.getTime(); // sort as numeric value, seconds since 1970
Copy link
Contributor

Choose a reason for hiding this comment

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

(Q) Why are we sorting as a numeric value rather than on date? Totally fine with it, but doesn't USWDS have support for sorting dates?

Copy link
Contributor

Choose a reason for hiding this comment

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

We have to sort dates as well as string values, namely 'Invalid date' and 'Invited'. Assigned each of these a numeric value (0 and 1) and sorted dates according to time since epoch

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/assets/js/get-gov.js Outdated Show resolved Hide resolved
src/registrar/views/portfolio_members_json.py Show resolved Hide resolved
@dave-kennedy-ecs
Copy link
Contributor

When clicking a domain that I am not a manager on, I get an access denied error image

image

Also - I am assuming that this manage button is out of scope right? image

I believe these are all expected behaviors. And yes the Manage button is out of scope for this ticket.

Copy link

🥳 Successfully deployed to developer sandbox dk.

@zandercymatics
Copy link
Contributor

I believe these are all expected behaviors. And yes the Manage button is out of scope for this ticket.

Ah I see what is going on. Okay - I thought the domain assignment list was specific to the portfolio, i.e. it would only show the domains the user is assigned to given it. That makes sense as to why it would error out in this case.

I'm assuming that this is desired right?

@dave-kennedy-ecs
Copy link
Contributor

I believe these are all expected behaviors. And yes the Manage button is out of scope for this ticket.

Ah I see what is going on. Okay - I thought the domain assignment list was specific to the portfolio, i.e. it would only show the domains the user is assigned to given it. That makes sense as to why it would error out in this case.

I'm assuming that this is desired right?

@zander, noting here that you are correct. The desired behavior is to only include the domains which are part of the portfolio and are assigned to the user/email. I have fixed in the most recent push

Copy link

🥳 Successfully deployed to developer sandbox dk.

let display_value = invalid_date; // Default display value for invalid or null dates
let sort_value = -1; // Default sort value for invalid or null dates

if (last_active === invited) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Much better, nice work

Comment on lines +2022 to +2031
* Behavior:
* - The function checks the user's permissions (`member_permissions`) and generates
* corresponding HTML sections based on the permission choices defined in `UserPortfolioPermissionChoices`.
* - Permissions are categorized into domains, requests, and members:
* - Domains: Determines whether the user can view or manage all or assigned domains.
* - Requests: Differentiates between users who can edit requests, view all requests, or have no request privileges.
* - Members: Distinguishes between members who can manage or only view other members.
* - If no relevant permissions are found, the function returns a message stating that the user has no additional permissions.
* - The resulting HTML always includes a header "Additional permissions for this member" and appends the relevant permission descriptions.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

🤌

Copy link
Contributor

@zandercymatics zandercymatics left a comment

Choose a reason for hiding this comment

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

Looks great. Confirmed that the bug was no longer present. Really wonderful PR all around

@dave-kennedy-ecs dave-kennedy-ecs merged commit fd9eb0d into main Oct 23, 2024
10 checks passed
@dave-kennedy-ecs dave-kennedy-ecs deleted the dk/2763-member-expand branch October 23, 2024 20:23
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.

Org Member Page - Expanded Row Functionality
4 participants