@iobroker/adapter-react-v5 3.1.3 → 3.1.6
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/Components/FileBrowser.js +277 -237
- package/Components/FileBrowser.js.map +1 -1
- package/Components/FileViewer.js +3 -1
- package/Components/FileViewer.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocomplete.js +5 -3
- package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js +5 -3
- package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js +16 -2
- package/Components/JsonConfigComponent/ConfigCertificateSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigCustom.js +148 -25
- package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigFile.js +183 -0
- package/Components/JsonConfigComponent/ConfigFile.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js +747 -0
- package/Components/JsonConfigComponent/ConfigFileSelector.js.map +1 -0
- package/Components/JsonConfigComponent/ConfigGeneric.js +105 -20
- package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js +132 -46
- package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js +25 -1
- package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigNumber.js +5 -4
- package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigObjectId.js +3 -2
- package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPanel.js +51 -40
- package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js +1 -1
- package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSelect.js +4 -2
- package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
- package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigSetState.js +2 -2
- package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticHeader.js +31 -8
- package/Components/JsonConfigComponent/ConfigStaticHeader.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js +1 -1
- package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js +1 -1
- package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTabs.js +12 -3
- package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigText.js +4 -2
- package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
- package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
- package/Components/JsonConfigComponent/index.js +12 -4
- package/Components/JsonConfigComponent/index.js.map +1 -1
- package/Components/ObjectBrowser.js +228 -222
- package/Components/ObjectBrowser.js.map +1 -1
- package/Components/TableResize.js +34 -16
- package/Components/TableResize.js.map +1 -1
- package/Components/TreeTable.js +2 -2
- package/Components/TreeTable.js.map +1 -1
- package/Components/Utils.js +5 -5
- package/Components/Utils.js.map +1 -1
- package/Dialogs/Confirm.js +3 -3
- package/Dialogs/Confirm.js.map +1 -1
- package/Dialogs/FileSelect.js +259 -0
- package/Dialogs/FileSelect.js.map +1 -0
- package/Dialogs/SelectID.js +15 -16
- package/Dialogs/SelectID.js.map +1 -1
- package/GenericApp.js +3 -3
- package/GenericApp.js.map +1 -1
- package/README.md +3 -0
- package/package.json +1 -1
|
@@ -2501,7 +2501,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
});
|
|
2503
2503
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "resizerMouseUp", function () {
|
|
2504
|
-
window.localStorage.setItem("".concat(_this.props.dialogName || 'App', ".table"), JSON.stringify(_this.resizerCurrentWidths));
|
|
2504
|
+
(window._localStorage || window.localStorage).setItem("".concat(_this.props.dialogName || 'App', ".table"), JSON.stringify(_this.resizerCurrentWidths));
|
|
2505
2505
|
_this.resizerActiveName = null;
|
|
2506
2506
|
_this.resizerNextName = null;
|
|
2507
2507
|
_this.resizerActiveDiv = null;
|
|
@@ -2562,7 +2562,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2562
2562
|
|
|
2563
2563
|
_this.calculateColumnsVisibility();
|
|
2564
2564
|
|
|
2565
|
-
window.localStorage.removeItem("".concat(_this.props.dialogName || 'App', ".table"));
|
|
2565
|
+
(window._localStorage || window.localStorage).removeItem("".concat(_this.props.dialogName || 'App', ".table"));
|
|
2566
2566
|
|
|
2567
2567
|
_this.forceUpdate();
|
|
2568
2568
|
});
|
|
@@ -2576,7 +2576,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2576
2576
|
return window.alert(error);
|
|
2577
2577
|
});
|
|
2578
2578
|
});
|
|
2579
|
-
_this.lastSelectedItems = window.localStorage.getItem("".concat(props.dialogName || 'App', ".objectSelected")) || '[]';
|
|
2579
|
+
_this.lastSelectedItems = (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".objectSelected")) || '[]';
|
|
2580
2580
|
|
|
2581
2581
|
try {
|
|
2582
2582
|
_this.lastSelectedItems = JSON.parse(_this.lastSelectedItems);
|
|
@@ -2590,7 +2590,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2590
2590
|
});
|
|
2591
2591
|
} catch (e) {}
|
|
2592
2592
|
|
|
2593
|
-
var expanded = window.localStorage.getItem("".concat(props.dialogName || 'App', ".objectExpanded")) || '[]';
|
|
2593
|
+
var expanded = (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".objectExpanded")) || '[]';
|
|
2594
2594
|
|
|
2595
2595
|
try {
|
|
2596
2596
|
expanded = JSON.parse(expanded);
|
|
@@ -2598,7 +2598,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2598
2598
|
expanded = [];
|
|
2599
2599
|
}
|
|
2600
2600
|
|
|
2601
|
-
var filter = props.defaultFilters || window.localStorage.getItem("".concat(props.dialogName || 'App', ".objectFilter")) || Object.assign({}, DEFAULT_FILTER);
|
|
2601
|
+
var filter = props.defaultFilters || (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".objectFilter")) || Object.assign({}, DEFAULT_FILTER);
|
|
2602
2602
|
|
|
2603
2603
|
if (typeof filter === 'string') {
|
|
2604
2604
|
try {
|
|
@@ -2654,7 +2654,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2654
2654
|
}).filter(function (id) {
|
|
2655
2655
|
return id;
|
|
2656
2656
|
});
|
|
2657
|
-
var columns = window.localStorage.getItem("".concat(props.dialogName || 'App', ".columns"));
|
|
2657
|
+
var columns = (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".columns"));
|
|
2658
2658
|
|
|
2659
2659
|
try {
|
|
2660
2660
|
columns = columns ? JSON.parse(columns) : null;
|
|
@@ -2662,7 +2662,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2662
2662
|
columns = null;
|
|
2663
2663
|
}
|
|
2664
2664
|
|
|
2665
|
-
var columnsWidths = window.localStorage.getItem("".concat(props.dialogName || 'App', ".columnsWidths"));
|
|
2665
|
+
var columnsWidths = (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".columnsWidths"));
|
|
2666
2666
|
|
|
2667
2667
|
try {
|
|
2668
2668
|
columnsWidths = columnsWidths ? JSON.parse(columnsWidths) : {};
|
|
@@ -2671,7 +2671,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2671
2671
|
}
|
|
2672
2672
|
|
|
2673
2673
|
_this.imagePrefix = props.imagePrefix || '.';
|
|
2674
|
-
var foldersFirst = window.localStorage.getItem((props.dialogName || 'App') + '.foldersFirst');
|
|
2674
|
+
var foldersFirst = (window._localStorage || window.localStorage).getItem((props.dialogName || 'App') + '.foldersFirst');
|
|
2675
2675
|
|
|
2676
2676
|
if (foldersFirst === 'false') {
|
|
2677
2677
|
foldersFirst = false;
|
|
@@ -2684,7 +2684,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2684
2684
|
var statesView = false;
|
|
2685
2685
|
|
|
2686
2686
|
try {
|
|
2687
|
-
statesView = _this.props.objectStatesView ? JSON.parse(window.localStorage.getItem((props.dialogName || 'App') + '.objectStatesView')) || false : false;
|
|
2687
|
+
statesView = _this.props.objectStatesView ? JSON.parse((window._localStorage || window.localStorage).getItem((props.dialogName || 'App') + '.objectStatesView')) || false : false;
|
|
2688
2688
|
} catch (error) {// ignore
|
|
2689
2689
|
}
|
|
2690
2690
|
|
|
@@ -2692,7 +2692,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2692
2692
|
loaded: false,
|
|
2693
2693
|
foldersFirst: foldersFirst,
|
|
2694
2694
|
selected: selected,
|
|
2695
|
-
selectedNonObject: window.localStorage.getItem("".concat(props.dialogName || 'App', ".selectedNonObject")) || '',
|
|
2695
|
+
selectedNonObject: (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".selectedNonObject")) || '',
|
|
2696
2696
|
filter: filter,
|
|
2697
2697
|
filterKey: 0,
|
|
2698
2698
|
depth: 0,
|
|
@@ -2711,13 +2711,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2711
2711
|
columns: columns,
|
|
2712
2712
|
columnsForAdmin: null,
|
|
2713
2713
|
columnsSelectorShow: false,
|
|
2714
|
-
columnsAuto: window.localStorage.getItem("".concat(props.dialogName || 'App', ".columnsAuto")) !== 'false',
|
|
2714
|
+
columnsAuto: (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".columnsAuto")) !== 'false',
|
|
2715
2715
|
columnsWidths: columnsWidths,
|
|
2716
2716
|
columnsDialogTransparent: 100,
|
|
2717
2717
|
columnsEditCustomDialog: null,
|
|
2718
2718
|
customColumnDialogValueChanged: false,
|
|
2719
2719
|
showExportDialog: false,
|
|
2720
|
-
linesEnabled: window.localStorage.getItem("".concat(props.dialogName || 'App', ".lines")) === 'true'
|
|
2720
|
+
linesEnabled: (window._localStorage || window.localStorage).getItem("".concat(props.dialogName || 'App', ".lines")) === 'true'
|
|
2721
2721
|
};
|
|
2722
2722
|
_this.edit = {};
|
|
2723
2723
|
_this.texts = {
|
|
@@ -2771,7 +2771,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2771
2771
|
aclEveryone_write_state: props.t('ra_aclEveryone_write_state')
|
|
2772
2772
|
};
|
|
2773
2773
|
_this.levelPadding = props.levelPadding || ITEM_LEVEL;
|
|
2774
|
-
var resizerCurrentWidths = window.localStorage.getItem("".concat(_this.props.dialogName || 'App', ".table"));
|
|
2774
|
+
var resizerCurrentWidths = (window._localStorage || window.localStorage).getItem("".concat(_this.props.dialogName || 'App', ".table"));
|
|
2775
2775
|
|
|
2776
2776
|
if (resizerCurrentWidths) {
|
|
2777
2777
|
try {
|
|
@@ -2934,7 +2934,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2934
2934
|
|
|
2935
2935
|
if (changed) {
|
|
2936
2936
|
expanded.sort();
|
|
2937
|
-
window.localStorage.setItem("".concat(this.props.dialogName || 'App', ".objectExpanded"), JSON.stringify(expanded));
|
|
2937
|
+
(window._localStorage || window.localStorage).setItem("".concat(this.props.dialogName || 'App', ".objectExpanded"), JSON.stringify(expanded));
|
|
2938
2938
|
this.setState({
|
|
2939
2939
|
expanded: expanded
|
|
2940
2940
|
}, cb);
|
|
@@ -2955,13 +2955,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
2955
2955
|
this.lastSelectedItems = (0, _toConsumableArray2["default"])(this.state.selected);
|
|
2956
2956
|
|
|
2957
2957
|
if (this.state.selected && this.state.selected.length) {
|
|
2958
|
-
window.localStorage.setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), JSON.stringify(this.lastSelectedItems));
|
|
2958
|
+
(window._localStorage || window.localStorage).setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), JSON.stringify(this.lastSelectedItems));
|
|
2959
2959
|
var name = this.lastSelectedItems.length === 1 ? _Utils["default"].getObjectName(this.objects, this.lastSelectedItems[0], null, {
|
|
2960
2960
|
language: this.state.lang
|
|
2961
2961
|
}) : '';
|
|
2962
2962
|
this.props.onSelect && this.props.onSelect(this.lastSelectedItems, name, isDouble);
|
|
2963
2963
|
} else {
|
|
2964
|
-
window.localStorage.setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), '');
|
|
2964
|
+
(window._localStorage || window.localStorage).setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), '');
|
|
2965
2965
|
|
|
2966
2966
|
if (this.state.selected.length) {
|
|
2967
2967
|
this.setState({
|
|
@@ -3108,7 +3108,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3108
3108
|
|
|
3109
3109
|
if (!this.props.multiSelect) {
|
|
3110
3110
|
if (this.objects[toggleItem] && (!this.props.types || this.props.types.includes(this.objects[toggleItem].type))) {
|
|
3111
|
-
window.localStorage.removeItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"));
|
|
3111
|
+
(window._localStorage || window.localStorage).removeItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"));
|
|
3112
3112
|
|
|
3113
3113
|
if (this.state.selected[0] !== toggleItem) {
|
|
3114
3114
|
this.setState({
|
|
@@ -3121,7 +3121,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3121
3121
|
this.onAfterSelect(isDouble);
|
|
3122
3122
|
}
|
|
3123
3123
|
} else {
|
|
3124
|
-
window.localStorage.setItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"), toggleItem);
|
|
3124
|
+
(window._localStorage || window.localStorage).setItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"), toggleItem);
|
|
3125
3125
|
this.setState({
|
|
3126
3126
|
selected: [],
|
|
3127
3127
|
selectedNonObject: toggleItem
|
|
@@ -3131,7 +3131,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3131
3131
|
}
|
|
3132
3132
|
} else {
|
|
3133
3133
|
if (this.objects[toggleItem] && (!this.props.types || this.props.types.includes(this.objects[toggleItem].type))) {
|
|
3134
|
-
window.localStorage.removeItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"));
|
|
3134
|
+
(window._localStorage || window.localStorage).removeItem("".concat(this.props.dialogName || 'App', ".selectedNonObject"));
|
|
3135
3135
|
var selected = (0, _toConsumableArray2["default"])(this.state.selected);
|
|
3136
3136
|
var pos = selected.indexOf(toggleItem);
|
|
3137
3137
|
|
|
@@ -3189,7 +3189,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3189
3189
|
columns.splice(_pos, 1);
|
|
3190
3190
|
}
|
|
3191
3191
|
|
|
3192
|
-
window.localStorage.setItem((_this9.props.dialogName || 'App') + '.columns', JSON.stringify(columns));
|
|
3192
|
+
(window._localStorage || window.localStorage).setItem((_this9.props.dialogName || 'App') + '.columns', JSON.stringify(columns));
|
|
3193
3193
|
|
|
3194
3194
|
_this9.calculateColumnsVisibility(null, columns);
|
|
3195
3195
|
|
|
@@ -3223,7 +3223,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3223
3223
|
onChange: function onChange(e) {
|
|
3224
3224
|
var columnsWidths = JSON.parse(JSON.stringify(_this9.state.columnsWidths));
|
|
3225
3225
|
columnsWidths[id] = e.target.value;
|
|
3226
|
-
window.localStorage.setItem((_this9.props.dialogName || 'App') + '.columnsWidths', JSON.stringify(columnsWidths));
|
|
3226
|
+
(window._localStorage || window.localStorage).setItem((_this9.props.dialogName || 'App') + '.columnsWidths', JSON.stringify(columnsWidths));
|
|
3227
3227
|
|
|
3228
3228
|
_this9.calculateColumnsVisibility(null, null, null, columnsWidths);
|
|
3229
3229
|
|
|
@@ -3267,7 +3267,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3267
3267
|
control: /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
3268
3268
|
checked: this.state.columnsAuto,
|
|
3269
3269
|
onChange: function onChange() {
|
|
3270
|
-
window.localStorage.setItem((_this10.props.dialogName || 'App') + '.columnsAuto', _this10.state.columnsAuto ? 'false' : 'true');
|
|
3270
|
+
(window._localStorage || window.localStorage).setItem((_this10.props.dialogName || 'App') + '.columnsAuto', _this10.state.columnsAuto ? 'false' : 'true');
|
|
3271
3271
|
|
|
3272
3272
|
if (!_this10.state.columnsAuto) {
|
|
3273
3273
|
_this10.calculateColumnsVisibility(true);
|
|
@@ -3299,7 +3299,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3299
3299
|
control: /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
3300
3300
|
checked: this.state.foldersFirst,
|
|
3301
3301
|
onChange: function onChange() {
|
|
3302
|
-
window.localStorage.setItem((_this10.props.dialogName || 'App') + '.foldersFirst', _this10.state.foldersFirst ? 'false' : 'true');
|
|
3302
|
+
(window._localStorage || window.localStorage).setItem((_this10.props.dialogName || 'App') + '.foldersFirst', _this10.state.foldersFirst ? 'false' : 'true');
|
|
3303
3303
|
|
|
3304
3304
|
_this10.setState({
|
|
3305
3305
|
foldersFirst: !_this10.state.foldersFirst
|
|
@@ -3312,7 +3312,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3312
3312
|
control: /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
3313
3313
|
checked: this.state.linesEnabled,
|
|
3314
3314
|
onChange: function onChange() {
|
|
3315
|
-
window.localStorage.setItem((_this10.props.dialogName || 'App') + '.lines', _this10.state.linesEnabled ? 'false' : 'true');
|
|
3315
|
+
(window._localStorage || window.localStorage).setItem((_this10.props.dialogName || 'App') + '.lines', _this10.state.linesEnabled ? 'false' : 'true');
|
|
3316
3316
|
|
|
3317
3317
|
_this10.setState({
|
|
3318
3318
|
linesEnabled: !_this10.state.linesEnabled
|
|
@@ -3355,7 +3355,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3355
3355
|
|
|
3356
3356
|
_this10.calculateColumnsVisibility(null, columns);
|
|
3357
3357
|
|
|
3358
|
-
window.localStorage.setItem((_this10.props.dialogName || 'App') + '.columns', JSON.stringify(columns));
|
|
3358
|
+
(window._localStorage || window.localStorage).setItem((_this10.props.dialogName || 'App') + '.columns', JSON.stringify(columns));
|
|
3359
3359
|
|
|
3360
3360
|
_this10.setState({
|
|
3361
3361
|
columns: columns
|
|
@@ -3387,7 +3387,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3387
3387
|
onChange: function onChange(e) {
|
|
3388
3388
|
var columnsWidths = JSON.parse(JSON.stringify(_this10.state.columnsWidths));
|
|
3389
3389
|
columnsWidths['_' + adapter + '_' + column.path] = e.target.value;
|
|
3390
|
-
window.localStorage.setItem((_this10.props.dialogName || 'App') + '.columnsWidths', JSON.stringify(columnsWidths));
|
|
3390
|
+
(window._localStorage || window.localStorage).setItem((_this10.props.dialogName || 'App') + '.columnsWidths', JSON.stringify(columnsWidths));
|
|
3391
3391
|
|
|
3392
3392
|
_this10.calculateColumnsVisibility(null, null, null, columnsWidths);
|
|
3393
3393
|
|
|
@@ -3675,7 +3675,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3675
3675
|
filter = Object.assign({}, this.state.filter, filter);
|
|
3676
3676
|
|
|
3677
3677
|
if (JSON.stringify(this.state.filter) !== JSON.stringify(filter)) {
|
|
3678
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectFilter', JSON.stringify(filter));
|
|
3678
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectFilter', JSON.stringify(filter));
|
|
3679
3679
|
this.setState({
|
|
3680
3680
|
filter: filter
|
|
3681
3681
|
}, function () {
|
|
@@ -3705,7 +3705,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3705
3705
|
filter = Object.assign({}, this.state.filter, filter);
|
|
3706
3706
|
|
|
3707
3707
|
if (JSON.stringify(this.state.filter) !== JSON.stringify(filter)) {
|
|
3708
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectFilter', JSON.stringify(filter));
|
|
3708
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectFilter', JSON.stringify(filter));
|
|
3709
3709
|
this.setState({
|
|
3710
3710
|
filter: filter,
|
|
3711
3711
|
filterKey: this.state.filterKey + 1
|
|
@@ -3843,7 +3843,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3843
3843
|
|
|
3844
3844
|
newFilter[name] = '';
|
|
3845
3845
|
_this18.filterRefs[name].current.childNodes[1].value = '';
|
|
3846
|
-
window.localStorage.setItem((_this18.props.dialogName || 'App') + '.objectFilter', JSON.stringify(newFilter));
|
|
3846
|
+
(window._localStorage || window.localStorage).setItem((_this18.props.dialogName || 'App') + '.objectFilter', JSON.stringify(newFilter));
|
|
3847
3847
|
|
|
3848
3848
|
_this18.setState({
|
|
3849
3849
|
filter: newFilter,
|
|
@@ -3973,7 +3973,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3973
3973
|
|
|
3974
3974
|
if (root === this.root) {
|
|
3975
3975
|
expanded.sort();
|
|
3976
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
3976
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
3977
3977
|
this.setState({
|
|
3978
3978
|
expanded: expanded
|
|
3979
3979
|
});
|
|
@@ -3986,10 +3986,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
3986
3986
|
}, {
|
|
3987
3987
|
key: "onCollapseAll",
|
|
3988
3988
|
value: function onCollapseAll() {
|
|
3989
|
-
|
|
3989
|
+
var _this23 = this;
|
|
3990
|
+
|
|
3991
|
+
(window._localStorage || window.localStorage).setItem("".concat(this.props.dialogName || 'App', ".objectExpanded"), JSON.stringify([]));
|
|
3992
|
+
(window._localStorage || window.localStorage).setItem("".concat(this.props.dialogName || 'App', ".objectSelected"), '[]');
|
|
3990
3993
|
this.setState({
|
|
3991
3994
|
expanded: [],
|
|
3992
|
-
depth: 0
|
|
3995
|
+
depth: 0,
|
|
3996
|
+
selected: []
|
|
3997
|
+
}, function () {
|
|
3998
|
+
return _this23.onAfterSelect();
|
|
3993
3999
|
});
|
|
3994
4000
|
}
|
|
3995
4001
|
/**
|
|
@@ -4002,7 +4008,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4002
4008
|
}, {
|
|
4003
4009
|
key: "expandDepth",
|
|
4004
4010
|
value: function expandDepth(root, depth, expanded) {
|
|
4005
|
-
var
|
|
4011
|
+
var _this24 = this;
|
|
4006
4012
|
|
|
4007
4013
|
root = root || this.root;
|
|
4008
4014
|
|
|
@@ -4016,7 +4022,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4016
4022
|
}
|
|
4017
4023
|
|
|
4018
4024
|
if (depth - 1 > 0) {
|
|
4019
|
-
|
|
4025
|
+
_this24.expandDepth(item, depth - 1, expanded);
|
|
4020
4026
|
}
|
|
4021
4027
|
}
|
|
4022
4028
|
});
|
|
@@ -4047,7 +4053,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4047
4053
|
var depth = this.state.depth + 1;
|
|
4048
4054
|
var expanded = (0, _toConsumableArray2["default"])(this.state.expanded);
|
|
4049
4055
|
this.expandDepth(this.root, depth, expanded);
|
|
4050
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
4056
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
4051
4057
|
this.setState({
|
|
4052
4058
|
depth: depth,
|
|
4053
4059
|
expanded: expanded
|
|
@@ -4062,7 +4068,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4062
4068
|
key: "onStatesViewVisible",
|
|
4063
4069
|
value: function onStatesViewVisible() {
|
|
4064
4070
|
var statesView = !this.state.statesView;
|
|
4065
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectStatesView', JSON.stringify(statesView));
|
|
4071
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectStatesView', JSON.stringify(statesView));
|
|
4066
4072
|
this.setState({
|
|
4067
4073
|
statesView: statesView
|
|
4068
4074
|
});
|
|
@@ -4077,7 +4083,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4077
4083
|
if (this.state.depth > 0) {
|
|
4078
4084
|
var depth = this.state.depth - 1;
|
|
4079
4085
|
var expanded = this.collapseDepth(depth, this.state.expanded);
|
|
4080
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
4086
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
4081
4087
|
this.setState({
|
|
4082
4088
|
depth: depth,
|
|
4083
4089
|
expanded: expanded
|
|
@@ -4120,7 +4126,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4120
4126
|
}, {
|
|
4121
4127
|
key: "_exportObjects",
|
|
4122
4128
|
value: function _exportObjects(isAll) {
|
|
4123
|
-
var
|
|
4129
|
+
var _this25 = this;
|
|
4124
4130
|
|
|
4125
4131
|
if (isAll) {
|
|
4126
4132
|
generateFile('allObjects.json', this.objects);
|
|
@@ -4129,10 +4135,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4129
4135
|
var id = this.state.selected[0] || this.state.selectedNonObject;
|
|
4130
4136
|
|
|
4131
4137
|
this._getSelectedIdsForExport().forEach(function (key) {
|
|
4132
|
-
result[key] = JSON.parse(JSON.stringify(
|
|
4138
|
+
result[key] = JSON.parse(JSON.stringify(_this25.objects[key])); // add enum information
|
|
4133
4139
|
|
|
4134
4140
|
if (result[key].common) {
|
|
4135
|
-
var enums =
|
|
4141
|
+
var enums = _this25.getEnumsForId(key);
|
|
4136
4142
|
|
|
4137
4143
|
if (enums) {
|
|
4138
4144
|
result[key].common.enums = enums;
|
|
@@ -4148,7 +4154,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4148
4154
|
}, {
|
|
4149
4155
|
key: "renderExportDialog",
|
|
4150
4156
|
value: function renderExportDialog() {
|
|
4151
|
-
var
|
|
4157
|
+
var _this26 = this;
|
|
4152
4158
|
|
|
4153
4159
|
if (this.state.showExportDialog === false) {
|
|
4154
4160
|
return null;
|
|
@@ -4159,10 +4165,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4159
4165
|
color: "grey",
|
|
4160
4166
|
variant: "outlined",
|
|
4161
4167
|
onClick: function onClick() {
|
|
4162
|
-
return
|
|
4168
|
+
return _this26.setState({
|
|
4163
4169
|
showExportDialog: false
|
|
4164
4170
|
}, function () {
|
|
4165
|
-
return
|
|
4171
|
+
return _this26._exportObjects(true);
|
|
4166
4172
|
});
|
|
4167
4173
|
}
|
|
4168
4174
|
}, this.props.t('ra_All objects')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
@@ -4170,17 +4176,17 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4170
4176
|
variant: "contained",
|
|
4171
4177
|
autoFocus: true,
|
|
4172
4178
|
onClick: function onClick() {
|
|
4173
|
-
return
|
|
4179
|
+
return _this26.setState({
|
|
4174
4180
|
showExportDialog: false
|
|
4175
4181
|
}, function () {
|
|
4176
|
-
return
|
|
4182
|
+
return _this26._exportObjects(false);
|
|
4177
4183
|
});
|
|
4178
4184
|
}
|
|
4179
4185
|
}, this.props.t('ra_Only selected')), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4180
4186
|
color: "grey",
|
|
4181
4187
|
variant: "contained",
|
|
4182
4188
|
onClick: function onClick() {
|
|
4183
|
-
return
|
|
4189
|
+
return _this26.setState({
|
|
4184
4190
|
showExportDialog: false
|
|
4185
4191
|
});
|
|
4186
4192
|
},
|
|
@@ -4201,7 +4207,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4201
4207
|
* @returns {JSX.Element}
|
|
4202
4208
|
*/
|
|
4203
4209
|
function getToolbar() {
|
|
4204
|
-
var
|
|
4210
|
+
var _this27 = this;
|
|
4205
4211
|
|
|
4206
4212
|
var allowObjectCreation = false;
|
|
4207
4213
|
|
|
@@ -4235,7 +4241,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4235
4241
|
title: this.props.t('ra_Refresh tree')
|
|
4236
4242
|
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4237
4243
|
onClick: function onClick() {
|
|
4238
|
-
return
|
|
4244
|
+
return _this27.refreshComponent();
|
|
4239
4245
|
},
|
|
4240
4246
|
disabled: this.state.updating,
|
|
4241
4247
|
size: "large"
|
|
@@ -4245,7 +4251,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4245
4251
|
key: "expertMode",
|
|
4246
4252
|
color: this.state.filter.expertMode ? 'secondary' : 'default',
|
|
4247
4253
|
onClick: function onClick() {
|
|
4248
|
-
return
|
|
4254
|
+
return _this27.onFilter('expertMode', !_this27.state.filter.expertMode);
|
|
4249
4255
|
},
|
|
4250
4256
|
size: "large"
|
|
4251
4257
|
}, /*#__PURE__*/_react["default"].createElement(_IconExpert["default"], null))), !this.props.disableColumnSelector && /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
@@ -4254,7 +4260,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4254
4260
|
key: "columnSelector",
|
|
4255
4261
|
color: this.state.columnsAuto ? 'primary' : 'default',
|
|
4256
4262
|
onClick: function onClick() {
|
|
4257
|
-
return
|
|
4263
|
+
return _this27.setState({
|
|
4258
4264
|
columnsSelectorShow: true
|
|
4259
4265
|
});
|
|
4260
4266
|
},
|
|
@@ -4264,7 +4270,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4264
4270
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4265
4271
|
key: "expandAll",
|
|
4266
4272
|
onClick: function onClick() {
|
|
4267
|
-
return
|
|
4273
|
+
return _this27.onExpandAll();
|
|
4268
4274
|
},
|
|
4269
4275
|
size: "large"
|
|
4270
4276
|
}, /*#__PURE__*/_react["default"].createElement(_IconOpen["default"], null))), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
@@ -4272,7 +4278,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4272
4278
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4273
4279
|
key: "collapseAll",
|
|
4274
4280
|
onClick: function onClick() {
|
|
4275
|
-
return
|
|
4281
|
+
return _this27.onCollapseAll();
|
|
4276
4282
|
},
|
|
4277
4283
|
size: "large"
|
|
4278
4284
|
}, /*#__PURE__*/_react["default"].createElement(_IconClosed["default"], null))), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
@@ -4281,7 +4287,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4281
4287
|
key: "expandVisible",
|
|
4282
4288
|
color: "primary",
|
|
4283
4289
|
onClick: function onClick() {
|
|
4284
|
-
return
|
|
4290
|
+
return _this27.onExpandVisible();
|
|
4285
4291
|
},
|
|
4286
4292
|
size: "large"
|
|
4287
4293
|
}, /*#__PURE__*/_react["default"].createElement(StyledBadge, {
|
|
@@ -4293,7 +4299,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4293
4299
|
key: "collapseVisible",
|
|
4294
4300
|
color: "primary",
|
|
4295
4301
|
onClick: function onClick() {
|
|
4296
|
-
return
|
|
4302
|
+
return _this27.onCollapseVisible();
|
|
4297
4303
|
},
|
|
4298
4304
|
size: "large"
|
|
4299
4305
|
}, /*#__PURE__*/_react["default"].createElement(StyledBadge, {
|
|
@@ -4303,7 +4309,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4303
4309
|
title: this.props.t('ra_Toggle the states view')
|
|
4304
4310
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4305
4311
|
onClick: function onClick() {
|
|
4306
|
-
return
|
|
4312
|
+
return _this27.onStatesViewVisible();
|
|
4307
4313
|
},
|
|
4308
4314
|
size: "large"
|
|
4309
4315
|
}, /*#__PURE__*/_react["default"].createElement(_LooksOne["default"], {
|
|
@@ -4313,7 +4319,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4313
4319
|
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4314
4320
|
disabled: !allowObjectCreation,
|
|
4315
4321
|
onClick: function onClick() {
|
|
4316
|
-
return
|
|
4322
|
+
return _this27.setState({
|
|
4317
4323
|
modalNewObj: true
|
|
4318
4324
|
});
|
|
4319
4325
|
},
|
|
@@ -4327,7 +4333,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4327
4333
|
input.setAttribute('id', 'files');
|
|
4328
4334
|
input.setAttribute('opacity', 0);
|
|
4329
4335
|
input.addEventListener('change', function (e) {
|
|
4330
|
-
return
|
|
4336
|
+
return _this27.handleJsonUpload(e);
|
|
4331
4337
|
}, false);
|
|
4332
4338
|
input.click();
|
|
4333
4339
|
},
|
|
@@ -4336,8 +4342,8 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4336
4342
|
title: this.props.t('ra_Save objects tree as JSON file')
|
|
4337
4343
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4338
4344
|
onClick: function onClick() {
|
|
4339
|
-
return
|
|
4340
|
-
showExportDialog:
|
|
4345
|
+
return _this27.setState({
|
|
4346
|
+
showExportDialog: _this27._getSelectedIdsForExport().length
|
|
4341
4347
|
});
|
|
4342
4348
|
},
|
|
4343
4349
|
size: "large"
|
|
@@ -4351,28 +4357,28 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4351
4357
|
whiteSpace: 'nowrap'
|
|
4352
4358
|
}
|
|
4353
4359
|
}, "".concat(this.props.t('ra_Objects'), ": ").concat(Object.keys(this.info.objects).length, ", ").concat(this.props.t('ra_States'), ": ").concat(Object.keys(this.info.objects).filter(function (el) {
|
|
4354
|
-
return
|
|
4360
|
+
return _this27.info.objects[el].type === 'state';
|
|
4355
4361
|
}).length)), this.props.objectEditBoolean && /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
4356
4362
|
title: this.props.t('ra_Edit custom config')
|
|
4357
4363
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4358
4364
|
onClick: function onClick() {
|
|
4359
4365
|
// get all visible states
|
|
4360
|
-
var ids = getVisibleItems(
|
|
4366
|
+
var ids = getVisibleItems(_this27.root, 'state', _this27.objects);
|
|
4361
4367
|
|
|
4362
4368
|
if (ids.length) {
|
|
4363
|
-
|
|
4369
|
+
_this27.pauseSubscribe(true);
|
|
4364
4370
|
|
|
4365
4371
|
if (ids.length === 1) {
|
|
4366
|
-
window.localStorage.setItem((
|
|
4367
|
-
|
|
4372
|
+
(window._localStorage || window.localStorage).setItem((_this27.props.dialogName || 'App') + '.objectSelected', _this27.state.selected[0]);
|
|
4373
|
+
_this27.props.router && _this27.props.router.doNavigate(null, 'custom', _this27.state.selected[0]);
|
|
4368
4374
|
}
|
|
4369
4375
|
|
|
4370
|
-
|
|
4376
|
+
_this27.setState({
|
|
4371
4377
|
customDialog: ids
|
|
4372
4378
|
});
|
|
4373
4379
|
} else {
|
|
4374
|
-
|
|
4375
|
-
toast:
|
|
4380
|
+
_this27.setState({
|
|
4381
|
+
toast: _this27.props.t('ra_please select object')
|
|
4376
4382
|
});
|
|
4377
4383
|
}
|
|
4378
4384
|
},
|
|
@@ -4397,7 +4403,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4397
4403
|
expanded.splice(pos, 1);
|
|
4398
4404
|
}
|
|
4399
4405
|
|
|
4400
|
-
window.localStorage.setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
4406
|
+
(window._localStorage || window.localStorage).setItem((this.props.dialogName || 'App') + '.objectExpanded', JSON.stringify(expanded));
|
|
4401
4407
|
this.setState({
|
|
4402
4408
|
expanded: expanded
|
|
4403
4409
|
});
|
|
@@ -4434,7 +4440,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4434
4440
|
* @param {{ cellButtonsButton: string | undefined; cellButtonsButtonAlone: any; cellButtonsButtonIcon: string | undefined; cellButtonsButtonWithCustoms: any; }} classes
|
|
4435
4441
|
*/
|
|
4436
4442
|
function renderColumnButtons(id, item, classes) {
|
|
4437
|
-
var
|
|
4443
|
+
var _this28 = this,
|
|
4438
4444
|
_item$children2,
|
|
4439
4445
|
_item$data$obj$common,
|
|
4440
4446
|
_item$data$obj$common3;
|
|
@@ -4445,7 +4451,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4445
4451
|
}, this.state.filter.expertMode && this.props.objectEditOfAccessControl ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4446
4452
|
className: _Utils["default"].clsx(classes.cellButtonsButton, classes.cellButtonsEmptyButton, classes.cellButtonMinWidth),
|
|
4447
4453
|
onClick: function onClick() {
|
|
4448
|
-
return
|
|
4454
|
+
return _this28.setState({
|
|
4449
4455
|
modalEditOfAccess: true,
|
|
4450
4456
|
modalEmptyId: id,
|
|
4451
4457
|
modalEditOfAccessObjData: item.data
|
|
@@ -4458,7 +4464,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4458
4464
|
"aria-label": "delete",
|
|
4459
4465
|
title: this.texts.deleteObject,
|
|
4460
4466
|
onClick: function onClick() {
|
|
4461
|
-
return
|
|
4467
|
+
return _this28.props.onObjectDelete(id, !!(item.children && item.children.length), false);
|
|
4462
4468
|
}
|
|
4463
4469
|
}, /*#__PURE__*/_react["default"].createElement(_Delete["default"], {
|
|
4464
4470
|
className: classes.cellButtonsButtonIcon
|
|
@@ -4474,7 +4480,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4474
4480
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
4475
4481
|
className: classes.cellButtonMinWidth,
|
|
4476
4482
|
onClick: function onClick() {
|
|
4477
|
-
return
|
|
4483
|
+
return _this28.setState({
|
|
4478
4484
|
modalEditOfAccess: true,
|
|
4479
4485
|
modalEditOfAccessObjData: item.data
|
|
4480
4486
|
});
|
|
@@ -4492,9 +4498,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4492
4498
|
"aria-label": "edit",
|
|
4493
4499
|
title: this.texts.editObject,
|
|
4494
4500
|
onClick: function onClick() {
|
|
4495
|
-
window.localStorage.setItem("".concat(
|
|
4501
|
+
(window._localStorage || window.localStorage).setItem("".concat(_this28.props.dialogName || 'App', ".objectSelected"), id);
|
|
4496
4502
|
|
|
4497
|
-
|
|
4503
|
+
_this28.setState({
|
|
4498
4504
|
editObjectDialog: id
|
|
4499
4505
|
});
|
|
4500
4506
|
}
|
|
@@ -4508,7 +4514,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4508
4514
|
onClick: function onClick() {
|
|
4509
4515
|
var _item$children3, _item$data$obj$common2;
|
|
4510
4516
|
|
|
4511
|
-
return
|
|
4517
|
+
return _this28.props.onObjectDelete(id, !!((_item$children3 = item.children) !== null && _item$children3 !== void 0 && _item$children3.length), !((_item$data$obj$common2 = item.data.obj.common) !== null && _item$data$obj$common2 !== void 0 && _item$data$obj$common2.dontDelete));
|
|
4512
4518
|
},
|
|
4513
4519
|
title: this.texts.deleteObject
|
|
4514
4520
|
}, /*#__PURE__*/_react["default"].createElement(_Delete["default"], {
|
|
@@ -4520,13 +4526,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4520
4526
|
"aria-label": "config",
|
|
4521
4527
|
title: this.texts.customConfig,
|
|
4522
4528
|
onClick: function onClick() {
|
|
4523
|
-
window.localStorage.setItem((
|
|
4529
|
+
(window._localStorage || window.localStorage).setItem((_this28.props.dialogName || 'App') + '.objectSelected', id);
|
|
4524
4530
|
|
|
4525
|
-
|
|
4531
|
+
_this28.pauseSubscribe(true);
|
|
4526
4532
|
|
|
4527
|
-
|
|
4533
|
+
_this28.props.router && _this28.props.router.doNavigate(null, 'customs', id);
|
|
4528
4534
|
|
|
4529
|
-
|
|
4535
|
+
_this28.setState({
|
|
4530
4536
|
customDialog: [id]
|
|
4531
4537
|
});
|
|
4532
4538
|
}
|
|
@@ -4542,7 +4548,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4542
4548
|
}, {
|
|
4543
4549
|
key: "readHistory",
|
|
4544
4550
|
value: function readHistory(id) {
|
|
4545
|
-
var
|
|
4551
|
+
var _this29 = this;
|
|
4546
4552
|
|
|
4547
4553
|
/*interface GetHistoryOptions {
|
|
4548
4554
|
instance?: string;
|
|
@@ -4587,7 +4593,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4587
4593
|
}
|
|
4588
4594
|
}
|
|
4589
4595
|
})["catch"](function (e) {
|
|
4590
|
-
return
|
|
4596
|
+
return _this29.showError(e);
|
|
4591
4597
|
});
|
|
4592
4598
|
}
|
|
4593
4599
|
}
|
|
@@ -4603,7 +4609,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4603
4609
|
key: "renderColumnValue",
|
|
4604
4610
|
value: function renderColumnValue(id, item, classes) {
|
|
4605
4611
|
var _obj$common4,
|
|
4606
|
-
|
|
4612
|
+
_this30 = this;
|
|
4607
4613
|
|
|
4608
4614
|
var obj = item.data.obj;
|
|
4609
4615
|
|
|
@@ -4635,7 +4641,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4635
4641
|
if (!info) {
|
|
4636
4642
|
info = item.data.state = item.data.state || formatValue(id, state, obj, this.texts, this.props.dateFormat, this.props.isFloatComma);
|
|
4637
4643
|
info.valFull = info.valFull.map(function (item) {
|
|
4638
|
-
if (item.t ===
|
|
4644
|
+
if (item.t === _this30.texts.quality && state.q) {
|
|
4639
4645
|
return [/*#__PURE__*/_react["default"].createElement("div", {
|
|
4640
4646
|
className: classes.cellValueTooltipBoth,
|
|
4641
4647
|
key: item.t
|
|
@@ -4684,7 +4690,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4684
4690
|
}, "(", info.valText.s, ")") : null, /*#__PURE__*/_react["default"].createElement(_IconCopy["default"], {
|
|
4685
4691
|
className: _Utils["default"].clsx(classes.cellButtonsValueButton, 'copyButton', classes.cellButtonsValueButtonCopy),
|
|
4686
4692
|
onClick: function onClick(e) {
|
|
4687
|
-
return
|
|
4693
|
+
return _this30.onCopy(e, copyText);
|
|
4688
4694
|
},
|
|
4689
4695
|
key: "cc"
|
|
4690
4696
|
}) //<IconEdit className={ Utils.clsx(classes.cellButtonsValueButton, 'copyButton', classes.cellButtonsValueButtonEdit) } key="ce" />
|
|
@@ -4707,7 +4713,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4707
4713
|
popper: this.props.classes.cellValueTooltipBox
|
|
4708
4714
|
},
|
|
4709
4715
|
onOpen: function onOpen() {
|
|
4710
|
-
return
|
|
4716
|
+
return _this30.readHistory(id);
|
|
4711
4717
|
}
|
|
4712
4718
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
4713
4719
|
style: info.style,
|
|
@@ -4722,7 +4728,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4722
4728
|
}, {
|
|
4723
4729
|
key: "_syncEnum",
|
|
4724
4730
|
value: function _syncEnum(id, enumIds, newArray, cb) {
|
|
4725
|
-
var
|
|
4731
|
+
var _this31 = this;
|
|
4726
4732
|
|
|
4727
4733
|
if (!enumIds || !enumIds.length) {
|
|
4728
4734
|
return cb && cb();
|
|
@@ -4743,9 +4749,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4743
4749
|
var obj = JSON.parse(JSON.stringify(this.info.objects[enumId]));
|
|
4744
4750
|
obj.common.members.splice(pos, 1);
|
|
4745
4751
|
promises.push(this.props.socket.setObject(enumId, obj).then(function () {
|
|
4746
|
-
return
|
|
4752
|
+
return _this31.info.objects[enumId] = obj;
|
|
4747
4753
|
})["catch"](function (e) {
|
|
4748
|
-
return
|
|
4754
|
+
return _this31.showError(e);
|
|
4749
4755
|
}));
|
|
4750
4756
|
}
|
|
4751
4757
|
} // add to it
|
|
@@ -4762,16 +4768,16 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4762
4768
|
_obj.common.members.sort();
|
|
4763
4769
|
|
|
4764
4770
|
promises.push(this.props.socket.setObject(enumId, _obj).then(function () {
|
|
4765
|
-
return
|
|
4771
|
+
return _this31.info.objects[enumId] = _obj;
|
|
4766
4772
|
})["catch"](function (e) {
|
|
4767
|
-
return
|
|
4773
|
+
return _this31.showError(e);
|
|
4768
4774
|
}));
|
|
4769
4775
|
}
|
|
4770
4776
|
}
|
|
4771
4777
|
|
|
4772
4778
|
Promise.all(promises).then(function () {
|
|
4773
4779
|
return setTimeout(function () {
|
|
4774
|
-
return
|
|
4780
|
+
return _this31._syncEnum(id, enumIds, newArray, cb);
|
|
4775
4781
|
}, 0);
|
|
4776
4782
|
});
|
|
4777
4783
|
}
|
|
@@ -4784,12 +4790,12 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4784
4790
|
}, {
|
|
4785
4791
|
key: "syncEnum",
|
|
4786
4792
|
value: function syncEnum(id, enumName, newArray) {
|
|
4787
|
-
var
|
|
4793
|
+
var _this32 = this;
|
|
4788
4794
|
|
|
4789
4795
|
var toCheck = (0, _toConsumableArray2["default"])(this.info[enumName === 'func' ? 'funcEnums' : 'roomEnums']);
|
|
4790
4796
|
return new Promise(function (resolve) {
|
|
4791
|
-
return
|
|
4792
|
-
error &&
|
|
4797
|
+
return _this32._syncEnum(id, toCheck, newArray, function (error) {
|
|
4798
|
+
error && _this32.showError(error); // force update of object
|
|
4793
4799
|
|
|
4794
4800
|
resolve();
|
|
4795
4801
|
});
|
|
@@ -4803,7 +4809,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4803
4809
|
}, {
|
|
4804
4810
|
key: "renderEnumDialog",
|
|
4805
4811
|
value: function renderEnumDialog() {
|
|
4806
|
-
var
|
|
4812
|
+
var _this33 = this;
|
|
4807
4813
|
|
|
4808
4814
|
if (this.state.enumDialog) {
|
|
4809
4815
|
var type = this.state.enumDialog.type;
|
|
@@ -4812,18 +4818,18 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4812
4818
|
var enumsOriginal = this.state.enumDialog.enumsOriginal;
|
|
4813
4819
|
var enums = (type === 'room' ? this.info.roomEnums : this.info.funcEnums).map(function (id) {
|
|
4814
4820
|
return {
|
|
4815
|
-
name: getName(
|
|
4821
|
+
name: getName(_this33.objects[id] && _this33.objects[id].common && _this33.objects[id].common.name || id.split('.').pop(), _this33.props.lang),
|
|
4816
4822
|
value: id,
|
|
4817
|
-
icon: getSelectIdIcon(
|
|
4823
|
+
icon: getSelectIdIcon(_this33.objects, id, _this33.imagePrefix)
|
|
4818
4824
|
};
|
|
4819
4825
|
});
|
|
4820
4826
|
enums.forEach(function (item) {
|
|
4821
4827
|
if (item.icon && typeof item.icon == 'string') {
|
|
4822
4828
|
item.icon = /*#__PURE__*/_react["default"].createElement("div", {
|
|
4823
|
-
className:
|
|
4829
|
+
className: _this33.props.classes.enumIconDiv
|
|
4824
4830
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
4825
4831
|
src: item.icon,
|
|
4826
|
-
className:
|
|
4832
|
+
className: _this33.props.classes.enumIcon,
|
|
4827
4833
|
alt: item.name
|
|
4828
4834
|
}));
|
|
4829
4835
|
}
|
|
@@ -4832,7 +4838,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4832
4838
|
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4833
4839
|
className: this.props.classes.enumDialog,
|
|
4834
4840
|
onClose: function onClose() {
|
|
4835
|
-
return
|
|
4841
|
+
return _this33.setState({
|
|
4836
4842
|
enumDialog: null
|
|
4837
4843
|
});
|
|
4838
4844
|
},
|
|
@@ -4846,8 +4852,8 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4846
4852
|
disabled: JSON.stringify(enumsOriginal) === JSON.stringify(itemEnums),
|
|
4847
4853
|
size: "small",
|
|
4848
4854
|
onClick: function onClick() {
|
|
4849
|
-
return
|
|
4850
|
-
return
|
|
4855
|
+
return _this33.syncEnum(item.data.id, type, itemEnums).then(function () {
|
|
4856
|
+
return _this33.setState({
|
|
4851
4857
|
enumDialog: null,
|
|
4852
4858
|
enumDialogEnums: null
|
|
4853
4859
|
});
|
|
@@ -4873,11 +4879,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4873
4879
|
|
|
4874
4880
|
var labelId = "checkbox-list-label-".concat(id);
|
|
4875
4881
|
return /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
|
|
4876
|
-
className:
|
|
4882
|
+
className: _this33.props.classes.headerCellSelectItem,
|
|
4877
4883
|
key: id,
|
|
4878
4884
|
onClick: function onClick() {
|
|
4879
4885
|
var pos = itemEnums.indexOf(id);
|
|
4880
|
-
var enumDialogEnums = JSON.parse(JSON.stringify(
|
|
4886
|
+
var enumDialogEnums = JSON.parse(JSON.stringify(_this33.state.enumDialogEnums));
|
|
4881
4887
|
|
|
4882
4888
|
if (pos === -1) {
|
|
4883
4889
|
enumDialogEnums.push(id);
|
|
@@ -4886,13 +4892,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4886
4892
|
enumDialogEnums.splice(pos, 1);
|
|
4887
4893
|
}
|
|
4888
4894
|
|
|
4889
|
-
|
|
4895
|
+
_this33.setState({
|
|
4890
4896
|
enumDialogEnums: enumDialogEnums
|
|
4891
4897
|
});
|
|
4892
4898
|
}
|
|
4893
4899
|
}, /*#__PURE__*/_react["default"].createElement(_ListItemIcon["default"], {
|
|
4894
4900
|
classes: {
|
|
4895
|
-
root:
|
|
4901
|
+
root: _this33.props.classes.enumCheckbox
|
|
4896
4902
|
}
|
|
4897
4903
|
}, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
4898
4904
|
edge: "start",
|
|
@@ -4918,7 +4924,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4918
4924
|
}, {
|
|
4919
4925
|
key: "renderEditRoleDialog",
|
|
4920
4926
|
value: function renderEditRoleDialog() {
|
|
4921
|
-
var
|
|
4927
|
+
var _this34 = this;
|
|
4922
4928
|
|
|
4923
4929
|
if (this.state.roleDialog && this.props.objectBrowserEditRole) {
|
|
4924
4930
|
var ObjectBrowserEditRole = this.props.objectBrowserEditRole;
|
|
@@ -4930,10 +4936,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4930
4936
|
roles: this.info.roles,
|
|
4931
4937
|
onClose: function onClose(obj) {
|
|
4932
4938
|
if (obj) {
|
|
4933
|
-
|
|
4939
|
+
_this34.info.objects[_this34.state.roleDialog] = obj;
|
|
4934
4940
|
}
|
|
4935
4941
|
|
|
4936
|
-
|
|
4942
|
+
_this34.setState({
|
|
4937
4943
|
roleDialog: false
|
|
4938
4944
|
});
|
|
4939
4945
|
}
|
|
@@ -4950,7 +4956,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4950
4956
|
}, {
|
|
4951
4957
|
key: "onColumnsEditCustomDialogClose",
|
|
4952
4958
|
value: function onColumnsEditCustomDialogClose(isSave) {
|
|
4953
|
-
var
|
|
4959
|
+
var _this35 = this;
|
|
4954
4960
|
|
|
4955
4961
|
if (isSave) {
|
|
4956
4962
|
var value = this.customColumnDialog.value;
|
|
@@ -4963,17 +4969,17 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4963
4969
|
|
|
4964
4970
|
this.customColumnDialog = null;
|
|
4965
4971
|
this.props.socket.getObject(this.state.columnsEditCustomDialog.obj._id).then(function (obj) {
|
|
4966
|
-
if (
|
|
4967
|
-
return
|
|
4972
|
+
if (_this35.setCustomValue(obj, _this35.state.columnsEditCustomDialog.it, value)) {
|
|
4973
|
+
return _this35.props.socket.setObject(obj._id, obj);
|
|
4968
4974
|
} else {
|
|
4969
|
-
throw new Error(
|
|
4975
|
+
throw new Error(_this35.props.t('ra_Cannot update attribute, because not found in the object'));
|
|
4970
4976
|
}
|
|
4971
4977
|
}).then(function () {
|
|
4972
|
-
return
|
|
4978
|
+
return _this35.setState({
|
|
4973
4979
|
columnsEditCustomDialog: null
|
|
4974
4980
|
});
|
|
4975
4981
|
})["catch"](function (e) {
|
|
4976
|
-
return
|
|
4982
|
+
return _this35.showError(e);
|
|
4977
4983
|
});
|
|
4978
4984
|
} else {
|
|
4979
4985
|
this.customColumnDialog = null;
|
|
@@ -4989,7 +4995,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
4989
4995
|
}, {
|
|
4990
4996
|
key: "renderColumnsEditCustomDialog",
|
|
4991
4997
|
value: function renderColumnsEditCustomDialog() {
|
|
4992
|
-
var
|
|
4998
|
+
var _this36 = this;
|
|
4993
4999
|
|
|
4994
5000
|
if (this.state.columnsEditCustomDialog) {
|
|
4995
5001
|
if (!this.customColumnDialog) {
|
|
@@ -5003,7 +5009,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5003
5009
|
|
|
5004
5010
|
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
5005
5011
|
onClose: function onClose() {
|
|
5006
|
-
return
|
|
5012
|
+
return _this36.setState({
|
|
5007
5013
|
columnsEditCustomDialog: null
|
|
5008
5014
|
});
|
|
5009
5015
|
},
|
|
@@ -5017,15 +5023,15 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5017
5023
|
}, this.customColumnDialog.type === 'boolean' ? /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
5018
5024
|
control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
5019
5025
|
onKeyUp: function onKeyUp(e) {
|
|
5020
|
-
return e.keyCode === 13 &&
|
|
5026
|
+
return e.keyCode === 13 && _this36.onColumnsEditCustomDialogClose(true);
|
|
5021
5027
|
},
|
|
5022
5028
|
defaultChecked: this.customColumnDialog.value === 'true',
|
|
5023
5029
|
onChange: function onChange(e) {
|
|
5024
|
-
|
|
5025
|
-
var changed =
|
|
5030
|
+
_this36.customColumnDialog.value = e.target.checked.toString();
|
|
5031
|
+
var changed = _this36.customColumnDialog.value !== _this36.customColumnDialog.initValue;
|
|
5026
5032
|
|
|
5027
|
-
if (changed === !
|
|
5028
|
-
|
|
5033
|
+
if (changed === !_this36.state.customColumnDialogValueChanged) {
|
|
5034
|
+
_this36.setState({
|
|
5029
5035
|
customColumnDialogValueChanged: changed
|
|
5030
5036
|
});
|
|
5031
5037
|
}
|
|
@@ -5037,15 +5043,15 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5037
5043
|
defaultValue: this.customColumnDialog.value,
|
|
5038
5044
|
fullWidth: true,
|
|
5039
5045
|
onKeyUp: function onKeyUp(e) {
|
|
5040
|
-
return e.keyCode === 13 &&
|
|
5046
|
+
return e.keyCode === 13 && _this36.onColumnsEditCustomDialogClose(true);
|
|
5041
5047
|
},
|
|
5042
5048
|
label: this.state.columnsEditCustomDialog.it.name + ' (' + this.state.columnsEditCustomDialog.it.pathText + ')',
|
|
5043
5049
|
onChange: function onChange(e) {
|
|
5044
|
-
|
|
5045
|
-
var changed =
|
|
5050
|
+
_this36.customColumnDialog.value = e.target.value;
|
|
5051
|
+
var changed = _this36.customColumnDialog.value !== _this36.customColumnDialog.initValue;
|
|
5046
5052
|
|
|
5047
|
-
if (changed === !
|
|
5048
|
-
|
|
5053
|
+
if (changed === !_this36.state.customColumnDialogValueChanged) {
|
|
5054
|
+
_this36.setState({
|
|
5049
5055
|
customColumnDialogValueChanged: changed
|
|
5050
5056
|
});
|
|
5051
5057
|
}
|
|
@@ -5054,7 +5060,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5054
5060
|
}))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5055
5061
|
variant: "contained",
|
|
5056
5062
|
onClick: function onClick() {
|
|
5057
|
-
return
|
|
5063
|
+
return _this36.onColumnsEditCustomDialogClose(true);
|
|
5058
5064
|
},
|
|
5059
5065
|
disabled: !this.state.customColumnDialogValueChanged,
|
|
5060
5066
|
color: "primary",
|
|
@@ -5063,7 +5069,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5063
5069
|
color: "grey",
|
|
5064
5070
|
variant: "contained",
|
|
5065
5071
|
onClick: function onClick() {
|
|
5066
|
-
return
|
|
5072
|
+
return _this36.onColumnsEditCustomDialogClose();
|
|
5067
5073
|
},
|
|
5068
5074
|
startIcon: /*#__PURE__*/_react["default"].createElement(_Close["default"], null)
|
|
5069
5075
|
}, this.props.t('ra_Cancel'))));
|
|
@@ -5163,7 +5169,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5163
5169
|
}, {
|
|
5164
5170
|
key: "renderCustomValue",
|
|
5165
5171
|
value: function renderCustomValue(obj, it, item) {
|
|
5166
|
-
var
|
|
5172
|
+
var _this37 = this;
|
|
5167
5173
|
|
|
5168
5174
|
var text = this.getCustomValue(obj, it);
|
|
5169
5175
|
|
|
@@ -5172,7 +5178,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5172
5178
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
5173
5179
|
className: _Utils["default"].clsx(this.props.classes.columnCustom, this.props.classes.columnCustomEditable, this.props.classes['columnCustom_' + it.align]),
|
|
5174
5180
|
onClick: function onClick() {
|
|
5175
|
-
return
|
|
5181
|
+
return _this37.setState({
|
|
5176
5182
|
columnsEditCustomDialog: {
|
|
5177
5183
|
item: item,
|
|
5178
5184
|
it: it,
|
|
@@ -5203,7 +5209,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5203
5209
|
}, {
|
|
5204
5210
|
key: "renderLeaf",
|
|
5205
5211
|
value: function renderLeaf(item, isExpanded, classes, counter) {
|
|
5206
|
-
var
|
|
5212
|
+
var _this38 = this,
|
|
5207
5213
|
_common$alias,
|
|
5208
5214
|
_common$alias2,
|
|
5209
5215
|
_this$states$id2,
|
|
@@ -5225,12 +5231,12 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5225
5231
|
iconFolder = isExpanded ? /*#__PURE__*/_react["default"].createElement(_IconOpen["default"], {
|
|
5226
5232
|
className: classes.cellIdIconFolder,
|
|
5227
5233
|
onClick: function onClick() {
|
|
5228
|
-
return
|
|
5234
|
+
return _this38.toggleExpanded(id);
|
|
5229
5235
|
}
|
|
5230
5236
|
}) : /*#__PURE__*/_react["default"].createElement(_IconClosed["default"], {
|
|
5231
5237
|
className: classes.cellIdIconFolder,
|
|
5232
5238
|
onClick: function onClick() {
|
|
5233
|
-
return
|
|
5239
|
+
return _this38.toggleExpanded(id);
|
|
5234
5240
|
}
|
|
5235
5241
|
});
|
|
5236
5242
|
} else {
|
|
@@ -5338,11 +5344,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5338
5344
|
e.stopPropagation();
|
|
5339
5345
|
e.preventDefault();
|
|
5340
5346
|
|
|
5341
|
-
|
|
5347
|
+
_this38.onSelect(common.alias.id.read);
|
|
5342
5348
|
|
|
5343
5349
|
setTimeout(function () {
|
|
5344
|
-
|
|
5345
|
-
return
|
|
5350
|
+
_this38.expandAllSelected(function () {
|
|
5351
|
+
return _this38.scrollToItem(common.alias.id.read);
|
|
5346
5352
|
});
|
|
5347
5353
|
}, 100);
|
|
5348
5354
|
},
|
|
@@ -5352,11 +5358,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5352
5358
|
e.stopPropagation();
|
|
5353
5359
|
e.preventDefault();
|
|
5354
5360
|
|
|
5355
|
-
|
|
5361
|
+
_this38.onSelect(common.alias.id.write);
|
|
5356
5362
|
|
|
5357
5363
|
setTimeout(function () {
|
|
5358
|
-
|
|
5359
|
-
return
|
|
5364
|
+
_this38.expandAllSelected(function () {
|
|
5365
|
+
return _this38.scrollToItem(common.alias.id.write);
|
|
5360
5366
|
});
|
|
5361
5367
|
}, 100);
|
|
5362
5368
|
},
|
|
@@ -5366,11 +5372,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5366
5372
|
e.stopPropagation();
|
|
5367
5373
|
e.preventDefault();
|
|
5368
5374
|
|
|
5369
|
-
|
|
5375
|
+
_this38.onSelect(common.alias.id);
|
|
5370
5376
|
|
|
5371
5377
|
setTimeout(function () {
|
|
5372
|
-
|
|
5373
|
-
return
|
|
5378
|
+
_this38.expandAllSelected(function () {
|
|
5379
|
+
return _this38.scrollToItem(common.alias.id);
|
|
5374
5380
|
});
|
|
5375
5381
|
}, 100);
|
|
5376
5382
|
},
|
|
@@ -5400,19 +5406,19 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5400
5406
|
|
|
5401
5407
|
ids[name] = _id;
|
|
5402
5408
|
|
|
5403
|
-
if (!
|
|
5404
|
-
var
|
|
5409
|
+
if (!_this38.states[_id]) {
|
|
5410
|
+
var _this38$objects$_id;
|
|
5405
5411
|
|
|
5406
|
-
if (((
|
|
5407
|
-
!
|
|
5408
|
-
|
|
5412
|
+
if (((_this38$objects$_id = _this38.objects[_id]) === null || _this38$objects$_id === void 0 ? void 0 : _this38$objects$_id.type) === 'state') {
|
|
5413
|
+
!_this38.recordStates.includes(_id) && _this38.recordStates.push(_id);
|
|
5414
|
+
_this38.states[_id] = {
|
|
5409
5415
|
val: null
|
|
5410
5416
|
};
|
|
5411
5417
|
|
|
5412
|
-
|
|
5418
|
+
_this38.subscribe(_id);
|
|
5413
5419
|
}
|
|
5414
5420
|
} else {
|
|
5415
|
-
!
|
|
5421
|
+
!_this38.recordStates.includes(_id) && _this38.recordStates.push(_id);
|
|
5416
5422
|
}
|
|
5417
5423
|
}); // calculate color
|
|
5418
5424
|
// errorId has priority
|
|
@@ -5501,13 +5507,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5501
5507
|
key: id,
|
|
5502
5508
|
id: id,
|
|
5503
5509
|
onClick: function onClick() {
|
|
5504
|
-
return
|
|
5510
|
+
return _this38.onSelect(id);
|
|
5505
5511
|
},
|
|
5506
5512
|
onDoubleClick: function onDoubleClick() {
|
|
5507
5513
|
if (!item.children) {
|
|
5508
|
-
|
|
5514
|
+
_this38.onSelect(id, true);
|
|
5509
5515
|
} else {
|
|
5510
|
-
|
|
5516
|
+
_this38.toggleExpanded(id);
|
|
5511
5517
|
}
|
|
5512
5518
|
}
|
|
5513
5519
|
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
@@ -5552,7 +5558,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5552
5558
|
}, /*#__PURE__*/_react["default"].createElement(_IconCopy["default"], {
|
|
5553
5559
|
className: _Utils["default"].clsx(classes.cellCopyButton, 'copyButton'),
|
|
5554
5560
|
onClick: function onClick(e) {
|
|
5555
|
-
return
|
|
5561
|
+
return _this38.onCopy(e, id);
|
|
5556
5562
|
}
|
|
5557
5563
|
}))), this.columnsVisibility.name ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5558
5564
|
className: classes.cellName,
|
|
@@ -5566,7 +5572,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5566
5572
|
}, /*#__PURE__*/_react["default"].createElement(_IconCopy["default"], {
|
|
5567
5573
|
className: _Utils["default"].clsx(classes.cellCopyButton, 'copyButton'),
|
|
5568
5574
|
onClick: function onClick(e) {
|
|
5569
|
-
return
|
|
5575
|
+
return _this38.onCopy(e, item.data.title);
|
|
5570
5576
|
}
|
|
5571
5577
|
})) : null) : null, !this.state.statesView ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.columnsVisibility.type ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5572
5578
|
className: classes.cellType,
|
|
@@ -5580,7 +5586,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5580
5586
|
cursor: this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole ? 'text' : 'default'
|
|
5581
5587
|
},
|
|
5582
5588
|
onClick: this.state.filter.expertMode && enumEditable && this.props.objectBrowserEditRole ? function () {
|
|
5583
|
-
return
|
|
5589
|
+
return _this38.setState({
|
|
5584
5590
|
roleDialog: item.data.id
|
|
5585
5591
|
});
|
|
5586
5592
|
} : undefined
|
|
@@ -5591,9 +5597,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5591
5597
|
cursor: enumEditable ? 'text' : 'default'
|
|
5592
5598
|
},
|
|
5593
5599
|
onClick: enumEditable ? function () {
|
|
5594
|
-
var enums = findEnumsForObjectAsIds(
|
|
5600
|
+
var enums = findEnumsForObjectAsIds(_this38.info, item.data.id, 'roomEnums');
|
|
5595
5601
|
|
|
5596
|
-
|
|
5602
|
+
_this38.setState({
|
|
5597
5603
|
enumDialogEnums: enums,
|
|
5598
5604
|
enumDialog: {
|
|
5599
5605
|
item: item,
|
|
@@ -5609,9 +5615,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5609
5615
|
cursor: enumEditable ? 'text' : 'default'
|
|
5610
5616
|
},
|
|
5611
5617
|
onClick: enumEditable ? function () {
|
|
5612
|
-
var enums = findEnumsForObjectAsIds(
|
|
5618
|
+
var enums = findEnumsForObjectAsIds(_this38.info, item.data.id, 'funcEnums');
|
|
5613
5619
|
|
|
5614
|
-
|
|
5620
|
+
_this38.setState({
|
|
5615
5621
|
enumDialogEnums: enums,
|
|
5616
5622
|
enumDialog: {
|
|
5617
5623
|
item: item,
|
|
@@ -5646,11 +5652,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5646
5652
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
5647
5653
|
className: classes.cellAdapter,
|
|
5648
5654
|
style: {
|
|
5649
|
-
width:
|
|
5655
|
+
width: _this38.columnsVisibility[it.id]
|
|
5650
5656
|
},
|
|
5651
5657
|
key: it.id,
|
|
5652
5658
|
title: it.adapter + ' => ' + it.pathText
|
|
5653
|
-
},
|
|
5659
|
+
}, _this38.renderCustomValue(obj, it, item));
|
|
5654
5660
|
}), this.columnsVisibility.val ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
5655
5661
|
className: classes.cellValue,
|
|
5656
5662
|
style: {
|
|
@@ -5658,31 +5664,31 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5658
5664
|
cursor: valueEditable ? (common === null || common === void 0 ? void 0 : common.type) === 'file' ? 'zoom-in' : item.data.button ? 'grab' : 'text' : 'default'
|
|
5659
5665
|
},
|
|
5660
5666
|
onClick: valueEditable ? function () {
|
|
5661
|
-
if (!obj || !
|
|
5667
|
+
if (!obj || !_this38.states) {
|
|
5662
5668
|
return null;
|
|
5663
5669
|
}
|
|
5664
5670
|
|
|
5665
5671
|
if ((common === null || common === void 0 ? void 0 : common.type) === 'file') {
|
|
5666
|
-
return
|
|
5672
|
+
return _this38.setState({
|
|
5667
5673
|
viewFileDialog: id
|
|
5668
5674
|
});
|
|
5669
5675
|
} // in non-expert mode control button directly
|
|
5670
5676
|
|
|
5671
5677
|
|
|
5672
|
-
if (!
|
|
5673
|
-
return
|
|
5678
|
+
if (!_this38.state.filter.expertMode && item.data.button) {
|
|
5679
|
+
return _this38.props.socket.setState(id, true)["catch"](function (e) {
|
|
5674
5680
|
return window.alert("Cannot write state \"".concat(id, "\": ").concat(e));
|
|
5675
5681
|
});
|
|
5676
5682
|
}
|
|
5677
5683
|
|
|
5678
|
-
|
|
5679
|
-
val:
|
|
5680
|
-
q:
|
|
5684
|
+
_this38.edit = {
|
|
5685
|
+
val: _this38.states[id] ? _this38.states[id].val : '',
|
|
5686
|
+
q: _this38.states[id] ? _this38.states[id].q || 0 : 0,
|
|
5681
5687
|
ack: false,
|
|
5682
5688
|
id: id
|
|
5683
5689
|
};
|
|
5684
5690
|
|
|
5685
|
-
|
|
5691
|
+
_this38.setState({
|
|
5686
5692
|
updateOpened: true
|
|
5687
5693
|
});
|
|
5688
5694
|
} : undefined
|
|
@@ -5705,7 +5711,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5705
5711
|
}, {
|
|
5706
5712
|
key: "renderItem",
|
|
5707
5713
|
value: function renderItem(root, isExpanded, classes, counter) {
|
|
5708
|
-
var
|
|
5714
|
+
var _this39 = this;
|
|
5709
5715
|
|
|
5710
5716
|
var items = [];
|
|
5711
5717
|
counter = counter || {
|
|
@@ -5737,9 +5743,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5737
5743
|
if (!this.state.foldersFirst) {
|
|
5738
5744
|
root.children && items.push(root.children.map(function (item) {
|
|
5739
5745
|
// do not render too many items in column editor mode
|
|
5740
|
-
if (!
|
|
5746
|
+
if (!_this39.state.columnsSelectorShow || counter.count < 15) {
|
|
5741
5747
|
if (item.data.sumVisibility) {
|
|
5742
|
-
return
|
|
5748
|
+
return _this39.renderItem(item, undefined, classes, counter);
|
|
5743
5749
|
}
|
|
5744
5750
|
}
|
|
5745
5751
|
|
|
@@ -5750,9 +5756,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5750
5756
|
root.children && items.push(root.children.map(function (item) {
|
|
5751
5757
|
if (item.children) {
|
|
5752
5758
|
// do not render too many items in column editor mode
|
|
5753
|
-
if (!
|
|
5759
|
+
if (!_this39.state.columnsSelectorShow || counter.count < 15) {
|
|
5754
5760
|
if (item.data.sumVisibility) {
|
|
5755
|
-
return
|
|
5761
|
+
return _this39.renderItem(item, undefined, classes, counter);
|
|
5756
5762
|
}
|
|
5757
5763
|
}
|
|
5758
5764
|
}
|
|
@@ -5763,9 +5769,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5763
5769
|
root.children && items.push(root.children.map(function (item) {
|
|
5764
5770
|
if (!item.children) {
|
|
5765
5771
|
// do not render too many items in column editor mode
|
|
5766
|
-
if (!
|
|
5772
|
+
if (!_this39.state.columnsSelectorShow || counter.count < 15) {
|
|
5767
5773
|
if (item.data.sumVisibility) {
|
|
5768
|
-
return
|
|
5774
|
+
return _this39.renderItem(item, undefined, classes, counter);
|
|
5769
5775
|
}
|
|
5770
5776
|
}
|
|
5771
5777
|
}
|
|
@@ -5788,7 +5794,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5788
5794
|
}, {
|
|
5789
5795
|
key: "calculateColumnsVisibility",
|
|
5790
5796
|
value: function calculateColumnsVisibility(columnsAuto, columns, columnsForAdmin, columnsWidths) {
|
|
5791
|
-
var
|
|
5797
|
+
var _this40 = this;
|
|
5792
5798
|
|
|
5793
5799
|
columnsWidths = columnsWidths || this.state.columnsWidths;
|
|
5794
5800
|
columnsForAdmin = columnsForAdmin || this.state.columnsForAdmin;
|
|
@@ -5881,7 +5887,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5881
5887
|
Object.keys(columnsForAdmin).sort().forEach(function (adapter) {
|
|
5882
5888
|
return columnsForAdmin[adapter].forEach(function (column) {
|
|
5883
5889
|
var id = '_' + adapter + '_' + column.path;
|
|
5884
|
-
|
|
5890
|
+
_this40.columnsVisibility[id] = columns.includes(id);
|
|
5885
5891
|
|
|
5886
5892
|
if (columns.includes(id)) {
|
|
5887
5893
|
var item = {
|
|
@@ -5904,12 +5910,12 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5904
5910
|
}
|
|
5905
5911
|
}
|
|
5906
5912
|
|
|
5907
|
-
|
|
5913
|
+
_this40.adapterColumns.push(item);
|
|
5908
5914
|
|
|
5909
|
-
|
|
5910
|
-
_widthSum2 +=
|
|
5915
|
+
_this40.columnsVisibility[id] = columnsWidths[item.id] || column.width || SCREEN_WIDTHS[_this40.props.width].widths.func || SCREEN_WIDTHS.xl.widths.func;
|
|
5916
|
+
_widthSum2 += _this40.columnsVisibility[id];
|
|
5911
5917
|
} else {
|
|
5912
|
-
|
|
5918
|
+
_this40.columnsVisibility[id] = 0;
|
|
5913
5919
|
}
|
|
5914
5920
|
});
|
|
5915
5921
|
});
|
|
@@ -5931,10 +5937,10 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5931
5937
|
this.columnsVisibility.nameHeader = "calc(100% - ".concat(_widthSum2 + 5 + this.state.scrollBarWidth, "px)");
|
|
5932
5938
|
} else {
|
|
5933
5939
|
var newWidth = Object.keys(this.columnsVisibility).reduce(function (accumulator, name) {
|
|
5934
|
-
if (name === 'id' || typeof
|
|
5940
|
+
if (name === 'id' || typeof _this40.columnsVisibility[name] === 'string' || !_this40.columnsVisibility[name]) {
|
|
5935
5941
|
return accumulator;
|
|
5936
5942
|
} else {
|
|
5937
|
-
return accumulator +
|
|
5943
|
+
return accumulator + _this40.columnsVisibility[name];
|
|
5938
5944
|
}
|
|
5939
5945
|
}, 0);
|
|
5940
5946
|
this.columnsVisibility.id = "calc(100% - ".concat(newWidth, "px)");
|
|
@@ -5949,7 +5955,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5949
5955
|
* @returns {JSX.Element}
|
|
5950
5956
|
*/
|
|
5951
5957
|
function renderHeader() {
|
|
5952
|
-
var
|
|
5958
|
+
var _this41 = this;
|
|
5953
5959
|
|
|
5954
5960
|
var classes = this.props.classes;
|
|
5955
5961
|
var filterClearInValue = null;
|
|
@@ -5957,7 +5963,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
5957
5963
|
if (!this.columnsVisibility.buttons && !this.isFilterEmpty()) {
|
|
5958
5964
|
filterClearInValue = /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
5959
5965
|
onClick: function onClick() {
|
|
5960
|
-
return
|
|
5966
|
+
return _this41.clearFilter();
|
|
5961
5967
|
},
|
|
5962
5968
|
className: classes.buttonClearFilter,
|
|
5963
5969
|
title: this.props.t('ra_Clear filter'),
|
|
@@ -6049,7 +6055,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6049
6055
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
6050
6056
|
className: _Utils["default"].clsx(classes.headerCell, classes.headerCellValue),
|
|
6051
6057
|
style: {
|
|
6052
|
-
width:
|
|
6058
|
+
width: _this41.columnsVisibility[item.id]
|
|
6053
6059
|
},
|
|
6054
6060
|
title: item.adapter,
|
|
6055
6061
|
key: item.id,
|
|
@@ -6085,18 +6091,18 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6085
6091
|
}, {
|
|
6086
6092
|
key: "renderToast",
|
|
6087
6093
|
value: function renderToast() {
|
|
6088
|
-
var
|
|
6094
|
+
var _this42 = this;
|
|
6089
6095
|
|
|
6090
6096
|
return /*#__PURE__*/_react["default"].createElement(_Snackbar["default"], {
|
|
6091
6097
|
open: !!this.state.toast,
|
|
6092
6098
|
autoHideDuration: 3000,
|
|
6093
6099
|
onClick: function onClick() {
|
|
6094
|
-
return
|
|
6100
|
+
return _this42.setState({
|
|
6095
6101
|
toast: ''
|
|
6096
6102
|
});
|
|
6097
6103
|
},
|
|
6098
6104
|
onClose: function onClose() {
|
|
6099
|
-
return
|
|
6105
|
+
return _this42.setState({
|
|
6100
6106
|
toast: ''
|
|
6101
6107
|
});
|
|
6102
6108
|
},
|
|
@@ -6106,7 +6112,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6106
6112
|
"aria-label": "close",
|
|
6107
6113
|
color: "inherit",
|
|
6108
6114
|
onClick: function onClick() {
|
|
6109
|
-
return
|
|
6115
|
+
return _this42.setState({
|
|
6110
6116
|
toast: ''
|
|
6111
6117
|
});
|
|
6112
6118
|
}
|
|
@@ -6122,14 +6128,14 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6122
6128
|
}, {
|
|
6123
6129
|
key: "componentDidUpdate",
|
|
6124
6130
|
value: function componentDidUpdate() {
|
|
6125
|
-
var
|
|
6131
|
+
var _this43 = this;
|
|
6126
6132
|
|
|
6127
6133
|
if (this.tableRef.current) {
|
|
6128
6134
|
var scrollBarWidth = this.tableRef.current.offsetWidth - this.tableRef.current.clientWidth;
|
|
6129
6135
|
|
|
6130
6136
|
if (this.state.scrollBarWidth !== scrollBarWidth) {
|
|
6131
6137
|
setTimeout(function () {
|
|
6132
|
-
return
|
|
6138
|
+
return _this43.setState({
|
|
6133
6139
|
scrollBarWidth: scrollBarWidth
|
|
6134
6140
|
});
|
|
6135
6141
|
}, 100);
|
|
@@ -6159,13 +6165,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6159
6165
|
}, {
|
|
6160
6166
|
key: "renderCustomDialog",
|
|
6161
6167
|
value: function renderCustomDialog() {
|
|
6162
|
-
var
|
|
6168
|
+
var _this44 = this;
|
|
6163
6169
|
|
|
6164
6170
|
if (this.state.customDialog && this.props.objectCustomDialog) {
|
|
6165
6171
|
var ObjectCustomDialog = this.props.objectCustomDialog;
|
|
6166
6172
|
return /*#__PURE__*/_react["default"].createElement(ObjectCustomDialog, {
|
|
6167
6173
|
reportChangedIds: function reportChangedIds(changedIds) {
|
|
6168
|
-
return
|
|
6174
|
+
return _this44.changedIds = (0, _toConsumableArray2["default"])(changedIds);
|
|
6169
6175
|
},
|
|
6170
6176
|
objectIDs: this.state.customDialog,
|
|
6171
6177
|
expertMode: this.state.filter.expertMode,
|
|
@@ -6179,19 +6185,19 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6179
6185
|
objects: this.objects,
|
|
6180
6186
|
customsInstances: this.info.customs,
|
|
6181
6187
|
onClose: function onClose() {
|
|
6182
|
-
|
|
6188
|
+
_this44.pauseSubscribe(false);
|
|
6183
6189
|
|
|
6184
|
-
|
|
6190
|
+
_this44.setState({
|
|
6185
6191
|
customDialog: null
|
|
6186
6192
|
});
|
|
6187
6193
|
|
|
6188
|
-
if (
|
|
6189
|
-
|
|
6194
|
+
if (_this44.changedIds) {
|
|
6195
|
+
_this44.changedIds = null; // update all changed IDs
|
|
6190
6196
|
|
|
6191
|
-
|
|
6197
|
+
_this44.forceUpdate();
|
|
6192
6198
|
}
|
|
6193
6199
|
|
|
6194
|
-
|
|
6200
|
+
_this44.props.router && _this44.props.router.doNavigate('tab-objects');
|
|
6195
6201
|
}
|
|
6196
6202
|
});
|
|
6197
6203
|
} else {
|
|
@@ -6206,7 +6212,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6206
6212
|
}, {
|
|
6207
6213
|
key: "onUpdate",
|
|
6208
6214
|
value: function onUpdate(valAck) {
|
|
6209
|
-
var
|
|
6215
|
+
var _this45 = this;
|
|
6210
6216
|
|
|
6211
6217
|
this.props.socket.setState(this.edit.id, {
|
|
6212
6218
|
val: valAck.val,
|
|
@@ -6214,7 +6220,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6214
6220
|
q: valAck.q || 0,
|
|
6215
6221
|
expire: valAck.expire || undefined
|
|
6216
6222
|
})["catch"](function (e) {
|
|
6217
|
-
return
|
|
6223
|
+
return _this45.showError('Cannot write value: ' + e);
|
|
6218
6224
|
});
|
|
6219
6225
|
}
|
|
6220
6226
|
/**
|
|
@@ -6225,7 +6231,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6225
6231
|
}, {
|
|
6226
6232
|
key: "renderEditObjectDialog",
|
|
6227
6233
|
value: function renderEditObjectDialog() {
|
|
6228
|
-
var
|
|
6234
|
+
var _this46 = this;
|
|
6229
6235
|
|
|
6230
6236
|
if (!this.state.editObjectDialog || !this.props.objectBrowserEditObject) {
|
|
6231
6237
|
return null;
|
|
@@ -6245,24 +6251,24 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6245
6251
|
t: this.props.t,
|
|
6246
6252
|
expertMode: this.state.filter.expertMode,
|
|
6247
6253
|
onNewObject: function onNewObject(obj) {
|
|
6248
|
-
return
|
|
6249
|
-
return
|
|
6254
|
+
return _this46.props.socket.setObject(obj._id, obj).then(function () {
|
|
6255
|
+
return _this46.setState({
|
|
6250
6256
|
editObjectDialog: obj._id
|
|
6251
6257
|
}, function () {
|
|
6252
|
-
return
|
|
6258
|
+
return _this46.onSelect(obj._id);
|
|
6253
6259
|
});
|
|
6254
6260
|
})["catch"](function (e) {
|
|
6255
|
-
return
|
|
6261
|
+
return _this46.showError('Cannot write object: ' + e);
|
|
6256
6262
|
});
|
|
6257
6263
|
},
|
|
6258
6264
|
onClose: function onClose(obj) {
|
|
6259
|
-
|
|
6265
|
+
_this46.setState({
|
|
6260
6266
|
editObjectDialog: ''
|
|
6261
6267
|
});
|
|
6262
6268
|
|
|
6263
6269
|
if (obj) {
|
|
6264
|
-
|
|
6265
|
-
return
|
|
6270
|
+
_this46.props.socket.setObject(obj._id, obj)["catch"](function (e) {
|
|
6271
|
+
return _this46.showError('Cannot write object: ' + e);
|
|
6266
6272
|
});
|
|
6267
6273
|
}
|
|
6268
6274
|
}
|
|
@@ -6276,7 +6282,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6276
6282
|
}, {
|
|
6277
6283
|
key: "renderViewObjectFileDialog",
|
|
6278
6284
|
value: function renderViewObjectFileDialog() {
|
|
6279
|
-
var
|
|
6285
|
+
var _this47 = this;
|
|
6280
6286
|
|
|
6281
6287
|
if (!this.state.viewFileDialog || !this.props.objectBrowserViewFile) {
|
|
6282
6288
|
return null;
|
|
@@ -6292,7 +6298,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6292
6298
|
t: this.props.t,
|
|
6293
6299
|
expertMode: this.state.filter.expertMode,
|
|
6294
6300
|
onClose: function onClose() {
|
|
6295
|
-
return
|
|
6301
|
+
return _this47.setState({
|
|
6296
6302
|
viewFileDialog: ''
|
|
6297
6303
|
});
|
|
6298
6304
|
}
|
|
@@ -6307,7 +6313,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6307
6313
|
key: "renderEditValueDialog",
|
|
6308
6314
|
value: function renderEditValueDialog() {
|
|
6309
6315
|
var _this$objects$this$ed,
|
|
6310
|
-
|
|
6316
|
+
_this48 = this;
|
|
6311
6317
|
|
|
6312
6318
|
if (!this.state.updateOpened || !this.props.objectBrowserValue) {
|
|
6313
6319
|
return null;
|
|
@@ -6338,11 +6344,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6338
6344
|
defaultHistory: this.defaultHistory,
|
|
6339
6345
|
dateFormat: this.props.dateFormat,
|
|
6340
6346
|
onClose: function onClose(res) {
|
|
6341
|
-
|
|
6347
|
+
_this48.setState({
|
|
6342
6348
|
updateOpened: false
|
|
6343
6349
|
});
|
|
6344
6350
|
|
|
6345
|
-
res &&
|
|
6351
|
+
res && _this48.onUpdate(res);
|
|
6346
6352
|
}
|
|
6347
6353
|
});
|
|
6348
6354
|
}
|
|
@@ -6354,7 +6360,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6354
6360
|
* @returns {JSX.Element}
|
|
6355
6361
|
*/
|
|
6356
6362
|
function render() {
|
|
6357
|
-
var
|
|
6363
|
+
var _this49 = this;
|
|
6358
6364
|
|
|
6359
6365
|
this.recordStates = [];
|
|
6360
6366
|
this.unsubscribeTimer && clearTimeout(this.unsubscribeTimer); // apply filter if changed
|
|
@@ -6369,13 +6375,13 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6369
6375
|
|
|
6370
6376
|
if (counter.count < 500 && !this.state.expandAllVisible) {
|
|
6371
6377
|
setTimeout(function () {
|
|
6372
|
-
return
|
|
6378
|
+
return _this49.setState({
|
|
6373
6379
|
expandAllVisible: true
|
|
6374
6380
|
});
|
|
6375
6381
|
});
|
|
6376
6382
|
} else if (counter.count >= 500 && this.state.expandAllVisible) {
|
|
6377
6383
|
setTimeout(function () {
|
|
6378
|
-
return
|
|
6384
|
+
return _this49.setState({
|
|
6379
6385
|
expandAllVisible: false
|
|
6380
6386
|
});
|
|
6381
6387
|
});
|
|
@@ -6385,9 +6391,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
|
|
|
6385
6391
|
}
|
|
6386
6392
|
|
|
6387
6393
|
this.unsubscribeTimer = setTimeout(function () {
|
|
6388
|
-
|
|
6394
|
+
_this49.unsubscribeTimer = null;
|
|
6389
6395
|
|
|
6390
|
-
|
|
6396
|
+
_this49.checkUnsubscribes();
|
|
6391
6397
|
}, 200);
|
|
6392
6398
|
|
|
6393
6399
|
if (!this.state.loaded) {
|