Skip to content

Commit

Permalink
Bug fixes & version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
TotallyInformation committed Jan 4, 2024
1 parent a05ec38 commit c54af77
Show file tree
Hide file tree
Showing 31 changed files with 121 additions and 73 deletions.
27 changes: 20 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ Please see the documentation for archived changelogs - a new archive is produced

## Issues

* uibuilder.send({ payload: pl, topic: tp }, nodename)

where nodename is defined as:
const nodename = '30fb97fcc6154e6c'
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.

### "Outdated" dependencies

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.
Expand All @@ -31,10 +25,29 @@ I will be trying to eliminate packages that have enforced structural changes. Th

------------

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

Nothing currently.

## [v6.8.2](https://github.com/TotallyInformation/node-red-contrib-uibuilder/compare/v6.8.1...v6.8.2)

### `uibrouter` library

* **FIXED** Default route was always being set on load. Now correctly takes the current URL hash into account first.
* **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.
* **FIXED** On start, hash change event could be fired twice. Now does the initial route before setting up the hash change listener.

### `uib-save` node

* **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.
* **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.
* **FIXED** In the Editor, the list of available uibuilder nodes to choose from was not sorted. Now sorted for ease of access.
* **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`)

### `ti-common.js` Editor support library

* **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).

## [v6.8.1](https://github.com/TotallyInformation/node-red-contrib-uibuilder/compare/v6.8.0...v6.8.1)

* **FIXED** Regression caused by "fix" for users deploying with an invalid URL. `uibuilder` node's editor and runtime code updated.
Expand Down
2 changes: 1 addition & 1 deletion front-end/ui.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var require_ui = __commonJS({
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
*/
constructor(win, extLog, jsonHighlight) {
__publicField(this, "version", "6.8.1-src");
__publicField(this, "version", "6.8.2-src");
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
Expand Down
2 changes: 1 addition & 1 deletion front-end/ui.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/ui.esm.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/ui.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
*/
constructor(win, extLog, jsonHighlight) {
__publicField(this, "version", "6.8.1-src");
__publicField(this, "version", "6.8.2-src");
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
Expand Down
2 changes: 1 addition & 1 deletion front-end/ui.iife.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/ui.iife.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions front-end/uibuilder.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var require_ui = __commonJS({
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
*/
constructor(win, extLog, jsonHighlight) {
__publicField(this, "version", "6.8.1-src");
__publicField(this, "version", "6.8.2-src");
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
Expand Down Expand Up @@ -4641,7 +4641,7 @@ __publicField(_UibVar, "props", ["filter", "id", "name", "report", "topic", "typ
var UibVar = _UibVar;

// src/front-end-module/uibuilder.module.js
var version = "6.8.1-esm";
var version = "6.8.2-esm";
var isMinified = !/param/.test(function(param) {
});
var logLevel = isMinified ? 0 : 1;
Expand Down
2 changes: 1 addition & 1 deletion front-end/uibuilder.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/uibuilder.esm.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions front-end/uibuilder.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
* @param {function} [jsonHighlight] A function that returns a highlighted HTML of JSON input
*/
constructor(win, extLog, jsonHighlight) {
__publicField(this, "version", "6.8.1-src");
__publicField(this, "version", "6.8.2-src");
// List of tags and attributes not in sanitise defaults but allowed in uibuilder.
__publicField(this, "sanitiseExtraTags", ["uib-var"]);
__publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
Expand Down Expand Up @@ -4642,7 +4642,7 @@
var UibVar = _UibVar;

// src/front-end-module/uibuilder.module.js
var version = "6.8.1-iife";
var version = "6.8.2-iife";
var isMinified = !/param/.test(function(param) {
});
var logLevel = isMinified ? 0 : 1;
Expand Down
2 changes: 1 addition & 1 deletion front-end/uibuilder.iife.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/uibuilder.iife.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/uibuilderfe.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if (typeof require !== 'undefined' && typeof io === 'undefined') { // eslint-d

//#region ++++++++++ Start of setup ++++++++++ //

self.version = '6.8.1-old'
self.version = '6.8.2-old'
self.moduleName = 'uibuilder' // Must match moduleName in uibuilder.js on the server
// @ts-expect-error ts(2345) Tests loaded ver of lib to see if minified
self.isUnminified = (/param/).test(function(param) {}) // eslint-disable-line no-unused-vars
Expand Down
2 changes: 1 addition & 1 deletion front-end/uibuilderfe.min.js

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions front-end/utils/uibrouter.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ var UibRouter = class {
this._updateRouteIds();
Promise.all(Object.values(routerConfig2.routes).filter((r) => r.type && r.type === "url").map(this._loadExternal)).then(this._appendExternalTemplates).then(() => {
this._start();
return true;
}).catch((reason) => {
console.error(reason);
});
}
/** Save a reference to, and create if necessary, the HTML element to hold routes */
Expand Down Expand Up @@ -89,8 +92,8 @@ var UibRouter = class {
_start() {
if (__privateGet(this, _startDone) === true)
return;
this.doRoute(this.keepHashFromUrl(window.location.hash));
window.addEventListener("hashchange", (event) => this._hashChange(event));
this.doRoute();
document.dispatchEvent(new CustomEvent("uibrouter:loaded"));
if (uibuilder)
uibuilder.set("uibrouter", "loaded");
Expand Down Expand Up @@ -215,8 +218,11 @@ var UibRouter = class {
document.dispatchEvent(new CustomEvent("uibrouter:route-change-failed", { detail: { newRouteId, oldRouteId } }));
if (uibuilder)
uibuilder.set("uibrouter", "route change failed");
window.location.hash = oldRouteId ? `#${oldRouteId}` : "";
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}'`);
if (newRouteId === oldRouteId)
oldRouteId = "";
this.doRoute(oldRouteId || "");
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}'`);
return;
}
if (this.config.hide) {
if (oldRouteId) {
Expand Down Expand Up @@ -372,7 +378,7 @@ _startDone = new WeakMap();
// eslint-disable-line no-unused-vars
//#region --- Variables ---
/** Class version */
__publicField(UibRouter, "version", "1.0.1");
__publicField(UibRouter, "version", "1.0.2");
var uibrouter_default = UibRouter;
if (!window["UibRouter"]) {
window["UibRouter"] = UibRouter;
Expand Down
Loading

0 comments on commit c54af77

Please sign in to comment.