@node-red/editor-client 2.1.2 → 2.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/editor-client",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
package/public/red/about CHANGED
@@ -1,3 +1,19 @@
1
+ #### 2.1.3: Maintenance Release
2
+
3
+ Runtime
4
+
5
+ - Update gen-publish script to update 'next' tag for main releases
6
+ - Add environment variable to enable/disable tours (#3221) @hardillb
7
+ - Fix loading non-default language files leaving runtime in wrong locale (#3225) @knolleary
8
+
9
+ Editor
10
+
11
+ - Refresh editor settings whenever a node is added or enabled (#3227) @knolleary
12
+ - Revert spinner css change that made it shrink in some cases (#3229) @knolleary
13
+ - Fix import notification message when importing config nodes (#3224) @knolleary
14
+ - Handle changing types of TypedInput repeatedly (#3223) @knolleary
15
+
16
+
1
17
  #### 2.1.2: Maintenance Release
2
18
 
3
19
 
package/public/red/red.js CHANGED
@@ -566,31 +566,33 @@ var RED = (function() {
566
566
  var typeList;
567
567
  var info;
568
568
  if (topic == "notification/node/added") {
569
- var addedTypes = [];
570
- msg.forEach(function(m) {
571
- var id = m.id;
572
- RED.nodes.addNodeSet(m);
573
- addedTypes = addedTypes.concat(m.types);
574
- RED.i18n.loadNodeCatalog(id, function() {
575
- var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
576
- $.ajax({
577
- headers: {
578
- "Accept":"text/html",
579
- "Accept-Language": lang
580
- },
581
- cache: false,
582
- url: 'nodes/'+id,
583
- success: function(data) {
584
- appendNodeConfig(data);
585
- }
569
+ RED.settings.refreshSettings(function(err, data) {
570
+ var addedTypes = [];
571
+ msg.forEach(function(m) {
572
+ var id = m.id;
573
+ RED.nodes.addNodeSet(m);
574
+ addedTypes = addedTypes.concat(m.types);
575
+ RED.i18n.loadNodeCatalog(id, function() {
576
+ var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
577
+ $.ajax({
578
+ headers: {
579
+ "Accept":"text/html",
580
+ "Accept-Language": lang
581
+ },
582
+ cache: false,
583
+ url: 'nodes/'+id,
584
+ success: function(data) {
585
+ appendNodeConfig(data);
586
+ }
587
+ });
586
588
  });
587
589
  });
588
- });
589
- if (addedTypes.length) {
590
- typeList = "<ul><li>"+addedTypes.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
591
- RED.notify(RED._("palette.event.nodeAdded", {count:addedTypes.length})+typeList,"success");
592
- }
593
- loadIconList();
590
+ if (addedTypes.length) {
591
+ typeList = "<ul><li>"+addedTypes.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
592
+ RED.notify(RED._("palette.event.nodeAdded", {count:addedTypes.length})+typeList,"success");
593
+ }
594
+ loadIconList();
595
+ })
594
596
  } else if (topic == "notification/node/removed") {
595
597
  for (i=0;i<msg.length;i++) {
596
598
  m = msg[i];
@@ -603,27 +605,29 @@ var RED = (function() {
603
605
  loadIconList();
604
606
  } else if (topic == "notification/node/enabled") {
605
607
  if (msg.types) {
606
- info = RED.nodes.getNodeSet(msg.id);
607
- if (info.added) {
608
- RED.nodes.enableNodeSet(msg.id);
609
- typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
610
- RED.notify(RED._("palette.event.nodeEnabled", {count:msg.types.length})+typeList,"success");
611
- } else {
612
- var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
613
- $.ajax({
614
- headers: {
615
- "Accept":"text/html",
616
- "Accept-Language": lang
617
- },
618
- cache: false,
619
- url: 'nodes/'+msg.id,
620
- success: function(data) {
621
- appendNodeConfig(data);
622
- typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
623
- RED.notify(RED._("palette.event.nodeAdded", {count:msg.types.length})+typeList,"success");
624
- }
625
- });
626
- }
608
+ RED.settings.refreshSettings(function(err, data) {
609
+ info = RED.nodes.getNodeSet(msg.id);
610
+ if (info.added) {
611
+ RED.nodes.enableNodeSet(msg.id);
612
+ typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
613
+ RED.notify(RED._("palette.event.nodeEnabled", {count:msg.types.length})+typeList,"success");
614
+ } else {
615
+ var lang = localStorage.getItem("editor-language")||RED.i18n.detectLanguage();
616
+ $.ajax({
617
+ headers: {
618
+ "Accept":"text/html",
619
+ "Accept-Language": lang
620
+ },
621
+ cache: false,
622
+ url: 'nodes/'+msg.id,
623
+ success: function(data) {
624
+ appendNodeConfig(data);
625
+ typeList = "<ul><li>"+msg.types.map(RED.utils.sanitize).join("</li><li>")+"</li></ul>";
626
+ RED.notify(RED._("palette.event.nodeAdded", {count:msg.types.length})+typeList,"success");
627
+ }
628
+ });
629
+ }
630
+ });
627
631
  }
628
632
  } else if (topic == "notification/node/disabled") {
629
633
  if (msg.types) {
@@ -1408,7 +1412,7 @@ RED.settings = (function () {
1408
1412
  load(done);
1409
1413
  }
1410
1414
 
1411
- var load = function(done) {
1415
+ var refreshSettings = function(done) {
1412
1416
  $.ajax({
1413
1417
  headers: {
1414
1418
  "Accept": "application/json"
@@ -1418,6 +1422,23 @@ RED.settings = (function () {
1418
1422
  url: 'settings',
1419
1423
  success: function (data) {
1420
1424
  setProperties(data);
1425
+ done(null, data);
1426
+ },
1427
+ error: function(jqXHR,textStatus,errorThrown) {
1428
+ if (jqXHR.status === 401) {
1429
+ if (/[?&]access_token=(.*?)(?:$|&)/.test(window.location.search)) {
1430
+ window.location.search = "";
1431
+ }
1432
+ RED.user.login(function() { refreshSettings(done); });
1433
+ } else {
1434
+ console.log("Unexpected error loading settings:",jqXHR.status,textStatus);
1435
+ }
1436
+ }
1437
+ });
1438
+ }
1439
+ var load = function(done) {
1440
+ refreshSettings(function(err, data) {
1441
+ if (!err) {
1421
1442
  if (!RED.settings.user || RED.settings.user.anonymous) {
1422
1443
  RED.settings.remove("auth-tokens");
1423
1444
  }
@@ -1430,18 +1451,8 @@ RED.settings = (function () {
1430
1451
  console.log("D3",d3.version);
1431
1452
  console.groupEnd();
1432
1453
  loadUserSettings(done);
1433
- },
1434
- error: function(jqXHR,textStatus,errorThrown) {
1435
- if (jqXHR.status === 401) {
1436
- if (/[?&]access_token=(.*?)(?:$|&)/.test(window.location.search)) {
1437
- window.location.search = "";
1438
- }
1439
- RED.user.login(function() { load(done); });
1440
- } else {
1441
- console.log("Unexpected error loading settings:",jqXHR.status,textStatus);
1442
- }
1443
1454
  }
1444
- });
1455
+ })
1445
1456
  };
1446
1457
 
1447
1458
  function loadUserSettings(done) {
@@ -1517,6 +1528,7 @@ RED.settings = (function () {
1517
1528
  init: init,
1518
1529
  load: load,
1519
1530
  loadUserSettings: loadUserSettings,
1531
+ refreshSettings: refreshSettings,
1520
1532
  set: set,
1521
1533
  get: get,
1522
1534
  remove: remove,
@@ -14071,7 +14083,7 @@ RED.stack = (function() {
14071
14083
  var previousType = this.typeMap[this.propertyType];
14072
14084
  previousValue = this.input.val();
14073
14085
 
14074
- if (this.typeChanged) {
14086
+ if (previousType && this.typeChanged) {
14075
14087
  if (this.options.debug) { console.log(this.identifier,"typeChanged",{previousType,previousValue}) }
14076
14088
  if (previousType.options && opt.hasValue !== true) {
14077
14089
  this.oldValues[previousType.value] = previousValue;
@@ -23708,7 +23720,7 @@ RED.view = (function() {
23708
23720
  counts.push(RED._("clipboard.group",{count:newGroupCount}));
23709
23721
  }
23710
23722
  if (newConfigNodeCount > 0) {
23711
- counts.push(RED._("clipboard.configNode",{count:newNodeCount}));
23723
+ counts.push(RED._("clipboard.configNode",{count:newConfigNodeCount}));
23712
23724
  }
23713
23725
  if (new_subflows.length > 0) {
23714
23726
  counts.push(RED._("clipboard.subflow",{count:new_subflows.length}));