Skip to content

Commit

Permalink
Merge pull request #625 from bcgov/feat/srs-265
Browse files Browse the repository at this point in the history
issue fix for 265
  • Loading branch information
midhun-aot authored Feb 16, 2024
2 parents 66fdd90 + 87a8524 commit 3e135ed
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,44 +473,67 @@
"action": "custom",
"showValidations": false,
"theme": "warning",
"size": "md",
"block": false,
"leftIcon": "",
"rightIcon": "",
"shortcut": "",
"description": "",
"tooltip": "",
"customClass": "",
"tabindex": "",
"disableOnInvalid": false,
"hidden": false,
"autofocus": false,
"disabled": true,
"tableView": false,
"modalEdit": false,
"key": "needsMoreInfo",
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\nconst taskUrl = window.location.pathname.split('/');\r\nconst taskId = taskUrl[2];\r\nconst authToken = localStorage.getItem(\"authToken\");\r\nconst bpmUrl = localStorage.getItem(\"bpmApiUrl\");\r\nvar reqUrl = bpmUrl + \"/task/\" + taskId + \"/variables\";\r\n\r\n\r\n getData(reqUrl, authToken).then((response) => {\r\n \r\n\t if(roles.includes(\"formsflow-reviewer\")) {\r\n \tvar applicationStatus = response.applicationStatus ? response.applicationStatus.value : '';\r\n\tvar isResubmitted = response.isSrcrResubmitted ? response.isSrcrResubmitted.value : false;\r\n \t show = true;\r\n \t \r\n\r\n \t\t\r\n\t if (isResubmitted) {\r\n\t component.disabled = true;\r\n\t component.description = 'Disabled since SRCR resubmission in progress';\r\n\t instance.triggerRedraw();\r\n\t } else {\r\n\t component.description = '';\r\n\t component.disabled = false;\r\n\t instance.triggerRedraw();\r\n\t }\r\n\t }\r\n\t else\r\n\t {\r\n \t\tshow = false;\r\n\t }\r\n });\r\n\r\n\r\nasync function getData(reqUrl, authToken) {\r\n const response = await fetch(reqUrl, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-type\": \"application/json\",\r\n Accept: \"application/json\",\r\n Authorization: \"Bearer \" + authToken,\r\n },\r\n });\r\n const data = await response.json();\r\n return data;\r\n}",
"tags": [],
"properties": {},
"conditional": {
"show": null,
"when": null,
"eq": "",
"json": ""
},
"customConditional": "const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"));\r\nconst roles = UserDetails[\"role\"];\r\nconst taskUrl = window.location.pathname.split('/');\r\nconst taskId = taskUrl[2];\r\nconst authToken = localStorage.getItem(\"authToken\");\r\nconst bpmUrl = localStorage.getItem(\"bpmApiUrl\");\r\nvar reqUrl = bpmUrl + \"/task/\" + taskId + \"/variables\";\r\n\r\n\r\n getData(reqUrl, authToken).then((response) => {\r\n \r\n\t if(roles.includes(\"formsflow-reviewer\")) {\r\n \tvar applicationStatus = response.applicationStatus ? response.applicationStatus.value : '';\r\n\tvar isSrcrResubmitted = response.isSrcrResubmitted ? response.isSrcrResubmitted.value : false;\r\n\tvar isSoscResubmitted = response.isSoscResubmitted ? response.isSoscResubmitted.value : false;\r\n \t show = true;\r\n \t \r\n\r\n \t\t\r\n\t if (isSrcrResubmitted) {\r\n\t component.disabled = true;\r\n\t component.description = 'Disabled since SRCR resubmission in progress';\r\n\t instance.triggerRedraw();\r\n\t } else if (isSoscResubmitted) {\r\n\t component.disabled = true;\r\n\t component.description = 'Disabled since SoSC resubmission in progress';\r\n\t instance.triggerRedraw();\r\n\t } else {\r\n\t component.description = '';\r\n\t component.disabled = false;\r\n\t instance.triggerRedraw();\r\n\t }\r\n\t }\r\n\t else\r\n\t {\r\n \t\tshow = false;\r\n\t }\r\n });\r\n\r\n\r\nasync function getData(reqUrl, authToken) {\r\n const response = await fetch(reqUrl, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-type\": \"application/json\",\r\n Accept: \"application/json\",\r\n Authorization: \"Bearer \" + authToken,\r\n },\r\n });\r\n const data = await response.json();\r\n return data;\r\n}",
"logic": [],
"attributes": {},
"overlay": {
"style": "",
"page": "",
"left": "",
"top": "",
"width": "",
"height": ""
},
"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;+submissionId;\r\nconst filteredData = _.pick(data, data.deraUtilKeys);\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: 'Returned'\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:'Returned'\r\n }); \r\n});",
"input": true,
"redrawOn": "textField",
"keyModified": true,
"placeholder": "",
"prefix": "",
"customClass": "",
"suffix": "",
"multiple": false,
"defaultValue": null,
"protected": false,
"unique": false,
"persistent": false,
"hidden": false,
"clearOnHide": true,
"refreshOn": "",
"modalEdit": false,
"dataGridLabel": true,
"labelPosition": "top",
"description": "",
"errorLabel": "",
"tooltip": "",
"hideLabel": false,
"tabindex": "",
"autofocus": false,
"dbIndex": false,
"customDefaultValue": "",
"calculateValue": "",
"calculateServer": false,
"widget": {
"type": "input"
},
"attributes": {},
"validateOn": "change",
"validate": {
"required": false,
Expand All @@ -520,31 +543,13 @@
"multiple": false,
"unique": false
},
"conditional": {
"show": null,
"when": null,
"eq": ""
},
"overlay": {
"style": "",
"left": "",
"top": "",
"width": "",
"height": ""
},
"allowCalculateOverride": false,
"encrypted": false,
"showCharCount": false,
"showWordCount": false,
"properties": {},
"allowMultipleMasks": false,
"addons": [],
"size": "md",
"leftIcon": "",
"rightIcon": "",
"block": false,
"disableOnInvalid": false,
"id": "er4piec"
"id": "e5azrwm"
}
],
"size": "md",
Expand Down Expand Up @@ -5564,7 +5569,7 @@
"attributes": {},
"components": [
{
"id": "eh8z2bfa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"id": "eh8z2bfa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"key": "panel",
"tags": [],
"tree": false,
Expand Down Expand Up @@ -36160,7 +36165,7 @@
}
],
"collapsible": false,
"id": "eof794000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"id": "eof79400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"placeholder": "",
"prefix": "",
"customClass": "",
Expand Down
Loading

0 comments on commit 3e135ed

Please sign in to comment.