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 #2975 - domain and domain info portfolio fields -[HOTGOV] #3044

Merged
merged 37 commits into from
Dec 6, 2024

Conversation

CocoByte
Copy link
Contributor

@CocoByte CocoByte commented Nov 7, 2024

Ticket 2975

Resolves #2975

Changes

  • Added @Property functions to DomainInfo to pull data from Portfolio when a portfolio is present
  • Updated admin.py so that DomainInfo and Domain tables in /admin use the converted fields in their columns and filters
  • Updated csv exports for the following;
    • Domain, Domain Info, and Domain Request admin tables
    • All analytic tables
  • Updated unit tests to use converted fields

Context for reviewers

Setup

Code Review Verification Steps

Go to /admin and verify that the following csv exports use converted fields instead of the native data for Domains, Domain Requests, and Domain Info;

  • Domains table
  • Domain Requests table
  • Domain Info table
  • All analytics csv exports

Also verify that the analytics displays use converted fields.

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

@CocoByte CocoByte requested a review from abroddrick as a code owner November 7, 2024 16:50
Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Nov 7, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

🥳 Successfully deployed to developer sandbox nl.

@CocoByte CocoByte changed the title [DRAFT] Issue #2975 - domain and domain info portfolio fields Issue #2975 - domain and domain info portfolio fields -[sandbox pending] Nov 14, 2024
@CocoByte CocoByte changed the title Issue #2975 - domain and domain info portfolio fields -[sandbox pending] Issue #2975 - domain and domain info portfolio fields -[NL] Nov 14, 2024
@CocoByte CocoByte changed the title Issue #2975 - domain and domain info portfolio fields -[NL] Issue #2975 - domain and domain info portfolio fields -[sandbox pending] Nov 14, 2024
src/registrar/admin.py Outdated Show resolved Hide resolved
Copy link
Contributor

@abroddrick abroddrick left a comment

Choose a reason for hiding this comment

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

See comments for changes requested and comments. Also I was only running this locally and already noticing a significant slowdown in performance. Can you please put this on a sandbox so we can see if the slow down is just a local oriented thing? If you want to use mine you can.

src/registrar/admin.py Outdated Show resolved Hide resolved
src/registrar/admin.py Outdated Show resolved Hide resolved
src/registrar/models/domain_request.py Outdated Show resolved Hide resolved
src/registrar/models/domain_information.py Outdated Show resolved Hide resolved
src/registrar/admin.py Outdated Show resolved Hide resolved
src/registrar/admin.py Outdated Show resolved Hide resolved
@asaki222 asaki222 assigned asaki222 and unassigned asaki222 Nov 22, 2024
src/registrar/tests/test_reports.py Outdated Show resolved Hide resolved
src/registrar/tests/test_reports.py Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 3, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Dec 4, 2024

🥳 Successfully deployed to developer sandbox nl.

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.

The custom fields don't appear to be sortable on the domain request or domain information tables, though they appear to be working on domains directly

src/registrar/admin.py Outdated Show resolved Hide resolved
src/registrar/admin.py Outdated Show resolved Hide resolved
src/registrar/admin.py Show resolved Hide resolved
src/registrar/tests/test_reports.py Outdated Show resolved Hide resolved
src/registrar/utility/csv_export.py Outdated Show resolved Hide resolved
@@ -262,6 +243,25 @@ def get_annotated_queryset(cls, **kwargs):
@classmethod
def get_model_annotation_dict(cls, **kwargs):
return convert_queryset_to_dict(cls.get_annotated_queryset(**kwargs), is_model=False)

@classmethod
def export_data_to_csv(cls, csv_file, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

(optional / nitpick) mind moving this back to line 216?

src/registrar/utility/csv_export.py Outdated Show resolved Hide resolved
src/registrar/utility/csv_export.py Show resolved Hide resolved
src/registrar/utility/csv_export.py Show resolved Hide resolved
src/registrar/utility/csv_export.py Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 5, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Dec 5, 2024

🥳 Successfully deployed to developer sandbox nl.

1 similar comment
Copy link

github-actions bot commented Dec 5, 2024

🥳 Successfully deployed to developer sandbox nl.

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.

See comments, but should be good to merge otherwise. I do recommend a second pair of eyes on this one but up to you on that.

There is a performance slowdown on/admin I think associated with the lookups (for loops), but at least locally/sandboxes it seemed okay. That said, I think we should tackle that in a follow-on as this ticket has already gone through a few iterations of that

Comment on lines 445 to +446
if self.portfolio:
return self.portfolio.federal_agency
return self.federal_agency
return self.portfolio.federal_agency.agency
Copy link
Contributor

Choose a reason for hiding this comment

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

(nitpick) shouldn't we check on self.portfolio and self.portfolio.federal_agency?

Comment on lines -261 to +266
"adomain10.gov,Ready,2024-04-03,(blank),Federal,Armed Forces Retirement Home,,,,(blank),,,,"
"adomain10.gov,Ready,2024-04-03,(blank),Federal,Armed Forces Retirement Home,,,, ,,(blank),,"
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like a errant space is being added here, for some reason and on the other tests (see just before (blank))

Comment on lines +257 to +258
"adomain2.gov,Dns needed,(blank),(blank),Federal - Executive,"
"Portfolio 1 Federal Agency,,,, ,,(blank),"
Copy link
Contributor

Choose a reason for hiding this comment

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

this was originally: "adomain2.gov,Dns needed,(blank),(blank),Interstate,,,,,(blank),,,"
It seems like the agency type changed from interstate to federal - executive. Is this expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I editted the data to make it clear when we are pulling from portfolio data or not. adomain2 is affected across all these tests

src/registrar/tests/test_reports.py Outdated Show resolved Hide resolved
src/registrar/utility/csv_export.py Show resolved Hide resolved
src/registrar/admin.py Show resolved Hide resolved
@CocoByte CocoByte dismissed abroddrick’s stale review December 5, 2024 20:01

comments addressed and subsequent reviews have been made

Copy link

github-actions bot commented Dec 5, 2024

🥳 Successfully deployed to developer sandbox nl.

1 similar comment
Copy link

github-actions bot commented Dec 5, 2024

🥳 Successfully deployed to developer sandbox nl.

Copy link

github-actions bot commented Dec 6, 2024

🥳 Successfully deployed to developer sandbox nl.

@CocoByte CocoByte merged commit 42df091 into main Dec 6, 2024
10 checks passed
@CocoByte CocoByte deleted the nl/2975-domain-and-domain-info-portfolio-fields branch December 6, 2024 00: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.

Domain Info and domain on Django admin pull portfolio info when applicable
4 participants