iobroker.webui 1.18.1 → 1.18.2
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 +3 -0
- package/io-package.json +14 -14
- package/package.json +4 -4
- package/www/dist/frontend/config/ConfigureWebcomponentDesigner.js +3 -3
- package/www/dist/frontend/services/IobrokerWebuiRefactorService.js +2 -2
- package/www/index.html +1 -1
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/services/refactorService/BindingsRefactorService.js +2 -2
- package/www/node_modules/@node-projects/web-component-designer/dist/elements/widgets/refactorView/refactor-view.js +2 -1
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/index.js +1 -0
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/services/ScriptRefactorService.js +51 -26
- package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/services/VisualizationBindingsRefactorService.js +51 -0
package/README.md
CHANGED
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "webui",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.2",
|
|
5
5
|
"titleLang": {
|
|
6
6
|
"en": "webui",
|
|
7
7
|
"de": "webui",
|
|
@@ -29,6 +29,19 @@
|
|
|
29
29
|
"zh-cn": "使用万维网传送器的高锰用户接口"
|
|
30
30
|
},
|
|
31
31
|
"news": {
|
|
32
|
+
"1.18.2": {
|
|
33
|
+
"en": "better refcatoring",
|
|
34
|
+
"de": "besser refcatoring",
|
|
35
|
+
"ru": "лучший хладагент",
|
|
36
|
+
"pt": "melhor refcatoring",
|
|
37
|
+
"nl": "betere refcatoring",
|
|
38
|
+
"fr": "mieux réfcatorer",
|
|
39
|
+
"it": "migliore refcatoring",
|
|
40
|
+
"es": "mejor refcatoring",
|
|
41
|
+
"pl": "lepsza rekatalizacja",
|
|
42
|
+
"uk": "кращий рефторинг",
|
|
43
|
+
"zh-cn": "更好的还原"
|
|
44
|
+
},
|
|
32
45
|
"1.18.1": {
|
|
33
46
|
"en": "fix screen settings",
|
|
34
47
|
"de": "einstellungen für den bildschirm",
|
|
@@ -106,19 +119,6 @@
|
|
|
106
119
|
"pl": "właściwości kontroli wewnętrznej\nwewnętrzne właściwości ekranu",
|
|
107
120
|
"uk": "внутрішні елементи управління\nвнутрішні параметри екрана",
|
|
108
121
|
"zh-cn": "内部控制属性\n内部屏幕属性"
|
|
109
|
-
},
|
|
110
|
-
"1.16.3": {
|
|
111
|
-
"en": "raise errors on unimplemented commands\nwrong script upgrade",
|
|
112
|
-
"de": "fehler auf unimplementierten befehlen erhöhen\nfehlerbehebung",
|
|
113
|
-
"ru": "собрать ошибки по невыполненным командам\nнеправильное обновление",
|
|
114
|
-
"pt": "levantar erros em comandos não implementados\natualização de script errado",
|
|
115
|
-
"nl": "verhoog fouten bij niet geïmplementeerde commando's\nverkeerde script upgrade",
|
|
116
|
-
"fr": "soulever des erreurs sur des commandes non mises en œuvre\nmauvaise mise à jour du script",
|
|
117
|
-
"it": "sollevare errori su comandi non implementati\naggiornamento script sbagliato",
|
|
118
|
-
"es": "levantar errores en comandos unimplemented\nactualización incorrecta del script",
|
|
119
|
-
"pl": "podnoszenie błędów w niewdrożonych poleceniach\nbłędne uaktualnienie skryptu",
|
|
120
|
-
"uk": "підняти помилки на непристойних команд\nнеправильне оновлення сценарію",
|
|
121
|
-
"zh-cn": "在未执行的命令上提出错误\n错误的脚本升级"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"icon": "logo.png",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.webui",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"description": "ioBroker webui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/backend/main.js",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"@node-projects/node-html-parser-esm": "^6.2.0",
|
|
55
55
|
"@node-projects/propertygrid.webcomponent": "^1.2.3",
|
|
56
56
|
"@node-projects/splitview.webcomponent": "^1.0.1",
|
|
57
|
-
"@node-projects/web-component-designer": "^0.1.
|
|
57
|
+
"@node-projects/web-component-designer": "^0.1.226",
|
|
58
58
|
"@node-projects/web-component-designer-codeview-monaco": "^0.1.32",
|
|
59
59
|
"@node-projects/web-component-designer-htmlparserservice-nodehtmlparser": "^0.1.11",
|
|
60
60
|
"@node-projects/web-component-designer-stylesheetservice-css-tools": "^0.1.10",
|
|
61
|
-
"@node-projects/web-component-designer-visualization-addons": "^0.1.
|
|
61
|
+
"@node-projects/web-component-designer-visualization-addons": "^0.1.89",
|
|
62
62
|
"@node-projects/web-component-designer-widgets-wunderbaum": "^0.1.29",
|
|
63
63
|
"@types/json-schema": "^7.0.15",
|
|
64
64
|
"@web/dev-server": "^0.4.6",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"del": "^8.0.0",
|
|
72
72
|
"dock-spawn-ts": "^3.2.1",
|
|
73
73
|
"es-module-shims": "^1.10.1",
|
|
74
|
-
"eslint": "^9.
|
|
74
|
+
"eslint": "^9.14.0",
|
|
75
75
|
"esprima-next": "^6.0.3",
|
|
76
76
|
"gulp": "^5.0.0",
|
|
77
77
|
"gulp-git": "^2.11.0",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseCustomWebcomponentBindingsService,
|
|
1
|
+
import { BaseCustomWebcomponentBindingsService, EventsService, JsonFileElementsService, PreDefinedElementsService, SeperatorContextMenu, TextRefactorService, createDefaultServiceContainer } from "@node-projects/web-component-designer";
|
|
2
2
|
import { NodeHtmlParserService } from '@node-projects/web-component-designer-htmlparserservice-nodehtmlparser';
|
|
3
3
|
import { CodeViewMonaco } from '@node-projects/web-component-designer-codeview-monaco';
|
|
4
4
|
import { CssToolsStylesheetService } from '@node-projects/web-component-designer-stylesheetservice-css-tools';
|
|
5
|
-
import { BindableObjectDragDropService, BindingsEditor, VisualizationBindingsService, PropertyGridDragDropService, ScriptRefactorService } from "@node-projects/web-component-designer-visualization-addons";
|
|
5
|
+
import { BindableObjectDragDropService, BindingsEditor, VisualizationBindingsService, PropertyGridDragDropService, ScriptRefactorService, VisualizationBindingsRefactorService } from "@node-projects/web-component-designer-visualization-addons";
|
|
6
6
|
import { IobrokerWebuiBindableObjectsService } from "../services/IobrokerWebuiBindableObjectsService.js";
|
|
7
7
|
import { IobrokerWebuiDemoProviderService } from "../services/IobrokerWebuiDemoProviderService.js";
|
|
8
8
|
import { IobrokerWebuiConfirmationWrapper } from "./IobrokerWebuiConfirmationWrapper.js";
|
|
@@ -34,7 +34,7 @@ export function configureDesigner(bindingsHelper) {
|
|
|
34
34
|
serviceContainer.register("eventsService", new EventsService());
|
|
35
35
|
serviceContainer.register("eventsService", new IobrokerWebuiCustomControlEventsService());
|
|
36
36
|
serviceContainer.register("propertyGridDragDropService", new PropertyGridDragDropService());
|
|
37
|
-
serviceContainer.register("refactorService", new
|
|
37
|
+
serviceContainer.register("refactorService", new VisualizationBindingsRefactorService());
|
|
38
38
|
serviceContainer.register("refactorService", new TextRefactorService());
|
|
39
39
|
serviceContainer.register("refactorService", new ScriptRefactorService());
|
|
40
40
|
serviceContainer.register("refactorService", new IobrokerWebuiRefactorService());
|
|
@@ -12,7 +12,7 @@ export class IobrokerWebuiRefactorService {
|
|
|
12
12
|
if (pdef.type == 'signal') {
|
|
13
13
|
if (d.element[p]) {
|
|
14
14
|
refactorings.push({
|
|
15
|
-
name: d.element[p], itemType: '
|
|
15
|
+
name: d.element[p], itemType: 'signal', target: BindingTarget.property, targetName: p, service: this, designItem: d, type: 'binding', sourceObject: pdef, display: 'property' + '/' + p, refactor: newValue => {
|
|
16
16
|
d.element[p] = newValue; //TODO: set of property is not yet undoable, maybe we need this in designitem. Or designitem should set reste it?
|
|
17
17
|
d.setAttribute(PropertiesHelper.camelToDashCase(p), newValue);
|
|
18
18
|
}
|
|
@@ -22,7 +22,7 @@ export class IobrokerWebuiRefactorService {
|
|
|
22
22
|
else if (pdef.type == 'screen') {
|
|
23
23
|
if (d.element[p]) {
|
|
24
24
|
refactorings.push({
|
|
25
|
-
name: d.element[p], itemType: '
|
|
25
|
+
name: d.element[p], itemType: 'screen', target: BindingTarget.property, targetName: p, service: this, designItem: d, type: 'binding', sourceObject: pdef, display: 'property' + '/' + p, refactor: newValue => {
|
|
26
26
|
d.element[p] = newValue; //TODO: set of property is not yet undoable, maybe we need this in designitem. Or designitem should set reste it?
|
|
27
27
|
d.setAttribute(PropertiesHelper.camelToDashCase(p), newValue);
|
|
28
28
|
}
|
package/www/index.html
CHANGED
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
</button>
|
|
214
214
|
<button data-command="save" title="save" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/save.svg"></button>
|
|
215
215
|
<div style="margin-left: 30px;">
|
|
216
|
-
webui - 1.18.
|
|
216
|
+
webui - 1.18.2 - d9df0ad
|
|
217
217
|
</div>
|
|
218
218
|
<button style="margin-left: 30px;" data-command="paste" title="paste" disabled><img
|
|
219
219
|
src="./node_modules/@node-projects/web-component-designer/assets/icons/paste.svg"></button>
|
|
@@ -9,10 +9,10 @@ export class BindingsRefactorService {
|
|
|
9
9
|
if (s.includes(':')) {
|
|
10
10
|
let nm = s.split(':')[0];
|
|
11
11
|
let sng = s.substring(nm.length + 1);
|
|
12
|
-
refactorings.push({ service: this, name: sng, itemType: '
|
|
12
|
+
refactorings.push({ service: this, name: sng, itemType: 'signal', designItem: d, type: 'binding', sourceObject: b, display: b.target + '/' + b.targetName + ' - ' + nm + ':', shortName: nm });
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
refactorings.push({ service: this, name: s, itemType: '
|
|
15
|
+
refactorings.push({ service: this, name: s, itemType: 'signal', designItem: d, type: 'binding', sourceObject: b, display: b.target + '/' + b.targetName });
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -13,7 +13,7 @@ export class RefactorView extends BaseCustomWebComponentConstructorAppend {
|
|
|
13
13
|
<template repeat:item="[[this.refactorings]]">
|
|
14
14
|
<details open>
|
|
15
15
|
<summary>
|
|
16
|
-
name:<input value="[[item[1][0].name]]" @keydown="[[this._refactor(item, event)]]" style="flex-grow: 1; min-width: 0">
|
|
16
|
+
[[item[1][0].itemType]]-name:<input value="[[item[1][0].name]]" @keydown="[[this._refactor(item, event)]]" style="flex-grow: 1; min-width: 0">
|
|
17
17
|
</summary>
|
|
18
18
|
<ul>
|
|
19
19
|
<template repeat:reft="[[item[1]]]">
|
|
@@ -48,6 +48,7 @@ export class RefactorView extends BaseCustomWebComponentConstructorAppend {
|
|
|
48
48
|
font-size: 10px;
|
|
49
49
|
display: flex;
|
|
50
50
|
align-items: center;
|
|
51
|
+
white-space: nowrap;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
ul {
|
package/www/node_modules/@node-projects/web-component-designer-visualization-addons/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from './scripting/ScriptCommands.js';
|
|
|
19
19
|
export * from './scripting/ScriptSystem.js';
|
|
20
20
|
export * from './services/BindableObjectDragDropService.js';
|
|
21
21
|
export * from './services/VisualizationBindingsService.js';
|
|
22
|
+
export * from './services/VisualizationBindingsRefactorService.js';
|
|
22
23
|
export * from './services/PropertyGridDragDropService.js';
|
|
23
24
|
export * from './services/ScriptRefactorService.js';
|
|
24
25
|
export * from './services/SignalPropertyEditor.js';
|
|
@@ -14,59 +14,84 @@ export class ScriptRefactorService {
|
|
|
14
14
|
const cp = c[p];
|
|
15
15
|
if (cp != null && typeof cp === 'object') {
|
|
16
16
|
let mp = cp;
|
|
17
|
-
if (mp.source
|
|
18
|
-
refactorings.push({ name: mp.name, itemType: '
|
|
17
|
+
if (mp.source === 'signal') {
|
|
18
|
+
refactorings.push({ name: mp.name, itemType: 'signal', target: BindingTarget.event, targetName: a[0], service: this, designItem: d, type: 'script', sourceObject: script, display: c.type + '/' + p + '[property]', refactor: newValue => mp.name = newValue });
|
|
19
|
+
}
|
|
20
|
+
else if (mp.source === 'property') {
|
|
21
|
+
refactorings.push({ name: mp.name, itemType: 'property', target: BindingTarget.event, targetName: a[0], service: this, designItem: d, type: 'script', sourceObject: script, display: c.type + '/' + p + '[signal]', refactor: newValue => mp.name = newValue });
|
|
22
|
+
}
|
|
23
|
+
else if (mp.source === 'complexString') {
|
|
24
|
+
for (let m of mp.name.matchAll(/\{(.*?)\}/g)) {
|
|
25
|
+
let full = m[0];
|
|
26
|
+
let nm = m[1];
|
|
27
|
+
if (nm[0] === '?') {
|
|
28
|
+
let prefix = '?';
|
|
29
|
+
nm = nm.substring(1);
|
|
30
|
+
if (nm[0] === '?') {
|
|
31
|
+
prefix = '??';
|
|
32
|
+
nm = nm.substring(1);
|
|
33
|
+
}
|
|
34
|
+
refactorings.push({ name: nm, itemType: 'property', target: BindingTarget.event, targetName: a[0], service: this, designItem: d, type: 'script', sourceObject: script, display: c.type + '/' + p + '[complexString]->property', refactor: newValue => mp.name = mp.name.replace(full, '{' + prefix + newValue + '}') });
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
refactorings.push({ name: nm, itemType: 'signal', target: BindingTarget.event, targetName: a[0], service: this, designItem: d, type: 'script', sourceObject: script, display: c.type + '/' + p + '[complexString]->signal', refactor: newValue => mp.name = mp.name.replace(full, '{' + newValue + '}') });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
19
40
|
}
|
|
20
41
|
}
|
|
21
42
|
}
|
|
22
43
|
switch (c.type) {
|
|
23
44
|
case 'SetSignalValue':
|
|
24
|
-
if (c.signal)
|
|
25
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
45
|
+
if (c.signal && typeof c.signal === 'string')
|
|
46
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
26
47
|
break;
|
|
27
48
|
case 'ToggleSignalValue':
|
|
28
|
-
if (c.signal)
|
|
29
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
49
|
+
if (c.signal && typeof c.signal === 'string')
|
|
50
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
30
51
|
break;
|
|
31
52
|
case 'IncrementSignalValue':
|
|
32
|
-
if (c.signal)
|
|
33
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
53
|
+
if (c.signal && typeof c.signal === 'string')
|
|
54
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
34
55
|
break;
|
|
35
56
|
case 'DecrementSignalValue':
|
|
36
|
-
if (c.signal)
|
|
37
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
57
|
+
if (c.signal && typeof c.signal === 'string')
|
|
58
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
38
59
|
break;
|
|
39
60
|
case 'SetBitInSignal':
|
|
40
|
-
if (c.signal)
|
|
41
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
61
|
+
if (c.signal && typeof c.signal === 'string')
|
|
62
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
42
63
|
break;
|
|
43
64
|
case 'ClearBitInSignal':
|
|
44
|
-
if (c.signal)
|
|
45
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
65
|
+
if (c.signal && typeof c.signal === 'string')
|
|
66
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
46
67
|
break;
|
|
47
68
|
case 'ToggleBitInSignal':
|
|
48
|
-
if (c.signal)
|
|
49
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
69
|
+
if (c.signal && typeof c.signal === 'string')
|
|
70
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
50
71
|
break;
|
|
51
72
|
case 'OpenScreen':
|
|
52
|
-
if (c.screen)
|
|
53
|
-
refactorings.push({ name: c.screen, itemType: '
|
|
73
|
+
if (c.screen && typeof c.screen === 'string')
|
|
74
|
+
refactorings.push({ name: c.screen, itemType: 'screen', target: BindingTarget.event, targetName: a[0], display: c.type + '/screen', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.screen = newValue });
|
|
54
75
|
break;
|
|
55
76
|
case 'OpenDialog':
|
|
56
|
-
if (c.screen)
|
|
57
|
-
refactorings.push({ name: c.screen, itemType: '
|
|
77
|
+
if (c.screen && typeof c.screen === 'string')
|
|
78
|
+
refactorings.push({ name: c.screen, itemType: 'screen', target: BindingTarget.event, targetName: a[0], display: c.type + '/screen', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.screen = newValue });
|
|
58
79
|
break;
|
|
59
80
|
case 'CalculateSignalValue':
|
|
60
|
-
if (c.targetSignal)
|
|
61
|
-
refactorings.push({ name: c.targetSignal, itemType: '
|
|
81
|
+
if (c.targetSignal && typeof c.targetSignal === 'string')
|
|
82
|
+
refactorings.push({ name: c.targetSignal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/targetSignal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.targetSignal = newValue });
|
|
62
83
|
break;
|
|
63
84
|
case 'SubscribeSignal':
|
|
64
|
-
if (c.signal)
|
|
65
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
85
|
+
if (c.signal && typeof c.signal === 'string')
|
|
86
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
66
87
|
break;
|
|
67
88
|
case 'UnsubscribeSignal':
|
|
68
|
-
if (c.signal)
|
|
69
|
-
refactorings.push({ name: c.signal, itemType: '
|
|
89
|
+
if (c.signal && typeof c.signal === 'string')
|
|
90
|
+
refactorings.push({ name: c.signal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/signal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.signal = newValue });
|
|
91
|
+
break;
|
|
92
|
+
case 'ShowMessageBox':
|
|
93
|
+
if (c.resultSignal && typeof c.resultSignal === 'string')
|
|
94
|
+
refactorings.push({ name: c.resultSignal, itemType: 'signal', target: BindingTarget.event, targetName: a[0], display: c.type + '/resultSignal', service: this, designItem: d, type: 'script', sourceObject: script, refactor: newValue => c.resultSignal = newValue });
|
|
70
95
|
break;
|
|
71
96
|
}
|
|
72
97
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export class VisualizationBindingsRefactorService {
|
|
2
|
+
getRefactorings(designItems) {
|
|
3
|
+
let refactorings = [];
|
|
4
|
+
for (let d of designItems) {
|
|
5
|
+
let bindings = d.serviceContainer.bindingService.getBindings(d);
|
|
6
|
+
if (bindings) {
|
|
7
|
+
for (let b of bindings) {
|
|
8
|
+
for (let s of b.bindableObjectNames) {
|
|
9
|
+
let itemType = 'signal';
|
|
10
|
+
let prefix = "";
|
|
11
|
+
if (s.includes(':')) {
|
|
12
|
+
let nm = s.split(':')[0];
|
|
13
|
+
let sng = s.substring(nm.length + 1);
|
|
14
|
+
if (sng.startsWith('?')) {
|
|
15
|
+
sng = sng.substring(1);
|
|
16
|
+
prefix = '?';
|
|
17
|
+
itemType = 'property';
|
|
18
|
+
if (sng.startsWith('?')) {
|
|
19
|
+
sng = sng.substring(1);
|
|
20
|
+
prefix = '??';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
refactorings.push({ service: this, name: sng, itemType: itemType, designItem: d, type: 'binding', sourceObject: b, display: b.target + '/' + b.targetName + ' - ' + nm + ':', shortName: nm, prefix: prefix });
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
if (s.startsWith('?')) {
|
|
27
|
+
s = s.substring(1);
|
|
28
|
+
prefix = '?';
|
|
29
|
+
itemType = 'property';
|
|
30
|
+
if (s.startsWith('?')) {
|
|
31
|
+
s = s.substring(1);
|
|
32
|
+
prefix = '??';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
refactorings.push({ service: this, name: s, itemType: itemType, designItem: d, type: 'binding', sourceObject: b, display: b.target + '/' + b.targetName, prefix: prefix });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return refactorings;
|
|
42
|
+
}
|
|
43
|
+
refactor(refactoring, oldValue, newValue) {
|
|
44
|
+
let binding = refactoring.sourceObject;
|
|
45
|
+
if (refactoring.shortName)
|
|
46
|
+
binding.bindableObjectNames = binding.bindableObjectNames.map(x => x == refactoring.shortName + ':' + refactoring.prefix + oldValue ? refactoring.shortName + ':' + refactoring.prefix + newValue : x);
|
|
47
|
+
else
|
|
48
|
+
binding.bindableObjectNames = binding.bindableObjectNames.map(x => x == refactoring.prefix + oldValue ? refactoring.prefix + newValue : x);
|
|
49
|
+
refactoring.designItem.serviceContainer.bindingService.setBinding(refactoring.designItem, binding);
|
|
50
|
+
}
|
|
51
|
+
}
|