From d57155acc5c5a797c69856aad4af82b00cff21ce Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 14 May 2024 13:07:55 -0600 Subject: [PATCH 1/8] 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 72abe6a276..c8bfc47ac0 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -15,6 +15,12 @@

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 %} +

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 5f359e95f4..d24e6f8fa6 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 0000000000..edd6ea6455 --- /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 f939761381..f6101873e0 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -16,6 +16,8 @@ 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 @@ def get(self, request, *args, **kwargs): # 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 2/8] 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 c8bfc47ac0..2db0177fb4 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -15,10 +15,10 @@

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 %} -

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 f6101873e0..e141af5026 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -229,10 +229,10 @@ def get(self, request, *args, **kwargs): # 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 @@ def get_context_data(self): 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 @@ def get_context_data(self): "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 3/8] 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 e141af5026..21675c2fea 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -230,9 +230,6 @@ def get(self, request, *args, **kwargs): 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 @@ def get_context_data(self): 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 @@ def get_context_data(self): "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 d3281ddf06d8bce6144b1fa275d524e3d833c6c4 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 21 May 2024 14:23:03 -0600 Subject: [PATCH 4/8] 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 d24e6f8fa6..5f359e95f4 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 21675c2fea..d080195922 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -388,7 +388,6 @@ def get_context_data(self): 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 78ba5c78d7c1e8090694217bc93ea31fa9ca4fb5 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 22 May 2024 15:26:10 -0600 Subject: [PATCH 5/8] 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 2db0177fb4..2b941b48f7 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -14,8 +14,7 @@

You’re about to start your .gov domain request.

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 d080195922..9dcf183a2e 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -230,7 +230,8 @@ def get(self, request, *args, **kwargs): 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 @@ def get_context_data(self): 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 6/8] 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 c716ad49c2..cc86e661b3 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 2b941b48f7..d6d3b3b7f5 100644 --- a/src/registrar/templates/domain_request_intro.html +++ b/src/registrar/templates/domain_request_intro.html @@ -15,8 +15,8 @@

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 %} -

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 edd6ea6455..3bd46f2e47 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 7/8] 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 9dcf183a2e..8fb1040052 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -230,7 +230,6 @@ def get(self, request, *args, **kwargs): 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 8/8] 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 cc86e661b3..7501dc1f0c 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 3bd46f2e47..2922fd3f73 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 }}