{ "custom": {}, "params": { "btnActionClose": "closePopup", "btnActionPrimary": "closePopup", "btnActionSecondary": "closePopup", "btnIconAlignment": "left", "btnIconPrimary": "chevron_right", "btnIconSecondary": "", "btnTextPrimary": "Primary", "btnTextSecondary": "Secondary", "editField1": "editField", "editField2": "", "editField3": "", "field1Description": "Description goes here.", "field2Description": "Description goes here.", "field3Description": "Description goes here.", "key": "value", "message": "Message goes here.", "path": "", "payload": { "key": "The payload to return to the caller would go here. DLC 2021-09-23" }, "showCloseBtn": true, "state": "info", "title": "title", "userRole": true }, "propConfig": { "params.btnActionClose": { "paramDirection": "input", "persistent": true }, "params.btnActionPrimary": { "paramDirection": "inout", "persistent": true }, "params.btnActionSecondary": { "paramDirection": "inout", "persistent": true }, "params.btnIconAlignment": { "paramDirection": "inout" }, "params.btnIconPrimary": { "paramDirection": "inout", "persistent": true }, "params.btnIconSecondary": { "paramDirection": "inout", "persistent": true }, "params.btnIconSecondary_1": { "paramDirection": "input", "persistent": true }, "params.btnIconSecondary_2": { "paramDirection": "input", "persistent": true }, "params.btnIconSecondary_3": { "paramDirection": "input", "persistent": true }, "params.btnTextPrimary": { "paramDirection": "inout" }, "params.btnTextSecondary": { "paramDirection": "inout" }, "params.buttons.key": { "paramDirection": "input", "persistent": true }, "params.editField1": { "paramDirection": "input", "persistent": true }, "params.editField2": { "paramDirection": "input", "persistent": true }, "params.editField3": { "paramDirection": "input", "persistent": true }, "params.field1Description": { "paramDirection": "input", "persistent": true }, "params.field2Description": { "paramDirection": "input", "persistent": true }, "params.field3Description": { "paramDirection": "input", "persistent": true }, "params.key": { "paramDirection": "input", "persistent": true }, "params.message": { "paramDirection": "input", "persistent": true }, "params.path": { "paramDirection": "input", "persistent": true }, "params.payload": { "paramDirection": "input", "persistent": true }, "params.showCloseBtn": { "paramDirection": "input", "persistent": true }, "params.state": { "paramDirection": "input", "persistent": true }, "params.title": { "paramDirection": "input", "persistent": true }, "params.userRole": { "binding": { "config": { "path": "session.props.auth.user.roles" }, "transforms": [ { "code": "\tif any(item \u003d\u003d \"eurme-ignition-admins\" for item in value):\n\t\treturn True\n\telse:\n\t\treturn False\n\t\t\n", "type": "script" } ], "type": "property" }, "paramDirection": "inout", "persistent": true } }, "props": { "defaultSize": { "height": 675, "width": 858 } }, "root": { "children": [ { "children": [ { "meta": { "name": "iconMain" }, "position": { "basis": "32px", "display": false, "shrink": 0 }, "propConfig": { "props.color": { "binding": { "config": { "expression": "{view.params.state}" }, "transforms": [ { "fallback": "var(--info)", "inputType": "scalar", "mappings": [ { "input": "warning", "output": "var(--warning)" }, { "input": "success", "output": "var(--success)" }, { "input": "error", "output": "var(--error)" }, { "input": "info", "output": "var(--info)" } ], "outputType": "scalar", "type": "map" } ], "type": "expr" } }, "props.path": { "binding": { "config": { "expression": "{view.params.state}" }, "transforms": [ { "fallback": "material/info", "inputType": "scalar", "mappings": [ { "input": "warning", "output": "material/warning" }, { "input": "info", "output": "material/info" }, { "input": "error", "output": "material/error" }, { "input": "success", "output": "material/check_circle" } ], "outputType": "scalar", "type": "map" } ], "type": "expr" } } }, "props": { "style": { "classes": "Utilities/m-r-16" } }, "type": "ia.display.icon" }, { "children": [ { "meta": { "name": "title" }, "position": { "grow": 1, "shrink": 0 }, "propConfig": { "position.display": { "binding": { "config": { "expression": "{this.props.text}" }, "transforms": [ { "fallback": true, "inputType": "scalar", "mappings": [ { "input": "", "output": false } ], "outputType": "scalar", "type": "map" } ], "type": "expr" } }, "props.style.color": { "binding": { "config": { "path": "view.params.state" }, "enabled": false, "transforms": [ { "fallback": "var(--info)", "inputType": "scalar", "mappings": [ { "input": "info", "output": "var(--info)" }, { "input": "success", "output": "var(--success)" }, { "input": "error", "output": "var(--error)" }, { "input": "warning", "output": "var(--warning)" } ], "outputType": "scalar", "type": "map" } ], "type": "property" } }, "props.text": { "binding": { "config": { "path": "view.params.title" }, "type": "property" } } }, "props": { "style": { "classes": "Alerts/alertTitle", "color": "#FFFFFF" } }, "type": "ia.display.label" }, { "meta": { "name": "message" }, "position": { "grow": 1, "shrink": 0 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.params.message" }, "type": "property" } } }, "props": { "style": { "classes": "Alerts/alertMessage" } }, "type": "ia.display.label" }, { "meta": { "name": "BreakpointContainer_0" }, "position": { "basis": "20px" }, "type": "ia.container.breakpt" }, { "meta": { "name": "message_0" }, "position": { "grow": 1, "shrink": 0 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.params.field1Description" }, "type": "property" } } }, "props": { "style": { "classes": "Alerts/alertMessage" } }, "type": "ia.display.label" }, { "meta": { "name": "Field1" }, "position": { "basis": "30px", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "bidirectional": true, "path": "view.params.editField1" }, "type": "property" } } }, "props": { "style": { "textAlign": "start" } }, "type": "ia.input.text-field" }, { "meta": { "name": "BreakpointContainer_1" }, "position": { "basis": "20px" }, "type": "ia.container.breakpt" }, { "meta": { "name": "message_1" }, "position": { "grow": 1, "shrink": 0 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.params.field2Description" }, "type": "property" } } }, "props": { "style": { "classes": "Alerts/alertMessage" } }, "type": "ia.display.label" }, { "meta": { "name": "Field2" }, "position": { "basis": "200px", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "bidirectional": true, "path": "view.params.editField2" }, "type": "property" } } }, "props": { "resize": "both" }, "type": "ia.input.text-area" }, { "meta": { "name": "BreakpointContainer" }, "position": { "basis": "20px" }, "type": "ia.container.breakpt" }, { "meta": { "name": "message_2" }, "position": { "grow": 1, "shrink": 0 }, "propConfig": { "props.text": { "binding": { "config": { "path": "view.params.field3Description" }, "type": "property" } } }, "props": { "style": { "classes": "Alerts/alertMessage" } }, "type": "ia.display.label" }, { "meta": { "name": "Field3" }, "position": { "basis": "200px", "grow": 1 }, "propConfig": { "props.text": { "binding": { "config": { "bidirectional": true, "path": "view.params.editField3" }, "type": "property" } } }, "props": { "resize": "both" }, "type": "ia.input.text-area" } ], "meta": { "name": "content" }, "position": { "grow": 1 }, "props": { "direction": "column", "style": { "classes": "Utilities/m-r-16" } }, "type": "ia.container.flex" }, { "events": { "dom": { "onClick": { "config": { "script": "\tmessageType \u003d self.view.params.btnActionClose\t\n\tsystem.perspective.sendMessage(messageType, scope \u003d \"session\")" }, "scope": "G", "type": "script" }, "onTouchStart": { "config": { "script": "\tmessageType \u003d self.view.params.btnActionClose\t\t\n\tpayload \u003d self.view.params.payload\t\t## Added 2021-09-23 to return to caller view\n\tsystem.perspective.sendMessage(messageType, payload, scope \u003d \"session\")" }, "scope": "G", "type": "script" } } }, "meta": { "name": "iconClose" }, "position": { "basis": "16px", "shrink": 0 }, "propConfig": { "position.display": { "binding": { "config": { "path": "view.params.showCloseBtn" }, "type": "property" } } }, "props": { "path": "material/close", "style": { "classes": "Alerts/alertClose" } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "closePopup", "pageScope": false, "script": "\t# closes the last focused popup\n\tsystem.perspective.closePopup(\u0027alertDialog\u0027)", "sessionScope": true, "viewScope": false } ] }, "type": "ia.display.icon" } ], "meta": { "name": "body" }, "position": { "basis": "150px", "grow": 1 }, "props": { "alignItems": "flex-start", "justify": "center", "style": { "boxSizing": "content-box", "classes": "Utilities/p-16" } }, "type": "ia.container.flex" }, { "children": [ { "events": { "component": { "onActionPerformed": { "config": { "script": "\tmessageType \u003d self.view.params.btnActionSecondary\t\t\n\tpayload \u003d self.view.params.payload\t\t## Added 2021-09-23 to return to caller view\n\tsystem.perspective.sendMessage(messageType, payload, scope \u003d \"session\")" }, "scope": "G", "type": "script" } } }, "meta": { "name": "actionSecondary" }, "position": { "shrink": 0 }, "propConfig": { "position.display": { "binding": { "config": { "path": "this.props.text" }, "transforms": [ { "fallback": true, "inputType": "scalar", "mappings": [ { "input": "", "output": false } ], "outputType": "scalar", "type": "map" } ], "type": "property" } }, "props.image.icon.path": { "binding": { "config": { "expression": "\"material/\" + {view.params.btnIconSecondary}" }, "transforms": [ { "code": "\tif str(value) \u003d\u003d \"material/\":\n\t\treturn \"\"\n\telse:\n\t\treturn value", "type": "script" } ], "type": "expr" } }, "props.image.position": { "binding": { "config": { "path": "view.params.btnIconAlignment" }, "type": "property" } }, "props.image.style.fill": { "binding": { "config": { "path": "view.params.state" }, "transforms": [ { "fallback": "#222222", "inputType": "scalar", "mappings": [ { "input": "info", "output": "#17599C" }, { "input": "success", "output": "#117539" }, { "input": "warning", "output": "#C26700" }, { "input": "error", "output": "#A62D19" } ], "outputType": "color", "type": "map" } ], "type": "property" } }, "props.style.classes": { "binding": { "config": { "path": "view.params.state" }, "enabled": false, "transforms": [ { "fallback": "Alerts/alertBtn2 Utilities/m-r-8 Utilities/p-rl-8", "inputType": "scalar", "mappings": [ { "input": "error", "output": "Alerts/states/errorBtn2 Utilities/m-r-8 Utilities/p-rl-8" }, { "input": "warning", "output": "Alerts/states/warningBtn2 Utilities/m-r-8 Utilities/p-rl-8" }, { "input": "info", "output": "Alerts/states/infoBtn2 Utilities/m-r-8 Utilities/p-rl-8" }, { "input": "success", "output": "Alerts/states/successBtn2 Utilities/m-r-8 Utilities/p-rl-8" } ], "outputType": "scalar", "type": "map" } ], "type": "property" } }, "props.text": { "binding": { "config": { "expression": "{view.params.btnTextSecondary}" }, "type": "expr" } } }, "props": { "image": { "height": 20, "icon": {}, "width": 20 }, "primary": false, "style": { "classes": "Alerts/alertButtonSecondary", "margin": "5px", "marginRight": "30px" } }, "scripts": { "customMethods": [], "extensionFunctions": null, "messageHandlers": [ { "messageType": "closePopup", "pageScope": false, "script": "\t# closes the last focused popup\n\tsystem.perspective.closePopup(\u0027alertDialog\u0027)", "sessionScope": true, "viewScope": false } ] }, "type": "ia.input.button" }, { "events": { "component": { "onActionPerformed": { "config": { "script": "\t#############################################################################################\n\t# Purpose:\tSubmits Current form data to the selected destination from the parameters.\t\t#\n\t#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\n\t# Login: \t\t\tDate:\t\t\t\t#Comment:\t\t\t\t\t\t\t\tVersion:\t# \n\t# dmamani\t\t\t1/4/23\t\t\t\tRelease to Production\t\t\t\t\tV1\t\t\t#\n\t# \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#\n\t#############################################################################################\n\timport os\n\timport boto3\n\tfrom pprint import pprint, pformat\n\tfrom SymbolLibrary import fetch_library, list_backups, write_library, update_symbol_library, rollback\n\t\n\tsystem.perspective.print(self.session.props.auth.user.roles)\n\t\n\tif not self.view.params.userRole: \n\t\tmsg \u003d \"Contact MAP Team\tCTI: Distribution Center \u003e Maintenance Automation Platform \u003e SCADA Issue\" \n\t\tself.show_error_dialog(msg)\n\t\tsystem.perspective.closePopup(\u0027editItem\u0027)\n\t\treturn\n\n\tsymbolpath \u003d self.view.params.path\n\tcurrentuser \u003d self.session.props.auth.user.id\n\tcurrentcategory \u003d self.view.params.editField1\n\tcurrentinfo \u003d self.view.params.editField2\n\tcurrentdesc \u003d self.view.params.editField3\n\n\tresp \u003d update_symbol_library(symbolpath, category\u003dcurrentcategory, info\u003dcurrentinfo, description\u003dcurrentdesc, username\u003dcurrentuser)\n\tmsg \u003d pformat(resp)\n\t\n\tself.show_success_dialog(msg)\n\tsystem.perspective.print(msg)\n\tsystem.perspective.print(fetch_library(username\u003dcurrentuser))\n\tsystem.perspective.print(symbolpath)\n\tsystem.perspective.print(self.session.props.auth.user.id)\n\t\n\tsystem.perspective.sendMessage(\"UserClickRefresh\", scope \u003d \"page\")\n\tsystem.perspective.closePopup(\u0027editItem\u0027)\n" }, "scope": "G", "type": "script" } } }, "meta": { "name": "actionPrimary" }, "position": { "basis": "109px", "shrink": 0 }, "propConfig": { "props.image.icon.path": { "binding": { "config": { "expression": "\"material/\" + {view.params.btnIconPrimary}" }, "transforms": [ { "code": "\tif str(value) \u003d\u003d \"material/\":\n\t\treturn \"\"\n\telse:\n\t\treturn value", "type": "script" } ], "type": "expr" } }, "props.image.position": { "binding": { "config": { "path": "view.params.btnIconAlignment" }, "type": "property" } }, "props.style.classes": { "binding": { "config": { "path": "view.params.state" }, "enabled": false, "transforms": [ { "fallback": "Alerts/alertBtn1 Utilities/p-rl-8", "inputType": "scalar", "mappings": [ { "input": "error", "output": "Alerts/states/errorBtn1 Utilities/p-rl-8" }, { "input": "warning", "output": "Alerts/states/warningBtn1 Utilities/p-rl-8" }, { "input": "info", "output": "Alerts/states/infoBtn1 Utilities/p-rl-8" }, { "input": "success", "output": "Alerts/states/successBtn1 Utilities/p-rl-8" } ], "outputType": "scalar", "type": "map" } ], "type": "property" } }, "props.text": { "binding": { "config": { "path": "view.params.btnTextPrimary" }, "type": "property" } } }, "props": { "image": { "height": 20, "icon": {}, "style": { "margin": 5 }, "width": 20 }, "style": { "classes": "Alerts/alertButton", "margin": "5px" }, "textStyle": { "textAlign": "center" } }, "scripts": { "customMethods": [ { "name": "show_success_dialog", "params": [ "msg\u003dNone" ], "script": "\t# ~~ 13 PARAMETERS ~~\n\t# state\t\t\t\t\t(default \u003d info) empty string uses generic gray styling\n\t# title \t\t\t\t(default \u003d Alert Title) empty string sets the title visibility to false\n\t# message \t\t\t\t(default \u003d Alert message goes here.)\n\t# show close button\t\t(default \u003d true) boolean\n\t# btn text primary\t\t(default \u003d \"Primary\")\n\t# btn text secondary\t(default \u003d \"Secondary\")\n\t# btn icon primary \t\t(default \u003d chevron_right) do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon secondary \t(default \u003d \"\") do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon alignment\t(default \u003d \"right\") left or right\n\t# btn primary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn secondary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn close action\t\t(default \u003d \"\") add message handlers on this icon to enable other script actions\n\t# payload\t\t\t\t(default \u003d {}) add a payload here to return to the target message handler\n\t\n\tAlerts.showAlert(\n\t\t\"success\", \n\t\t\"Update Symbol Library Results\", \n\t\tmsg, \n\t\t\"true\",\n\t\t\"OK\", \n\t\t\"CLOSE\", \n\t\t\"\", \n\t\t\"\", \n\t\t\"left\", \n\t\t\"closePopup\", \n\t\t\"closePopup\", \n\t\t\"closePopup\",\n\t\t{}\n\t)\n\t\t\t\t\t\t" }, { "name": "show_error_dialog", "params": [ "msg\u003dNone" ], "script": "\t# ~~ 13 PARAMETERS ~~\n\t# state\t\t\t\t\t(default \u003d info) empty string uses generic gray styling\n\t# title \t\t\t\t(default \u003d Alert Title) empty string sets the title visibility to false\n\t# message \t\t\t\t(default \u003d Alert message goes here.)\n\t# show close button\t\t(default \u003d true) boolean\n\t# btn text primary\t\t(default \u003d \"Primary\")\n\t# btn text secondary\t(default \u003d \"Secondary\")\n\t# btn icon primary \t\t(default \u003d chevron_right) do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon secondary \t(default \u003d \"\") do not include \u0027material/\u0027 in the path, just the icon name\n\t# btn icon alignment\t(default \u003d \"right\") left or right\n\t# btn primary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn secondary action\t(default \u003d \"\") add message handlers on this button to enable other script actions\n\t# btn close action\t\t(default \u003d \"\") add message handlers on this icon to enable other script actions\n\t# payload\t\t\t\t(default \u003d {}) add a payload here to return to the target message handler\n\t\n\tAlerts.showAlert(\n\t\t\"error\", \n\t\t\"Not Authorized\", \n\t\tmsg, \n\t\t\"true\",\n\t\t\"OK\", \n\t\t\"CLOSE\", \n\t\t\"\", \n\t\t\"\", \n\t\t\"left\", \n\t\t\"closePopup\", \n\t\t\"closePopup\", \n\t\t\"closePopup\",\n\t\t{}\n\t)\n\t\t\t\t\t\t" } ], "extensionFunctions": null, "messageHandlers": [ { "messageType": "closePopup", "pageScope": false, "script": "\t# closes the last focused popup\n\tsystem.perspective.closePopup(\u0027alertDialog\u0027)", "sessionScope": true, "viewScope": false }, { "messageType": "logout", "pageScope": false, "script": "\tsystem.perspective.logout()", "sessionScope": true, "viewScope": false } ] }, "type": "ia.input.button" } ], "meta": { "name": "footer" }, "position": { "basis": "56px", "shrink": 0 }, "props": { "justify": "flex-end", "style": { "backgroundColor": "var(--neutral-30)", "borderTop": "1px solid var(--neutral-50)", "classes": "Utilities/p-8" } }, "type": "ia.container.flex" } ], "events": { "dom": { "onFocus": { "config": { "script": "\tmessageType \u003d \u0027alertFocus\u0027\n\tsystem.perspective.sendMessage(messageType)" }, "scope": "G", "type": "script" } } }, "meta": { "name": "dialog" }, "propConfig": { "props.style.classes": { "binding": { "config": { "expression": "{view.params.state}" }, "transforms": [ { "fallback": "Alerts/alertDefault", "inputType": "scalar", "mappings": [ { "input": "info", "output": "Alerts/states/info" }, { "input": "warning", "output": "Alerts/states/warning" }, { "input": "error", "output": "Alerts/states/error" }, { "input": "success", "output": "Alerts/states/success" } ], "outputType": "scalar", "type": "map" } ], "type": "expr" } } }, "props": { "direction": "column", "style": { "maxHeight": "none" } }, "type": "ia.container.flex" } }