@sapui5/sap.rules.ui 1.109.0 → 1.111.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 +20 -5
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +4 -1
- package/src/sap/rules/ui/BindingSpy.js +1 -1
- package/src/sap/rules/ui/Constants.js +40 -0
- package/src/sap/rules/ui/DecisionTable.js +1 -1
- package/src/sap/rules/ui/DecisionTableCell.js +1 -1
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +13 -13
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +1 -1
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +1 -1
- package/src/sap/rules/ui/DecisionTableConfiguration.js +1 -1
- package/src/sap/rules/ui/DecisionTableSettings.js +1 -1
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +1 -1
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +1 -1
- package/src/sap/rules/ui/RuleBase.js +1 -1
- package/src/sap/rules/ui/RuleBuilder.js +1 -1
- package/src/sap/rules/ui/TextRule.js +83 -5
- package/src/sap/rules/ui/TextRuleConfiguration.js +1 -1
- package/src/sap/rules/ui/TextRuleSettings.js +1 -1
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +66 -34
- package/src/sap/rules/ui/ast/parser/bundle.js +14411 -14411
- package/src/sap/rules/ui/i18n/messagebundle.properties +11 -1
- package/src/sap/rules/ui/i18n/messagebundle_ar.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_bg.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_ca.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_cs.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_cy.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_da.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_de.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_el.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_en.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_en_GB.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_en_US_sappsd.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_en_US_saprigi.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_en_US_saptrc.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_es.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_es_MX.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_et.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_fi.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_fr.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_fr_CA.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_hi.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_hr.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_hu.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_id.properties +6 -1
- package/src/sap/rules/ui/i18n/messagebundle_it.properties +9 -4
- package/src/sap/rules/ui/i18n/messagebundle_iw.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_ja.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_kk.properties +6 -1
- package/src/sap/rules/ui/i18n/messagebundle_ko.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_lt.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_lv.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_ms.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_nl.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_no.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_pl.properties +6 -1
- package/src/sap/rules/ui/i18n/messagebundle_pt.properties +6 -1
- package/src/sap/rules/ui/i18n/messagebundle_pt_PT.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_ro.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_ru.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_sh.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_sk.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_sl.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_sv.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_th.properties +13 -8
- package/src/sap/rules/ui/i18n/messagebundle_tr.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_uk.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_vi.properties +7 -2
- package/src/sap/rules/ui/i18n/messagebundle_zh_CN.properties +5 -0
- package/src/sap/rules/ui/i18n/messagebundle_zh_TW.properties +5 -0
- package/src/sap/rules/ui/library.js +1 -1
- package/src/sap/rules/ui/services/AstExpressionLanguage.js +2 -2
- package/src/sap/rules/ui/themes/base/AstExpression.less +1 -1
- package/src/sap/rules/ui/type/ExpressionAbs.js +1 -1
package/package.json
CHANGED
|
@@ -902,7 +902,7 @@ sap.ui.define([
|
|
|
902
902
|
},
|
|
903
903
|
|
|
904
904
|
_closeAutoSuggestionPopup: function () {
|
|
905
|
-
if (this._oAutoSuggestionPopUp)
|
|
905
|
+
if (this._oAutoSuggestionPopUp && this._oAutoSuggestionPopUp.isOpen())
|
|
906
906
|
this._oAutoSuggestionPopUp.close();
|
|
907
907
|
},
|
|
908
908
|
|
|
@@ -916,7 +916,7 @@ sap.ui.define([
|
|
|
916
916
|
keyCodes = [16, 17, 18, 93, 13, 9, 35, 36, 45, 34, 33, 40, 37, 38, 39, 27, 44, 145, 19, 112, 113, 114, 115, 116, 117, 118,
|
|
917
917
|
119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135
|
|
918
918
|
]; //Non printable keys refer https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
|
|
919
|
-
|
|
919
|
+
var isMac = sap.ui.Device.os.name === "mac";
|
|
920
920
|
this.aKeyTracker = [];
|
|
921
921
|
if (!this._focusedOut) {
|
|
922
922
|
that._setCurrentCursorPosition(that._cursorPostion);
|
|
@@ -934,9 +934,12 @@ sap.ui.define([
|
|
|
934
934
|
that._handleArrowNavigation(event);
|
|
935
935
|
} else if (event.key === "Control") {
|
|
936
936
|
that.ctrlPressed = true;
|
|
937
|
-
} else if (
|
|
937
|
+
} else if (isMac && event.key === "Alt") {
|
|
938
|
+
that.optionPressed = true;
|
|
939
|
+
} else if ((that.ctrlPressed && (event.keyCode === 32 || event.key === " ")) || (isMac && that.optionPressed && (event.keyCode === 32 || event.key === " ")) ) {
|
|
938
940
|
that._initializeCursorSpan();
|
|
939
941
|
that.ctrlPressed = false;
|
|
942
|
+
that.optionPressed = false;
|
|
940
943
|
that._bCtrlSpacePressed = true;
|
|
941
944
|
//For where Clause
|
|
942
945
|
if (!that.dataObjectInfo) {
|
|
@@ -945,6 +948,9 @@ sap.ui.define([
|
|
|
945
948
|
if (!that.relString) {
|
|
946
949
|
that.relString = "";
|
|
947
950
|
}
|
|
951
|
+
if (isMac){
|
|
952
|
+
event.preventDefault();
|
|
953
|
+
}
|
|
948
954
|
} else if (event.key === "Shift") {
|
|
949
955
|
that.bShiftPressed = true;
|
|
950
956
|
} else if (that.bShiftPressed && keyCodes.indexOf(event.keyCode) === -1) {
|
|
@@ -969,6 +975,7 @@ sap.ui.define([
|
|
|
969
975
|
|
|
970
976
|
this._input.on("click", function (event) {
|
|
971
977
|
that.ctrlPressed = false;
|
|
978
|
+
that.optionPressed = false;
|
|
972
979
|
that.forceFireChange = false;
|
|
973
980
|
that._initializeCursorSpan();
|
|
974
981
|
var json;
|
|
@@ -1022,7 +1029,7 @@ sap.ui.define([
|
|
|
1022
1029
|
|
|
1023
1030
|
//After space keyup, this is needed, else it continues
|
|
1024
1031
|
// till _handleKeyUpEvent and closes the autosuggestion
|
|
1025
|
-
if (event.key === "Control" || event.keyCode === 35 || event.keyCode === 36 || event.keyCode === 37 || event.keyCode === 39 || event.keyCode === 20 || event.keyCode === 144) {
|
|
1032
|
+
if (event.key === "Control" || (sap.ui.Device.os.name === "mac" && event.key === "Alt") || event.keyCode === 35 || event.keyCode === 36 || event.keyCode === 37 || event.keyCode === 39 || event.keyCode === 20 || event.keyCode === 144) {
|
|
1026
1033
|
return;
|
|
1027
1034
|
}
|
|
1028
1035
|
|
|
@@ -1066,6 +1073,10 @@ sap.ui.define([
|
|
|
1066
1073
|
}
|
|
1067
1074
|
|
|
1068
1075
|
if (currentText !== lastText) {
|
|
1076
|
+
if(lastText? lastText.trim() == "" : true && currentText.trim() == ""){
|
|
1077
|
+
this.textContent = "";
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1069
1080
|
that.bTypingFlow = true;
|
|
1070
1081
|
//needed when shift and some key has been keyed up at same time
|
|
1071
1082
|
if (((event.keyCode !== 8 && event.keyCode !== 46) && keyCodes.indexOf(event.keyCode) === -1) || (event.key === "Shift" && that
|
|
@@ -2614,6 +2625,8 @@ sap.ui.define([
|
|
|
2614
2625
|
title: this.oBundle.getText("astSuggestionDialogTitle"),
|
|
2615
2626
|
initialFocus: that, //To keep focus on input even after popup is opened
|
|
2616
2627
|
afterOpen: function () { //Needed to set cursor for text rule
|
|
2628
|
+
// focus should be set on the popover after its opened
|
|
2629
|
+
this.focus();
|
|
2617
2630
|
var position;
|
|
2618
2631
|
if (that.bEditInBetween) {
|
|
2619
2632
|
position = that.filterTextLength;
|
|
@@ -2790,7 +2803,9 @@ sap.ui.define([
|
|
|
2790
2803
|
Log.error("Error in parsing string to JSON: " + e.message);
|
|
2791
2804
|
}
|
|
2792
2805
|
}
|
|
2793
|
-
this.
|
|
2806
|
+
if(!(this.getDomRef("input").children && this.getDomRef("input").children.length == 1 && this.getDomRef("input").children[0].outerHTML == "<br>")){
|
|
2807
|
+
this._uiModel.push(item);
|
|
2808
|
+
}
|
|
2794
2809
|
}
|
|
2795
2810
|
that._uiModeltoString();
|
|
2796
2811
|
}
|
|
@@ -37,6 +37,9 @@ sap.ui.define([
|
|
|
37
37
|
}
|
|
38
38
|
var oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
39
39
|
var placeHolderText = oBundle.getText("ctrlSpaceCue");
|
|
40
|
+
if(sap.ui.Device.os.name == "mac"){
|
|
41
|
+
placeHolderText = oBundle.getText("optionSpaceCue");
|
|
42
|
+
}
|
|
40
43
|
if(placeHolderText.length>50 && oControl.getParent().getId() === "popover") {
|
|
41
44
|
placeHolderText = placeHolderText.substring(0,50) + " ...";
|
|
42
45
|
}
|
|
@@ -72,4 +75,4 @@ sap.ui.define([
|
|
|
72
75
|
|
|
73
76
|
return AstExpressionBasicRenderer;
|
|
74
77
|
|
|
75
|
-
}, /* bExport= */ true);
|
|
78
|
+
}, /* bExport= */ true);
|
|
@@ -37,6 +37,46 @@ sap.ui.define(function() {
|
|
|
37
37
|
Constants.UP = "UP";
|
|
38
38
|
Constants.DOWN = "DOWN";
|
|
39
39
|
Constants.CONDITION = "CONDITION";
|
|
40
|
+
Constants.OPERATOR_MAPPING = [{valueHelpType:"U",operator:"EQ",exclude:false,supported:true,message:"equal to"},
|
|
41
|
+
{valueHelpType:"O",operator:"EQ",exclude:false,supported:true,message:"equal to"},
|
|
42
|
+
{valueHelpType:"U",operator:"Contains",exclude:false,supported:true,message:"contains"},
|
|
43
|
+
{valueHelpType:"O",operator:"Contains",exclude:false,supported:true,message:"contains"},
|
|
44
|
+
{valueHelpType:"U",operator:"EQ",exclude:true,supported:true,message:"equal to"},
|
|
45
|
+
{valueHelpType:"O",operator:"EQ",exclude:true,supported:true,message:"equal to"},
|
|
46
|
+
{valueHelpType:"U",operator:"Contains",exclude:true,supported:false,message:"does not contain"},
|
|
47
|
+
{valueHelpType:"O",operator:"Contains",exclude:true,supported:false,message:"does not contain"},
|
|
48
|
+
{valueHelpType:"U",operator:"BT",exclude:false,supported:true,message:"between"},
|
|
49
|
+
{valueHelpType:"O",operator:"BT",exclude:false,supported:false,message:"between"},
|
|
50
|
+
{valueHelpType:"U",operator:"BT",exclude:true,supported:false,message:"not between"},
|
|
51
|
+
{valueHelpType:"O",operator:"BT",exclude:true,supported:false,message:"not between"},
|
|
52
|
+
{valueHelpType:"U",operator:"StartsWith",exclude:false,supported:false,message:"starts with"},
|
|
53
|
+
{valueHelpType:"O",operator:"StartsWith",exclude:false,supported:false,message:"starts with"},
|
|
54
|
+
{valueHelpType:"U",operator:"StartsWith",exclude:true,supported:false,message:"does not start with"},
|
|
55
|
+
{valueHelpType:"O",operator:"StartsWith",exclude:true,supported:false,message:"does not start with"},
|
|
56
|
+
{valueHelpType:"U",operator:"EndsWith",exclude:false,supported:false,message:"ends with"},
|
|
57
|
+
{valueHelpType:"O",operator:"EndsWith",exclude:false,supported:false,message:"ends with"},
|
|
58
|
+
{valueHelpType:"U",operator:"EndsWith",exclude:true,supported:false,message:"does not end with"},
|
|
59
|
+
{valueHelpType:"O",operator:"EndsWith",exclude:true,supported:false,message:"does not end with"},
|
|
60
|
+
{valueHelpType:"U",operator:"LT",exclude:false,supported:true,message:"less than"},
|
|
61
|
+
{valueHelpType:"O",operator:"LT",exclude:false,supported:false,message:"less than"},
|
|
62
|
+
{valueHelpType:"U",operator:"LT",exclude:true,supported:true,message:"not less than"},
|
|
63
|
+
{valueHelpType:"O",operator:"LT",exclude:true,supported:false,message:"not less than"},
|
|
64
|
+
{valueHelpType:"U",operator:"LE",exclude:false,supported:true,message:"less than equal to"},
|
|
65
|
+
{valueHelpType:"O",operator:"LE",exclude:false,supported:false,message:"less than equal to"},
|
|
66
|
+
{valueHelpType:"U",operator:"LE",exclude:true,supported:true,message:"not less than equal to"},
|
|
67
|
+
{valueHelpType:"O",operator:"LE",exclude:true,supported:false,message:"not less than equal to"},
|
|
68
|
+
{valueHelpType:"U",operator:"GT",exclude:false,supported:true,message:"greater than"},
|
|
69
|
+
{valueHelpType:"O",operator:"GT",exclude:false,supported:false,message:"greater than"},
|
|
70
|
+
{valueHelpType:"U",operator:"GT",exclude:true,supported:true,message:"not greater than"},
|
|
71
|
+
{valueHelpType:"O",operator:"GT",exclude:true,supported:false,message:"not greater than"},
|
|
72
|
+
{valueHelpType:"U",operator:"GE",exclude:false,supported:true,message:"greater than equal to"},
|
|
73
|
+
{valueHelpType:"O",operator:"GE",exclude:false,supported:false,message:"greater than equal to"},
|
|
74
|
+
{valueHelpType:"U",operator:"GE",exclude:true,supported:true,message:"not greater than equal to"},
|
|
75
|
+
{valueHelpType:"O",operator:"GE",exclude:true,supported:false,message:"not greater than equal to"},
|
|
76
|
+
{valueHelpType:"U",operator:"Empty",exclude:false,supported:false,message:"empty"},
|
|
77
|
+
{valueHelpType:"O",operator:"Empty",exclude:false,supported:false,message:"empty"},
|
|
78
|
+
{valueHelpType:"U",operator:"Empty",exclude:true,supported:false,message:"not empty"},
|
|
79
|
+
{valueHelpType:"O",operator:"Empty",exclude:true,supported:false,message:"not empty"}];
|
|
40
80
|
return Constants;
|
|
41
81
|
|
|
42
82
|
}, true);
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* @extends sap.rules.ui.AstExpressionBasic
|
|
28
28
|
*
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.111.0
|
|
31
31
|
*
|
|
32
32
|
* @constructor
|
|
33
33
|
* @private
|
|
@@ -128,7 +128,7 @@ sap.ui.define([
|
|
|
128
128
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
DecisionTableCellAstExpressionBasic.prototype._updateModelAstNodes = function (oModel, oColumnData) {
|
|
131
|
+
DecisionTableCellAstExpressionBasic.prototype._updateModelAstNodes = function (oModel, oColumnData, sGroupId) {
|
|
132
132
|
if (this.oDecisionTableCell) {
|
|
133
133
|
var astNodes = oColumnData.ASTNodes;
|
|
134
134
|
for (var node in astNodes) {
|
|
@@ -163,13 +163,13 @@ sap.ui.define([
|
|
|
163
163
|
|
|
164
164
|
var mParameters = {};
|
|
165
165
|
mParameters.properties = updatedAstNode;
|
|
166
|
-
mParameters.groupId =
|
|
166
|
+
mParameters.groupId = sGroupId;
|
|
167
167
|
oModel.createEntry("/DecisionTableRowCellASTs", mParameters);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
DecisionTableCellAstExpressionBasic.prototype._removeExistingAstNodes = function (oModel, oColumnData, sPath, astNodes) {
|
|
172
|
+
DecisionTableCellAstExpressionBasic.prototype._removeExistingAstNodes = function (oModel, oColumnData, sPath, astNodes, sGroupId) {
|
|
173
173
|
if (this.oDecisionTableCell) {
|
|
174
174
|
var mParameters = {};
|
|
175
175
|
mParameters.ColId = oColumnData.ColId;
|
|
@@ -199,7 +199,7 @@ sap.ui.define([
|
|
|
199
199
|
|
|
200
200
|
oModel.callFunction("/DeleteDTRowCellASTDraft", {
|
|
201
201
|
method: "POST",
|
|
202
|
-
groupId:
|
|
202
|
+
groupId: sGroupId,
|
|
203
203
|
urlParameters: mParameters
|
|
204
204
|
});
|
|
205
205
|
|
|
@@ -222,22 +222,23 @@ sap.ui.define([
|
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
DecisionTableCellAstExpressionBasic.prototype._removeAndUpdateExisitingNodes = function (oModel, oData, sPath, astNodes,sCellContentPath) {
|
|
225
|
-
|
|
225
|
+
var sGroupId = oData.RowId + "," + oData.ColId;
|
|
226
|
+
oModel.setDeferredGroups([sGroupId]);
|
|
226
227
|
var oEventBus = sap.ui.getCore().getEventBus();
|
|
227
228
|
oModel.update(sPath, {
|
|
228
229
|
"Content": oModel.getProperty(sCellContentPath)
|
|
229
230
|
}, {
|
|
230
|
-
groupId:
|
|
231
|
+
groupId: sGroupId,
|
|
231
232
|
success: function (oData) {
|
|
232
233
|
oEventBus.publish("sap.ui.rules", "astCreated");
|
|
233
234
|
}
|
|
234
235
|
});
|
|
235
|
-
this._removeExistingAstNodes(oModel, oData, sPath, astNodes);
|
|
236
|
+
this._removeExistingAstNodes(oModel, oData, sPath, astNodes, sGroupId);
|
|
236
237
|
if (this._checkEmptyMarkerNode(astNodes)) {
|
|
237
|
-
this._updateModelAstNodes(oModel, oData);
|
|
238
|
+
this._updateModelAstNodes(oModel, oData, sGroupId);
|
|
238
239
|
}
|
|
239
240
|
oModel.submitChanges({
|
|
240
|
-
groupId:
|
|
241
|
+
groupId: sGroupId
|
|
241
242
|
});
|
|
242
243
|
};
|
|
243
244
|
|
|
@@ -266,9 +267,8 @@ sap.ui.define([
|
|
|
266
267
|
var sCellContentPath = this.oDecisionTableCell.getValuePath();
|
|
267
268
|
var sPath = "/" + sCellContentPath.split("/")[1];
|
|
268
269
|
oEventBus.publish("sap.ui.rules", "astCreating");
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
270
|
+
this._removeAndUpdateExisitingNodes(oModel, oData, sPath, astNodes,sCellContentPath);
|
|
271
|
+
|
|
272
272
|
}
|
|
273
273
|
};
|
|
274
274
|
|
|
@@ -47,7 +47,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
47
47
|
* @extends Control
|
|
48
48
|
*
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.111.0
|
|
51
51
|
*
|
|
52
52
|
* @constructor
|
|
53
53
|
* @private
|
|
@@ -95,6 +95,9 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
95
95
|
* Create Odata call for TextRuleBranch or TextRuleDefaultBranch based on type of condition
|
|
96
96
|
*/
|
|
97
97
|
_addConditionBlock: function (oEvent, sType) {
|
|
98
|
+
if(this._isAddCallInProgress) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
98
101
|
var that = this;
|
|
99
102
|
var oDataModel = this._getModel();
|
|
100
103
|
var oSource = oEvent.getSource();
|
|
@@ -143,6 +146,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
143
146
|
mParameters.error = function () {
|
|
144
147
|
Log.info("Error creating " + sKeytext + "entity");
|
|
145
148
|
};
|
|
149
|
+
this._isAddCallInProgress = true;
|
|
146
150
|
oDataModel.createEntry(sKeytext, mParameters);
|
|
147
151
|
},
|
|
148
152
|
|
|
@@ -158,6 +162,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
158
162
|
_addConditionSuccess: function (newCondition, that, data) {
|
|
159
163
|
var sNumbering;
|
|
160
164
|
var nNewIndex;
|
|
165
|
+
var bConditionCreated = false;
|
|
161
166
|
var sConditionId = newCondition.Id;
|
|
162
167
|
var oDataModel = that._getModel();
|
|
163
168
|
var oHeaderKey = {
|
|
@@ -186,6 +191,18 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
186
191
|
var oElsePanel = that._createElseFormLayout(oContext, that.oBundle.getText("titleElse"), true);
|
|
187
192
|
oVerticalLayout.removeContent(data.nIndex);
|
|
188
193
|
oVerticalLayout.insertContent(oElsePanel, data.nIndex);
|
|
194
|
+
oElsePanel.addEventDelegate({
|
|
195
|
+
onAfterRendering: function(){
|
|
196
|
+
if (data && data.bfirst && !bConditionCreated && oElsePanel.getContent().length > 0 && oElsePanel.getContent()[0].getFormContainers() &&
|
|
197
|
+
oElsePanel.getContent()[0].getFormContainers().length > 0 && oElsePanel.getContent()[0].getFormContainers()[0].getFormElements() &&
|
|
198
|
+
oElsePanel.getContent()[0].getFormContainers()[0].getFormElements().length > 0 && oElsePanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields() &&
|
|
199
|
+
oElsePanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields().length > 0 &&
|
|
200
|
+
oElsePanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields()[0]._input) {
|
|
201
|
+
oElsePanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields()[0]._input.focus();
|
|
202
|
+
bConditionCreated = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
});
|
|
189
206
|
} else if (response.Type === that.typeElseIf) {
|
|
190
207
|
that.getModel("displayModel").getProperty("/textRuleConditions/ElseIf").push(response);
|
|
191
208
|
if (data.bfirst) {
|
|
@@ -198,12 +215,26 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
198
215
|
var oElseIfPanel = that._createFormLayout(oContext, that.oBundle.getText("titleElseIf") + sNumbering, true);
|
|
199
216
|
oVerticalLayout.insertContent(oElseIfPanel, nNewIndex);
|
|
200
217
|
that._adjustElseIfTitle(data.verticalLayout, nNewIndex, true);
|
|
218
|
+
oElseIfPanel.addEventDelegate({
|
|
219
|
+
onAfterRendering: function(){
|
|
220
|
+
if (data && data.bfirst && !bConditionCreated && oElseIfPanel.getContent().length > 0 && oElseIfPanel.getContent()[0].getFormContainers() &&
|
|
221
|
+
oElseIfPanel.getContent()[0].getFormContainers().length > 0 && oElseIfPanel.getContent()[0].getFormContainers()[0].getFormElements() &&
|
|
222
|
+
oElseIfPanel.getContent()[0].getFormContainers()[0].getFormElements().length > 0 && oElseIfPanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields() &&
|
|
223
|
+
oElseIfPanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields().length > 0 &&
|
|
224
|
+
oElseIfPanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields()[0]._input) {
|
|
225
|
+
oElseIfPanel.getContent()[0].getFormContainers()[0].getFormElements()[0].getFields()[0]._input.focus();
|
|
226
|
+
bConditionCreated = true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
201
230
|
}
|
|
231
|
+
that._isAddCallInProgress = false;
|
|
202
232
|
that._updateBusyState(false);
|
|
203
233
|
sap.m.MessageToast.show(that.oBundle.getText("branchCreatedSuccess"));
|
|
204
234
|
},
|
|
205
235
|
error: function () {
|
|
206
236
|
Log.info("Error reading TextRuleResultExpressions");
|
|
237
|
+
that._isAddCallInProgress = false;
|
|
207
238
|
}
|
|
208
239
|
});
|
|
209
240
|
|
|
@@ -431,7 +462,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
431
462
|
tooltip: this.oBundle.getText("deleteElseIf"),
|
|
432
463
|
visible: "{TextRuleModel>/editable}",
|
|
433
464
|
press: function (oEvent) {
|
|
434
|
-
that.
|
|
465
|
+
that.showDeleteConfirmationDialogMessage(oEvent.getSource());
|
|
435
466
|
}
|
|
436
467
|
}).setBindingContext(oContext);
|
|
437
468
|
|
|
@@ -466,7 +497,7 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
466
497
|
tooltip: this.oBundle.getText("deleteElse"),
|
|
467
498
|
visible: "{TextRuleModel>/editable}",
|
|
468
499
|
press: function (oEvent) {
|
|
469
|
-
that.
|
|
500
|
+
that.showDeleteConfirmationDialogMessage(oEvent.getSource());
|
|
470
501
|
}
|
|
471
502
|
}).setBindingContext(oContext);
|
|
472
503
|
|
|
@@ -505,6 +536,35 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
505
536
|
return oPanel;
|
|
506
537
|
},
|
|
507
538
|
|
|
539
|
+
showDeleteConfirmationDialogMessage: function(oSource) {
|
|
540
|
+
var that = this;
|
|
541
|
+
var oDialog = new Dialog({
|
|
542
|
+
title: this.oBundle.getText("warning_title"),
|
|
543
|
+
type: sap.m.DialogType.Message,
|
|
544
|
+
state: sap.ui.core.ValueState.Warning,
|
|
545
|
+
content: new Text({
|
|
546
|
+
text: this.oBundle.getText("condition_delete_confirmation_message")
|
|
547
|
+
}),
|
|
548
|
+
afterClose: function() {
|
|
549
|
+
oDialog.destroy();
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
oDialog.setBeginButton(new Button({
|
|
553
|
+
text: this.oBundle.getText("textrule_confirmation_dialog_delete"),
|
|
554
|
+
press: function() {
|
|
555
|
+
that._deleteConditionBlock(oSource)
|
|
556
|
+
oDialog.close();
|
|
557
|
+
}
|
|
558
|
+
}));
|
|
559
|
+
oDialog.setEndButton(new Button({
|
|
560
|
+
text: this.oBundle.getText("textrule_confirmation_dialog_cancel"),
|
|
561
|
+
press: function() {
|
|
562
|
+
oDialog.close();
|
|
563
|
+
}
|
|
564
|
+
}));
|
|
565
|
+
oDialog.open();
|
|
566
|
+
},
|
|
567
|
+
|
|
508
568
|
/*
|
|
509
569
|
* Returns If form container
|
|
510
570
|
*/
|
|
@@ -627,10 +687,9 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
627
687
|
* Deletes based on Binding path
|
|
628
688
|
* Vertical layout content deleted based on its index
|
|
629
689
|
*/
|
|
630
|
-
_deleteConditionBlock: function (
|
|
690
|
+
_deleteConditionBlock: function (oSource) {
|
|
631
691
|
var that = this;
|
|
632
692
|
var oDataModel = this._getModel();
|
|
633
|
-
var oSource = oEvent.getSource();
|
|
634
693
|
var oPanel = oSource.getParent().getParent();
|
|
635
694
|
var oVerticalLayout = oPanel.getParent();
|
|
636
695
|
var nIndex = oVerticalLayout.indexOfContent(oPanel);
|
|
@@ -638,6 +697,8 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
638
697
|
var sConditionId = oBindingContext.getProperty("Id");
|
|
639
698
|
var sType = oBindingContext.getProperty("Type");
|
|
640
699
|
var sKeyText;
|
|
700
|
+
var initialConditionCount = oVerticalLayout.getContent().length;
|
|
701
|
+
var bConditionDeleted = false;
|
|
641
702
|
if (sType === that.typeElse) {
|
|
642
703
|
sKeyText = "/TextRuleDefaultBranches";
|
|
643
704
|
} else if (sType === that.typeElseIf) {
|
|
@@ -676,6 +737,23 @@ sap.ui.define(["sap/base/Log","sap/ui/thirdparty/jquery",
|
|
|
676
737
|
that._adjustElseIfTitle(oVerticalLayout, nIndex, false);
|
|
677
738
|
} /* eslint-enable */
|
|
678
739
|
that._updateBusyState(false);
|
|
740
|
+
oVerticalLayout.addEventDelegate({
|
|
741
|
+
onAfterRendering: function(){
|
|
742
|
+
if(!bConditionDeleted) {
|
|
743
|
+
if (initialConditionCount === 3 && (nIndex === 1 || nIndex === 2)){
|
|
744
|
+
oVerticalLayout.getContent()[nIndex].getContent()[0].focus();
|
|
745
|
+
} else if(nIndex === initialConditionCount-2 && oVerticalLayout.getContent().length > 0 && oVerticalLayout.getContent()[nIndex] &&
|
|
746
|
+
oVerticalLayout.getContent()[nIndex].getContent().length > 0 && oVerticalLayout.getContent()[nIndex].getContent()[0].getMetadata().getName()
|
|
747
|
+
=== "sap.m.Button") {
|
|
748
|
+
oVerticalLayout.getContent()[initialConditionCount-2].getContent()[0].focus()
|
|
749
|
+
} else if(oVerticalLayout.getContent().length > 0 && oVerticalLayout.getContent()[nIndex] &&
|
|
750
|
+
oVerticalLayout.getContent()[nIndex].getContent().length > 0 && oVerticalLayout.getContent()[nIndex].getContent()[0].getFormContainers().length > 0) {
|
|
751
|
+
oVerticalLayout.getContent()[nIndex].getContent()[0].getFormContainers()[0].getFormElements()[0].getFields()[0]._input.focus();
|
|
752
|
+
}
|
|
753
|
+
bConditionDeleted = true;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
});
|
|
679
757
|
sap.m.MessageToast.show(that.oBundle.getText("branchDeletedSuccess"));
|
|
680
758
|
};
|
|
681
759
|
|