Skip to content

Commit

Permalink
Merge pull request #650 from bcgov/feat/srs-260
Browse files Browse the repository at this point in the history
issue fix for 260
  • Loading branch information
midhun-aot authored Mar 19, 2024
2 parents cb87404 + 52d8331 commit 572e101
Show file tree
Hide file tree
Showing 5 changed files with 1,134 additions and 1,103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
"showValidations": false,
"tableView": false,
"key": "prevReviewer",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))\r\n\r\nconst roles = UserDetails[\"role\"];\r\n\r\n\r\nif(roles.includes(\"formsflow-reviewer\") && \r\n!roles.includes(\"formsflow-reviewer/caseworker\") &&\r\n!(roles.includes(\"formsflow-reviewer/sdm\") && data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\")) {\r\n show = true;\r\n}\r\nelse\r\n{\r\n if (roles.includes(\"formsflow-reviewer/caseworker\") &&\r\n roles.includes(\"formsflow-reviewer/sdm\") &&\r\n data.bundleStatus === \"cssaCaseworkerAccepted\")\r\n show = true;\r\n else\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))\r\n\r\nconst roles = UserDetails[\"role\"];\r\n\r\n\r\nif(roles.includes(\"formsflow-reviewer\") && \r\n!roles.includes(\"formsflow-reviewer/caseworker\") &&\r\n!(roles.includes(\"formsflow-reviewer/sdm\") && data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\")) {\r\n show = true;\r\n}\r\nelse\r\n{\r\n if (roles.includes(\"formsflow-reviewer/caseworker\") &&\r\n roles.includes(\"formsflow-reviewer/sdm\") &&\r\n data.bundleStatus === \"Caseworker Accepted CSSA Form\")\r\n show = true;\r\n else\r\n show = false;\r\n}",
"type": "button",
"custom": "const submissionId = form._submission._id;\r\nconst formId = form._submission.form;\r\nconst formDataReqUrl = form.formio?form.formio.formUrl:(localStorage.getItem('customSubmissionUrl')+'/form/'+formId)+'/submission/'+submissionId;\r\nconst filteredData = _.pick(data, data.cssaUtilKeys);\r\nconst formDataReqObj1 = { \"_id\": submissionId, \"data\": filteredData};\r\nconst formio = new Formio(formDataReqUrl);\r\nformio.saveSubmission(formDataReqObj1).then( result => {\r\nform.emit('customEvent', {\r\n type: \"actionComplete\", \r\n component: component,\r\n actionType: 'Recheck'\r\n }); \r\n}).catch((error)=>{\r\n//Error callback on not Save\r\nform.emit('customEvent', {\r\n type: \"actionError\", \r\n component: component,\r\n actionType:'Recheck'\r\n }); \r\n});",
"input": true,
Expand Down Expand Up @@ -548,7 +548,7 @@
"eq": "",
"json": ""
},
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/caseworker\")){\r\n\tif((data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\" && data.bundleStatus === 'cssaMgrAccepted')||\r\n\tdata.bundleStatus === 'cssaCaseworkerAccepted')\r\n show = false;\r\n\telse\r\n\t\tshow = true;\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/caseworker\")){\r\n\tif((data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\" && data.bundleStatus === 'CSSA Manager Accepted')||\r\n\tdata.bundleStatus === 'Caseworker Accepted CSSA Form')\r\n show = false;\r\n\telse\r\n\t\tshow = true;\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"logic": [],
"attributes": {},
"overlay": {
Expand Down Expand Up @@ -607,7 +607,7 @@
"showValidations": false,
"tableView": false,
"key": "approved",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\n\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/sdm\")&&\r\ndata.bundleStatus !== 'cssaMgrAccepted') {\r\n show = true;\r\n}\r\nelse\r\n{\r\n if(data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\")\r\n show = true;\r\n else\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\n\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/sdm\")&&\r\ndata.bundleStatus !== 'CSSA Manager Accepted') {\r\n show = true;\r\n}\r\nelse\r\n{\r\n if(data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\")\r\n show = true;\r\n else\r\n show = false;\r\n}",
"type": "button",
"custom": "\r\nconst submissionId = form._submission._id;\r\nconst formId = form._submission.form;\r\nconst formDataReqUrl = form.formio?form.formio.formUrl:(localStorage.getItem('customSubmissionUrl')+'/form/'+formId)+'/submission/'+submissionId;\r\nconst filteredData = _.pick(data, data.cssaUtilKeys);\r\nconst formDataReqObj1 = { \"_id\": submissionId, \"data\": filteredData};\r\nconst formio = new Formio(formDataReqUrl);\r\nformio.saveSubmission(formDataReqObj1).then( result => {\r\nform.emit('customEvent', {\r\n type: \"actionComplete\", \r\n component: component,\r\n actionType: 'Approved'\r\n }); \r\n}).catch((error)=>{\r\n//Error callback on not Save\r\nform.emit('customEvent', {\r\n type: \"actionError\", \r\n component: component,\r\n actionType:'Approved'\r\n }); \r\n});\r\n",
"input": true,
Expand Down Expand Up @@ -1390,7 +1390,7 @@
"eq": "",
"json": ""
},
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))\r\nconst roles = UserDetails[\"role\"];\r\nif(roles.includes(\"formsflow-reviewer/cssa-team\") || \r\nroles.includes(\"formsflow-reviewer/cssa-manager\") || \r\nroles.includes(\"formsflow-reviewer/csap\") || \r\nroles.includes(\"formsflow-reviewer/csap-society\") || \r\nroles.includes(\"formsflow-reviewer/caseworker\") || \r\nroles.includes(\"formsflow-reviewer/sdm\")) \r\n{\r\n if(data.bundleStatus === 'cssaCaseworkerAccepted' ||\r\n (data.bundleStatus === 'cssaMgrAccepted' && \r\n data.typeOfReview === 'applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc'))\r\n show = false;\r\n else\r\n show = true;\r\n}\r\nelse\r\n{\r\n if(data.bundleStatus === 'cssaMgrAccepted')\r\n show = true;\r\n else\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))\r\nconst roles = UserDetails[\"role\"];\r\nif(roles.includes(\"formsflow-reviewer/cssa-team\") || \r\nroles.includes(\"formsflow-reviewer/cssa-manager\") || \r\nroles.includes(\"formsflow-reviewer/csap\") || \r\nroles.includes(\"formsflow-reviewer/csap-society\") || \r\nroles.includes(\"formsflow-reviewer/caseworker\") || \r\nroles.includes(\"formsflow-reviewer/sdm\")) \r\n{\r\n if(data.bundleStatus === 'Caseworker Accepted CSSA Form' ||\r\n (data.bundleStatus === 'CSSA Manager Accepted' && \r\n data.typeOfReview === 'applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc'))\r\n show = false;\r\n else\r\n show = true;\r\n}\r\nelse\r\n{\r\n if(data.bundleStatus === 'CSSA Manager Accepted')\r\n show = true;\r\n else\r\n show = false;\r\n}",
"logic": [],
"attributes": {},
"overlay": {
Expand Down Expand Up @@ -1450,7 +1450,7 @@
"showValidations": false,
"tableView": false,
"key": "approveBundle",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif((roles.includes(\"formsflow-reviewer/sdm\") &&\r\ndata.bundleStatus === 'cssaCaseworkerAccepted') ||\r\n(roles.includes(\"formsflow-reviewer/sdm\") &&\r\ndata.bundleStatus === 'cssaMgrAccepted' &&\r\ndata.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\")) {\r\n show = true;\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif((roles.includes(\"formsflow-reviewer/sdm\") &&\r\ndata.bundleStatus === 'Caseworker Accepted CSSA Form') ||\r\n(roles.includes(\"formsflow-reviewer/sdm\") &&\r\ndata.bundleStatus === 'CSSA Manager Accepted' &&\r\ndata.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\")) {\r\n show = true;\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"type": "button",
"custom": "\r\nform.emit('customEvent', {\r\n type: \"actionComplete\", \r\n component: component,\r\n actionType: 'Approved'\r\n})",
"input": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@
"eq": "",
"json": ""
},
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/site-risk-classification-officer\")) \r\n{\r\n show = true;\r\n}\r\nelse if (roles.includes(\"formsflow-reviewer/caseworker\") &&\r\ndata.srcrBundleStatus === \"srcrSrcoAccepted\")\r\n{\r\n if (data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\" ||\r\n data.siteRiskClassification !== 'notHighRisk')\r\n show = false;\r\nelse\r\n show = true;\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/site-risk-classification-officer\")) \r\n{\r\n show = true;\r\n}\r\nelse if (roles.includes(\"formsflow-reviewer/caseworker\") &&\r\ndata.srcrBundleStatus === \"SRCO Accepted SRCR Form\")\r\n{\r\n if (data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\" ||\r\n data.siteRiskClassification !== 'notHighRisk')\r\n show = false;\r\nelse\r\n show = true;\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"logic": [],
"attributes": {},
"overlay": {
Expand Down Expand Up @@ -1328,7 +1328,7 @@
"eq": "",
"json": ""
},
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/sdm\")) {\r\n if (data.srcrBundleStatus === \"srcrCaseworkerAccepted\") \r\n show = true;\r\n else if (data.srcrBundleStatus === \"srcrSrcoAccepted\") {\r\n if (data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\" ||\r\n data.siteRiskClassification !== 'notHighRisk')\r\n show = true;\r\n else\r\n show = false;\r\n }\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\n\r\nif(roles.includes(\"formsflow-reviewer/sdm\")) {\r\n if (data.srcrBundleStatus === \"Caseworker Accepted SRCR Form\") \r\n show = true;\r\n else if (data.srcrBundleStatus === \"SRCO Accepted SRCR Form\") {\r\n if (data.typeOfReview === \"applicationViaTheSocietyOfContaminatedSitesApprovedProfessionalsOfBc\" ||\r\n data.siteRiskClassification !== 'notHighRisk')\r\n show = true;\r\n else\r\n show = false;\r\n }\r\n}\r\nelse\r\n{\r\n show = false;\r\n}",
"logic": [],
"attributes": {},
"overlay": {
Expand Down
Loading

0 comments on commit 572e101

Please sign in to comment.