Skip to content

Commit

Permalink
chore: release v5.2.5
Browse files Browse the repository at this point in the history
Added fallback for admin4
  • Loading branch information
GermanBluefox committed Jul 16, 2021
1 parent 454a39a commit eb4bdc2
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 91 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_OLD.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
The newest change log is in README.md

## 5.1.3 (2021-03-23)
* (bluefox) fixed the error in the debugging

## 5.1.2 (2021-03-22)
* (bluefox) Showed the runtime information for the rules

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ And then call `npm run build`.
-->

## Changelog
### 5.2.5 (2021-07-16)
* (bluefox) Added fallback for admin4

### 5.2.3 (2021-07-08)
* (agross) Fix imports like "rxjs/operators" for versioned npm modules
Expand All @@ -59,9 +61,6 @@ And then call `npm run build`.
* (ThomasPohl) Blockly: add text_multiline block
* (Apollon77) Prevent crash case(Sentry IOBROKER-JAVASCRIPT-70)

### 5.1.3 (2021-03-23)
* (bluefox) fixed the error in the debugging

## License

The MIT License (MIT)
Expand Down
20 changes: 10 additions & 10 deletions admin/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"files": {
"main.css": "/static/css/main.4454f519.chunk.css",
"main.js": "/static/js/main.6206163b.chunk.js",
"main.js.map": "/static/js/main.6206163b.chunk.js.map",
"main.css": "/static/css/main.1a464464.chunk.css",
"main.js": "/static/js/main.966939fd.chunk.js",
"main.js.map": "/static/js/main.966939fd.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.02a8da94.js",
"runtime-main.js.map": "/static/js/runtime-main.02a8da94.js.map",
"static/css/2.1c4297c9.chunk.css": "/static/css/2.1c4297c9.chunk.css",
"static/js/2.bec0dd21.chunk.js": "/static/js/2.bec0dd21.chunk.js",
"static/js/2.bec0dd21.chunk.js.map": "/static/js/2.bec0dd21.chunk.js.map",
"static/js/2.67f55b0b.chunk.js": "/static/js/2.67f55b0b.chunk.js",
"static/js/2.67f55b0b.chunk.js.map": "/static/js/2.67f55b0b.chunk.js.map",
"index.html": "/index.html",
"static/css/2.1c4297c9.chunk.css.map": "/static/css/2.1c4297c9.chunk.css.map",
"static/css/main.4454f519.chunk.css.map": "/static/css/main.4454f519.chunk.css.map",
"static/js/2.bec0dd21.chunk.js.LICENSE.txt": "/static/js/2.bec0dd21.chunk.js.LICENSE.txt",
"static/css/main.1a464464.chunk.css.map": "/static/css/main.1a464464.chunk.css.map",
"static/js/2.67f55b0b.chunk.js.LICENSE.txt": "/static/js/2.67f55b0b.chunk.js.LICENSE.txt",
"static/media/hysteresis.04ebd02c.png": "/static/media/hysteresis.04ebd02c.png"
},
"entrypoints": [
"static/js/runtime-main.02a8da94.js",
"static/css/2.1c4297c9.chunk.css",
"static/js/2.bec0dd21.chunk.js",
"static/css/main.4454f519.chunk.css",
"static/js/main.6206163b.chunk.js"
"static/js/2.67f55b0b.chunk.js",
"static/css/main.1a464464.chunk.css",
"static/js/main.966939fd.chunk.js"
]
}
2 changes: 2 additions & 0 deletions admin/static/css/main.1a464464.chunk.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions admin/static/css/main.4454f519.chunk.css

This file was deleted.

3 changes: 3 additions & 0 deletions admin/static/js/2.67f55b0b.chunk.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object-assign
*/

/*!
Copyright (c) 2017 Jed Watson.
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
Expand Down

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions admin/static/js/2.bec0dd21.chunk.js

This file was deleted.

2 changes: 0 additions & 2 deletions admin/static/js/main.6206163b.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion admin/static/js/main.6206163b.chunk.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions admin/static/js/main.966939fd.chunk.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions admin/static/js/main.966939fd.chunk.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/tab.html

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,32 @@
"Apollon77 <[email protected]>",
"AlCalzone"
],
"version": "5.2.3",
"version": "5.2.5",
"news": {
"5.2.5": {
"en": "Added fallback for admin4",
"de": "Fallback für admin4 hinzugefügt",
"ru": "Добавлен резервный вариант для admin4",
"pt": "Adicionado substituto para admin4",
"nl": "Terugval toegevoegd voor admin4",
"fr": "Ajout de la solution de secours pour admin4",
"it": "Aggiunto fallback per admin4",
"es": "Respaldo agregado para admin4",
"pl": "Dodano rezerwę dla admin4",
"zh-cn": "为 admin4 添加了后备"
},
"5.2.4": {
"en": "Added fallback for admin4",
"de": "Fallback für admin4 hinzugefügt",
"ru": "Добавлен резервный вариант для admin4",
"pt": "Adicionado substituto para admin4",
"nl": "Terugval toegevoegd voor admin4",
"fr": "Ajout de la solution de secours pour admin4",
"it": "Aggiunto fallback per admin4",
"es": "Respaldo agregado para admin4",
"pl": "Dodano rezerwę dla admin4",
"zh-cn": "为 admin4 添加了后备"
},
"5.2.3": {
"en": "Fix imports like \"rxjs/operators\" for versioned npm modules",
"de": "Importe wie \"rxjs/operators\" für versionierte npm-Module behoben",
Expand Down Expand Up @@ -237,30 +261,6 @@
"es": "Errores corregidos en las reglas",
"pl": "Naprawiono błędy w regułach",
"zh-cn": "修正规则错误"
},
"5.0.3": {
"en": "Implemented the memory for condition",
"de": "Implementierte den Speicher für Bedingung",
"ru": "Реализована память для условия",
"pt": "Implementou a memória para a condição",
"nl": "Het geheugen geïmplementeerd voor conditie",
"fr": "Implémentation de la mémoire pour la condition",
"it": "Implementata la memoria per la condizione",
"es": "Implementado la memoria para condición",
"pl": "Zaimplementowano pamięć warunkową",
"zh-cn": "实现条件存储"
},
"5.0.2": {
"en": "Fixed error in the rules",
"de": "Fehler in den Regeln behoben",
"ru": "Исправлена ошибка в правилах",
"pt": "Erro corrigido nas regras",
"nl": "Fout in de regels opgelost",
"fr": "Correction d'une erreur dans les règles",
"it": "Corretto errore nelle regole",
"es": "Error solucionado en las reglas.",
"pl": "Naprawiono błąd w zasadach",
"zh-cn": "修正规则中的错误"
}
},
"desc": {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.javascript",
"version": "5.2.3",
"version": "5.2.5",
"description": "Rules Engine for ioBroker",
"author": "bluefox <[email protected]>",
"contributors": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"@iobroker/adapter-core": "^2.5.0",
"@types/node": "^12.20.16",
"@types/request": "^2.48.5",
"@types/request": "^2.48.6",
"coffee-compiler": "^0.3.2",
"coffee-script": "^1.12.7",
"jsonata": "^1.8.4",
Expand All @@ -46,15 +46,15 @@
},
"devDependencies": {
"@alcalzone/release-script": "^2.2.0",
"@types/iobroker": "^3.3.0",
"@types/iobroker": "^3.3.1",
"alcalzone-shared": "^4.0.0",
"chai": "^4.3.4",
"del": "^6.0.0",
"eslint": "^7.30.0",
"gulp": "^4.0.2",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.1.3",
"mocha": "^9.0.1",
"mocha": "^9.0.2",
"timekeeper": "^2.2.0"
},
"bugs": {
Expand Down
40 changes: 20 additions & 20 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
{
"name": "js",
"version": "5.2.3",
"version": "5.2.5",
"private": true,
"dependencies": {
"@iobroker/adapter-react": "^1.6.7",
"@material-ui/core": "^4.11.3",
"@iobroker/adapter-react": "^2.0.1",
"@material-ui/core": "^4.12.1",
"@material-ui/icons": "^4.11.2",
"@sentry/browser": "^6.0.4",
"@sentry/integrations": "^6.0.4",
"@sentry/browser": "^6.9.0",
"@sentry/integrations": "^6.9.0",
"clsx": "^1.1.1",
"cronstrue": "^1.108.0",
"eslint": "^7.19.0",
"lodash": "^4.17.20",
"cronstrue": "^1.114.0",
"eslint": "^7.30.0",
"lodash": "^4.17.21",
"monaco-editor": "~0.23.0",
"react": "^17.0.1",
"react": "^17.0.2",
"react-bem-helper": "^1.4.1",
"react-dnd": "^11.1.3",
"react-dnd-html5-backend": "^11.1.3",
"react-dnd-touch-backend": "^12.0.0",
"react-dom": "^17.0.1",
"react-dropzone": "^11.2.4",
"react-dnd": "^14.0.2",
"react-dnd-html5-backend": "^14.0.0",
"react-dnd-touch-backend": "^14.0.0",
"react-dom": "^17.0.2",
"react-dropzone": "^11.3.4",
"react-fullscreen": "^0.1.0",
"react-i18next": "^11.8.5",
"react-icons": "^4.1.0",
"react-i18next": "^11.11.3",
"react-icons": "^4.2.0",
"react-monaco-editor": "^0.43.0",
"react-scripts": "^4.0.1",
"react-scripts": "^4.0.3",
"react-splitter-layout": "^4.0.0",
"react-text-mask": "^5.4.3",
"react-treeview-mui": "^0.1.2",
"sass": "^1.32.5",
"sass": "^1.35.2",
"suncalc2": "^1.8.1",
"reactour": "^1.18.1",
"styled-components": "^5.2.1",
"reactour": "^1.18.6",
"styled-components": "^5.3.0",
"react-json-view": "^1.21.3"
},
"scripts": {
Expand Down
49 changes: 40 additions & 9 deletions src/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,45 @@ class App extends GenericApp {
});
}

// BF(2021.07.16): support fallback on admin4. Remove it after one year
getAdapterInstances() {
return new Promise((resolve, reject) => {
let timeout = setTimeout(() => {
this.socket.getObjectView(
`system.adapter.${this.adapterName}.`,
`system.adapter.${this.adapterName}.\u9999`,
'instance'
)
.then(items => {
timeout = null;
resolve(Object.keys(items).map(id => items[id]));
})
.catch(e => {
timeout = null;
reject(e);
});
}, 2000);

return this.socket.getAdapterInstances(this.adapterName)
.then(result => {
if (timeout) {
clearTimeout(timeout);
timeout = null;
return resolve(result);
}
})
.catch(e => {
if (timeout) {
clearTimeout(timeout);
timeout = null;
reject(e);
}
});
});
}

subscribeOnInstances() {
return this.socket.getAdapterInstances(this.adapterName)
return this.getAdapterInstances()
.then(instancesArray => {
const instances = instancesArray.map(obj => parseInt(obj._id.split('.').pop())).sort();
const runningInstances = {};
Expand Down Expand Up @@ -573,15 +610,9 @@ class App extends GenericApp {
if (newCommon.engineType !== undefined) {
obj.common.engineType = newCommon.engineType || 'Javascript/js';
}

return new Promise((resolve, reject) =>
this.socket.getRawSocket().emit('extendObject', oldId, obj, err =>
err ? reject(err) : resolve()));
} else {
return new Promise((resolve, reject) =>
this.socket.getRawSocket().emit('extendObject', oldId, obj, err =>
err ? reject(err) : resolve()));
}

return this.socket.extendObject(oldId, obj);
} else {
// let prefix;

Expand Down
12 changes: 4 additions & 8 deletions src/src/SideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,16 +392,12 @@ export const Droppable = (props) => {
</div>;
};

export const Draggable = (props) => {
export const Draggable = props => {
const { name } = props;
const [{ opacity }, drag] = useDrag({
item: {
name,
type: 'script'
},
collect: (monitor) => ({
opacity: monitor.isDragging() ? 0.3 : 1,
}),
type: 'script',
item: () => ({name}),
collect: monitor => ({opacity: monitor.isDragging() ? 0.3 : 1,}),
});
// About transform: https://github.com/react-dnd/react-dnd/issues/832#issuecomment-442071628
return <div ref={drag} style={{ opacity, transform: 'translate3d(0, 0, 0)' }}>
Expand Down

0 comments on commit eb4bdc2

Please sign in to comment.