From bad60b307786c5181e4169d6f72208f776cfff5d Mon Sep 17 00:00:00 2001 From: Dhivya Date: Mon, 25 Jul 2022 12:02:10 +0530 Subject: [PATCH 1/3] BugFix/SCAT-5753 CA/DA vetting validation --- .../validations/ca_vetting_validation.js | 71 +++++++++++++++++-- .../validations/da_vetting_validation.js | 68 +++++++++++++++++- 2 files changed, 133 insertions(+), 6 deletions(-) diff --git a/src/main/public/assets/scripts/validations/ca_vetting_validation.js b/src/main/public/assets/scripts/validations/ca_vetting_validation.js index 9a5916f967..08c9f699eb 100644 --- a/src/main/public/assets/scripts/validations/ca_vetting_validation.js +++ b/src/main/public/assets/scripts/validations/ca_vetting_validation.js @@ -19,6 +19,7 @@ document.addEventListener('DOMContentLoaded', () => { var rolevalidation=[]; var staffval=[]; var vettval=[]; + var rolebox_validation=[]; let totalStaff=0; let totalVetting=0; @@ -93,7 +94,7 @@ if(totalVetting<100 || totalVetting>100) else if (classTarget.value > 99 && classTarget.value != '') { document.getElementsByClassName("weight_class")[a - 1].classList.add('govuk-input--error') document.getElementsByClassName("ca_weight_class_error")[a - 1].innerHTML = 'Please enter number <100 and >0'; - preventDefaultState.push(true); + rolebox_validation.push(true); } else if (classTarget.value <= 0 && classTarget.value !== '') { document.getElementsByClassName("weight_class")[a - 1].classList.add('govuk-input--error') @@ -180,7 +181,7 @@ if(totalVetting<100 || totalVetting>100) - switch (true) { + /* switch (true) { case (preventDefaultState.length > 0 && decimalnumber.length > 0 && nonnumerical.length > 0): e.preventDefault(); @@ -267,9 +268,71 @@ if(totalVetting<100 || totalVetting>100) default: console.log("If all else fails"); break; - } + }*/ - + let errormsg=''; + if(preventDefaultState.length > 0 || decimalnumber.length > 0 || nonnumerical.length > 0 || rolevalidation.length>0 || staffval.length>0 || vettval.length> 0 || rolebox_validation.length>0) +{ + if(preventDefaultState.length > 0 && decimalnumber.length > 0 && nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0

  • The input field should not contain decimal values

  • The input field must be a number
  • '; + + if(preventDefaultState.length > 0 && decimalnumber.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0

  • The input field should not contain decimal values
  • '; + + if (preventDefaultState.length > 0 && nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0

  • The input field must be a number
  • '; + + if (decimalnumber.length > 0 && nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field should not contain decimal values

  • The input field must be a number
  • '; + + if (preventDefaultState.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0
  • '; + + if (nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number
  • '; + + if (decimalnumber.length > 0) + + + errormsg=errormsg+'
  • The input field should not contain decimal values
  • '; + + if (rolevalidation.length>0) + + errormsg=errormsg+'
  • At least 1 DDaT role must be populated with a quantity value
  • '; + + if(staffval.length>0) + + errormsg=errormsg+'
  • Sum of all [Weighting for number of staff] values for all Role Families in all groups = 100%
  • '; + + if(vettval.length>0) + + errormsg=errormsg+'
  • Sum of all [Weighting for related vetting requirement] values for all Role Families in all groups = 100%
  • '; + + if(rolebox_validation.length>0) + + errormsg=errormsg+'
  • Value entered in [How many people you need for this role family?] <= 99
  • '; + + + + e.preventDefault(); + $('#ca_vetting_error_summary').removeClass('hide-block'); + $('.govuk-error-summary__title').text('There is a problem'); + $("#ca_summary_list").html(errormsg); + $('html, body').animate({ scrollTop: 0 }, 'fast'); + + } diff --git a/src/main/public/assets/scripts/validations/da_vetting_validation.js b/src/main/public/assets/scripts/validations/da_vetting_validation.js index 51f1544398..4a42941c7b 100644 --- a/src/main/public/assets/scripts/validations/da_vetting_validation.js +++ b/src/main/public/assets/scripts/validations/da_vetting_validation.js @@ -19,6 +19,7 @@ document.addEventListener('DOMContentLoaded', () => { var rolevalidation=[]; var staffval=[]; var vettval=[]; + var rolebox_validation=[]; let totalStaff=0; let totalVetting=0; @@ -96,7 +97,7 @@ if(totalVetting<100 || totalVetting>100) else if (classTarget.value > 99 && classTarget.value != '') { document.getElementsByClassName("weight_class")[a - 1].classList.add('govuk-input--error') document.getElementsByClassName("da_weight_class_error")[a - 1].innerHTML = 'Please enter number <100 and >0'; - preventDefaultState.push(true); + rolebox_validation.push(true); } else if (classTarget.value <= 0 && classTarget.value !== '') { document.getElementsByClassName("weight_class")[a - 1].classList.add('govuk-input--error') @@ -181,7 +182,7 @@ if(totalVetting<100 || totalVetting>100) * */ - switch (true) { + /*switch (true) { case (preventDefaultState.length > 0 && decimalnumber.length > 0 && nonnumerical.length > 0): e.preventDefault(); @@ -266,6 +267,69 @@ if(totalVetting<100 || totalVetting>100) default: console.log("If all else fails"); break; + }*/ + let errormsg=''; + if(preventDefaultState.length > 0 || decimalnumber.length > 0 || nonnumerical.length > 0 || rolevalidation.length>0 || staffval.length>0 || vettval.length> 0 || rolebox_validation.length>0) + { + if(preventDefaultState.length > 0 && decimalnumber.length > 0 && nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0

  • The input field should not contain decimal values

  • The input field must be a number
  • '; + + if(preventDefaultState.length > 0 && decimalnumber.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0

  • The input field should not contain decimal values
  • '; + + if (preventDefaultState.length > 0 && nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0

  • The input field must be a number
  • '; + + if (decimalnumber.length > 0 && nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field should not contain decimal values

  • The input field must be a number
  • '; + + if (preventDefaultState.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number less than 100 and greater than 0
  • '; + + if (nonnumerical.length > 0) + + + errormsg=errormsg+'
  • The input field must be a number
  • '; + + if (decimalnumber.length > 0) + + + errormsg=errormsg+'
  • The input field should not contain decimal values
  • '; + + if (rolevalidation.length>0) + + errormsg=errormsg+'
  • At least 1 DDaT role must be populated with a quantity value
  • '; + + if(staffval.length>0) + + errormsg=errormsg+'
  • Sum of all [Weighting for number of staff] values for all Role Families in all groups = 100%
  • '; + + if(vettval.length>0) + + errormsg=errormsg+'
  • Sum of all [Weighting for related vetting requirement] values for all Role Families in all groups = 100%
  • '; + + if(rolebox_validation.length>0) + + errormsg=errormsg+'
  • Value entered in [How many people you need for this role family?] <= 99
  • '; + + e.preventDefault(); + $('#da_vetting_error_summary').removeClass('hide-block'); + $('.govuk-error-summary__title').text('There is a problem'); + $("#da_summary_list").html(errormsg); + $('html, body').animate({ scrollTop: 0 }, 'fast'); + + + } if (!inputtedtext.length > 0) { From d89beaf4bc9def4793e19f03edf5b361d1726d1a Mon Sep 17 00:00:00 2001 From: Dhivya Date: Mon, 25 Jul 2022 15:37:28 +0530 Subject: [PATCH 2/3] SCATT-5711 --- .../requirements/views/da-resourcesVettingWeightings.njk | 2 +- src/main/resources/content/requirements/daTaskList-B1.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/features/requirements/views/da-resourcesVettingWeightings.njk b/src/main/features/requirements/views/da-resourcesVettingWeightings.njk index 9faaad2c48..cb2ae9eba5 100644 --- a/src/main/features/requirements/views/da-resourcesVettingWeightings.njk +++ b/src/main/features/requirements/views/da-resourcesVettingWeightings.njk @@ -21,7 +21,7 @@ "href": "/da/task-list?path="+ choosenViewPath }, { - "text": "Set your resources and vetting weightings", + "text": "Select resources and set weightings", "href": "#" }] }) }} diff --git a/src/main/resources/content/requirements/daTaskList-B1.json b/src/main/resources/content/requirements/daTaskList-B1.json index 4cfb92dd03..e673845e16 100644 --- a/src/main/resources/content/requirements/daTaskList-B1.json +++ b/src/main/resources/content/requirements/daTaskList-B1.json @@ -79,7 +79,7 @@ { "Task": 4, "link": "/da/resources-vetting-weightings", - "title": " Select the resources you need and set weighting for vetting and resources ", + "title": " Set your resources and vetting weightings", "required": "mandatory", "status": "Cannot start yet" }, From 370bb19f8a48ac0d2c38135431e23220d076d310 Mon Sep 17 00:00:00 2001 From: Dhivya Date: Mon, 25 Jul 2022 17:08:23 +0530 Subject: [PATCH 3/3] SCAT-5503 --- .../resources/content/event-management/event-management.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/content/event-management/event-management.json b/src/main/resources/content/event-management/event-management.json index cd705ac437..4f0118ea0e 100644 --- a/src/main/resources/content/event-management/event-management.json +++ b/src/main/resources/content/event-management/event-management.json @@ -14,7 +14,7 @@ } ], "title": "Your Project", - "subtitle": "Manage your project from this page including responding to supplier's clarification questions or messages in your inbox. See supplier's answers to your published project.", + "subtitle": "You can manage your project from this page including responding to supplier's clarification questions or messages in your inbox. See supplier's answers to your published project.", "subtitle1":"You can close this project using the link under the project name below.", "subsection2_title": "Project ID/name", "subsection2_content": "Close this project",