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

[litterbox] 2162: Delete Submitter field and Your contact information page #2693

Merged
merged 59 commits into from
Sep 13, 2024

Conversation

erinysong
Copy link
Contributor

@erinysong erinysong commented Aug 29, 2024

Ticket

Resolves #2162

Changes

  • Remove submitter from registrar models
  • Remove Contacts who are only assigned as domain request submitters (as opposed to Senior Officials and Other Contacts)
  • Remove Your contact information page from domain and domain request view since Your contact information uses submitter data which is now deprecated in favor of storing contact info through user profile (saved as Creator in Domain and DomainRequest)
  • Remove submitter from fixtures
  • Remove references to submitter from models diagram
  • Remove tests involving submitter and refactor email tests to test new behavior of sending emails to creators per Change email sending to use Creator email not submitter on domain requests #2157

Context for reviewers

Now that the Creator field takes data from user profiles to associate domains and domain requests with a point of contact, we no longer need the submitter field and are removing it from the system.

Tagged @dotgov-designers since this involves removing a page that uses submitter data which we're removing.

Setup

Code Review Verification Steps

1. Test submitter no longer exists on /admin

  • Go to getgov-es /admin page. On the pages for Domain and DomainRequest, confirm that Submitter no longer exists below Creator as a field.

2. Test Your contact page no longer exists on registrar
Verify that Your contact information no longer exists as a page on the following:

  1. Domain and Domain Request pages as a sidebar menu item and page
image 2. Domain Request form as a sidebar menu item and page image

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 es.

Copy link

🥳 Successfully deployed to developer sandbox es.

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.

Getting some weird behavior with the email allow list when the profile_feature flag is turned off. Basically if you remove yourself from the email allow list and send out an email when the flag is off, it says it sends successfully (though it did not). I think its because of this logic that is still lingering.

image

@@ -387,12 +387,12 @@ class PurposeForm(RegistrarForm):


class YourContactForm(RegistrarForm):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can safely delete this entire thing now since we are deleting the domain_your_contact_info page. It looks like we aren't using it anywhere.
image

Comment on lines 688 to 691
self.assert_email_is_accurate(
"ORGANIZATION ALREADY HAS A .GOV DOMAIN", 0, _creator.email, bcc_email_address=BCC_EMAIL
)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
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
self.assert_email_is_accurate(
"ORGANIZATION ALREADY HAS A .GOV DOMAIN", 0, _creator.email, bcc_email_address=BCC_EMAIL
)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)
self.assert_email_is_accurate(
"ORGANIZATION ALREADY HAS A .GOV DOMAIN", 0, EMAIL, bcc_email_address=BCC_EMAIL
)
self.assertEqual(len(self.mock_client.EMAILS_SENT), 1)

Can you change these tests too such that it tests on EMAIL rather than _creator.email?

@@ -112,9 +111,7 @@ def test_submission_confirmation_other_contacts_spacing(self):
_, kwargs = self.mock_client.send_email.call_args
body = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"]
self.assertIn("Other employees from your organization:", body)
# spacing should be right between adjacent elements
self.assertRegex(body, r"5556\n\nOther employees")
Copy link
Contributor

Choose a reason for hiding this comment

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

@therealslimhsiehdy See above ^^

Comment on lines -1627 to -1642
class TestDomainContactInformation(TestDomainOverview):
@less_console_noise_decorator
def test_domain_your_contact_information(self):
"""Can load domain's your contact information page."""
page = self.client.get(reverse("domain-your-contact-information", kwargs={"pk": self.domain.id}))
self.assertContains(page, "Your contact information")

@less_console_noise_decorator
def test_domain_your_contact_information_content(self):
"""Logged-in user's contact information appears on the page."""
self.user.first_name = "Testy"
self.user.save()
page = self.app.get(reverse("domain-your-contact-information", kwargs={"pk": self.domain.id}))
self.assertContains(page, "Testy")


Copy link
Contributor

Choose a reason for hiding this comment

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

Basically, we're removing the feature flag. But as of now, this page will appear on the domain view page even though it no longer exists. This will return an error is a dead link when you navigate to it @therealslimhsiehdy
image
image

Copy link

🥳 Successfully deployed to developer sandbox es.

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.

LGTM after your changes, but I'd suggest that Alysia briefly looks this over as well before merging. There are quite a few varying submitter "flows" so its possible that something was missed, though I tried to be as thorough as I could

Copy link

🥳 Successfully deployed to developer sandbox es.

@CocoByte CocoByte self-assigned this Sep 12, 2024
Copy link
Contributor

@Matt-Spence Matt-Spence left a comment

Choose a reason for hiding this comment

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

I focused specifically on the migrations, they LGTM. I ran them in reverse a couple times to ensure if we need to revert that things will work fine. Only note: I agree with @zandercymatics's comment here that we should consider utilizing the export feature to save the data.

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

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.

Zander was quite thorough. I downloaded the branch and found a couple areas I want to double-check on...

Don't we also want to get rid of Submitter in these areas?...
image

image

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.

Nice work! Approved

@therealslimhsiehdy
Copy link
Contributor

Zander was quite thorough. I downloaded the branch and found a couple areas I want to double-check on...

Don't we also want to get rid of Submitter in these areas?... image

image

FYI for the JS section bc it's variable naming I decided against updating that for now. Great catch on the second screenshot -- I've updated it in this commit

Copy link

🥳 Successfully deployed to developer sandbox es.

1 similar comment
Copy link

🥳 Successfully deployed to developer sandbox es.

Copy link

🥳 Successfully deployed to developer sandbox es.

Copy link

🥳 Successfully deployed to developer sandbox es.

@therealslimhsiehdy therealslimhsiehdy merged commit c1daa45 into main Sep 13, 2024
10 checks passed
@therealslimhsiehdy therealslimhsiehdy deleted the es/2162-delete-submitter-v2 branch September 13, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove submitter from Domain Requests and Domain Info
8 participants