Skip to content

Commit

Permalink
Merge pull request #3177 from cisagov/za/2768-make-additional-details…
Browse files Browse the repository at this point in the history
…-not-required

#3057: Make additional details not required on the org request page - [ZA]
  • Loading branch information
zandercymatics authored Dec 5, 2024
2 parents 52c8afc + babb935 commit c20aaee
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/registrar/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
# dynamically generate the other domain_request_urls
domain_request_urls = [
path("", RedirectView.as_view(pattern_name="domain-request:start"), name="redirect-to-start"),
path("start/", views.DomainRequestWizard.as_view(), name="start"),
path("finished/", views.Finished.as_view(), name="finished"),
path("start/", views.DomainRequestWizard.as_view(), name=views.DomainRequestWizard.NEW_URL_NAME),
path("finished/", views.Finished.as_view(), name=views.DomainRequestWizard.FINISHED_URL_NAME),
]
for step, view in [
# add/remove steps here
Expand Down
16 changes: 16 additions & 0 deletions src/registrar/forms/domain_request_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,22 @@ class AnythingElseForm(BaseDeletableRegistrarForm):
)


class PortfolioAnythingElseForm(BaseDeletableRegistrarForm):
"""The form for the portfolio additional details page. Tied to the anything_else field."""

anything_else = forms.CharField(
required=False,
label="Anything else?",
widget=forms.Textarea(),
validators=[
MaxLengthValidator(
2000,
message="Response must be less than 2000 characters.",
)
],
)


class AnythingElseYesNoForm(BaseYesNoForm):
"""Yes/no toggle for the anything else question on additional details"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h3 class="register-form-review-header">Alternative domains</h3>
{% endif %}

{% if step == Step.ADDITIONAL_DETAILS %}
{% with title=form_titles|get_item:step value=domain_request.anything_else|default:"<span class='text-bold text-secondary-dark'>Incomplete</span>"|safe %}
{% with title=form_titles|get_item:step value=domain_request.anything_else|default:"None" %}
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=is_editable edit_link=domain_request_url %}
{% endwith %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
{% load static field_helpers %}

{% block form_required_fields_help_text %}
{% include "includes/required_fields.html" %}
{% comment %} Empty - this step is not required {% endcomment %}
{% endblock %}

{% block form_fields %}

<fieldset class="usa-fieldset margin-top-2">
<h2>Is there anything else you’d like us to know about your domain request?</h2>
<fieldset class="usa-fieldset">
<h2 class="margin-top-0 margin-bottom-0">Is there anything else you’d like us to know about your domain request?</h2>
</legend>
</fieldset>

<div class="margin-top-3" id="anything-else">
<p><em>Provide details below. <abbr class="usa-hint usa-hint--required" title="required">*</abbr></em></p>
<div id="anything-else">
<p><em>This question is optional.</em></p>
{% with attr_maxlength=2000 add_label_class="usa-sr-only" %}
{% input_with_errors forms.0.anything_else %}
{% endwith %}
Expand Down
7 changes: 4 additions & 3 deletions src/registrar/views/domain_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
URL_NAMESPACE = "domain-request"
# name for accessing /domain-request/<id>/edit
EDIT_URL_NAME = "edit-domain-request"
NEW_URL_NAME = "/request/start/"
NEW_URL_NAME = "start"
FINISHED_URL_NAME = "finished"

# region: Titles
# We need to pass our human-readable step titles as context to the templates.
Expand Down Expand Up @@ -313,7 +314,7 @@ def get(self, request, *args, **kwargs):
# send users "to the domain request wizard" without needing to know which view
# is first in the list of steps.
if self.__class__ == DomainRequestWizard:
if request.path_info == self.NEW_URL_NAME:
if current_url == self.NEW_URL_NAME:
# Clear context so the prop getter won't create a request here.
# Creating a request will be handled in the post method for the
# intro page.
Expand Down Expand Up @@ -614,7 +615,7 @@ def save(self, forms: list):
class PortfolioAdditionalDetails(DomainRequestWizard):
template_name = "portfolio_domain_request_additional_details.html"

forms = [forms.AnythingElseForm]
forms = [forms.PortfolioAnythingElseForm]


# Non-portfolio pages
Expand Down

0 comments on commit c20aaee

Please sign in to comment.