Skip to content

Commit a1e2836

Browse files
sn0wcat--global
andauthored
chore: release 3.9.1 🎉 (#105)
* 3.9.1-0 * chore: release 3.9.1 🎉 Co-authored-by: --global <igor.milovanovic@siemens.com>
1 parent b54ccf6 commit a1e2836

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 3.9.1 (Vienna Bobcats) - September 2020
4+
5+
## Bugfix 3.9.1
6+
7+
- Node not loading on raspberry pi with chromium 79.0 (#103)
8+
- Copy to clipboard not working on raspberry pi with chromium 79.0 (#104)
9+
310
## 3.9.0 (Vienna Bobcats) - September 2020
411

512
## New Features 3.9.0

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mindconnect/node-red-contrib-mindconnect",
3-
"version": "3.9.0",
3+
"version": "3.9.1",
44
"description": "node red mindconnect node using mindconnect-nodejs library.",
55
"main": "index.js",
66
"scripts": {

src/mindconnect.html

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
&nbsp;&nbsp;<a href="https://opensource.mindsphere.io/docs/node-red-contrib-mindconnect/index.html" target="_new" class="headerLink" title="Documentation">
77
<i class="fa fa-globe"></i> MindConnect Node-RED Agent
88
</a>
9-
</span> <span style="color:#aaaaaa !important">v3.9.0</span>
9+
</span> <span style="color:#aaaaaa !important">v3.9.1</span>
1010
</div>
1111

1212
<div class="form-row">
@@ -680,6 +680,28 @@
680680
},
681681

682682
oneditprepare: function () {
683+
684+
const copyToClipboard = str => {
685+
686+
const textarea = document.createElement('textarea');
687+
textarea.textContent = str;
688+
textarea.setAttribute('readonly', '');
689+
textarea.style.position = 'absolute';
690+
textarea.style.left = '-9999px';
691+
692+
document.body.appendChild(textarea);
693+
var selection = document.getSelection();
694+
var range = document.createRange();
695+
range.selectNode(textarea);
696+
selection.removeAllRanges();
697+
selection.addRange(range);
698+
699+
const success = document.execCommand('copy');
700+
selection.removeAllRanges();
701+
document.body.removeChild(textarea);
702+
return success;
703+
};
704+
683705
function copyLink(dataSourceConfig, option) {
684706
if (option === "BULK" || option === "TIMESERIES") {
685707
const values = [];
@@ -703,11 +725,12 @@
703725
null,
704726
2
705727
)};\nmsg.payload=bulkValues;\nreturn msg;`;
706-
navigator.clipboard.writeText(option === "BULK" ? bulkTemplate : functionTemplate);
728+
const success = copyToClipboard(option === "BULK" ? bulkTemplate : functionTemplate);
707729
$("#mindconnect-infoDialog-output").text(
708-
`Copied ${
730+
success ? `Copied ${
709731
option === "BULK" ? "Bulk" : ""
710-
} TimeSeries Template Data to Clipboard. (Paste this template to a function node)`
732+
} TimeSeries Template Data to Clipboard. (Paste this template to a function node)` :
733+
"Couldn't copy the text to clipboard"
711734
);
712735
});
713736
} else {
@@ -746,11 +769,12 @@
746769
msg.payload=fileInfo;
747770
return msg;`;
748771

749-
navigator.clipboard.writeText(option === "EVENT" ? eventTemplate : fileTemplate);
772+
const success = copyToClipboard(option === "EVENT" ? eventTemplate : fileTemplate);
750773
$("#mindconnect-infoDialog-output").text(
751-
`Copied ${
774+
success ? `Copied ${
752775
option === "EVENT" ? "Event" : "File"
753-
} Template Data to Clipboard. (Paste this template to a function node.)`
776+
} Template Data to Clipboard. (Paste this template to a function node.)` :
777+
"Couldn't copy the text to clipboard"
754778
);
755779
}
756780
return false;
@@ -835,7 +859,7 @@
835859
const url = `<a class="ghostLink diagLink" href="${urlTemplate}${mapping.entityId}/details" target="_new" title="Open Asset in MindSphere Asset Manager"><i class="fa fa-external-link"></i> `;
836860
mappingList.append(
837861
`<li>${
838-
mapping?.validity?.status === "VALID"
862+
(mapping && mapping.validity && mapping.validity.status && (mapping.validity.status === "VALID"))
839863
? "<i class='fa fa-check-circle' style='color:#65C728' title='VALID'></i>"
840864
: "<i class='fa fa-exclamation-triangle' style='color:#F62447' title='NOT VALID'></i>"
841865
} <span style="color:#354C80">${

0 commit comments

Comments
 (0)