From d57155acc5c5a797c69856aad4af82b00cff21ce Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 14 May 2024 13:07:55 -0600 Subject: [PATCH 01/10] Added domain request pre-amble for user contact info (uses waffle flag for profile feature) --- .../templates/domain_request_intro.html | 6 ++++ .../templates/domain_request_review.html | 2 +- .../includes/profile_information.html | 36 +++++++++++++++++++ src/registrar/views/domain_request.py | 6 ++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/registrar/templates/includes/profile_information.html diff --git a/src/registrar/templates/domain_request_intro.html b/src/registrar/templates/domain_request_intro.html index 72abe6a27..c8bfc47ac 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -15,6 +15,12 @@

If you have all the information you need, completing your domain request might take around 15 minutes.

+ {% if has_profile_feature_flag %} +

How we'll reach you

+

While reviewing your domain request, we may need to reach out with questions. We'll also email you when we complete our review If the contact information below is not correct, visit your profile to make updates.

+ {% include "includes/profile_information.html" with user=user%} + {% endif %} + {% block form_buttons %}
diff --git a/src/registrar/templates/domain_request_review.html b/src/registrar/templates/domain_request_review.html index 5f359e95f..d24e6f8fa 100644 --- a/src/registrar/templates/domain_request_review.html +++ b/src/registrar/templates/domain_request_review.html @@ -1,4 +1,4 @@ -{% extends 'domain_request_form.html' %} +{% extends '(request):.html' %} {% load static url_helpers %} {% load custom_filters %} diff --git a/src/registrar/templates/includes/profile_information.html b/src/registrar/templates/includes/profile_information.html new file mode 100644 index 000000000..edd6ea645 --- /dev/null +++ b/src/registrar/templates/includes/profile_information.html @@ -0,0 +1,36 @@ +{% load static field_helpers %} + +{% block domain_content %} + + +
+
+

+ Your contact information +

+
+
    +
  • Full name: {{ user.contact.first_name }} {{ user.contact.last_name }}
  • +
  • Organization email: {{ user.contact.email }}
  • +
  • Title or role in your organization: {{ user.contact.title }}
  • +
  • Phone: {{ user.contact.phone }}
  • +
+
+
+
+ +{% endblock %} diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index f93976138..f6101873e 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -16,6 +16,8 @@ from registrar.utility import StrEnum from registrar.views.utility import StepsHelper from registrar.views.utility.permission_views import DomainRequestPermissionDeleteView +from waffle.decorators import flag_is_active + from .utility import ( DomainRequestPermissionView, DomainRequestPermissionWithdrawView, @@ -227,6 +229,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): # know which view is first in the list of steps. if self.__class__ == DomainRequestWizard: if request.path_info == self.NEW_URL_NAME: + user = self.request.user + context = self.get_context_data() + context["user"] = user + context["has_profile_feature_flag"] = flag_is_active(request, "profile_feature") return render(request, "domain_request_intro.html") else: return self.goto(self.steps.first) From fa2d6a1387c12c9ee8bc08ec3b180b689453503d Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 15 May 2024 15:53:54 -0600 Subject: [PATCH 02/10] Fixed profile flag --- src/registrar/templates/domain_request_intro.html | 8 ++++---- src/registrar/views/domain_request.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/registrar/templates/domain_request_intro.html b/src/registrar/templates/domain_request_intro.html index c8bfc47ac..2db0177fb 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -15,10 +15,10 @@

If you have all the information you need, completing your domain request might take around 15 minutes.

- {% if has_profile_feature_flag %} -

How we'll reach you

-

While reviewing your domain request, we may need to reach out with questions. We'll also email you when we complete our review If the contact information below is not correct, visit your profile to make updates.

- {% include "includes/profile_information.html" with user=user%} + {% if has_profile_feature_flag == true %} +

How we'll reach you

+

While reviewing your domain request, we may need to reach out with questions. We'll also email you when we complete our review If the contact information below is not correct, visit your profile to make updates.

+ {% include "includes/profile_information.html" with user=user%} {% endif %} diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index f6101873e..e141af502 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -229,10 +229,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): # know which view is first in the list of steps. if self.__class__ == DomainRequestWizard: if request.path_info == self.NEW_URL_NAME: - user = self.request.user context = self.get_context_data() - context["user"] = user - context["has_profile_feature_flag"] = flag_is_active(request, "profile_feature") + has_prof = flag_is_active(self.request, "profile_feature") + context["has_profile_feature_flag"] = has_prof + logger.debug("PROFILE FLAG is %s" % has_prof) return render(request, "domain_request_intro.html") else: return self.goto(self.steps.first) @@ -390,7 +390,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): else: modal_heading = "You are about to submit an incomplete request" - return { + context = { "form_titles": self.TITLES, "steps": self.steps, # Add information about which steps should be unlocked @@ -398,7 +398,11 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): "is_federal": self.domain_request.is_federal(), "modal_button": modal_button, "modal_heading": modal_heading, + #Use the profile waffle feature flag to toggle profile features throughout domain requests + "has_profile_feature_flag": flag_is_active(self.request, "profile_feature"), + "user": self.request.user } + return context def get_step_list(self) -> list: """Dynamically generated list of steps in the form wizard.""" From affd7d88acfd9429e641416c9f375460ad7373bf Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 15 May 2024 15:58:03 -0600 Subject: [PATCH 03/10] linted --- src/registrar/views/domain_request.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index e141af502..21675c2fe 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -230,9 +230,6 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): if self.__class__ == DomainRequestWizard: if request.path_info == self.NEW_URL_NAME: context = self.get_context_data() - has_prof = flag_is_active(self.request, "profile_feature") - context["has_profile_feature_flag"] = has_prof - logger.debug("PROFILE FLAG is %s" % has_prof) return render(request, "domain_request_intro.html") else: return self.goto(self.steps.first) @@ -390,6 +387,9 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): else: modal_heading = "You are about to submit an incomplete request" + has_profile_flag = flag_is_active(self.request, "profile_feature") + logger.debug("PROFILE FLAG is %s" % has_profile_flag) + context = { "form_titles": self.TITLES, "steps": self.steps, @@ -398,9 +398,9 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): "is_federal": self.domain_request.is_federal(), "modal_button": modal_button, "modal_heading": modal_heading, - #Use the profile waffle feature flag to toggle profile features throughout domain requests - "has_profile_feature_flag": flag_is_active(self.request, "profile_feature"), - "user": self.request.user + # Use the profile waffle feature flag to toggle profile features throughout domain requests + "has_profile_feature_flag": has_profile_flag, + "user": self.request.user, } return context From b002b7ea2bb8139d795e93af927787e4192156a2 Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Fri, 17 May 2024 12:29:33 -0400 Subject: [PATCH 04/10] Remove your contact step from requests --- src/registrar/views/domain_request.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index a90eaf271..cda43b423 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -22,7 +22,7 @@ from .utility import ( DomainRequestWizardPermissionView, ) -from waffle.decorators import flag_is_active +from waffle.decorators import flag_is_active, waffle_flag logger = logging.getLogger(__name__) @@ -406,6 +406,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): condition = condition(self) if condition: step_list.append(step) + + if flag_is_active(self.request, "profile_feature"): + step_list.remove(Step.YOUR_CONTACT) + return step_list def goto(self, step): @@ -540,6 +544,10 @@ class YourContact(DomainRequestWizard): template_name = "domain_request_your_contact.html" forms = [forms.YourContactForm] + @waffle_flag("!profile_feature") # type: ignore + def dispatch(self, request, *args, **kwargs): # type: ignore + return super().dispatch(request, *args, **kwargs) + class OtherContacts(DomainRequestWizard): template_name = "domain_request_other_contacts.html" From d3281ddf06d8bce6144b1fa275d524e3d833c6c4 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 21 May 2024 14:23:03 -0600 Subject: [PATCH 05/10] fixed testing and some cleanup --- src/registrar/templates/domain_request_review.html | 2 +- src/registrar/views/domain_request.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/registrar/templates/domain_request_review.html b/src/registrar/templates/domain_request_review.html index d24e6f8fa..5f359e95f 100644 --- a/src/registrar/templates/domain_request_review.html +++ b/src/registrar/templates/domain_request_review.html @@ -1,4 +1,4 @@ -{% extends '(request):.html' %} +{% extends 'domain_request_form.html' %} {% load static url_helpers %} {% load custom_filters %} diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index 21675c2fe..d08019592 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -388,7 +388,6 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): modal_heading = "You are about to submit an incomplete request" has_profile_flag = flag_is_active(self.request, "profile_feature") - logger.debug("PROFILE FLAG is %s" % has_profile_flag) context = { "form_titles": self.TITLES, From 076a73931d082a5882da1bb5a343f57edeadce25 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Tue, 21 May 2024 17:14:30 -0400 Subject: [PATCH 06/10] removed your contact information from domain request status view --- src/registrar/templates/domain_request_status.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/templates/domain_request_status.html b/src/registrar/templates/domain_request_status.html index 0ea16e3a3..ac447476d 100644 --- a/src/registrar/templates/domain_request_status.html +++ b/src/registrar/templates/domain_request_status.html @@ -106,7 +106,7 @@ {% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level %} {% endif %} - {% if DomainRequest.submitter %} + {% if DomainRequest.submitter and not has_profile_feature_flag %} {% include "includes/summary_item.html" with title='Your contact information' value=DomainRequest.submitter contact='true' heading_level=heading_level %} {% endif %} From 78ba5c78d7c1e8090694217bc93ea31fa9ca4fb5 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 22 May 2024 15:26:10 -0600 Subject: [PATCH 07/10] Fixed context --- src/registrar/templates/domain_request_intro.html | 3 +-- src/registrar/views/domain_request.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/registrar/templates/domain_request_intro.html b/src/registrar/templates/domain_request_intro.html index 2db0177fb..2b941b48f 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -14,8 +14,7 @@

Time to complete the form

If you have all the information you need, completing your domain request might take around 15 minutes.

- - {% if has_profile_feature_flag == true %} + {% if has_profile_feature_flag %}

How we'll reach you

While reviewing your domain request, we may need to reach out with questions. We'll also email you when we complete our review If the contact information below is not correct, visit your profile to make updates.

{% include "includes/profile_information.html" with user=user%} diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index d08019592..9dcf183a2 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -230,7 +230,8 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): if self.__class__ == DomainRequestWizard: if request.path_info == self.NEW_URL_NAME: context = self.get_context_data() - return render(request, "domain_request_intro.html") + logger.debug("CONTEXT profile flag is %s" % context["has_profile_feature_flag"]) + return render(request, "domain_request_intro.html", context=context) else: return self.goto(self.steps.first) @@ -388,6 +389,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): modal_heading = "You are about to submit an incomplete request" has_profile_flag = flag_is_active(self.request, "profile_feature") + logger.debug("PROFILE FLAG is %s" % has_profile_flag) context = { "form_titles": self.TITLES, From 27acae12e2763cbfa7932e32ce203f14b451652c Mon Sep 17 00:00:00 2001 From: CocoByte Date: Thu, 23 May 2024 16:55:46 -0600 Subject: [PATCH 08/10] Design updates --- src/registrar/assets/sass/_theme/_admin.scss | 11 +++++++++++ src/registrar/templates/domain_request_intro.html | 4 ++-- .../templates/includes/profile_information.html | 13 +------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/registrar/assets/sass/_theme/_admin.scss b/src/registrar/assets/sass/_theme/_admin.scss index c716ad49c..cc86e661b 100644 --- a/src/registrar/assets/sass/_theme/_admin.scss +++ b/src/registrar/assets/sass/_theme/_admin.scss @@ -724,3 +724,14 @@ div.dja__model-description{ .text-underline { text-decoration: underline !important; } + +//-- Override some styling for the USWDS summary box (per design quidance for ticket #2055 +.usa-summary-box { + background: #{$dhs-blue-10}; + border-color: #{$dhs-blue-30}; + max-width: 72ex; + word-wrap: break-word; +} +.usa-summary-box h3 { + color: #{$dhs-blue-60}; +} \ No newline at end of file diff --git a/src/registrar/templates/domain_request_intro.html b/src/registrar/templates/domain_request_intro.html index 2b941b48f..d6d3b3b7f 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -15,8 +15,8 @@

If you have all the information you need, completing your domain request might take around 15 minutes.

{% if has_profile_feature_flag %} -

How we'll reach you

-

While reviewing your domain request, we may need to reach out with questions. We'll also email you when we complete our review If the contact information below is not correct, visit your profile to make updates.

+

How we’ll reach you

+

While reviewing your domain request, we may need to reach out with questions. We’ll also email you when we complete our review If the contact information below is not correct, visit your profile to make updates.

{% include "includes/profile_information.html" with user=user%} {% endif %} diff --git a/src/registrar/templates/includes/profile_information.html b/src/registrar/templates/includes/profile_information.html index edd6ea645..3bd46f2e4 100644 --- a/src/registrar/templates/includes/profile_information.html +++ b/src/registrar/templates/includes/profile_information.html @@ -2,17 +2,6 @@ {% block domain_content %} -
  • Full name: {{ user.contact.first_name }} {{ user.contact.last_name }}
  • -
  • Organization email: {{ user.contact.email }}
  • +
  • Organization email: {{ user.email }}
  • Title or role in your organization: {{ user.contact.title }}
  • Phone: {{ user.contact.phone }}
From 9024d683af3d446d07cffbfe979c16676ab2ffb6 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Thu, 23 May 2024 16:56:40 -0600 Subject: [PATCH 09/10] log cleanup --- src/registrar/views/domain_request.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index 9dcf183a2..8fb104005 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -230,7 +230,6 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView): if self.__class__ == DomainRequestWizard: if request.path_info == self.NEW_URL_NAME: context = self.get_context_data() - logger.debug("CONTEXT profile flag is %s" % context["has_profile_feature_flag"]) return render(request, "domain_request_intro.html", context=context) else: return self.goto(self.steps.first) From 6d6d603123630b7784195dbeab4d26910c0c248d Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 28 May 2024 11:13:15 -0600 Subject: [PATCH 10/10] PR updates / cleanup --- src/registrar/assets/sass/_theme/_admin.scss | 3 ++- src/registrar/templates/includes/profile_information.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/registrar/assets/sass/_theme/_admin.scss b/src/registrar/assets/sass/_theme/_admin.scss index cc86e661b..7501dc1f0 100644 --- a/src/registrar/assets/sass/_theme/_admin.scss +++ b/src/registrar/assets/sass/_theme/_admin.scss @@ -732,6 +732,7 @@ div.dja__model-description{ max-width: 72ex; word-wrap: break-word; } + .usa-summary-box h3 { color: #{$dhs-blue-60}; -} \ No newline at end of file +} diff --git a/src/registrar/templates/includes/profile_information.html b/src/registrar/templates/includes/profile_information.html index 3bd46f2e4..2922fd3f7 100644 --- a/src/registrar/templates/includes/profile_information.html +++ b/src/registrar/templates/includes/profile_information.html @@ -13,10 +13,10 @@
    -
  • Full name: {{ user.contact.first_name }} {{ user.contact.last_name }}
  • +
  • Full name: {{ user.contact.get_formatted_name }}
  • Organization email: {{ user.email }}
  • Title or role in your organization: {{ user.contact.title }}
  • -
  • Phone: {{ user.contact.phone }}
  • +
  • Phone: {{ user.contact.phone.as_national }}