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.
feat(cms): add internal business project to case summary
- Loading branch information
Serena Abbott
authored and
Serena Abbott
committed
Oct 27, 2023
1 parent
1e2cdff
commit 48fd93a
Showing
13 changed files
with
147 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
window.addEventListener("load", () => { | ||
const projectSelect = document.getElementById("select_project"); | ||
projectSelect.addEventListener("change", toggleNewProjectTextVisibility); | ||
toggleNewProjectTextVisibility.bind(projectSelect)(); | ||
}); | ||
|
||
function changeNewProjectTextState(state) { | ||
const newProjectText = document.getElementById("new_project_text"); | ||
|
||
if (state == "hidden") { | ||
newProjectText.value = ''; | ||
newProjectText.classList.add("govuk-!-display-none"); | ||
newProjectText.parentNode.childNodes[0].classList.add("govuk-!-display-none"); | ||
newProjectText.setAttribute("disabled", true); | ||
|
||
} else if (state == "visible") { | ||
newProjectText.classList.remove("govuk-!-display-none"); | ||
newProjectText.parentNode.childNodes[0].classList.remove("govuk-!-display-none"); | ||
newProjectText.removeAttribute("disabled"); | ||
} | ||
} | ||
|
||
function toggleNewProjectTextVisibility() { | ||
if (this.options[this.selectedIndex].text == 'Add new project') { | ||
changeNewProjectTextState("visible"); | ||
} else { | ||
changeNewProjectTextState("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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddProjectToSupportCase < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :support_cases, :project, :string | ||
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