From 9b32633d0170af078d30500be07cb3960f808765 Mon Sep 17 00:00:00 2001
From: Golnar <47370713+GolnarNaghavi@users.noreply.github.com>
Date: Fri, 8 Nov 2024 09:50:51 -0800
Subject: [PATCH 1/2] Worked on JS code for sprint 18
---
.../caps_ChildCareQuarterlyReport.Form.js | 13 +++++++++----
.../Scripts/FormHandler/caps_Project.Form.js | 5 +++++
.../Scripts/FormHandler/caps_ProjectTracker.Form.js | 4 ++--
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/CAPS/WebResources/Scripts/FormHandler/caps_ChildCareQuarterlyReport.Form.js b/CAPS/WebResources/Scripts/FormHandler/caps_ChildCareQuarterlyReport.Form.js
index ecf921f..5987a0b 100644
--- a/CAPS/WebResources/Scripts/FormHandler/caps_ChildCareQuarterlyReport.Form.js
+++ b/CAPS/WebResources/Scripts/FormHandler/caps_ChildCareQuarterlyReport.Form.js
@@ -19,19 +19,23 @@ CAPS.ChildCareQuarterlyReport.ShowHideFields = function (executionContext) {
var formContext = executionContext.getFormContext();
if (formContext.getAttribute("caps_selfoperated").getValue() === true) {
formContext.getControl("caps_notdirectlyoperatingsecuredauthorizedoperator").setVisible(false);
+ formContext.getControl("caps_nameofauthorizedoperator").setVisible(false);
}
else {
formContext.getControl("caps_notdirectlyoperatingsecuredauthorizedoperator").setVisible(true);
+ formContext.getControl("caps_nameofauthorizedoperator").setVisible(true);
+ //formContext.getAttribute("caps_nameofauthorizedoperator").setValue(null);
}
- //If no Or Information Previously Provided Or Self Operated is Yes
+ //If no Self Operated is No
if (formContext.getAttribute("caps_notdirectlyoperatingsecuredauthorizedoperator").getValue() === 746660001 ||
- formContext.getAttribute("caps_notdirectlyoperatingsecuredauthorizedoperator").getValue() === 746660002 ||
formContext.getAttribute("caps_notdirectlyoperatingsecuredauthorizedoperator").getValue() === null ||
formContext.getAttribute("caps_selfoperated").getValue() === true) {
formContext.getControl("caps_whattypeofauthorizedoperator").setVisible(false);
formContext.getControl("caps_forprofitoperatorjustification").setVisible(false);
formContext.getAttribute("caps_whattypeofauthorizedoperator").setValue(null);
formContext.getAttribute("caps_forprofitoperatorjustification").setValue(null);
+ formContext.getControl("caps_nameofauthorizedoperator").setVisible(false);
+ formContext.getAttribute("caps_nameofauthorizedoperator").setValue(null);
}
else {
formContext.getControl("caps_whattypeofauthorizedoperator").setVisible(true);
@@ -40,14 +44,15 @@ CAPS.ChildCareQuarterlyReport.ShowHideFields = function (executionContext) {
formContext.getAttribute("caps_whattypeofauthorizedoperator").getValue() === null) {
formContext.getControl("caps_forprofitoperatorjustification").setVisible(false);
formContext.getAttribute("caps_forprofitoperatorjustification").setValue(null);
+ formContext.getControl("caps_nameofauthorizedoperator").setVisible(true);
+
}
else {
formContext.getControl("caps_forprofitoperatorjustification").setVisible(true);
}
}
- //If Received funding from additional sources is No or Information Previously Provided
+ //If Received funding from additional sources is No
if (formContext.getAttribute("caps_receivedfundingfromadditionalsources").getValue() === 746660001 ||
- formContext.getAttribute("caps_receivedfundingfromadditionalsources").getValue() === 746660002 ||
formContext.getAttribute("caps_receivedfundingfromadditionalsources").getValue() === null) {
formContext.getControl("caps_amountreceivedandfromwhom").setVisible(false);
formContext.getAttribute("caps_amountreceivedandfromwhom").setValue(null);
diff --git a/CAPS/WebResources/Scripts/FormHandler/caps_Project.Form.js b/CAPS/WebResources/Scripts/FormHandler/caps_Project.Form.js
index 1a4a25d..ac8f8fd 100644
--- a/CAPS/WebResources/Scripts/FormHandler/caps_Project.Form.js
+++ b/CAPS/WebResources/Scripts/FormHandler/caps_Project.Form.js
@@ -1311,11 +1311,16 @@ CAPS.Project.ToggleBUSReplacement = function (executionContext) {
//Show Bus to be replaced and make mandatory
formContext.getControl("caps_bus").setVisible(true);
formContext.getAttribute("caps_bus").setRequiredLevel("required");
+ if (executionContext.getFormContext() != FORM_STATE.CREATE) {
+ formContext.getControl("caps_currentkilometers").setVisible(true);
+ }
+
}
else {
//hide Bus to be replaced and make optional and clear
formContext.getControl("caps_bus").setVisible(false);
formContext.getAttribute("caps_bus").setRequiredLevel("none");
+ formContext.getControl("caps_currentkilometers").setVisible(false);
if (formContext.getAttribute("caps_bus").getValue() != null && executionContext.getFormContext() != FORM_STATE.READ_ONLY) {
formContext.getAttribute("caps_bus").setValue(null);
}
diff --git a/CAPS/WebResources/Scripts/FormHandler/caps_ProjectTracker.Form.js b/CAPS/WebResources/Scripts/FormHandler/caps_ProjectTracker.Form.js
index 1a2571a..4879061 100644
--- a/CAPS/WebResources/Scripts/FormHandler/caps_ProjectTracker.Form.js
+++ b/CAPS/WebResources/Scripts/FormHandler/caps_ProjectTracker.Form.js
@@ -604,7 +604,7 @@ CAPS.ProjectTracker.showHideCategoryRelevantSections = function (formContext) {
if (categoryCode === 'CC_CONVERSION_MINOR') {
formContext.getAttribute("caps_childcareconstructiontype").controls.forEach(control => control.setVisible(false));
- formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(false);
+ formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(true);
}
if (categoryCode === 'CC_UPGRADE') {
@@ -618,7 +618,7 @@ CAPS.ProjectTracker.showHideCategoryRelevantSections = function (formContext) {
formContext.getAttribute("caps_proposedchildcarefacility").controls.forEach(control => control.setVisible(false));
formContext.getAttribute("caps_childcareconstructiontype").controls.forEach(control => control.setVisible(false));
formContext.getAttribute("caps_healthauthority").controls.forEach(control => control.setVisible(false));
- formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(false);
+ formContext.ui.tabs.get("tab_child_care").sections.get("tab_10_section_1").setVisible(true);
}
From c53270346f3bf6a4b525316c12107d2a73ffa002 Mon Sep 17 00:00:00 2001
From: Golnar <47370713+GolnarNaghavi@users.noreply.github.com>
Date: Fri, 8 Nov 2024 11:04:58 -0800
Subject: [PATCH 2/2] Comitted JS code
---
CAPS/WebResources/WebResources.csproj | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CAPS/WebResources/WebResources.csproj b/CAPS/WebResources/WebResources.csproj
index 68dd8a2..6acf20d 100644
--- a/CAPS/WebResources/WebResources.csproj
+++ b/CAPS/WebResources/WebResources.csproj
@@ -244,7 +244,9 @@
+
+
@@ -252,6 +254,7 @@
+