1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge branch 'master' into dev

This commit is contained in:
Nick O'Leary 2023-04-28 18:49:03 +01:00
commit 55a9a29f76
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
14 changed files with 57 additions and 35 deletions

View File

@ -29,8 +29,8 @@ jobs:
- name: Run tests - name: Run tests
run: | run: |
npm run test npm run test
- name: Publish to coveralls.io # - name: Publish to coveralls.io
if: ${{ matrix.node-version == 16 }} # if: ${{ matrix.node-version == 16 }}
uses: coverallsapp/github-action@v1.1.2 # uses: coverallsapp/github-action@v1.1.2
with: # with:
github-token: ${{ github.token }} # github-token: ${{ github.token }}

View File

@ -3,7 +3,6 @@
http://nodered.org http://nodered.org
[![Build Status](https://github.com/node-red/node-red/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/node-red/node-red/actions?query=branch%3Amaster) [![Build Status](https://github.com/node-red/node-red/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/node-red/node-red/actions?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/node-red/node-red/badge.svg?branch=master)](https://coveralls.io/r/node-red/node-red?branch=master)
Low-code programming for event-driven applications. Low-code programming for event-driven applications.

View File

@ -504,6 +504,7 @@
"unassigned": "Unassigned", "unassigned": "Unassigned",
"global": "global", "global": "global",
"workspace": "workspace", "workspace": "workspace",
"editor": "edit dialog",
"selectAll": "Select all", "selectAll": "Select all",
"selectNone": "Select none", "selectNone": "Select none",
"selectAllConnected": "Select connected", "selectAllConnected": "Select connected",

View File

@ -2201,16 +2201,27 @@ RED.nodes = (function() {
} else if (n.type.substring(0,7) === "subflow") { } else if (n.type.substring(0,7) === "subflow") {
var parentId = n.type.split(":")[1]; var parentId = n.type.split(":")[1];
var subflow = subflow_denylist[parentId]||subflow_map[parentId]||getSubflow(parentId); var subflow = subflow_denylist[parentId]||subflow_map[parentId]||getSubflow(parentId);
if (createNewIds || options.importMap[n.id] === "copy") { if (!subflow){
parentId = subflow.id; node._def = {
node.type = "subflow:"+parentId; color:"#fee",
node._def = registry.getNodeType(node.type); defaults: {},
delete node.i; label: "unknown: "+n.type,
labelStyle: "red-ui-flow-node-label-italic",
outputs: n.outputs|| (n.wires && n.wires.length) || 0,
set: registry.getNodeSet("node-red/unknown")
}
} else {
if (createNewIds || options.importMap[n.id] === "copy") {
parentId = subflow.id;
node.type = "subflow:"+parentId;
node._def = registry.getNodeType(node.type);
delete node.i;
}
node.name = n.name;
node.outputs = subflow.out.length;
node.inputs = subflow.in.length;
node.env = n.env;
} }
node.name = n.name;
node.outputs = subflow.out.length;
node.inputs = subflow.in.length;
node.env = n.env;
} else if (n.type === 'junction') { } else if (n.type === 'junction') {
node._def = {defaults:{}} node._def = {defaults:{}}
node._config.x = node.x node._config.x = node.x

View File

@ -47,7 +47,7 @@ RED.actionList = (function() {
var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog); var searchDiv = $("<div>",{class:"red-ui-search-container"}).appendTo(dialog);
searchInput = $('<input type="text" data-i18n="[placeholder]keyboard.filterActions">').appendTo(searchDiv).searchBox({ searchInput = $('<input type="text" data-i18n="[placeholder]keyboard.filterActions">').appendTo(searchDiv).searchBox({
change: function() { change: function() {
filterTerm = $(this).val().trim(); filterTerm = $(this).val().trim().toLowerCase();
filterTerms = filterTerm.split(" "); filterTerms = filterTerm.split(" ");
searchResults.editableList('filter'); searchResults.editableList('filter');
searchResults.find("li.selected").removeClass("selected"); searchResults.find("li.selected").removeClass("selected");

View File

@ -45,11 +45,13 @@ RED.editor = (function() {
var hasChanged; var hasChanged;
if (node.type.indexOf("subflow:")===0) { if (node.type.indexOf("subflow:")===0) {
subflow = RED.nodes.subflow(node.type.substring(8)); subflow = RED.nodes.subflow(node.type.substring(8));
isValid = subflow.valid; if (subflow){
hasChanged = subflow.changed; isValid = subflow.valid;
if (isValid === undefined) {
isValid = validateNode(subflow);
hasChanged = subflow.changed; hasChanged = subflow.changed;
if (isValid === undefined) {
isValid = validateNode(subflow);
hasChanged = subflow.changed;
}
} }
validationErrors = validateNodeProperties(node, node._def.defaults, node); validationErrors = validateNodeProperties(node, node._def.defaults, node);
node.valid = isValid && validationErrors.length === 0; node.valid = isValid && validationErrors.length === 0;

View File

@ -491,7 +491,11 @@ RED.keyboard = (function() {
okButton.attr("disabled",!valid); okButton.attr("disabled",!valid);
}); });
var scopeSelect = $('<select><option value="*" data-i18n="keyboard.global"></option><option value="red-ui-workspace" data-i18n="keyboard.workspace"></option></select>').appendTo(scope); var scopeSelect = $('<select>'+
'<option value="*" data-i18n="keyboard.global"></option>'+
'<option value="red-ui-workspace" data-i18n="keyboard.workspace"></option>'+
'<option value="red-ui-editor-stack" data-i18n="keyboard.editor"></option>'+
'</select>').appendTo(scope);
scopeSelect.i18n(); scopeSelect.i18n();
if (object.scope === "workspace") { if (object.scope === "workspace") {
object.scope = "red-ui-workspace"; object.scope = "red-ui-workspace";

View File

@ -681,24 +681,23 @@ RED.subflow = (function() {
var candidateOutputs = []; var candidateOutputs = [];
var candidateInputNodes = {}; var candidateInputNodes = {};
var boundingBox = [nodeList[0].x, var boundingBox = [nodeList[0].x-(nodeList[0].w/2),
nodeList[0].y, nodeList[0].y-(nodeList[0].h/2),
nodeList[0].x, nodeList[0].x+(nodeList[0].w/2),
nodeList[0].y]; nodeList[0].y+(nodeList[0].h/2)];
for (i=0;i<nodeList.length;i++) { for (i=0;i<nodeList.length;i++) {
n = nodeList[i]; n = nodeList[i];
nodes[n.id] = {n:n,outputs:{}}; nodes[n.id] = {n:n,outputs:{}};
boundingBox = [ boundingBox = [
Math.min(boundingBox[0],n.x), Math.min(boundingBox[0],n.x-(n.w/2)),
Math.min(boundingBox[1],n.y), Math.min(boundingBox[1],n.y-(n.h/2)),
Math.max(boundingBox[2],n.x), Math.max(boundingBox[2],n.x+(n.w/2)),
Math.max(boundingBox[3],n.y) Math.max(boundingBox[3],n.y+(n.h/2))
] ]
} }
var offsetX = snapToGrid(boundingBox[0] - 200); var offsetX = snapToGrid(boundingBox[0] - 140);
var offsetY = snapToGrid(boundingBox[1] - 80); var offsetY = snapToGrid(boundingBox[1] - 60);
var center = [ var center = [
snapToGrid((boundingBox[2]+boundingBox[0]) / 2), snapToGrid((boundingBox[2]+boundingBox[0]) / 2),

View File

@ -126,7 +126,7 @@
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
padding:0; padding:0;
overflow-wrap: anywhere;
li { li {
display: inline-block; display: inline-block;
padding:0; padding:0;

View File

@ -55,7 +55,7 @@
.red-ui-palette-search { .red-ui-palette-search {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background: var(--red-ui-secondary-background); background: var(--red-ui-form-input-background);
text-align: center; text-align: center;
height: 35px; height: 35px;
padding: 3px; padding: 3px;

View File

@ -35,6 +35,7 @@
padding: 8px; padding: 8px;
border-radius: 2px; border-radius: 2px;
background: var(--red-ui-popover-background); background: var(--red-ui-popover-background);
overflow-wrap: anywhere;
} }
.red-ui-popover:after, .red-ui-popover:before { .red-ui-popover:after, .red-ui-popover:before {
border: solid transparent; border: solid transparent;

View File

@ -108,6 +108,8 @@
} }
.red-ui-search-result-node-label { .red-ui-search-result-node-label {
color: var(--red-ui-secondary-text-color); color: var(--red-ui-secondary-text-color);
width: 240px;
overflow-wrap: anywhere;
} }
} }

View File

@ -31,6 +31,7 @@
> span { > span {
display: inline-block; display: inline-block;
margin-left: 5px; margin-left: 5px;
overflow-wrap: anywhere;
} }
border-bottom: 1px solid var(--red-ui-secondary-border-color); border-bottom: 1px solid var(--red-ui-secondary-border-color);
} }

View File

@ -201,7 +201,9 @@ function parseConfig(config) {
if (subflowDetails) { if (subflowDetails) {
var subflowType = subflowDetails[1] var subflowType = subflowDetails[1]
n.subflow = subflowType; n.subflow = subflowType;
flow.subflows[subflowType].instances.push(n) if (flow.subflows[subflowType]) {
flow.subflows[subflowType].instances.push(n)
}
} }
if (container) { if (container) {
container.nodes[n.id] = n; container.nodes[n.id] = n;