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

Issue #2349: Portfolio templates - [RJM] #2431

Merged
merged 15 commits into from
Jul 22, 2024
Merged

Conversation

rachidatecs
Copy link
Contributor

@rachidatecs rachidatecs commented Jul 5, 2024

Ticket

Resolves #2349

Changes

  • Moved a bunch of duplicate waffle flag checks to the global context_processors
  • Move/add path, portfolio id, and is org user to the global context_processors since those will be used on the nav
  • Add suborg to domains table (org user only) - View and JS changes
  • refactor templates and CSS

Context for reviewers

Devs: Follow the org_user_status global context and logo_clickable view context to understand how the different contexts are managed.

Designers: The suborg display still follows the original design. We can revise when we get to org group UI implementation or filter refactoring.

The nav on mobile uses out of the box styles and colors for both portfolio and regular users.

All: You may need to look at the old profile stuff and make sure it still works as expected as I've refactored how we're doing a context that profile uses - @zandercymatics

Setup

Add a portfolio with you as creator, makes sure the waffle flag is turned on.

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

github-actions bot commented Jul 5, 2024

🥳 Successfully deployed to developer sandbox rjm.

@rachidatecs rachidatecs changed the title Issue #2349: Portfolio templates DRAFT - Issue #2349: Portfolio templates - [RJM] Jul 5, 2024
Copy link

github-actions bot commented Jul 8, 2024

🥳 Successfully deployed to developer sandbox rjm.

Copy link

github-actions bot commented Jul 9, 2024

🥳 Successfully deployed to developer sandbox rjm.

@rachidatecs rachidatecs changed the title DRAFT - Issue #2349: Portfolio templates - [RJM] Issue #2349: Portfolio templates - [RJM] Jul 9, 2024
Copy link
Contributor

@CocoByte CocoByte left a comment

Choose a reason for hiding this comment

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

Ok - this took a while to read through, but so far the work looks solid.

I do recommend adding comments in our scss overrides, as it is not clear why some of them exist and what they affect. I totally appreciate the organization into separate files (frontend architecture can get spaghetti in a hurry without some housekeeping).

I also really like the new approach with our context for flags. Seems like a good standard overall for waffle flag items.

I plan on doing testing on RJM tomorrow to verify no breakages. But overall, no issues with the code (except a desire for more comments)

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.

Just a few things. Nice refactor work here

src/registrar/assets/js/get-gov.js Outdated Show resolved Hide resolved
src/registrar/assets/sass/_theme/_base.scss Show resolved Hide resolved
src/registrar/models/user.py Outdated Show resolved Hide resolved
src/registrar/registrar_middleware.py Show resolved Hide resolved
src/registrar/templates/home.html Outdated Show resolved Hide resolved
src/registrar/templates/portfolio_base.html Outdated Show resolved Hide resolved
src/registrar/views/domains_json.py Show resolved Hide resolved
src/registrar/views/domains_json.py Show resolved Hide resolved
src/registrar/views/index.py Outdated Show resolved Hide resolved
@zandercymatics
Copy link
Contributor

Approved ^^. Just remember to look over some of the comments + implement, particularly this one:
#2431 (comment)

Won't block the review on it, but I'll take a look after you answer!

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.

Sorry to retract - I found an edge case with the org flag and the feature flag:

image

@CocoByte
Copy link
Contributor

CocoByte commented Jul 16, 2024

A few things:

  1. BUG? -- I keep getting a 500 error when trying to add a Senior Official to a portfolio. Everything else appears to work in /admin
  2. The header for the Domains table doesn't match the figma (possibly a design update happened after this ticket was made?)

FIGMA:
image

SANDBOX:
image

  1. "Domain Groups" and "Members" don't navigate to anything (I don't see these as part of the ACs so I'm thinking this is intentional, but wanted to double-check)

Copy link
Contributor

@CocoByte CocoByte left a comment

Choose a reason for hiding this comment

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

(see comment)

Copy link

🥳 Successfully deployed to developer sandbox rjm.

@rachidatecs
Copy link
Contributor Author

rachidatecs commented Jul 16, 2024

A few things:

  1. BUG? -- I keep getting a 500 error when trying to add a Senior Official to a portfolio. Everything else appears to work in /admin
  2. The header for the Domains table doesn't match the figma (possibly a design update happened after this ticket was made?)
  3. "Domain Groups" and "Members" don't navigate to anything (I don't see these as part of the ACs so I'm thinking this is intentional, but wanted to double-check)
  1. I think this is a sandbox-speific issue. The code on the sandbox does not have a senior official on portfolios, but a previous PR might have run a migration that allows it
  2. Quite possible, let's see what Gaby says
  3. Intentional

I'll try merging main then pushing, and will check Figma again when I get a chance

Edit: 1 and 2 should be fixed

@rachidatecs
Copy link
Contributor Author

Sorry to retract - I found an edge case with the org flag and the feature flag:

Fixed

Copy link

🥳 Successfully deployed to developer sandbox rjm.

Copy link

🥳 Successfully deployed to developer sandbox rjm.

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.

Nice work but see @CocoByte s suggestions, too

Comment on lines +116 to +119
> .usa-navbar {
// This is a dangerous override to USWDS, necessary because we have a tooltip on the logo
overflow: visible;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

(nitpick/optional) Couldn't we this behaviour to a class on the same element that usa-navbar resides in?

Comment on lines +145 to +146
user_portfolios = Portfolio.objects.filter(creator=request.user)
first_portfolio = user_portfolios.first()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
user_portfolios = Portfolio.objects.filter(creator=request.user)
first_portfolio = user_portfolios.first()
first_portfolio = Portfolio.objects.filter(creator=request.user).first()

(Optional) you could also combine this field if you want. Optional though

Copy link
Contributor

@CocoByte CocoByte left a comment

Choose a reason for hiding this comment

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

LGTM (just needs linting)

@gabydisarli
Copy link
Contributor

Hi Rachid, adding some feedback after a first pass for visual and AC. This is looking so great!

  1. Change background (behind domains table) to #FCFCFC. Note that the domains table background should be white.
  2. Change border above the nav bar (below the usa banner) to A9AEB1 (uswds base-light)
  3. Change focus on Organization in nav bar so that the margin on the left matches the right (right now it’s really close to the end of the org name).
  4. Increase padding between main content and nav bar/header to 32 instead of 24.
  5. Increase margin between Reset button and search component from 16 to 24
  6. Can you match the table data pieces to match the Figma.. I’m seeing width sizes that don’t match the figma for the 1024 viewport size. Note, in case it’s relevant. In a follow on ticket (Add Domain Groups to the Domains Table page in the Portfolio view #2395), we will improve this table to stretch with the viewport for users with large screens. We do want it to switch to the mobile view under 1024.

Copy link

🥳 Successfully deployed to developer sandbox rjm.

Copy link
Contributor

@gabydisarli gabydisarli 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!

@rachidatecs rachidatecs merged commit 0c8f0b4 into main Jul 22, 2024
10 checks passed
@rachidatecs rachidatecs deleted the rjm/2349-portfolio-ui branch July 22, 2024 16:05
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.

Portfolio view matches the figma for the Domains page and navigation
4 participants