Files
Stream_PHX_A7/Gateways/FE/projects/.resources/67ca8377d88de449622566a51879f1791eb86a7bc037f2753a75cbe22ef72a16

637 lines
19 KiB
Plaintext

{
"custom": {
"model": null
},
"params": {
"auth": {
"almAck": true,
"almShelve": true,
"config": true,
"control": true
},
"tagPath": ""
},
"propConfig": {
"custom.model": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.tagPath}"
},
"tagPath": "{1}/Meta/ModelNo"
},
"transforms": [
{
"expression": "coalesce({value},null)",
"type": "expression"
}
],
"type": "tag"
},
"persistent": true
},
"params.auth": {
"paramDirection": "input",
"persistent": true
},
"params.tagPath": {
"paramDirection": "input",
"persistent": true
}
},
"props": {},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"shrink": 0
},
"props": {
"text": "Tag Notes"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "TextArea"
},
"position": {
"grow": 1
},
"type": "ia.input.text-area"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "160px",
"display": false
},
"props": {
"direction": "column",
"style": {
"margin": "12px 12px 0px 12px"
}
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Markdown"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "!{parent.custom.editMode}"
},
"type": "expr"
}
},
"props.source": {
"binding": {
"config": {
"struct": {
"tag_notes": "{parent.custom.data.tag_notes.body}",
"wiki_notes": "{parent.custom.data.wiki_notes.body}"
},
"waitOnAll": true
},
"transforms": [
{
"code": "\treturn \"\"\"{}\n\n{}\"\"\".format(value[\u0027wiki_notes\u0027], value[\u0027tag_notes\u0027])",
"type": "script"
}
],
"type": "expr-struct"
}
}
},
"props": {
"style": {
"margin": "12px"
}
},
"type": "ia.display.markdown"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "ApplicationHelp/Field ApplicationHelp/Small_Text"
},
"text": "Wiki Last Updated"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Value"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "if({/root.custom.data.wiki_notes.last_updated} \u003d null, \"---\", \r\ndateFormat({/root.custom.data.wiki_notes.last_updated}, \"MMM d, yy h:mm a\") + \" by \" + {/root.custom.data.wiki_notes.last_updated_by})"
},
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "ApplicationHelp/Small_Text"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Last Updated"
},
"position": {
"grow": 1,
"shrink": 0
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "ApplicationHelp/Field ApplicationHelp/Small_Text"
},
"text": "Notes Last Updated"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Value"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "if({/root.custom.data.tag_notes.last_updated} \u003d null, \"---\", \r\ndateFormat({/root.custom.data.tag_notes.last_updated}, \"MMM d, yy h:mm a\") + \" by \" + {/root.custom.data.tag_notes.last_updated_by})"
},
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "ApplicationHelp/Small_Text"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Last Updated_0"
},
"position": {
"grow": 1,
"shrink": 0
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.view.getChild(\"root\").custom.editMode \u003d not self.view.getChild(\"root\").custom.editMode\n\tself.view.getChild(\"root\").custom.editType \u003d \u0027wiki_notes\u0027\n\tsystem.perspective.sendMessage(\"refreshEditor\")"
},
"permissions": {
"securityLevels": [
{
"children": [],
"name": "Authenticated"
}
],
"type": "AllOf"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Edit"
},
"position": {
"shrink": 0
},
"propConfig": {
"custom.isAuthorized": {
"binding": {
"config": {
"expression": "isAuthorized(true, \u0027Authenticated/Roles/System Administrator\u0027)"
},
"type": "expr"
}
},
"position.display": {
"binding": {
"config": {
"path": "view.params.auth.config"
},
"type": "property"
}
},
"props.image.icon.path": {
"binding": {
"config": {
"expression": "if({/root.custom.editMode}, \u0027material/close\u0027, \u0027material/edit\u0027)"
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"expression": "if({/root.custom.editMode}, \u0027Cancel\u0027, \u0027Edit Wiki\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {}
},
"style": {
"classes": "ApplicationHelp/Standard_Button",
"padding": "0 10px"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.view.getChild(\"root\").custom.editMode \u003d not self.view.getChild(\"root\").custom.editMode\n\tself.view.getChild(\"root\").custom.editType \u003d \u0027tag_notes\u0027\n\tsystem.perspective.sendMessage(\"refreshEditor\")"
},
"permissions": {
"securityLevels": [
{
"children": [],
"name": "Authenticated"
}
],
"type": "AllOf"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Edit_0"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.auth.control"
},
"type": "property"
}
},
"props.image.icon.path": {
"binding": {
"config": {
"expression": "if({/root.custom.editMode}, \u0027material/close\u0027, \u0027material/edit\u0027)"
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"expression": "if({/root.custom.editMode}, \u0027Cancel\u0027, \u0027Edit Notes\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {}
},
"style": {
"classes": "ApplicationHelp/Standard_Button",
"padding": "0 10px"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "!{parent.custom.editMode}"
},
"type": "expr"
}
}
},
"props": {
"justify": "space-between",
"style": {
"gap": "10px",
"padding": "6px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Editor"
},
"position": {
"grow": 1
},
"propConfig": {
"props.params.inText": {
"binding": {
"config": {
"expression": "if({/root.custom.editType}\u003d\u0027wiki_notes\u0027,\r\n{/root.custom.data.wiki_notes.body},\r\n{/root.custom.data.tag_notes.body})"
},
"type": "expr"
}
}
},
"props": {
"params": {
"outText": ""
},
"path": "Library/Templates/Markdown/Editor"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "Editor"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "{parent.custom.editMode}"
},
"type": "expr"
}
}
},
"props": {
"direction": "column",
"style": {
"margin": "0px 12px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\ttagPath \u003d self.view.params.tagPath\n\tmodelNo \u003d self.view.custom.model\n\teditType \u003d self.view.getChild(\"root\").custom.editType\n\tbody \u003d self.parent.parent.getChild(\"Editor\").getChild(\"Editor\").props.params.outText\n\tuser \u003d \"guest\" if self.session.props.auth.user.userName \u003d\u003d None else self.session.props.auth.user.userName\n\tif editType \u003d\u003d \u0027wiki_notes\u0027:\n\t\tid \u003d self.view.getChild(\"root\").custom.data.tag_notes.id\n\t\tif id \u003d\u003d None:\n\t\t\tsystem.db.runNamedQuery(\"Wiki Notes/Insert Note\", {\"modelNo\":modelNo, \"body\":body, \"user\":user})\n\t\telse:\n\t\t\tsystem.db.runNamedQuery(\"Wiki Notes/Update Note\", {\"id\":id, \"body\":body, \"user\":user})\n\t\t\t\n\telif editType \u003d\u003d \u0027tag_notes\u0027:\n\t\tid \u003d self.view.getChild(\"root\").custom.data.tag_notes.id\n\t\tif id \u003d\u003d None:\n\t\t\tsystem.db.runNamedQuery(\"Tag Notes/Insert Note\", {\"tagPath\":tagPath, \"body\":body, \"user\":user})\n\t\telse:\n\t\t\tsystem.db.runNamedQuery(\"Tag Notes/Update Note\", {\"id\":id, \"body\":body, \"user\":user})\n\t\t\n\tsystem.perspective.sendMessage(messageType\u003d\"tag-notes-refresh\", payload\u003d{})\n\tself.view.getChild(\"root\").custom.editMode \u003d False"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Save"
},
"position": {
"basis": "100px",
"shrink": 0
},
"props": {
"image": {
"icon": {
"path": "material/save"
}
},
"style": {
"classes": "ApplicationHelp/Standard_Button",
"padding": "0 10px"
},
"text": "Save"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tself.view.getChild(\"root\").custom.editMode \u003d False"
},
"permissions": {
"securityLevels": [
{
"children": [],
"name": "Authenticated"
}
],
"type": "AllOf"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Cancel"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.image.icon.path": {
"binding": {
"config": {
"expression": "if({/root.custom.editMode}, \u0027material/close\u0027, \u0027material/edit\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {}
},
"primary": false,
"style": {
"classes": "ApplicationHelp/Standard_Button",
"padding": "0 10px"
},
"text": "Cancel"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "Actions"
},
"position": {
"basis": "54px",
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "{parent.custom.editMode}"
},
"type": "expr"
}
}
},
"props": {
"justify": "center",
"style": {
"gap": "10px",
"padding": "10px"
},
"wrap": "wrap"
},
"type": "ia.container.flex"
}
],
"custom": {
"data": {},
"editType": "tag_notes"
},
"meta": {
"name": "root"
},
"propConfig": {
"custom.data.tag_notes": {
"binding": {
"config": {
"parameters": {
"tagPath": "{view.params.tagPath}"
},
"queryPath": "Tag Notes/Get Notes",
"returnFormat": "json"
},
"transforms": [
{
"code": "\tif value \u003d\u003d None or len(value) \u003d\u003d 0:\n\t\tvalue \u003d {\"id\":None, \"body\":\"\", \"last_updated\":None, \"last_updated_by\":None}\n\telse:\n\t\tvalue \u003d value[0]\n\t\n\treturn value",
"type": "script"
}
],
"type": "query"
}
},
"custom.data.wiki_notes": {
"binding": {
"config": {
"parameters": {
"modelNo": "{view.custom.model}"
},
"queryPath": "Wiki Notes/Get Notes",
"returnFormat": "json"
},
"transforms": [
{
"code": "\tif value \u003d\u003d None or len(value) \u003d\u003d 0:\n\t\tvalue \u003d {\"id\":None, \"body\":\"\", \"last_updated\":None, \"last_updated_by\":None}\n\telse:\n\t\tvalue \u003d value[0]\n\t\n\treturn value",
"type": "script"
}
],
"type": "query"
}
},
"custom.editMode": {
"binding": {
"config": {
"expression": "false"
},
"type": "expr"
}
}
},
"props": {
"direction": "column"
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "tag-notes-refresh",
"pageScope": true,
"script": "\tself.refreshBinding(\"custom.data.wiki_notes\")\n\tself.refreshBinding(\"custom.data.tag_notes\")",
"sessionScope": false,
"viewScope": false
}
]
},
"type": "ia.container.flex"
}
}