Skip to content

Commit c54af77

Browse files
Bug fixes & version bump
1 parent a05ec38 commit c54af77

31 files changed

+121
-73
lines changed

CHANGELOG.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ Please see the documentation for archived changelogs - a new archive is produced
88

99
## Issues
1010

11-
* uibuilder.send({ payload: pl, topic: tp }, nodename)
12-
13-
where nodename is defined as:
14-
const nodename = '30fb97fcc6154e6c'
15-
After the upgrade, this is no more working, no errors in console. It simply doesn't send the message back to the node in NR.
16-
1711
### "Outdated" dependencies
1812

1913
Unfortunately, for various reasons, some of the package dependencies that UIBUILDER relies on cannot be updated to their latest versions. These are documented, with the reason, here.
@@ -31,10 +25,29 @@ I will be trying to eliminate packages that have enforced structural changes. Th
3125

3226
------------
3327

34-
## [Unreleased](https://github.com/TotallyInformation/node-red-contrib-uibuilder/compare/v6.8.1...main)
28+
## [Unreleased](https://github.com/TotallyInformation/node-red-contrib-uibuilder/compare/v6.8.2...main)
3529

3630
Nothing currently.
3731

32+
## [v6.8.2](https://github.com/TotallyInformation/node-red-contrib-uibuilder/compare/v6.8.1...v6.8.2)
33+
34+
### `uibrouter` library
35+
36+
* **FIXED** Default route was always being set on load. Now correctly takes the current URL hash into account first.
37+
* **FIXED** Routes loaded via script, if pre-selected on page load (e.g. in URL hash), were crashing. Now will automatically revert to the default route and just print an error to the console.
38+
* **FIXED** On start, hash change event could be fired twice. Now does the initial route before setting up the hash change listener.
39+
40+
### `uib-save` node
41+
42+
* **FIXED** After import/paste, impossible to set a selected uibuilder node reference. Due to a timing issue in how Node-RED reports on nodes added to the flows on Editor page load. Now pre-populate the list of in-editor uibuilder nodes with deployed uibuilder nodes.
43+
* **FIXED** Correctly change saved URL if a uibuilder node changes it. In this case, the save node knows the id of its linked uibuilder node but not the name so we change the name and mark the save node as needing re-deployment.
44+
* **FIXED** In the Editor, the list of available uibuilder nodes to choose from was not sorted. Now sorted for ease of access.
45+
* **FIXED** After a paste/import, when the url changes, reset the `addType` flag to stop chkUrl re-blanking it by adding `if (node.addType === 'paste/import') node.addType = 'load'` (in `oneditchange`)
46+
47+
### `ti-common.js` Editor support library
48+
49+
* **IMPROVED** Due to a timing issue in how Node-RED reports on nodes added to the flows on Editor page load, the in-editor list of uibuilder node was not built soon enough for use. Now pre-populates the list of in-editor uibuilder nodes with deployed uibuilder nodes. (Only if the in-editor list has zero entries).
50+
3851
## [v6.8.1](https://github.com/TotallyInformation/node-red-contrib-uibuilder/compare/v6.8.0...v6.8.1)
3952

4053
* **FIXED** Regression caused by "fix" for users deploying with an invalid URL. `uibuilder` node's editor and runtime code updated.

front-end/ui.esm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var require_ui = __commonJS({
2020
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
2121
*/
2222
constructor(win, extLog, jsonHighlight) {
23-
__publicField(this, "version", "6.8.1-src");
23+
__publicField(this, "version", "6.8.2-src");
2424
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
2525
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
2626
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);

front-end/ui.esm.min.js

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

front-end/ui.esm.min.js.map

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

front-end/ui.iife.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
2222
*/
2323
constructor(win, extLog, jsonHighlight) {
24-
__publicField(this, "version", "6.8.1-src");
24+
__publicField(this, "version", "6.8.2-src");
2525
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
2626
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
2727
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);

front-end/ui.iife.min.js

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

front-end/ui.iife.min.js.map

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

front-end/uibuilder.esm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var require_ui = __commonJS({
6262
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
6363
*/
6464
constructor(win, extLog, jsonHighlight) {
65-
__publicField(this, "version", "6.8.1-src");
65+
__publicField(this, "version", "6.8.2-src");
6666
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
6767
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
6868
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
@@ -4641,7 +4641,7 @@ __publicField(_UibVar, "props", ["filter", "id", "name", "report", "topic", "typ
46414641
var UibVar = _UibVar;
46424642

46434643
// src/front-end-module/uibuilder.module.js
4644-
var version = "6.8.1-esm";
4644+
var version = "6.8.2-esm";
46454645
var isMinified = !/param/.test(function(param) {
46464646
});
46474647
var logLevel = isMinified ? 0 : 1;

front-end/uibuilder.esm.min.js

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

front-end/uibuilder.esm.min.js.map

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

front-end/uibuilder.iife.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
6464
*/
6565
constructor(win, extLog, jsonHighlight) {
66-
__publicField(this, "version", "6.8.1-src");
66+
__publicField(this, "version", "6.8.2-src");
6767
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
6868
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
6969
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
@@ -4642,7 +4642,7 @@
46424642
var UibVar = _UibVar;
46434643

46444644
// src/front-end-module/uibuilder.module.js
4645-
var version = "6.8.1-iife";
4645+
var version = "6.8.2-iife";
46464646
var isMinified = !/param/.test(function(param) {
46474647
});
46484648
var logLevel = isMinified ? 0 : 1;

front-end/uibuilder.iife.min.js

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

front-end/uibuilder.iife.min.js.map

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

front-end/uibuilderfe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ if (typeof require !== 'undefined' && typeof io === 'undefined') { // eslint-d
124124

125125
//#region ++++++++++ Start of setup ++++++++++ //
126126

127-
self.version = '6.8.1-old'
127+
self.version = '6.8.2-old'
128128
self.moduleName = 'uibuilder' // Must match moduleName in uibuilder.js on the server
129129
// @ts-expect-error ts(2345) Tests loaded ver of lib to see if minified
130130
self.isUnminified = (/param/).test(function(param) {}) // eslint-disable-line no-unused-vars

front-end/uibuilderfe.min.js

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

front-end/utils/uibrouter.esm.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ var UibRouter = class {
5959
this._updateRouteIds();
6060
Promise.all(Object.values(routerConfig2.routes).filter((r) => r.type && r.type === "url").map(this._loadExternal)).then(this._appendExternalTemplates).then(() => {
6161
this._start();
62+
return true;
63+
}).catch((reason) => {
64+
console.error(reason);
6265
});
6366
}
6467
/** Save a reference to, and create if necessary, the HTML element to hold routes */
@@ -89,8 +92,8 @@ var UibRouter = class {
8992
_start() {
9093
if (__privateGet(this, _startDone) === true)
9194
return;
95+
this.doRoute(this.keepHashFromUrl(window.location.hash));
9296
window.addEventListener("hashchange", (event) => this._hashChange(event));
93-
this.doRoute();
9497
document.dispatchEvent(new CustomEvent("uibrouter:loaded"));
9598
if (uibuilder)
9699
uibuilder.set("uibrouter", "loaded");
@@ -215,8 +218,11 @@ var UibRouter = class {
215218
document.dispatchEvent(new CustomEvent("uibrouter:route-change-failed", { detail: { newRouteId, oldRouteId } }));
216219
if (uibuilder)
217220
uibuilder.set("uibrouter", "route change failed");
218-
window.location.hash = oldRouteId ? `#${oldRouteId}` : "";
219-
throw new Error(`[uibrouter:doRoute] No valid route found. Either pass a valid route name or an event from an element having an href of '#routename'. Route id requested: '${newRouteId}'`);
221+
if (newRouteId === oldRouteId)
222+
oldRouteId = "";
223+
this.doRoute(oldRouteId || "");
224+
console.error(`[uibrouter:doRoute] No valid route found. Either pass a valid route name or an event from an element having an href of '#${newRouteId}'. Route id requested: '${newRouteId}'`);
225+
return;
220226
}
221227
if (this.config.hide) {
222228
if (oldRouteId) {
@@ -372,7 +378,7 @@ _startDone = new WeakMap();
372378
// eslint-disable-line no-unused-vars
373379
//#region --- Variables ---
374380
/** Class version */
375-
__publicField(UibRouter, "version", "1.0.1");
381+
__publicField(UibRouter, "version", "1.0.2");
376382
var uibrouter_default = UibRouter;
377383
if (!window["UibRouter"]) {
378384
window["UibRouter"] = UibRouter;

0 commit comments

Comments
 (0)