mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 09:07:02 +02:00
Fix js, linting
This commit is contained in:
parent
4edb6ea988
commit
e581d3b2ca
3 changed files with 20 additions and 16 deletions
|
@ -213,7 +213,6 @@ function HookupYesNoListener(radioButtonName, elementIdToShowIfYes, elementIdToS
|
||||||
// Check if the element exists before accessing its value
|
// Check if the element exists before accessing its value
|
||||||
let selectedValue = radioButtonChecked ? radioButtonChecked.value : null;
|
let selectedValue = radioButtonChecked ? radioButtonChecked.value : null;
|
||||||
|
|
||||||
if (elementIdToShowIfYes && elementIdToShowIfNo){
|
|
||||||
switch (selectedValue) {
|
switch (selectedValue) {
|
||||||
case 'True':
|
case 'True':
|
||||||
toggleTwoDomElements(elementIdToShowIfYes, elementIdToShowIfNo, 1);
|
toggleTwoDomElements(elementIdToShowIfYes, elementIdToShowIfNo, 1);
|
||||||
|
@ -226,9 +225,6 @@ function HookupYesNoListener(radioButtonName, elementIdToShowIfYes, elementIdToS
|
||||||
default:
|
default:
|
||||||
toggleTwoDomElements(elementIdToShowIfYes, elementIdToShowIfNo, 0);
|
toggleTwoDomElements(elementIdToShowIfYes, elementIdToShowIfNo, 0);
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
console.log("No elements to show")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radioButtons.length) {
|
if (radioButtons.length) {
|
||||||
|
|
|
@ -1103,7 +1103,14 @@ class DomainRequest(TimeStampedModel):
|
||||||
return self.other_contacts.exists()
|
return self.other_contacts.exists()
|
||||||
|
|
||||||
def has_additional_details(self) -> bool:
|
def has_additional_details(self) -> bool:
|
||||||
return self.has_anything_else_text() or self.has_cisa_representative
|
"""Combines the has_anything_else_text and has_cisa_representative fields,
|
||||||
|
then returns if this domain request has either of them."""
|
||||||
|
# Split out for linter
|
||||||
|
has_details = False
|
||||||
|
if self.has_anything_else_text or self.has_cisa_representative:
|
||||||
|
has_details = True
|
||||||
|
|
||||||
|
return has_details
|
||||||
|
|
||||||
def is_federal(self) -> Union[bool, None]:
|
def is_federal(self) -> Union[bool, None]:
|
||||||
"""Is this domain request for a federal agency?
|
"""Is this domain request for a federal agency?
|
||||||
|
|
|
@ -1037,8 +1037,9 @@ class DomainRequestTests(TestWithUser, WebTest):
|
||||||
|
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
|
||||||
# We expect to see this twice for both fields
|
# We expect to see this twice for both fields. This results in a count of 4
|
||||||
self.assertContains(response, "This question is required.", count=2)
|
# due to screen reader information / html.
|
||||||
|
self.assertContains(response, "This question is required.", count=4)
|
||||||
|
|
||||||
def test_submitting_other_contacts_deletes_no_other_contacts_rationale(self):
|
def test_submitting_other_contacts_deletes_no_other_contacts_rationale(self):
|
||||||
"""When a user submits the Other Contacts form with other contacts selected, the domain request's
|
"""When a user submits the Other Contacts form with other contacts selected, the domain request's
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue