@iobroker/dm-utils 0.6.10 → 0.6.11
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/README.md +4 -0
- package/build/DeviceManagement.d.ts +1 -1
- package/build/DeviceManagement.js +7 -4
- package/build/types/common.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -295,6 +295,10 @@ This method returns a promise that resolves to a `ProgressDialog` object.
|
|
|
295
295
|
### **WORK IN PROGRESS**
|
|
296
296
|
-->
|
|
297
297
|
## Changelog
|
|
298
|
+
### 0.6.11 (2024-12-11)
|
|
299
|
+
|
|
300
|
+
* (@GermanBluefox) Do not close handler for progress
|
|
301
|
+
|
|
298
302
|
### 0.6.10 (2024-12-10)
|
|
299
303
|
|
|
300
304
|
* (@GermanBluefox) Export `BackEndCommandJsonFormOptions` type
|
|
@@ -42,7 +42,7 @@ export declare class MessageContext implements ActionContext {
|
|
|
42
42
|
showForm(schema: JsonFormSchema, options?: {
|
|
43
43
|
data?: JsonFormData;
|
|
44
44
|
title?: ioBroker.StringOrTranslated;
|
|
45
|
-
buttons?: (ActionButton | 'apply' | 'cancel')[];
|
|
45
|
+
buttons?: (ActionButton | 'apply' | 'cancel' | 'close')[];
|
|
46
46
|
}): Promise<JsonFormData | undefined>;
|
|
47
47
|
openProgress(title: string, options?: {
|
|
48
48
|
indeterminate?: boolean;
|
|
@@ -341,7 +341,7 @@ class MessageContext {
|
|
|
341
341
|
});
|
|
342
342
|
this.send('progress', {
|
|
343
343
|
progress: Object.assign(Object.assign(Object.assign({ title }, options), update), { open: true }),
|
|
344
|
-
});
|
|
344
|
+
}, true);
|
|
345
345
|
return promise;
|
|
346
346
|
},
|
|
347
347
|
close: () => {
|
|
@@ -362,7 +362,7 @@ class MessageContext {
|
|
|
362
362
|
});
|
|
363
363
|
this.send('progress', {
|
|
364
364
|
progress: Object.assign(Object.assign({ title }, options), { open: true }),
|
|
365
|
-
});
|
|
365
|
+
}, true);
|
|
366
366
|
return promise;
|
|
367
367
|
}
|
|
368
368
|
sendFinalResult(result) {
|
|
@@ -403,12 +403,15 @@ class MessageContext {
|
|
|
403
403
|
throw new Error("Can't show another dialog while a progress dialog is open. Please call 'close()' on the dialog before opening another dialog.");
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
send(type, message) {
|
|
406
|
+
send(type, message, doNotClose) {
|
|
407
407
|
if (!this.lastMessage) {
|
|
408
408
|
throw new Error("No outstanding message, can't send a new one");
|
|
409
409
|
}
|
|
410
410
|
this.adapter.sendTo(this.lastMessage.from, this.lastMessage.command, Object.assign(Object.assign({}, message), { type, origin: this.lastMessage.message.origin || this.lastMessage._id }), this.lastMessage.callback);
|
|
411
|
-
|
|
411
|
+
if (!doNotClose) {
|
|
412
|
+
// "progress" is exception. It will be closed with "close" flag
|
|
413
|
+
this.lastMessage = undefined;
|
|
414
|
+
}
|
|
412
415
|
}
|
|
413
416
|
}
|
|
414
417
|
exports.MessageContext = MessageContext;
|
package/build/types/common.d.ts
CHANGED
|
@@ -854,7 +854,7 @@ export type BackEndCommand = BackEndCommandMessage | BackEndCommandOpenLink | Ba
|
|
|
854
854
|
export type BackEndCommandJsonFormOptions = {
|
|
855
855
|
data?: JsonFormData;
|
|
856
856
|
title?: ioBroker.StringOrTranslated;
|
|
857
|
-
buttons?: (ActionButton | 'apply' | 'cancel')[];
|
|
857
|
+
buttons?: (ActionButton | 'apply' | 'cancel' | 'close')[];
|
|
858
858
|
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
859
859
|
noTranslation?: boolean;
|
|
860
860
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/dm-utils",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "ioBroker Device Manager utilities for backend",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@alcalzone/release-script": "^3.8.0",
|
|
29
29
|
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
30
30
|
"@iobroker/eslint-config": "^1.0.0",
|
|
31
|
-
"@types/node": "^22.10.
|
|
31
|
+
"@types/node": "^22.10.2",
|
|
32
32
|
"axios": "^1.7.9",
|
|
33
33
|
"typescript": "^5.7.2"
|
|
34
34
|
},
|