generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[207] On Create a case, allow Category to be 'undefined' (#848)
* [207] Create Case - select category (yes and no paths) (#843) https://trello.com/c/lXJoWDBg/336-207-create-case-journey-yes https://trello.com/c/1xmSuvHV/337-207-create-case-journey-no * [207] update/remove case category (#846) https://trello.com/c/pUBS38GZ/338-207-update-remove-case-category
- Loading branch information
Showing
18 changed files
with
195 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
Reveal the category selection dropdown | ||
*/ | ||
|
||
function changeCategorySelectState(state) { | ||
const categorySelect = document.querySelectorAll("select[name='create_case_form[category_id]']")[0]; | ||
|
||
if (state == "hidden") { | ||
categorySelect.selectedIndex = 0; | ||
categorySelect.parentNode.classList.add("govuk-!-display-none"); | ||
|
||
} else if (state == "visible") { | ||
categorySelect.parentNode.classList.remove("govuk-!-display-none"); | ||
} | ||
} | ||
|
||
window.addEventListener("load", () => { | ||
const requestTypeYes = document.querySelectorAll("input[value=true]")[0]; | ||
const requestTypeNo = document.querySelectorAll("input[value=false]")[0]; | ||
|
||
requestTypeYes.addEventListener("change", () => { | ||
if (requestTypeYes.checked) { | ||
changeCategorySelectState("visible"); | ||
} | ||
}); | ||
|
||
requestTypeNo.addEventListener("change", () => { | ||
if (requestTypeNo.checked) { | ||
changeCategorySelectState("hidden"); | ||
} | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ def form_params | |
:estimated_savings, | ||
:hub_notes, | ||
:progress_notes, | ||
:request_type, | ||
) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ def form_params | |
:estimated_savings, | ||
:hub_notes, | ||
:progress_notes, | ||
:request_type, | ||
) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.