@sapui5/sap.rules.ui 1.121.0 → 1.122.0
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/package.json +1 -1
- package/src/sap/rules/ui/.library +1 -1
- package/src/sap/rules/ui/AstExpressionBasic.js +25 -18
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +6 -4
- package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +36 -34
- package/src/sap/rules/ui/BindingSpy.js +3 -4
- package/src/sap/rules/ui/DecisionTable.js +101 -74
- package/src/sap/rules/ui/DecisionTableCell.js +63 -33
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +17 -13
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +40 -32
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +21 -19
- package/src/sap/rules/ui/DecisionTableConfiguration.js +5 -6
- package/src/sap/rules/ui/DecisionTableRenderer.js +6 -5
- package/src/sap/rules/ui/DecisionTableSettings.js +254 -225
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +59 -59
- package/src/sap/rules/ui/ExpressionAdvanced.js +135 -111
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +17 -12
- package/src/sap/rules/ui/InstructionRenderer.js +1 -2
- package/src/sap/rules/ui/RuleBase.js +2 -3
- package/src/sap/rules/ui/RuleBuilder.js +23 -23
- package/src/sap/rules/ui/TextRule.js +70 -54
- package/src/sap/rules/ui/TextRuleConfiguration.js +2 -3
- package/src/sap/rules/ui/TextRuleSettings.js +133 -116
- package/src/sap/rules/ui/ast/autoComplete/AutoComplete.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +15 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +15 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +26 -17
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +75 -53
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +35 -23
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +93 -73
- package/src/sap/rules/ui/ast/util/AggregateFunctionDialog.js +172 -157
- package/src/sap/rules/ui/ast/util/LoopFunctionDialog.js +186 -163
- package/src/sap/rules/ui/ast/util/SelectFunctionDialog.js +205 -182
- package/src/sap/rules/ui/ast/util/utilsBase.js +85 -0
- package/src/sap/rules/ui/codemirror/addon/hint/show-hint.js +8 -4
- package/src/sap/rules/ui/i18n/messagebundle_ar.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_cnr.properties +34 -34
- package/src/sap/rules/ui/i18n/messagebundle_en_US_saprigi.properties +285 -285
- package/src/sap/rules/ui/i18n/messagebundle_hu.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_mk.properties +3 -3
- package/src/sap/rules/ui/i18n/messagebundle_sh.properties +88 -88
- package/src/sap/rules/ui/i18n/messagebundle_uk.properties +5 -5
- package/src/sap/rules/ui/library.js +6 -6
- package/src/sap/rules/ui/parser/businessLanguage/lib/IDPParser.js +115 -114
- package/src/sap/rules/ui/parser/businessLanguage/lib/antlr3_all_min.js +4 -4
- package/src/sap/rules/ui/parser/businessLanguage/lib/autoCompleteUtils.js +4 -3
- package/src/sap/rules/ui/parser/businessLanguage/lib/conversionUtils.js +10 -6
- package/src/sap/rules/ui/parser/businessLanguage/lib/entityModel.js +8 -7
- package/src/sap/rules/ui/parser/businessLanguage/lib/entityModelConstractor.js +17 -16
- package/src/sap/rules/ui/parser/businessLanguage/lib/parsingBackendMediator.js +10 -9
- package/src/sap/rules/ui/parser/businessLanguage/lib/termsUtils.js +4 -3
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_cnr.properties +57 -57
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_en_US_saprigi.properties +210 -210
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_mk.properties +1 -1
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sh.properties +90 -90
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sr.properties +1 -1
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_uk.properties +2 -2
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_cnr.properties +19 -19
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_en_US_saprigi.properties +26 -26
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_mk.properties +2 -2
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_sh.properties +26 -26
- package/src/sap/rules/ui/parser/infrastructure/errorHandling/hrfException.js +3 -3
- package/src/sap/rules/ui/parser/infrastructure/locale/lib/resourceBundleContext.js +4 -3
- package/src/sap/rules/ui/parser/infrastructure/messageHandling/lib/responseCollector.js +8 -7
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBody.js +8 -7
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyConvertor.js +4 -3
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyValidator.js +9 -8
- package/src/sap/rules/ui/providers/ValueHelpDialogProvider.js +63 -46
- package/src/sap/rules/ui/providers/ValueHelpProvider.js +8 -7
- package/src/sap/rules/ui/services/AstExpressionLanguage.js +12 -10
- package/src/sap/rules/ui/services/ExpressionLanguage.js +89 -83
- package/src/sap/rules/ui/type/DecisionTableCell.js +2 -2
- package/src/sap/rules/ui/type/DecisionTableHeader.js +3 -3
- package/src/sap/rules/ui/type/Expression.js +3 -3
- package/src/sap/rules/ui/type/ExpressionAbs.js +5 -5
|
@@ -11,7 +11,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
11
11
|
"sap/m/Label",
|
|
12
12
|
"sap/rules/ui/RuleBase",
|
|
13
13
|
"sap/m/Panel",
|
|
14
|
-
"sap/
|
|
14
|
+
"sap/m/Title",
|
|
15
15
|
"sap/ui/layout/form/Form",
|
|
16
16
|
"sap/m/Toolbar",
|
|
17
17
|
"sap/m/ToolbarSpacer",
|
|
@@ -30,12 +30,29 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
30
30
|
"sap/rules/ui/AstExpressionBasic",
|
|
31
31
|
"sap/rules/ui/services/ExpressionLanguage",
|
|
32
32
|
"sap/rules/ui/services/AstExpressionLanguage",
|
|
33
|
+
"sap/ui/core/Lib",
|
|
34
|
+
"sap/ui/model/json/JSONModel",
|
|
35
|
+
"sap/ui/layout/VerticalLayout",
|
|
36
|
+
"sap/ui/core/Element",
|
|
37
|
+
"sap/ui/core/EventBus",
|
|
38
|
+
"sap/m/MessageToast",
|
|
39
|
+
"sap/m/library",
|
|
40
|
+
"sap/ui/core/library",
|
|
41
|
+
"sap/ui/core/IconPool",
|
|
42
|
+
"sap/ui/layout/form/ResponsiveGridLayout",
|
|
43
|
+
"sap/ui/model/odata/v2/Context",
|
|
44
|
+
"sap/ui/layout/HorizontalLayout",
|
|
45
|
+
"sap/ui/layout/GridData",
|
|
33
46
|
"./TextRuleRenderer"
|
|
34
47
|
|
|
35
48
|
], function (Log, jQuery, library, Label, RuleBase, Panel, Title, Form, Toolbar, ToolbarSpacer, Text, Button, Grid, FormContainer, FormElement,
|
|
36
|
-
ExpressionAdvanced, Link, FlexBox, Dialog, TextRuleSettings, AstYamlConverter, Constants, AstExpressionBasic, ExpressionLanguage, AstExpressionLanguage,
|
|
49
|
+
ExpressionAdvanced, Link, FlexBox, Dialog, TextRuleSettings, AstYamlConverter, Constants, AstExpressionBasic, ExpressionLanguage, AstExpressionLanguage, coreLib, JSONModel, VerticalLayout, Element, EventBus, MessageToast, mobileLibrary,
|
|
50
|
+
coreLibrary, IconPool, ResponsiveGridLayout, Context, HorizontalLayout, GridData, TextRuleRenderer) {
|
|
37
51
|
"use strict";
|
|
38
52
|
|
|
53
|
+
var DialogType = mobileLibrary.DialogType;
|
|
54
|
+
var ButtonType = mobileLibrary.ButtonType;
|
|
55
|
+
var ValueState = coreLibrary.ValueState;
|
|
39
56
|
/**
|
|
40
57
|
* Constructor for a new TextRule Control.
|
|
41
58
|
*
|
|
@@ -47,14 +64,13 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
47
64
|
* @extends Control
|
|
48
65
|
*
|
|
49
66
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
67
|
+
* @version 1.122.0
|
|
51
68
|
*
|
|
52
69
|
* @constructor
|
|
53
70
|
* @private
|
|
54
71
|
* @alias sap.rules.ui.TextRule
|
|
55
72
|
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) design time meta model
|
|
56
73
|
*/
|
|
57
|
-
|
|
58
74
|
var TextRule = RuleBase.extend("sap.rules.ui.TextRule", {
|
|
59
75
|
metadata: {
|
|
60
76
|
properties: {
|
|
@@ -171,7 +187,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
171
187
|
RuleVersion: newCondition.RuleVersion
|
|
172
188
|
};
|
|
173
189
|
var sPath = oDataModel.createKey("/TextRuleConditions", oHeaderKey);
|
|
174
|
-
var oContext = new
|
|
190
|
+
var oContext = new Context(oDataModel, sPath);
|
|
175
191
|
var expandPath = "TextRuleResultExpressions";
|
|
176
192
|
if (this.getAstExpressionLanguage()) {
|
|
177
193
|
expandPath = "TextRuleResultExpressions/TextRuleResultExpressionASTs,TextRuleConditionASTs"
|
|
@@ -230,7 +246,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
230
246
|
}
|
|
231
247
|
that._isAddCallInProgress = false;
|
|
232
248
|
that._updateBusyState(false);
|
|
233
|
-
|
|
249
|
+
MessageToast.show(that.oBundle.getText("branchCreatedSuccess"));
|
|
234
250
|
},
|
|
235
251
|
error: function () {
|
|
236
252
|
Log.info("Error reading TextRuleResultExpressions");
|
|
@@ -269,7 +285,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
269
285
|
enabled: "{TextRuleModel>/editable}"
|
|
270
286
|
});
|
|
271
287
|
|
|
272
|
-
var oTitle = new
|
|
288
|
+
var oTitle = new Title({
|
|
273
289
|
text: this.oBundle.getText("textRule")
|
|
274
290
|
});
|
|
275
291
|
|
|
@@ -305,7 +321,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
305
321
|
},
|
|
306
322
|
|
|
307
323
|
_addTextRuleControl: function () {
|
|
308
|
-
this.verticalLayout = new
|
|
324
|
+
this.verticalLayout = new VerticalLayout({
|
|
309
325
|
width: "100%"
|
|
310
326
|
});
|
|
311
327
|
this.setAggregation("_verticalLayout", this.verticalLayout, true);
|
|
@@ -394,7 +410,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
394
410
|
design: "Transparent"
|
|
395
411
|
});
|
|
396
412
|
|
|
397
|
-
var oTitle = new
|
|
413
|
+
var oTitle = new Title({
|
|
398
414
|
text: sTitle
|
|
399
415
|
});
|
|
400
416
|
oToolbar.addContent(oTitle);
|
|
@@ -405,7 +421,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
405
421
|
backgroundDesign: "Translucent",
|
|
406
422
|
content: [new Form({
|
|
407
423
|
editable: true,
|
|
408
|
-
layout: new
|
|
424
|
+
layout: new ResponsiveGridLayout({
|
|
409
425
|
labelSpanXL: 2,
|
|
410
426
|
labelSpanL: 2,
|
|
411
427
|
labelSpanM: 2,
|
|
@@ -425,7 +441,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
425
441
|
]
|
|
426
442
|
}),new Form({
|
|
427
443
|
editable: true,
|
|
428
|
-
layout: new
|
|
444
|
+
layout: new ResponsiveGridLayout({
|
|
429
445
|
labelSpanXL: 2,
|
|
430
446
|
labelSpanL: 2,
|
|
431
447
|
labelSpanM: 2,
|
|
@@ -488,7 +504,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
488
504
|
design: "Transparent"
|
|
489
505
|
});
|
|
490
506
|
|
|
491
|
-
var oTitle = new
|
|
507
|
+
var oTitle = new Title({
|
|
492
508
|
text: sTitle
|
|
493
509
|
});
|
|
494
510
|
|
|
@@ -512,7 +528,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
512
528
|
backgroundDesign: "Translucent",
|
|
513
529
|
content: new Form({
|
|
514
530
|
editable: true,
|
|
515
|
-
layout: new
|
|
531
|
+
layout: new ResponsiveGridLayout({
|
|
516
532
|
labelSpanXL: 2,
|
|
517
533
|
labelSpanL: 2,
|
|
518
534
|
labelSpanM: 2,
|
|
@@ -539,11 +555,11 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
539
555
|
showDeleteConfirmationDialogMessage: function(oSource) {
|
|
540
556
|
var that = this;
|
|
541
557
|
var oDialog = new Dialog({
|
|
542
|
-
title: this.oBundle.getText("warning_title"),
|
|
543
|
-
type:
|
|
544
|
-
state:
|
|
558
|
+
title: this.oBundle.getText("warning_title"),
|
|
559
|
+
type: DialogType.Message,
|
|
560
|
+
state: ValueState.Warning,
|
|
545
561
|
content: new Text({
|
|
546
|
-
text: this.oBundle.getText("condition_delete_confirmation_message")
|
|
562
|
+
text: this.oBundle.getText("condition_delete_confirmation_message")
|
|
547
563
|
}),
|
|
548
564
|
afterClose: function() {
|
|
549
565
|
oDialog.destroy();
|
|
@@ -557,7 +573,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
557
573
|
}
|
|
558
574
|
}));
|
|
559
575
|
oDialog.setEndButton(new Button({
|
|
560
|
-
text: this.oBundle.getText("textrule_confirmation_dialog_cancel"),
|
|
576
|
+
text: this.oBundle.getText("textrule_confirmation_dialog_cancel"),
|
|
561
577
|
press: function() {
|
|
562
578
|
oDialog.close();
|
|
563
579
|
}
|
|
@@ -619,7 +635,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
619
635
|
RuleVersion: oResultExpressions[j].RuleVersion
|
|
620
636
|
};
|
|
621
637
|
var sPath = this._getModel().createKey("/TextRuleResultExpressions", oHeaderKey);
|
|
622
|
-
var oExpressionContext = new
|
|
638
|
+
var oExpressionContext = new Context(this._getModel(), sPath);
|
|
623
639
|
var type = oResultExpressions[j].BusinessDataType;
|
|
624
640
|
if (this.getExpressionLanguage()) {
|
|
625
641
|
if (type === Constants.DATE_BUSINESS_TYPE || type === Constants.TIMESTAMP_BUSINESS_TYPE || type === Constants.NUMBER || type ===
|
|
@@ -665,7 +681,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
665
681
|
//Create a copy of the setting model.
|
|
666
682
|
var settingModelDataStr = JSON.stringify(this._settingsModel.getData());
|
|
667
683
|
var settingModelData = JSON.parse(settingModelDataStr);
|
|
668
|
-
var settingModel = new
|
|
684
|
+
var settingModel = new JSONModel(settingModelData);
|
|
669
685
|
oTextRuleSettings.setModel(settingModel);
|
|
670
686
|
|
|
671
687
|
//Set configuration model
|
|
@@ -754,7 +770,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
754
770
|
}
|
|
755
771
|
}
|
|
756
772
|
});
|
|
757
|
-
|
|
773
|
+
MessageToast.show(that.oBundle.getText("branchDeletedSuccess"));
|
|
758
774
|
};
|
|
759
775
|
|
|
760
776
|
this._updateBusyState(true);
|
|
@@ -865,7 +881,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
865
881
|
};
|
|
866
882
|
|
|
867
883
|
var sPath = that._getModel().createKey("/TextRuleResultExpressions", oHeaderKey);
|
|
868
|
-
var oExpressionContext = new
|
|
884
|
+
var oExpressionContext = new Context(that._getModel(), sPath);
|
|
869
885
|
var oTextRuleConditions = that.getModel("displayModel").getProperty("/textRuleConditions");
|
|
870
886
|
for (var i = 0; i < oTextRuleConditions.length; i++) {
|
|
871
887
|
if (sConditionId === oTextRuleConditions[i].Id && oTextRuleConditions[i].TextRuleResultExpressions) {
|
|
@@ -997,15 +1013,15 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
997
1013
|
visible: bVisible,
|
|
998
1014
|
label: oLabel,
|
|
999
1015
|
//layoutData: new sap.ui.layout.form.GridElementData({hCells: "2"})
|
|
1000
|
-
fields: [oExpressionControl, new
|
|
1001
|
-
layoutData: new
|
|
1016
|
+
fields: [oExpressionControl, new HorizontalLayout({
|
|
1017
|
+
layoutData: new GridData({
|
|
1002
1018
|
span: "L1 M1 S1"
|
|
1003
1019
|
}),
|
|
1004
1020
|
content: [
|
|
1005
|
-
new
|
|
1021
|
+
new Button({
|
|
1006
1022
|
enabled: "{TextRuleModel>/editable}",
|
|
1007
|
-
type:
|
|
1008
|
-
icon:
|
|
1023
|
+
type: ButtonType.Transparent,
|
|
1024
|
+
icon: IconPool.getIconURI("sys-cancel"),
|
|
1009
1025
|
visible:{ parts: [{
|
|
1010
1026
|
path: "displayModel>/bCancelButtonVisible(" + sConditionId + ")"
|
|
1011
1027
|
}, {
|
|
@@ -1019,10 +1035,10 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1019
1035
|
that._deleteTextRuleResultExpression(oEvent);
|
|
1020
1036
|
}.bind(this)
|
|
1021
1037
|
}).setTooltip(this.oBundle.getText("removeColumn")),
|
|
1022
|
-
new
|
|
1038
|
+
new Button({
|
|
1023
1039
|
enabled: "{TextRuleModel>/editable}",
|
|
1024
|
-
type:
|
|
1025
|
-
icon:
|
|
1040
|
+
type: ButtonType.Transparent,
|
|
1041
|
+
icon: IconPool.getIconURI("add"),
|
|
1026
1042
|
visible: that.bOperationsContext,
|
|
1027
1043
|
press: function (oEvent) {
|
|
1028
1044
|
//Add coulmn from JSON model
|
|
@@ -1083,7 +1099,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1083
1099
|
|
|
1084
1100
|
//TODO : Remove after Ast Implementation
|
|
1085
1101
|
_getConvertedExpression: function (expression, isCodeText, oContext) {
|
|
1086
|
-
var oExpressionLanguage =
|
|
1102
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1087
1103
|
var oRuleData = this._formRuleData(oContext, expression);
|
|
1088
1104
|
var oResult;
|
|
1089
1105
|
if (isCodeText) {
|
|
@@ -1107,8 +1123,8 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1107
1123
|
|
|
1108
1124
|
_getElseButton: function () {
|
|
1109
1125
|
var that = this;
|
|
1110
|
-
if (!
|
|
1111
|
-
this.oElseButton = new
|
|
1126
|
+
if (!Element.getElementById("_elseButton")) {
|
|
1127
|
+
this.oElseButton = new Button({
|
|
1112
1128
|
id: "_elseButton",
|
|
1113
1129
|
text: this.oBundle.getText("addElse"),
|
|
1114
1130
|
tooltip: this.oBundle.getText("addElse"),
|
|
@@ -1123,8 +1139,8 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1123
1139
|
|
|
1124
1140
|
_getElseIfButton: function () {
|
|
1125
1141
|
var that = this;
|
|
1126
|
-
if (!
|
|
1127
|
-
this.oElseIfButton = new
|
|
1142
|
+
if (!Element.getElementById("_elseIfButton")) {
|
|
1143
|
+
this.oElseIfButton = new Button({
|
|
1128
1144
|
id: "_elseIfButton",
|
|
1129
1145
|
text: this.oBundle.getText("addElseIf"),
|
|
1130
1146
|
tooltip: this.oBundle.getText("addElseIf"),
|
|
@@ -1153,7 +1169,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1153
1169
|
RuleVersion: oElseIfData[i].RuleVersion
|
|
1154
1170
|
};
|
|
1155
1171
|
var sPath = this._getModel().createKey("/TextRuleConditions", oHeaderKey);
|
|
1156
|
-
var oContext = new
|
|
1172
|
+
var oContext = new Context(this._getModel(), sPath);
|
|
1157
1173
|
var nElseIfIndex = i + 1;
|
|
1158
1174
|
var sNumbering = " (" + nElseIfIndex + ")";
|
|
1159
1175
|
oControls.push(this._createFormLayout(oContext, sTitle + sNumbering, false));
|
|
@@ -1185,7 +1201,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1185
1201
|
RuleVersion: oElseData[0].RuleVersion
|
|
1186
1202
|
};
|
|
1187
1203
|
var sPath = this._getModel().createKey("/TextRuleConditions", oHeaderKey);
|
|
1188
|
-
var oContext = new
|
|
1204
|
+
var oContext = new Context(this._getModel(), sPath);
|
|
1189
1205
|
|
|
1190
1206
|
oControls.push(this._createElseFormLayout(oContext, sTitle), false);
|
|
1191
1207
|
} else {
|
|
@@ -1207,11 +1223,11 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1207
1223
|
var that = this;
|
|
1208
1224
|
var oExpressionLanguage = null;
|
|
1209
1225
|
var attributeInfo = "";
|
|
1210
|
-
var sType = businessDataType ? businessDataType :
|
|
1226
|
+
var sType = businessDataType ? businessDataType : library.ExpressionType.BooleanEnhanced;
|
|
1211
1227
|
this.valueState = "None";
|
|
1212
1228
|
this.bOperationsContext = false;
|
|
1213
1229
|
if (this.getAstExpressionLanguage()) {
|
|
1214
|
-
oExpressionLanguage =
|
|
1230
|
+
oExpressionLanguage =Element.getElementById(this.getAstExpressionLanguage());
|
|
1215
1231
|
var displayExpression = this._getExpressionFromAstNodes(oContext);
|
|
1216
1232
|
if(displayExpression && displayExpression.relString){
|
|
1217
1233
|
displayExpression.relString = displayExpression.relString.replace(/\\/g,"\\\\").replace(/{/g, "\\{").replace(/}/g, "\\}");
|
|
@@ -1242,7 +1258,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1242
1258
|
ariaLabelledBy: sAriaValue,
|
|
1243
1259
|
change: function (oEvent) {
|
|
1244
1260
|
var oSource = oEvent.getSource();
|
|
1245
|
-
var oEventBus =
|
|
1261
|
+
var oEventBus = EventBus.getInstance();
|
|
1246
1262
|
oContext = oSource.getBindingContext();
|
|
1247
1263
|
var sPath = oContext.getPath();
|
|
1248
1264
|
var astNodes = oEvent.getParameter("astNodes");
|
|
@@ -1260,7 +1276,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1260
1276
|
}.bind(this)
|
|
1261
1277
|
}).setBindingContext(oContext);
|
|
1262
1278
|
} else if (this.getExpressionLanguage()) {
|
|
1263
|
-
oExpressionLanguage =
|
|
1279
|
+
oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1264
1280
|
//TODO: Rebase to this change once vocabulary fixed from ui BUG FIX: 1880107212
|
|
1265
1281
|
var oResult = that._getConvertedExpression(expression, false, oContext);
|
|
1266
1282
|
var displayExpression = that._getExpressionFromParseResults(expression, oResult);
|
|
@@ -1326,7 +1342,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1326
1342
|
|
|
1327
1343
|
_removeAndUpdateExisitingNodes: function (sPath, oContext, astNodes, expression, oModel) {
|
|
1328
1344
|
var that = this;
|
|
1329
|
-
var oEventBus =
|
|
1345
|
+
var oEventBus = EventBus.getInstance();
|
|
1330
1346
|
oModel.setDeferredGroups(["astGroupId"]);
|
|
1331
1347
|
oModel.update(oContext.getPath(), {
|
|
1332
1348
|
"Expression": oContext.getProperty("Expression")
|
|
@@ -1354,7 +1370,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1354
1370
|
|
|
1355
1371
|
_getExpressionFromAstNodes: function (oContext) {
|
|
1356
1372
|
var that = this;
|
|
1357
|
-
var oExpressionLanguage =
|
|
1373
|
+
var oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1358
1374
|
var displayExpression = "";
|
|
1359
1375
|
var astList = [];
|
|
1360
1376
|
var astNodes = [];
|
|
@@ -1385,7 +1401,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1385
1401
|
|
|
1386
1402
|
_addNodeObject: function (astNode) {
|
|
1387
1403
|
var oNodeArray = [];
|
|
1388
|
-
var oExpressionLanguage =
|
|
1404
|
+
var oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1389
1405
|
var oAstUtil = oExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
1390
1406
|
|
|
1391
1407
|
var updatedAstNode = [];
|
|
@@ -1425,7 +1441,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1425
1441
|
RuleVersion: oIfData[0].RuleVersion
|
|
1426
1442
|
};
|
|
1427
1443
|
var sPath = this._getModel() ? this._getModel().createKey("/TextRuleConditions", oHeaderKey) : "";
|
|
1428
|
-
var oContext = new
|
|
1444
|
+
var oContext = new Context(this._getModel(), sPath);
|
|
1429
1445
|
|
|
1430
1446
|
return this._createFormLayout(oContext, sTitle, true);
|
|
1431
1447
|
},
|
|
@@ -1482,7 +1498,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1482
1498
|
data.textRuleConditions.If = [];
|
|
1483
1499
|
data.textRuleConditions.ElseIf = [];
|
|
1484
1500
|
data.textRuleConditions.Else = [];
|
|
1485
|
-
this._displayModel = new
|
|
1501
|
+
this._displayModel = new JSONModel(data);
|
|
1486
1502
|
this.setModel(this._displayModel, "displayModel");
|
|
1487
1503
|
},
|
|
1488
1504
|
|
|
@@ -1504,7 +1520,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1504
1520
|
data.textRuleResultExpressions = [];
|
|
1505
1521
|
data.resultDataObjectId = "";
|
|
1506
1522
|
data.expressionLanguageVersion = "";
|
|
1507
|
-
this._internalModel = new
|
|
1523
|
+
this._internalModel = new JSONModel(data);
|
|
1508
1524
|
this.setModel(this._internalModel, "TextRuleModel");
|
|
1509
1525
|
var ruleBuilderModel = this.getModel("ruleBuilderInternalModel");
|
|
1510
1526
|
var textRuleModel = this.getModel("TextRuleModel");
|
|
@@ -1518,7 +1534,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1518
1534
|
* JSON model for settings
|
|
1519
1535
|
*/
|
|
1520
1536
|
_initSettingsModel: function () {
|
|
1521
|
-
this._settingsModel = new
|
|
1537
|
+
this._settingsModel = new JSONModel();
|
|
1522
1538
|
this.setModel(this._settingsModel, "settingModel");
|
|
1523
1539
|
},
|
|
1524
1540
|
|
|
@@ -1539,9 +1555,9 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1539
1555
|
}
|
|
1540
1556
|
oDialog.attachBeforeClose(function (oData) {
|
|
1541
1557
|
var dialogState = oDialog.getState();
|
|
1542
|
-
if (dialogState ===
|
|
1558
|
+
if (dialogState === ValueState.Success) {
|
|
1543
1559
|
if (this._internalModel.getProperty("/resultChanged")) {
|
|
1544
|
-
var oEventBus =
|
|
1560
|
+
var oEventBus = EventBus.getInstance();
|
|
1545
1561
|
oEventBus.publish("sap.ui.rules", "refreshTextRuleModel");
|
|
1546
1562
|
}
|
|
1547
1563
|
this._resetControl();
|
|
@@ -1581,7 +1597,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1581
1597
|
this._internalModel.setProperty("/ruleVersion", sString[7]);
|
|
1582
1598
|
this._internalModel.setProperty("/ruleBindingPath", bindingContextPath);
|
|
1583
1599
|
|
|
1584
|
-
var oContext = new
|
|
1600
|
+
var oContext = new Context(oModel, bindingContextPath);
|
|
1585
1601
|
this.setBindingContext(oContext);
|
|
1586
1602
|
|
|
1587
1603
|
this._bindRule();
|
|
@@ -1730,7 +1746,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1730
1746
|
},
|
|
1731
1747
|
|
|
1732
1748
|
init: function () {
|
|
1733
|
-
this.oBundle =
|
|
1749
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
1734
1750
|
this.typeIf = "If";
|
|
1735
1751
|
this.typeElseIf = "ElseIf";
|
|
1736
1752
|
this.typeElse = "Else";
|
|
@@ -1782,7 +1798,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1782
1798
|
|
|
1783
1799
|
setExpressionLanguage: function (value) {
|
|
1784
1800
|
this.setAssociation("expressionLanguage", value, true);
|
|
1785
|
-
var expressionLanguage = (value instanceof Object) ? value :
|
|
1801
|
+
var expressionLanguage = (value instanceof Object) ? value : Element.getElementById(value);
|
|
1786
1802
|
if (!expressionLanguage) {
|
|
1787
1803
|
return this;
|
|
1788
1804
|
}
|
|
@@ -1799,7 +1815,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
1799
1815
|
|
|
1800
1816
|
setAstExpressionLanguage: function (value) {
|
|
1801
1817
|
this.setAssociation("astExpressionLanguage", value, true);
|
|
1802
|
-
var astExpressionLanguage = (value instanceof Object) ? value :
|
|
1818
|
+
var astExpressionLanguage = (value instanceof Object) ? value : Element.getElementById(value);
|
|
1803
1819
|
if (!astExpressionLanguage) {
|
|
1804
1820
|
return this;
|
|
1805
1821
|
}
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.TextRuleConfiguration
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery.sap.global",
|
|
11
10
|
"./library",
|
|
12
11
|
"sap/ui/core/Element"
|
|
13
|
-
], function(
|
|
12
|
+
], function(library, Element) {
|
|
14
13
|
"use strict";
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -24,7 +23,7 @@ sap.ui.define([
|
|
|
24
23
|
* @extends sap.ui.core.Element
|
|
25
24
|
*
|
|
26
25
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
26
|
+
* @version 1.122.0
|
|
28
27
|
*
|
|
29
28
|
* @constructor
|
|
30
29
|
* @public
|