profoundjs 6.0.0-beta.2 → 6.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -166,7 +166,7 @@
166
166
  "screen": {
167
167
  "record format name": "errscrn",
168
168
  "disable enter key": "true",
169
- "onload": "if ((window.puiMobileClient == null && window.device != null &&\n window.device.platform == \"iOS\") ||\n pui.genie != null) {\n\n applyProperty(\"btnBack\", \"visibility\", \"hidden\");\n applyProperty(\"btnBack\", \"field type\", \"graphics button\");\n\n}\nif (pui.genie != null) {\n\n applyProperty(\"NewSessionButton\", \"value\", pui.getLanguageText(\"runtimeText\", \"ok\"));\n applyProperty(\"NewSessionButton\", \"onclick\", \"pui.click();\");\n\n}\npui.formatErrorText(); \npui.confirmOnClose = false; \npui.shutdownOnClose = false;\n\n// Activate download button if we have Job info\nif (pui[\"appJob\"] && typeof pui[\"appJob\"][\"appjoblogkey\"] === \"string\") {\n applyProperty(\"JobLogDownload\", \"visibility\", \"visible\");\n}\n"
169
+ "onload": "if ((window.puiMobileClient == null && window.device != null &&\n window.device.platform == \"iOS\") ||\n pui.genie != null) {\n\n applyProperty(\"btnBack\", \"visibility\", \"hidden\");\n applyProperty(\"btnBack\", \"field type\", \"graphics button\");\n\n}\n\nvar jobinfo;\nif (pui.genie != null) {\n\n applyProperty(\"NewSessionButton\", \"value\", pui.getLanguageText(\"runtimeText\", \"ok\"));\n applyProperty(\"NewSessionButton\", \"onclick\", \"pui.click();\");\n\n if (pui.appJob != null && typeof pui.appJob.appjoblogkey === \"string\" && pui.appJob.appjoblogkey.length > 0){\n // The job log can be downloaded if a key exists for it.\n applyProperty(\"JobLogDownload\", \"visibility\", \"visible\");\n }\n}\nelse {\n // Not in Genie. Automatically attempt to fetch the job log from the server before it\n // is cleared. The download link should display after the log downloads.\n sessionStorage.removeItem(\"joblog\");\n\n jobinfo = pui.get(\"ESAPPJOBLOGKEY\");\n if (jobinfo.length > 0) {\n // Load a helper function that facilitates prompting the user to save; then, download.\n var filesaverPath = \"/jszip/FileSaver.min.js\";\n if (typeof saveAs == \"function\"){\n downloadJobLog();\n }\n else {\n pui[\"loadJS\"]({ \"path\": filesaverPath, \"callback\": downloadJobLog });\n }\n }\n else {\n console.log(\"Cannot download job log without job key.\");\n }\n}\n\npui.formatErrorText(); \npui.confirmOnClose = false; \npui.shutdownOnClose = false;\n\nvar xhr;\nfunction downloadJobLog(){\n xhr = new XMLHttpRequest();\n xhr.addEventListener(\"error\", xhrerror);\n xhr.addEventListener(\"load\", joblogFetch);\n xhr.open(\"POST\", pui.getProgramURL(\"PUI0009118.pgm\"), true);\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhr.send(\"jobinfo=\" + jobinfo);\n}\n\nfunction joblogFetch(){\n if (typeof xhr.response === \"string\" && xhr.response.length > 0){\n var contentDisp = xhr.getResponseHeader(\"Content-Disposition\");\n if (contentDisp === \"attachment\"){\n // The Content-Disposition header is \"attachment\" when the response is good.\n sessionStorage.setItem(\"joblog\", xhr.response); //Store the results in memory.\n applyProperty(\"JobLogDownload\", \"visibility\", \"visible\"); //show the download link.\n }\n else {\n // The response is error plain text.\n console.log(pui[\"getLanguageText\"](\"runtimeMsg\", \"failed to load x\", [\"Job Log\"]) + \"<br>\" + xhr.response);\n }\n }\n else {\n console.log(\"Job log download error: Empty Response\");\n }\n}\n\nfunction xhrerror(err){\n console.log(\"Job log download error:\", error);\n}\n"
170
170
  },
171
171
  "items": [
172
172
  {
@@ -617,41 +617,39 @@
617
617
  "container": "1"
618
618
  },
619
619
  {
620
- "id": "ESPJSSRVR",
620
+ "id": "JobLogDownload",
621
+ "field type": "html container",
622
+ "html": "Script: \"<span class=\\\"pui-material-icons\\\">file_download</span><span id=\\\"JobLogDownload_fb\\\">\" + pui.getLanguageText(\"runtimeText\",\"joblog download\") + \"</span>\"",
623
+ "left": "490px",
624
+ "top": "85px",
625
+ "height": "15px",
626
+ "width": "255px",
627
+ "visibility": "hidden",
628
+ "onclick": "var feedback_element = getObj(\"JobLogDownload_fb\");\nvar filename_prefix = pui[\"getLanguageText\"](\"runtimeText\", \"app job\") + \" \"; //e.g. \"Application Job \".\nvar file_ext = \".txt\";\n\nif (pui.genie != null) {\n // In Genie the job log is the Genie App Job and can be downloaded from Profound UI via an API.\n var appJob = pui.appJob;\n var job_num_user_name = \"NA\";\n if (appJob.number && appJob.user && appJob.name) {\n job_num_user_name = appJob.number +\"_\"+ appJob.user +\"_\"+ appJob.name;\n }\n\n pui.downloadJobLog({\n outputEl: feedback_element,\n jobinfo: appJob.appjoblogkey,\n filename: filename_prefix + job_num_user_name + file_ext\n });\n}\nelse {\n // In Profound.js and not in Genie the job log should have already downloaded due to \"onload\". Prompt to save it.\n var joblog = sessionStorage.getItem(\"joblog\");\n if (typeof joblog !== \"string\" || joblog.length < 1){\n feedback_element.innerHTML = \"Job log failed to download. Please check browser console for more information.\";\n }\n else {\n var job_num_user_name = pui.get(\"ESAPPJOB\").replace(/\\//g, \"_\");\n var filesaver = saveAs(\n new Blob([joblog]),\n filename_prefix + job_num_user_name + file_ext,\n {\"type\": \"text/plain;charset=utf-8\"}\n );\n filesaver.onwriteend = waitAndClearLinkText;\n }\n}\n\nfunction waitAndClearLinkText(){\n setTimeout(function(){ feedback_element.innerHTML = \"\"; }, 3000);\n}\n",
629
+ "tool tip": "Script: pui.getLanguageText(\"runtimeText\",\"joblog download\")",
630
+ "css class": "joblogDL",
631
+ "layout": "ErrorPanel",
632
+ "container": "1"
633
+ },
634
+ {
635
+ "id": "ESAPPJOBLOGKEY",
621
636
  "field type": "output field",
637
+ "css class": "outputField",
622
638
  "value": {
623
- "fieldName": "espjssrvr",
624
- "dataLength": "50",
639
+ "fieldName": "esappjoblogkey",
640
+ "dataLength": "1024",
625
641
  "trimLeading": "false",
626
642
  "trimTrailing": "true",
627
643
  "blankFill": "false",
628
644
  "rjZeroFill": "false",
629
- "dataType": "char",
645
+ "dataType": "varchar",
630
646
  "formatting": "Text",
631
647
  "textTransform": "none",
632
- "designValue": "[espjssrvr]"
648
+ "designValue": "[esappjoblogkey]"
633
649
  },
634
- "text align": "right",
635
- "left": "15px",
636
- "top": "525px",
637
- "height": "15px",
638
- "width": "70px",
639
- "visibility": "hidden",
640
- "layout": "ErrorPanel",
641
- "container": "1"
642
- },
643
- {
644
- "id": "JobLogDownload",
645
- "field type": "html container",
646
- "html": "Script: \"<span class=\\\"pui-material-icons\\\">file_download</span><span id=\\\"JobLogDownload_fb\\\">\" + pui.getLanguageText(\"runtimeText\",\"joblog download\") + \"</span>\"",
647
- "left": "490px",
650
+ "left": "375px",
648
651
  "top": "85px",
649
- "height": "15px",
650
- "width": "255px",
651
652
  "visibility": "hidden",
652
- "onclick": "var filename = pui.getLanguageText(\"runtimeText\",\"app job\");\nfilename.replace(\" \", \"_\");\nif (pui[\"appJob\"]){\n if (typeof pui[\"appJob\"][\"id\"] === \"string\"){\n var jobParts = pui[\"appJob\"][\"id\"].split(\"/\");\n if (jobParts.length == 3){\n filename += \"_\" + jobParts[0]+\"_\"+jobParts[1]+\"_\"+jobParts[2];\n }\n }\n else {\n filename += \"_\" + (pui[\"appJob\"][\"number\"] ? pui[\"appJob\"][\"number\"] : \"\");\n filename += \"_\" + (pui[\"appJob\"][\"user\"] ? pui[\"appJob\"][\"user\"] : \"\");\n filename += \"_\" + (pui[\"appJob\"][\"name\"] ? pui[\"appJob\"][\"name\"] : \"\");\n }\n}\nfilename += \".txt\";\n\ntry {\n // 1. Job; 2. The server with the job logs; 3. filename prefx; 4. element to get feedback text. (output)\n pui.downloadJobLog(\n pui[\"appJob\"][\"appjoblogkey\"],\n null,\n filename,\n getObj(\"JobLogDownload_fb\") );\n}\ncatch(exc){\n console.log(exc);\n}",
653
- "tool tip": "Script: pui.getLanguageText(\"runtimeText\",\"joblog download\")",
654
- "css class": "joblogDL",
655
653
  "layout": "ErrorPanel",
656
654
  "container": "1"
657
655
  }
@@ -12,10 +12,10 @@
12
12
  "profoundui"
13
13
  ],
14
14
  "engines": {
15
- "node": "^12 || ^14"
15
+ "node": "^14 || ^16"
16
16
  },
17
17
  "dependencies": {
18
- "profoundjs": "^6.0.0-beta.2"
18
+ "profoundjs": "^6.0.0-beta.6"
19
19
  },
20
20
  "scripts": {
21
21
  "start": "node start.js"
Binary file