Merge branch 'main' into za/2047-force-new-users-profile

This commit is contained in:
zandercymatics 2024-05-29 11:36:37 -06:00
commit a76b28442f
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
5 changed files with 63 additions and 6 deletions

View file

@ -724,3 +724,15 @@ div.dja__model-description{
.text-underline { .text-underline {
text-decoration: underline !important; 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};
}

View file

@ -14,7 +14,12 @@
<h2>Time to complete the form</h2> <h2>Time to complete the form</h2>
<p>If you have <a href="{% public_site_url 'domains/before/#information-you%E2%80%99ll-need-to-complete-the-domain-request-form' %}" target="_blank" class="usa-link">all the information you need</a>, <p>If you have <a href="{% public_site_url 'domains/before/#information-you%E2%80%99ll-need-to-complete-the-domain-request-form' %}" target="_blank" class="usa-link">all the information you need</a>,
completing your domain request might take around 15 minutes.</p> completing your domain request might take around 15 minutes.</p>
{% if has_profile_feature_flag %}
<h2>How well reach you</h2>
<p>While reviewing your domain request, we may need to reach out with questions. Well also email you when we complete our review If the contact information below is not correct, visit <a href="" target="_blank" class="usa-link">your profile</a> to make updates.</p>
{% include "includes/profile_information.html" with user=user%}
{% endif %}
{% block form_buttons %} {% block form_buttons %}
<div class="stepnav"> <div class="stepnav">

View file

@ -106,7 +106,7 @@
{% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level %} {% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level %}
{% endif %} {% 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 %} {% include "includes/summary_item.html" with title='Your contact information' value=DomainRequest.submitter contact='true' heading_level=heading_level %}
{% endif %} {% endif %}

View file

@ -0,0 +1,25 @@
{% load static field_helpers %}
{% block domain_content %}
<div
class="usa-summary-box"
role="region"
aria-labelledby="summary-box-key-information"
>
<div class="usa-summary-box__body">
<h3 class="usa-summary-box__heading" id="summary-box-key-information">
Your contact information
</h3>
<div class="usa-summary-box__text">
<ul>
<li>Full name: <b>{{ user.contact.get_formatted_name }}</b></li>
<li>Organization email: <b>{{ user.email }}</b></li>
<li>Title or role in your organization: <b>{{ user.contact.title }}</b></li>
<li>Phone: <b>{{ user.contact.phone.as_national }}</b></li>
</ul>
</div>
</div>
</div>
{% endblock %}

View file

@ -22,7 +22,7 @@ from .utility import (
DomainRequestWizardPermissionView, DomainRequestWizardPermissionView,
) )
from waffle.decorators import flag_is_active from waffle.decorators import flag_is_active, waffle_flag
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -230,7 +230,8 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
context = self.get_context_data() context = self.get_context_data()
if self.__class__ == DomainRequestWizard: if self.__class__ == DomainRequestWizard:
if request.path_info == self.NEW_URL_NAME: if request.path_info == self.NEW_URL_NAME:
return render(request, "domain_request_intro.html", context) context = self.get_context_data()
return render(request, "domain_request_intro.html", context=context)
else: else:
return self.goto(self.steps.first) return self.goto(self.steps.first)
@ -386,7 +387,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
else: else:
modal_heading = "You are about to submit an incomplete request" modal_heading = "You are about to submit an incomplete request"
return { has_profile_flag = flag_is_active(self.request, "profile_feature")
logger.debug("PROFILE FLAG is %s" % has_profile_flag)
context = {
"form_titles": self.TITLES, "form_titles": self.TITLES,
"steps": self.steps, "steps": self.steps,
# Add information about which steps should be unlocked # Add information about which steps should be unlocked
@ -394,8 +398,11 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
"is_federal": self.domain_request.is_federal(), "is_federal": self.domain_request.is_federal(),
"modal_button": modal_button, "modal_button": modal_button,
"modal_heading": modal_heading, "modal_heading": modal_heading,
"has_profile_feature_flag": flag_is_active(self.request, "profile_feature"), # 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
def get_step_list(self) -> list: def get_step_list(self) -> list:
"""Dynamically generated list of steps in the form wizard.""" """Dynamically generated list of steps in the form wizard."""
@ -406,6 +413,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
condition = condition(self) condition = condition(self)
if condition: if condition:
step_list.append(step) step_list.append(step)
if flag_is_active(self.request, "profile_feature"):
step_list.remove(Step.YOUR_CONTACT)
return step_list return step_list
def goto(self, step): def goto(self, step):
@ -540,6 +551,10 @@ class YourContact(DomainRequestWizard):
template_name = "domain_request_your_contact.html" template_name = "domain_request_your_contact.html"
forms = [forms.YourContactForm] 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): class OtherContacts(DomainRequestWizard):
template_name = "domain_request_other_contacts.html" template_name = "domain_request_other_contacts.html"