Skip to content

Commit

Permalink
Merge pull request #467 from bcgov/map-fix
Browse files Browse the repository at this point in the history
Map fix
  • Loading branch information
nikhila-aot authored Aug 30, 2023
2 parents df2056f + 37f9234 commit 0b191f5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
{
"components": [
{
"label": "Needs More Info Bundle",
"label": "Needs More Info",
"action": "custom",
"showValidations": false,
"theme": "warning",
Expand Down Expand Up @@ -233,7 +233,7 @@
"showWordCount": false,
"allowMultipleMasks": false,
"addons": [],
"id": "e2hisow"
"id": "ed5wtf6"
}
],
"size": "md",
Expand Down Expand Up @@ -456,7 +456,7 @@
"tableView": false,
"modalEdit": false,
"templates": {
"header": "{% console.log(\"row-key header\",'commentFor',row['commentFor']) %}\r\n{% const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))%}\r\n{% const groups = UserDetails[\"groups\"]; %}\r\n\r\n{% if(groups.includes(\"/formsflow/formsflow-client\") || groups.includes(\"/formsflow/formsflow-reviewer/csap\") || groups.includes(\"/formsflow/formsflow-reviewer/csap-society\")){ %}\r\n\r\n<div class=\"row card-header bg-default\">\r\n {% util.eachComponent(components, function(component) { %}\r\n {% if (displayValue(component) && component.key !== 'commentFor' ) { %}\r\n {% if(component.label === 'Notes') { %}\r\n <div class=\"col-sm-4\">{{ t(component.label) }}</div>\r\n {% } else if(component.key !== 'comments') { %}\r\n <div class=\"col-sm-2\">{{ t(component.label) }}</div>\r\n {% } %}\r\n {% } %}\r\n {% }) %}\r\n </div>\r\n\r\n{% } else { %}\r\n\r\n<div class=\"row card-header bg-default\">\r\n {% util.eachComponent(components, function(component) { %}\r\n {% if (displayValue(component)) { %}\r\n {% if(component.key == 'comments') { %}\r\n <div class=\"col-sm-4\"> {{ t(component.label)}} </div>\r\n {% } else if(component.key == 'role' || component.key == 'createdBy') { %}\r\n <div class=\"col-sm-2\"> {{ t(component.label)}} </div>\r\n{% } else { %}\r\n <div class=\"col-sm-1\"> {{ t(component.label)}} </div>\r\n{% } %} \r\n {% } %}\r\n {% }) %}\r\n </div>\r\n\r\n{% } %}",
"header": "{% console.log(\"row-key header\",'commentFor',row['commentFor']) %}\r\n{% const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))%}\r\n{% const groups = UserDetails[\"groups\"]; %}\r\n\r\n{% if(groups.includes(\"/formsflow/formsflow-client-reviewer\") || groups.includes(\"/formsflow/formsflow-client\") || groups.includes(\"/formsflow/formsflow-reviewer/csap\") || groups.includes(\"/formsflow/formsflow-reviewer/csap-society\")){ %}\r\n\r\n<div class=\"row card-header bg-default\">\r\n {% util.eachComponent(components, function(component) { %}\r\n {% if (displayValue(component) && component.key !== 'commentFor' ) { %}\r\n {% if(component.label === 'Notes') { %}\r\n <div class=\"col-sm-4\">{{ t(component.label) }}</div>\r\n {% } else if(component.key !== 'comments') { %}\r\n <div class=\"col-sm-2\">{{ t(component.label) }}</div>\r\n {% } %}\r\n {% } %}\r\n {% }) %}\r\n </div>\r\n\r\n{% } else { %}\r\n\r\n<div class=\"row card-header bg-default\">\r\n {% util.eachComponent(components, function(component) { %}\r\n {% if (displayValue(component)) { %}\r\n {% if(component.key == 'comments') { %}\r\n <div class=\"col-sm-4\"> {{ t(component.label)}} </div>\r\n {% } else if(component.key == 'role' || component.key == 'createdBy') { %}\r\n <div class=\"col-sm-2\"> {{ t(component.label)}} </div>\r\n{% } else { %}\r\n <div class=\"col-sm-1\"> {{ t(component.label)}} </div>\r\n{% } %} \r\n {% } %}\r\n {% }) %}\r\n </div>\r\n\r\n{% } %}",
"tableHeader": "\n <tr>\n {% util.eachComponent(components, function(component) { %}\n {% if (!component.hasOwnProperty('tableView') || component.tableView) { %}\n <td class=\"editgrid-table-column\">{{ component.label }}</td>\n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n <td class=\"editgrid-table-column\">Actions</td>\n {% } %}\n </tr>\n ",
"row": "\r\n\r\n{% console.log(\"row-key main\",'commentFor',row['commentFor']) %}\r\n{% const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))%}\r\n{% const groups = UserDetails[\"groups\"]; %}\r\n{% console.log('rendering edit grid body')%}\r\n{% if((groups.includes(\"/formsflow/formsflow-reviewer/formsflow-client-reviewer\") || groups.includes(\"/formsflow/formsflow-client\") || groups.includes(\"/formsflow/formsflow-reviewer/csap\") || groups.includes(\"/formsflow/formsflow-reviewer/csap-society\")) && row['commentFor']==='external'){ %}\r\n\r\n\r\n\r\n<div class=\"row\">\r\n\r\n {% util.eachComponent(components, function(component) { %}\r\n {% if (displayValue(component) && component.key !== 'commentFor' ) { %}\r\n {% console.log(\"row-key\",component.key,row[component.key]) %}\r\n {% const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))%}\r\n{% const groups = UserDetails[\"groups\"]; %}\r\n{% if((groups.includes(\"/formsflow/formsflow-reviewer/formsflow-client-reviewer\") || groups.includes(\"/formsflow/formsflow-client\") || groups.includes(\"/formsflow/formsflow-reviewer/csap\") || groups.includes(\"/formsflow/formsflow-reviewer/csap-society\")) && row['commentFor']==='external'){ %}\r\n{% if(component.key == 'comments') { %}\r\n <div class=\"col-sm-4 text-break\">\r\n {{ getView(component, row[component.key])}}\r\n </div>\r\n{% } else { %}\r\n <div class=\"col-sm-2 text-break\">\r\n {{ getView(component, row[component.key])}}\r\n </div>\r\n{%}%}\r\n \r\n\r\n {% } %}\r\n {% } %}\r\n {% }) %}\r\n {% if (!instance.options.readOnly && !instance.disabled) { %}\r\n {% const UserDetails = JSON.parse(localStorage.getItem(\"UserDetails\"))%}\r\n{% const groups = UserDetails[\"groups\"]; %}\r\n{% if((groups.includes(\"/formsflow/formsflow-reviewer/formsflow-client-reviewer\") || groups.includes(\"/formsflow/formsflow-client\") || groups.includes(\"/formsflow/formsflow-reviewer/csap\") || groups.includes(\"/formsflow/formsflow-reviewer/csap-society\")) && row['commentFor']==='external'){ %}\r\n <div class=\"col-sm-2\">\r\n <div class=\"btn-group pull-right\">\r\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\r\n <button class=\"btn btn-danger btn-sm removeRow\"><i class=\"{{ iconClass('trash') }}\"></i></button>\r\n {% } %}\r\n </div>\r\n </div>\r\n \r\n {% } %}\r\n {% } %}\r\n </div>\r\n {% } else if (groups.includes(\"/formsflow/formsflow-reviewer/site-information-advisor\") || groups.includes(\"/formsflow/formsflow-reviewer/cssa-team\") || groups.includes(\"/formsflow/formsflow-reviewer/caseworker\") || groups.includes(\"/formsflow/formsflow-reviewer/sdm\")) { %}\r\n <div class=\"row\">\r\n {% util.eachComponent(components, function(component) { %}\r\n {% console.log('for sia') %}\r\n {% if (displayValue(component)) { %}\r\n {% if(component.key == 'comments') { %}\r\n <div class=\"col-sm-4 text-break\"> {{ getView(component, row[component.key])}} </div>\r\n {% } else if(component.key == 'role' || component.key == 'createdBy') { %}\r\n <div class=\"col-sm-2 text-break\"> {{ getView(component, row[component.key])}} </div>\r\n{% } else { %}\r\n <div class=\"col-sm-1\"> {{ getView(component, row[component.key])}} </div>\r\n{% } %} \r\n \r\n {% } %}\r\n {% }) %}\r\n {% if (!instance.options.readOnly && !instance.disabled) { %}\r\n <div class=\"col-sm-1\">\r\n <div class=\"btn-group pull-right\">\r\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\r\n <button class=\"btn btn-danger btn-sm removeRow\"><i class=\"{{ iconClass('trash') }}\"></i></button>\r\n {% } %}\r\n </div>\r\n </div>\r\n {% } %}\r\n </div>\r\n {% } %}\r\n \r\n \r\n \r\n{% const emptyElements = []; %}\r\n{% const elements = document.getElementsByClassName(\"list-group-item\"); %}\r\n{% for (let i = 0; i < elements.length; i++) { %}\r\n{% const element = elements[i]; %}\r\n{% if(element.querySelectorAll('div.row').length===0){(element).remove() }} %}",
"tableRow": "\n {% util.eachComponent(components, function(component) { %}\n {% if (!component.hasOwnProperty('tableView') || component.tableView) { %}\n <td class=\"editgrid-table-column\">\n {{ getView(component, row[component.key]) }}\n </td>\n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n <td class=\"editgrid-table-column\">\n <div class=\"btn-group\">\n <button class=\"btn btn-default btn-light btn-sm editRow\" aria-label=\"{{ t('Edit row') }}\"><i class=\"{{ iconClass('edit') }}\"></i></button>\n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n <button class=\"btn btn-danger btn-sm removeRow\" aria-label=\"{{ t('Remove row') }}\"><i class=\"{{ iconClass('trash') }}\"></i></button>\n {% } %}\n </div>\n </td>\n {% } %}\n ",
Expand Down Expand Up @@ -603,7 +603,7 @@
"wysiwyg": false,
"editor": "",
"fixedSize": true,
"id": "eu50ikk"
"id": "e3f7xt6"
}
],
"width": 4,
Expand Down Expand Up @@ -695,7 +695,7 @@
"addons": [],
"inputType": "radio",
"fieldSet": false,
"id": "e9jdvz"
"id": "e9ddc4f"
}
],
"width": 2,
Expand Down Expand Up @@ -782,7 +782,7 @@
"displayMask": "",
"spellcheck": true,
"truncateMultipleSpaces": false,
"id": "e9e9ws"
"id": "exbt5zd"
}
],
"size": "md",
Expand Down Expand Up @@ -869,7 +869,7 @@
"displayMask": "",
"spellcheck": true,
"truncateMultipleSpaces": false,
"id": "e6pf0x"
"id": "etitw4"
}
],
"size": "md",
Expand Down Expand Up @@ -956,7 +956,7 @@
"displayMask": "",
"spellcheck": true,
"truncateMultipleSpaces": false,
"id": "edodsdx"
"id": "ej7qfd"
}
],
"size": "md",
Expand Down Expand Up @@ -1031,7 +1031,7 @@
"tree": false,
"lazyLoad": false,
"autoAdjust": false,
"id": "eruizib"
"id": "ei71bjj"
}
],
"placeholder": "",
Expand All @@ -1050,7 +1050,7 @@
"tree": true,
"lazyLoad": false,
"defaultOpen": false,
"id": "ex5ffy8"
"id": "ep1r5ub"
},
{
"id": "evi8v2p",
Expand Down Expand Up @@ -1213,7 +1213,7 @@
"attributes": {},
"components": [
{
"id": "ea2btv0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"id": "ea2btv000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"key": "Panel-InformationForAffectedAndLikelyAffectedParcels",
"tree": false,
"type": "panel",
Expand Down Expand Up @@ -8349,7 +8349,7 @@
"attributes": {},
"components": [
{
"id": "e3t798j000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"id": "e3t798j00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"key": "simplecols4",
"tree": false,
"type": "columns",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ task.execution.setVariable('deleteReason', "completed");</camunda:script>
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${action == 'Returned'}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_1oam11w" sourceRef="Activity_06nypz0" targetRef="Activity_0w5t5av">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${action == 'Accepted'}</bpmn:conditionExpression>
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${action == 'Accepted' || action == 'Approved' }</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_00mjhxs" sourceRef="Activity_0w5t5av" targetRef="Activity_0ro66yt" />
<bpmn:sequenceFlow id="Flow_04l5mhw" sourceRef="Activity_0ro66yt" targetRef="Activity_040vqyo" />
Expand Down
2 changes: 1 addition & 1 deletion map-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-parcelmap-bc",
"version": "1.0.4",
"version": "1.0.6",
"private": false,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
Expand Down
11 changes: 9 additions & 2 deletions map-package/src/map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ const Map = (props) => {

useEffect(() => {
if (props.initLocation.length > 0 && props.initLocation !== null && props.initLocation !== undefined) {
setZoom(13);
setLocation(props.initLocation);

if(props.readOnly)
{
setShow(false);
}

const timer = setTimeout(() => {
setZoom(13);
setLocation(props.initLocation);
}, 1000); // 3000 milliseconds (3 seconds)

// Clean up the timer to avoid memory leaks
return () => clearTimeout(timer);
}
}, [props]);

Expand Down

0 comments on commit 0b191f5

Please sign in to comment.