@sapui5/sap.rules.ui 1.121.0 → 1.123.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 +113 -74
- package/src/sap/rules/ui/DecisionTableCell.js +67 -34
- 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 +264 -232
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +61 -61
- 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 +30 -26
- package/src/sap/rules/ui/RuleBase.js +2 -3
- package/src/sap/rules/ui/RuleBuilder.js +29 -23
- package/src/sap/rules/ui/TextRule.js +78 -62
- 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.properties +9 -1
- 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 -7
- 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
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
// Provides control sap.rules.ui.
|
|
10
10
|
sap.ui.define([
|
|
11
|
-
"jquery.sap.global",
|
|
12
11
|
"sap/rules/ui/library",
|
|
13
12
|
"sap/ui/core/Control",
|
|
14
13
|
"sap/ui/layout/form/SimpleForm",
|
|
@@ -28,10 +27,40 @@ sap.ui.define([
|
|
|
28
27
|
"sap/rules/ui/AstExpressionBasic",
|
|
29
28
|
"sap/rules/ui/services/AstExpressionLanguage",
|
|
30
29
|
"sap/rules/ui/ast/util/AstUtil",
|
|
30
|
+
"sap/ui/core/library",
|
|
31
|
+
"sap/ui/model/odata/v2/ODataModel",
|
|
32
|
+
"sap/ui/model/Context",
|
|
33
|
+
"sap/m/library",
|
|
34
|
+
/*"sap/ui/layout/form/GridContainerData",*/
|
|
35
|
+
"sap/m/Column",
|
|
36
|
+
"sap/ui/layout/ResponsiveFlowLayoutData",
|
|
37
|
+
"sap/ui/core/IconPool",
|
|
38
|
+
"sap/m/MessageStrip",
|
|
39
|
+
"sap/ui/layout/HorizontalLayout",
|
|
40
|
+
"sap/ui/core/Item",
|
|
41
|
+
"sap/ui/model/Filter",
|
|
42
|
+
"sap/ui/model/FilterOperator",
|
|
43
|
+
"sap/m/SelectDialog",
|
|
44
|
+
"sap/m/StandardListItem",
|
|
45
|
+
"sap/ui/model/BindingMode",
|
|
46
|
+
"sap/ui/model/json/JSONModel",
|
|
47
|
+
"sap/m/Dialog",
|
|
48
|
+
"sap/m/ColumnListItem",
|
|
49
|
+
"sap/ui/core/EventBus",
|
|
50
|
+
"sap/ui/core/ListItem",
|
|
51
|
+
"sap/ui/core/Lib",
|
|
52
|
+
"sap/ui/core/BusyIndicator",
|
|
53
|
+
"sap/ui/core/Element",
|
|
54
|
+
"sap/m/MessageToast",
|
|
31
55
|
"./DecisionTableSettingsRenderer"
|
|
32
56
|
],
|
|
33
|
-
function (
|
|
34
|
-
ExpressionAdvanced, VerticalLayout, ExpressionType, Constants,
|
|
57
|
+
function (library, Control, SimpleForm, Label, Switch, Select, MessageBox, Table, Text, CheckBox, Input, Button,
|
|
58
|
+
ExpressionAdvanced, VerticalLayout, ExpressionType, Constants,
|
|
59
|
+
AstExpressionBasic, AstExpressionLanguage, AstUtil, coreLibrary, ODataModel,
|
|
60
|
+
Context, mobileLibrary, /*GridContainerData,*/ Column,
|
|
61
|
+
ResponsiveFlowLayoutData, IconPool, MessageStrip, HorizontalLayout, Item, Filter, FilterOperator, SelectDialog,
|
|
62
|
+
StandardListItem, BindingMode, JSONModel, Dialog,
|
|
63
|
+
ColumnListItem, EventBus, ListItem, coreLib, BusyIndicator, Element, MessageToast, DecisionTableSettingsRenderer) {
|
|
35
64
|
"use strict";
|
|
36
65
|
|
|
37
66
|
/**
|
|
@@ -44,7 +73,7 @@ sap.ui.define([
|
|
|
44
73
|
* @extends Control
|
|
45
74
|
*
|
|
46
75
|
* @author SAP SE
|
|
47
|
-
* @version 1.
|
|
76
|
+
* @version 1.123.0
|
|
48
77
|
*
|
|
49
78
|
* @constructor
|
|
50
79
|
* @private
|
|
@@ -55,13 +84,16 @@ sap.ui.define([
|
|
|
55
84
|
metadata: {
|
|
56
85
|
library: "sap.rules.ui",
|
|
57
86
|
properties: {
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated Since 1.52.8, use the attribute RuleFormat instead.
|
|
89
|
+
*/
|
|
58
90
|
cellFormat: {
|
|
59
91
|
type: "sap.rules.ui.DecisionTableCellFormat",
|
|
60
|
-
defaultValue:
|
|
92
|
+
defaultValue: library.DecisionTableCellFormat.Both
|
|
61
93
|
},
|
|
62
94
|
hitPolicies: {
|
|
63
95
|
type: "sap.rules.ui.RuleHitPolicy[]",
|
|
64
|
-
defaultValue: [
|
|
96
|
+
defaultValue: [library.RuleHitPolicy.FirstMatch, library.RuleHitPolicy.AllMatch]
|
|
65
97
|
},
|
|
66
98
|
modelName: {
|
|
67
99
|
type: "string",
|
|
@@ -73,7 +105,7 @@ sap.ui.define([
|
|
|
73
105
|
},
|
|
74
106
|
decisionTableFormat: {
|
|
75
107
|
type: "sap.rules.ui.DecisionTableFormat",
|
|
76
|
-
defaultValue:
|
|
108
|
+
defaultValue: library.DecisionTableFormat.RuleFormat
|
|
77
109
|
},
|
|
78
110
|
enableSettingResult: {
|
|
79
111
|
type: "boolean",
|
|
@@ -105,7 +137,7 @@ sap.ui.define([
|
|
|
105
137
|
renderer: DecisionTableSettingsRenderer
|
|
106
138
|
});
|
|
107
139
|
|
|
108
|
-
|
|
140
|
+
oDecisionTableSettings.prototype._addColumnToJsonModel = function (sequence) {
|
|
109
141
|
var displayModel = this.getModel();
|
|
110
142
|
var modelData = displayModel.getData();
|
|
111
143
|
var aColumns = displayModel.oData.DecisionTable.DecisionTableColumns.results;
|
|
@@ -123,7 +155,7 @@ sap.ui.define([
|
|
|
123
155
|
Id: this.mNextColumnId,
|
|
124
156
|
RuleId: modelData.Id,
|
|
125
157
|
Sequence: sequence + 1,
|
|
126
|
-
Type:
|
|
158
|
+
Type: library.DecisionTableColumn.Condition,
|
|
127
159
|
Version: modelData.Version,
|
|
128
160
|
Status: "C"
|
|
129
161
|
};
|
|
@@ -143,9 +175,9 @@ sap.ui.define([
|
|
|
143
175
|
this._setDisplayModelData(modelData);
|
|
144
176
|
};
|
|
145
177
|
|
|
146
|
-
|
|
178
|
+
oDecisionTableSettings.prototype._addNodeObject = function (astNode) {
|
|
147
179
|
var oNodeArray = [];
|
|
148
|
-
var oAstExpressionLanguage =
|
|
180
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
149
181
|
var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
150
182
|
|
|
151
183
|
var updatedAstNode = [];
|
|
@@ -172,17 +204,17 @@ sap.ui.define([
|
|
|
172
204
|
};
|
|
173
205
|
|
|
174
206
|
|
|
175
|
-
|
|
207
|
+
oDecisionTableSettings.prototype._bindPredefinedTable = function (sPath, sKey) {
|
|
176
208
|
var that = this;
|
|
177
209
|
this.oPredefinedTable.destroyItems();
|
|
178
210
|
var oModel = this.getModel("oDataModel");
|
|
179
211
|
var oExpressionLanguage;
|
|
180
212
|
if (this.getExpressionLanguage()) {
|
|
181
|
-
oExpressionLanguage =
|
|
213
|
+
oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
182
214
|
} else {
|
|
183
|
-
oExpressionLanguage =
|
|
215
|
+
oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
184
216
|
}
|
|
185
|
-
var vocabularyModel = new
|
|
217
|
+
var vocabularyModel = new ODataModel(oExpressionLanguage.getModel().sServiceUrl);
|
|
186
218
|
var bAddAttributeToPredefTable = true;
|
|
187
219
|
var sBindingPath;
|
|
188
220
|
var oHeaderKey;
|
|
@@ -200,7 +232,7 @@ sap.ui.define([
|
|
|
200
232
|
Version: oAttributes[i].Version
|
|
201
233
|
};
|
|
202
234
|
sBindingPath = oModel.createKey(sKey, oHeaderKey);
|
|
203
|
-
oContext = new
|
|
235
|
+
oContext = new Context(oModel, sBindingPath);
|
|
204
236
|
} else if (sKey === "/ExpandedAttributes") {
|
|
205
237
|
oHeaderKey = {
|
|
206
238
|
DataObjectId: oAttributes[i].DataObjectId,
|
|
@@ -210,7 +242,7 @@ sap.ui.define([
|
|
|
210
242
|
AttributeId: oAttributes[i].AttributeId
|
|
211
243
|
};
|
|
212
244
|
sBindingPath = vocabularyModel.createKey(sKey, oHeaderKey);
|
|
213
|
-
oContext = new
|
|
245
|
+
oContext = new Context(vocabularyModel, sBindingPath);
|
|
214
246
|
oContext.DataObjectAttributeinfo = oAttributes[i];
|
|
215
247
|
}
|
|
216
248
|
if (that.getExpressionLanguage()) {
|
|
@@ -289,7 +321,7 @@ sap.ui.define([
|
|
|
289
321
|
MessageBox.error(
|
|
290
322
|
oError.responseText, {
|
|
291
323
|
title: that.oBundle.getText("ERROR_DIALOG"),
|
|
292
|
-
actions: [
|
|
324
|
+
actions: [MessageBox.Action.OK]
|
|
293
325
|
|
|
294
326
|
});
|
|
295
327
|
}
|
|
@@ -299,7 +331,7 @@ sap.ui.define([
|
|
|
299
331
|
}
|
|
300
332
|
};
|
|
301
333
|
|
|
302
|
-
|
|
334
|
+
oDecisionTableSettings.prototype._getAttributeSequenceArray = function () {
|
|
303
335
|
var attributeSequenceArray = this.getModel("settingsModel").attributeSequenceArray;
|
|
304
336
|
if (!this.getModel("settingsModel").attributeSequenceArray) {
|
|
305
337
|
var settingsModel = this.getModel("settingsModel");
|
|
@@ -316,7 +348,7 @@ sap.ui.define([
|
|
|
316
348
|
return this.getModel("settingsModel").attributeSequenceArray;
|
|
317
349
|
};
|
|
318
350
|
|
|
319
|
-
|
|
351
|
+
oDecisionTableSettings.prototype._getOrderedAttributesArray = function (dataAttrList) {
|
|
320
352
|
var attributeSequenceArray = this.getModel("settingsModel").attributeSequenceArray;
|
|
321
353
|
if (!attributeSequenceArray) {
|
|
322
354
|
attributeSequenceArray = this._getAttributeSequenceArray();
|
|
@@ -334,7 +366,7 @@ sap.ui.define([
|
|
|
334
366
|
return orderedAttributesArray;
|
|
335
367
|
};
|
|
336
368
|
|
|
337
|
-
|
|
369
|
+
oDecisionTableSettings.prototype._calcNextColumnId = function () {
|
|
338
370
|
var displayModel = this.getModel();
|
|
339
371
|
var modelData = displayModel.getData();
|
|
340
372
|
var aColumns = modelData.DecisionTable ? modelData.DecisionTable.DecisionTableColumns.results : [];
|
|
@@ -351,7 +383,7 @@ sap.ui.define([
|
|
|
351
383
|
return nextId;
|
|
352
384
|
};
|
|
353
385
|
|
|
354
|
-
|
|
386
|
+
oDecisionTableSettings.prototype._callRefreshResultsFunctionImport = function () {
|
|
355
387
|
var that = this;
|
|
356
388
|
var odataModel = this.getModel("oDataModel");
|
|
357
389
|
var modelData = this.getModel().getData();
|
|
@@ -369,7 +401,7 @@ sap.ui.define([
|
|
|
369
401
|
};
|
|
370
402
|
|
|
371
403
|
var submitError = function (e) {
|
|
372
|
-
|
|
404
|
+
MessageToast.show(e);
|
|
373
405
|
};
|
|
374
406
|
|
|
375
407
|
var callRefreshFunctionImport = function (response) {
|
|
@@ -393,12 +425,12 @@ sap.ui.define([
|
|
|
393
425
|
}
|
|
394
426
|
};
|
|
395
427
|
|
|
396
|
-
|
|
428
|
+
oDecisionTableSettings.prototype._changeColumnInputMode = function (oContext, oEvent) {
|
|
397
429
|
var oSelect = oEvent.getSource();
|
|
398
430
|
this._openWarningDialog(oSelect, oContext);
|
|
399
431
|
};
|
|
400
432
|
|
|
401
|
-
|
|
433
|
+
oDecisionTableSettings.prototype._changeColumnStatusToUpdate = function (oContext) {
|
|
402
434
|
var model = oContext.getModel();
|
|
403
435
|
//Update column status to "update". But only in case it's not a new column
|
|
404
436
|
var status = oContext.getProperty("Status");
|
|
@@ -407,7 +439,7 @@ sap.ui.define([
|
|
|
407
439
|
}
|
|
408
440
|
};
|
|
409
441
|
|
|
410
|
-
|
|
442
|
+
oDecisionTableSettings.prototype._changeInputMode = function (bShouldChangeMode, oSelect, oContext) {
|
|
411
443
|
if (!bShouldChangeMode) {
|
|
412
444
|
oSelect.setSelectedKey(this.oBundle.getText("valueOnly"));
|
|
413
445
|
return;
|
|
@@ -417,7 +449,7 @@ sap.ui.define([
|
|
|
417
449
|
this._changeColumnStatusToUpdate(oContext);
|
|
418
450
|
};
|
|
419
451
|
|
|
420
|
-
|
|
452
|
+
oDecisionTableSettings.prototype._createDefaultColumn = function () {
|
|
421
453
|
var _displayModel = this.getModel();
|
|
422
454
|
var modelData = _displayModel.getData();
|
|
423
455
|
|
|
@@ -440,42 +472,42 @@ sap.ui.define([
|
|
|
440
472
|
},
|
|
441
473
|
Id: 1,
|
|
442
474
|
Sequence: 1,
|
|
443
|
-
Type:
|
|
475
|
+
Type: library.DecisionTableColumn.Condition,
|
|
444
476
|
Status: "C"
|
|
445
477
|
});
|
|
446
478
|
}
|
|
447
479
|
};
|
|
448
480
|
|
|
449
481
|
//Condition table
|
|
450
|
-
|
|
482
|
+
oDecisionTableSettings.prototype._createTable = function () {
|
|
451
483
|
this.conditionsTable = new Table({
|
|
452
|
-
backgroundDesign:
|
|
453
|
-
showSeparators:
|
|
454
|
-
layoutData: new
|
|
484
|
+
backgroundDesign: mobileLibrary.BackgroundDesign.Solid,
|
|
485
|
+
showSeparators: mobileLibrary.ListSeparators.None,
|
|
486
|
+
/*layoutData: new GridContainerData({
|
|
455
487
|
halfGrid: false
|
|
456
|
-
}),
|
|
488
|
+
}),TODO:Change by Harsh*/
|
|
457
489
|
columns: [
|
|
458
|
-
new
|
|
490
|
+
new Column({
|
|
459
491
|
width: "50%",
|
|
460
|
-
header: new
|
|
492
|
+
header: new Label({
|
|
461
493
|
text: this.oBundle.getText("colOfDecisionTable"),
|
|
462
|
-
design:
|
|
494
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
463
495
|
}).setTooltip(this.oBundle.getText("colOfDecisionTable"))
|
|
464
496
|
}),
|
|
465
497
|
|
|
466
|
-
new
|
|
498
|
+
new Column({
|
|
467
499
|
width: "25%",
|
|
468
|
-
header: new
|
|
500
|
+
header: new Label({
|
|
469
501
|
text: this.oBundle.getText("label"),
|
|
470
|
-
design:
|
|
502
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
471
503
|
}).setTooltip(this.oBundle.getText("label"))
|
|
472
504
|
}),
|
|
473
505
|
|
|
474
|
-
new
|
|
506
|
+
new Column({
|
|
475
507
|
width: "25%",
|
|
476
|
-
header: new
|
|
508
|
+
header: new Label({
|
|
477
509
|
text: this.oBundle.getText("fixedOperator"),
|
|
478
|
-
design:
|
|
510
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
479
511
|
}).setTooltip(this.oBundle.getText("fixedOperator"))
|
|
480
512
|
}),
|
|
481
513
|
|
|
@@ -488,7 +520,7 @@ sap.ui.define([
|
|
|
488
520
|
}).setTooltip(this.oBundle.getText("inputMode"))
|
|
489
521
|
}),*/ // input mode choice will be removed from decision table settings
|
|
490
522
|
|
|
491
|
-
new
|
|
523
|
+
new Column({
|
|
492
524
|
width: "20%"
|
|
493
525
|
})
|
|
494
526
|
]
|
|
@@ -505,7 +537,7 @@ sap.ui.define([
|
|
|
505
537
|
return this.conditionsTable;
|
|
506
538
|
};
|
|
507
539
|
|
|
508
|
-
|
|
540
|
+
oDecisionTableSettings.prototype._createRefreshButton = function () {
|
|
509
541
|
var _calcStatisticsMessage = function () { //returns null if no changes => we'll disable refresh button
|
|
510
542
|
var results = this.getModel("settingsModel").oData.results.resultsEnumration;
|
|
511
543
|
var currentResultID = this.getModel().oData.ResultDataObjectId;
|
|
@@ -552,9 +584,9 @@ sap.ui.define([
|
|
|
552
584
|
MessageBox.warning(
|
|
553
585
|
dialogStatisticsMessage, {
|
|
554
586
|
title: this.oBundle.getText("refeshResultWarningTitle"),
|
|
555
|
-
actions: [
|
|
587
|
+
actions: [MessageBox.Action.OK, MessageBox.Action.CANCEL],
|
|
556
588
|
onClose: function (oAction) {
|
|
557
|
-
if (oAction ===
|
|
589
|
+
if (oAction === MessageBox.Action.OK) {
|
|
558
590
|
_handleRefreshConfirmed();
|
|
559
591
|
}
|
|
560
592
|
}
|
|
@@ -562,12 +594,12 @@ sap.ui.define([
|
|
|
562
594
|
}.bind(this);
|
|
563
595
|
|
|
564
596
|
var oRefreshButton = new Button({
|
|
565
|
-
layoutData: new
|
|
597
|
+
layoutData: new ResponsiveFlowLayoutData({
|
|
566
598
|
weight: 1
|
|
567
599
|
}),
|
|
568
|
-
icon:
|
|
600
|
+
icon: IconPool.getIconURI("synchronize"),
|
|
569
601
|
width: "3rem",
|
|
570
|
-
type:
|
|
602
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
571
603
|
text: "",
|
|
572
604
|
press: _handleRefreshPress,
|
|
573
605
|
visible: true,
|
|
@@ -579,14 +611,14 @@ sap.ui.define([
|
|
|
579
611
|
};
|
|
580
612
|
|
|
581
613
|
//creates a message strip
|
|
582
|
-
|
|
583
|
-
var omsgStrip =
|
|
614
|
+
oDecisionTableSettings.prototype._createInfoMessageStrip = function (textstr, elementID) {
|
|
615
|
+
var omsgStrip = Element.getElementById(elementID);
|
|
584
616
|
if (!omsgStrip) {
|
|
585
|
-
omsgStrip = new
|
|
617
|
+
omsgStrip = new MessageStrip({
|
|
586
618
|
visible: true, // boolean
|
|
587
619
|
id: elementID,
|
|
588
620
|
text: textstr, // string
|
|
589
|
-
type:
|
|
621
|
+
type: coreLibrary.MessageType.Information, // sap.ui.core.MessageType
|
|
590
622
|
showIcon: true, // boolean
|
|
591
623
|
showCloseButton: true
|
|
592
624
|
}).addStyleClass("sapRULTDecisionTableSettingsMessageStrip");
|
|
@@ -594,7 +626,7 @@ sap.ui.define([
|
|
|
594
626
|
return omsgStrip;
|
|
595
627
|
};
|
|
596
628
|
|
|
597
|
-
|
|
629
|
+
oDecisionTableSettings.prototype._createLayout = function () {
|
|
598
630
|
var oForm = new SimpleForm({
|
|
599
631
|
editable: true,
|
|
600
632
|
layout: "ResponsiveGridLayout",
|
|
@@ -612,7 +644,7 @@ sap.ui.define([
|
|
|
612
644
|
enabled: "{settingsModel>/hitPolicy/enabled}",
|
|
613
645
|
items: {
|
|
614
646
|
path: "settingsModel>/hitPolicy/hitPolicyEnumration",
|
|
615
|
-
template: new
|
|
647
|
+
template: new Item({
|
|
616
648
|
key: "{settingsModel>key}",
|
|
617
649
|
text: "{settingsModel>text}"
|
|
618
650
|
})
|
|
@@ -631,7 +663,7 @@ sap.ui.define([
|
|
|
631
663
|
}),
|
|
632
664
|
|
|
633
665
|
new Label(),
|
|
634
|
-
new
|
|
666
|
+
new HorizontalLayout({}),
|
|
635
667
|
|
|
636
668
|
new Label({
|
|
637
669
|
text: this.oBundle.getText("conditionsTableLabelText")
|
|
@@ -639,12 +671,12 @@ sap.ui.define([
|
|
|
639
671
|
this._createTable(),
|
|
640
672
|
|
|
641
673
|
new Label(),
|
|
642
|
-
new
|
|
674
|
+
new HorizontalLayout({}),
|
|
643
675
|
|
|
644
676
|
new Label({
|
|
645
677
|
text: this.oBundle.getText("output")
|
|
646
678
|
}).setTooltip(this.oBundle.getText("output")),
|
|
647
|
-
new
|
|
679
|
+
new HorizontalLayout({
|
|
648
680
|
content: [
|
|
649
681
|
this._createResultInput(),
|
|
650
682
|
this._createRefreshButton()
|
|
@@ -660,10 +692,10 @@ sap.ui.define([
|
|
|
660
692
|
};
|
|
661
693
|
|
|
662
694
|
//creates layout for predefined values
|
|
663
|
-
|
|
695
|
+
oDecisionTableSettings.prototype._createPredefinedResultsLayout = function () {
|
|
664
696
|
//if ABAP backend is used, we do not show the predefined results table
|
|
665
697
|
if (this.needToRenderPredefinedResultsTable) {
|
|
666
|
-
var verticalLayout = new
|
|
698
|
+
var verticalLayout = new VerticalLayout({
|
|
667
699
|
content: [
|
|
668
700
|
this._createInfoMessageStrip(this.oBundle.getText("PredefinedMessageStripHiddenAccessInfoText"), "id_HiddenAccessMessageStrip"),
|
|
669
701
|
this._createInfoMessageStrip(this.oBundle.getText("PredefinedMessageStripEditableAccessInfoText"),
|
|
@@ -678,39 +710,39 @@ sap.ui.define([
|
|
|
678
710
|
};
|
|
679
711
|
|
|
680
712
|
//creates table for predefined values with access options
|
|
681
|
-
|
|
713
|
+
oDecisionTableSettings.prototype._createPredefinedResultsTable = function () {
|
|
682
714
|
//if the table does not exist, create the table
|
|
683
715
|
if (!this.oPredefinedTable) {
|
|
684
|
-
this.oPredefinedTable = new
|
|
685
|
-
backgroundDesign:
|
|
686
|
-
showSeparators:
|
|
687
|
-
swipeDirection:
|
|
688
|
-
layoutData: new
|
|
716
|
+
this.oPredefinedTable = new Table("idPredefinedTable", {
|
|
717
|
+
backgroundDesign: mobileLibrary.BackgroundDesign.Solid,
|
|
718
|
+
showSeparators: mobileLibrary.ListSeparators.All,
|
|
719
|
+
swipeDirection: mobileLibrary.SwipeDirection.Both,
|
|
720
|
+
/*layoutData: new GridContainerData({
|
|
689
721
|
halfGrid: false
|
|
690
|
-
}),
|
|
691
|
-
columns: [new
|
|
722
|
+
}),TODO:Change by Harsh*/
|
|
723
|
+
columns: [new Column({
|
|
692
724
|
width: "45%",
|
|
693
|
-
header: new
|
|
725
|
+
header: new Label({
|
|
694
726
|
text: this.oBundle.getText("PredefinedResultColumnHeaderText"),
|
|
695
|
-
design:
|
|
727
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
696
728
|
})
|
|
697
|
-
}), new
|
|
729
|
+
}), new Column({
|
|
698
730
|
width: "30%",
|
|
699
|
-
header: new
|
|
731
|
+
header: new Label({
|
|
700
732
|
text: this.oBundle.getText("PredefinedAccessColumnHeaderText"),
|
|
701
|
-
design:
|
|
733
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
702
734
|
})
|
|
703
|
-
}), new
|
|
735
|
+
}), new Column({
|
|
704
736
|
width: "45%",
|
|
705
|
-
header: new
|
|
737
|
+
header: new Label({
|
|
706
738
|
text: this.oBundle.getText("PredefinedValuesColumnHeaderText"),
|
|
707
|
-
design:
|
|
739
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
708
740
|
})
|
|
709
|
-
}), new
|
|
741
|
+
}), new Column({
|
|
710
742
|
width: "20%",
|
|
711
|
-
header: new
|
|
743
|
+
header: new Label({
|
|
712
744
|
text: this.oBundle.getText("ReorderResultDOAttributes"),
|
|
713
|
-
design:
|
|
745
|
+
design: mobileLibrary.LabelDesign.Bold
|
|
714
746
|
})
|
|
715
747
|
})]
|
|
716
748
|
});
|
|
@@ -734,7 +766,7 @@ sap.ui.define([
|
|
|
734
766
|
return null;
|
|
735
767
|
};
|
|
736
768
|
|
|
737
|
-
|
|
769
|
+
oDecisionTableSettings.prototype._createResultInput = function () {
|
|
738
770
|
var model = this.getModel();
|
|
739
771
|
var resultDataObjectId = model.oData.ResultDataObjectId;
|
|
740
772
|
var settingsModel = this.getModel("settingsModel");
|
|
@@ -749,7 +781,7 @@ sap.ui.define([
|
|
|
749
781
|
this.oResultInput = new Input({
|
|
750
782
|
width: "220px",
|
|
751
783
|
//enabled: "{settingsModel>/results/enabled}",
|
|
752
|
-
valueHelpOnly: true,
|
|
784
|
+
//valueHelpOnly: true,
|
|
753
785
|
showValueHelp: true,
|
|
754
786
|
value: resultText,
|
|
755
787
|
tooltip: this.oBundle.getText("chooseResultTooltip"),
|
|
@@ -763,21 +795,21 @@ sap.ui.define([
|
|
|
763
795
|
|
|
764
796
|
var _handleSearch = function _handleSearch(evt) {
|
|
765
797
|
var sValue = evt.getParameter("value");
|
|
766
|
-
var oFilter = new
|
|
798
|
+
var oFilter = new Filter(
|
|
767
799
|
"name",
|
|
768
|
-
|
|
800
|
+
FilterOperator.Contains, sValue
|
|
769
801
|
);
|
|
770
802
|
evt.getSource().getBinding("items").filter([oFilter]);
|
|
771
803
|
};
|
|
772
804
|
|
|
773
|
-
this.oSelectDialog = new
|
|
805
|
+
this.oSelectDialog = new SelectDialog({
|
|
774
806
|
title: this.oBundle.getText("chooseResultDialogTitle"),
|
|
775
807
|
styleClass: "sapUiPopupWithPadding",
|
|
776
808
|
rememberSelections: true,
|
|
777
809
|
items: {
|
|
778
810
|
path: "settingsModel>/results/resultsEnumration",
|
|
779
811
|
//sorter: { path: 'name' },
|
|
780
|
-
template: new
|
|
812
|
+
template: new StandardListItem({
|
|
781
813
|
title: "{settingsModel>label}",
|
|
782
814
|
description: "{settingsModel>description}"
|
|
783
815
|
})
|
|
@@ -841,9 +873,9 @@ sap.ui.define([
|
|
|
841
873
|
MessageBox.warning(
|
|
842
874
|
this.oBundle.getText("changeResultWarningMsg"), {
|
|
843
875
|
title: this.oBundle.getText("changeResultWarningTitle"),
|
|
844
|
-
actions: [
|
|
876
|
+
actions: [MessageBox.Action.OK, MessageBox.Action.CANCEL],
|
|
845
877
|
onClose: function (oAction) {
|
|
846
|
-
if (oAction ===
|
|
878
|
+
if (oAction === MessageBox.Action.OK) {
|
|
847
879
|
_handleValueHelpOpen();
|
|
848
880
|
}
|
|
849
881
|
}
|
|
@@ -867,7 +899,7 @@ sap.ui.define([
|
|
|
867
899
|
if(enableSettingResult) {
|
|
868
900
|
this.oResultInput.bindAggregation("suggestionItems",{
|
|
869
901
|
path: "settingsModel>/results/resultsEnumration",
|
|
870
|
-
template: new
|
|
902
|
+
template: new Item({
|
|
871
903
|
key: "{settingsModel>id}",
|
|
872
904
|
text: "{settingsModel>label}"
|
|
873
905
|
})
|
|
@@ -881,8 +913,8 @@ sap.ui.define([
|
|
|
881
913
|
return this.oResultInput;
|
|
882
914
|
};
|
|
883
915
|
|
|
884
|
-
|
|
885
|
-
var elementToDestroy =
|
|
916
|
+
oDecisionTableSettings.prototype._destroyElement = function (element) {
|
|
917
|
+
var elementToDestroy = Element.getElementById(element);
|
|
886
918
|
if (elementToDestroy) {
|
|
887
919
|
if (element === "idPredefinedTable") {
|
|
888
920
|
elementToDestroy.destroyColumns();
|
|
@@ -893,7 +925,7 @@ sap.ui.define([
|
|
|
893
925
|
|
|
894
926
|
/*function to find if an attribute is deleted and then remove the attribute from JSON and OdatModel
|
|
895
927
|
we will also have to ensure that the sequence is maintained after deletion*/
|
|
896
|
-
|
|
928
|
+
oDecisionTableSettings.prototype._findAndRemoveDeletedAttributeFromOModel = function () {
|
|
897
929
|
var _oSettingsModel = this.getModel("settingsModel");
|
|
898
930
|
var jsonArrayWithExistingValues = _oSettingsModel.oData.predefinedResults;
|
|
899
931
|
|
|
@@ -928,7 +960,7 @@ sap.ui.define([
|
|
|
928
960
|
}
|
|
929
961
|
};
|
|
930
962
|
|
|
931
|
-
|
|
963
|
+
oDecisionTableSettings.prototype._findPropertyAccessMode = function () {
|
|
932
964
|
var dtPropertyList = this.oModels.oDataModel.oServiceData.oMetadata.mEntityTypes["/DecisionTableColumnResults"].property;
|
|
933
965
|
if (dtPropertyList) {
|
|
934
966
|
for (var nPropertyPos = 0; nPropertyPos < dtPropertyList.length; nPropertyPos++) {
|
|
@@ -941,9 +973,9 @@ sap.ui.define([
|
|
|
941
973
|
};
|
|
942
974
|
|
|
943
975
|
//AST expression basic control for condition table
|
|
944
|
-
|
|
976
|
+
oDecisionTableSettings.prototype._getASTExpressionBasicForCondition = function (oContext) {
|
|
945
977
|
var that = this;
|
|
946
|
-
var oAstExpressionLanguage =
|
|
978
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
947
979
|
var sExpression = oContext.getProperty("Condition/Expression");
|
|
948
980
|
var displayExpression = this._getExpressionFromAstNodes(oContext);
|
|
949
981
|
|
|
@@ -1006,7 +1038,7 @@ sap.ui.define([
|
|
|
1006
1038
|
};
|
|
1007
1039
|
|
|
1008
1040
|
//AST expression basic control for predefined table
|
|
1009
|
-
|
|
1041
|
+
oDecisionTableSettings.prototype._getASTExpressionBasicForPredefined = function (oContext, expressionID, expression,
|
|
1010
1042
|
businessDataType, astNodes) {
|
|
1011
1043
|
var that = this;
|
|
1012
1044
|
var sAttributeId = "";
|
|
@@ -1026,8 +1058,8 @@ sap.ui.define([
|
|
|
1026
1058
|
if(expression && expression.relString) {
|
|
1027
1059
|
expression.relString = expression.relString.replace(/\\/g,"\\\\").replace(/{/g, "\\{").replace(/}/g, "\\}");
|
|
1028
1060
|
}
|
|
1029
|
-
var oAstExpressionLanguage =
|
|
1030
|
-
var sbusinessDataType = businessDataType ? businessDataType :
|
|
1061
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1062
|
+
var sbusinessDataType = businessDataType ? businessDataType : library.ExpressionType.NonComparison;
|
|
1031
1063
|
var astExpressionBasic = new AstExpressionBasic({
|
|
1032
1064
|
id: expressionID,
|
|
1033
1065
|
astExpressionLanguage: oAstExpressionLanguage,
|
|
@@ -1058,7 +1090,7 @@ sap.ui.define([
|
|
|
1058
1090
|
};
|
|
1059
1091
|
|
|
1060
1092
|
//Parses the nodes generated from astEL to form understandable by backend
|
|
1061
|
-
|
|
1093
|
+
oDecisionTableSettings.prototype._getASTNodes = function (astNodes, oContext) {
|
|
1062
1094
|
var modifiedNodes = []
|
|
1063
1095
|
for (var node in astNodes) {
|
|
1064
1096
|
var updatedAstNode = {};
|
|
@@ -1094,7 +1126,7 @@ sap.ui.define([
|
|
|
1094
1126
|
return modifiedNodes;
|
|
1095
1127
|
};
|
|
1096
1128
|
|
|
1097
|
-
|
|
1129
|
+
oDecisionTableSettings.prototype._getBindModelName = function () {
|
|
1098
1130
|
var path = "";
|
|
1099
1131
|
var modelName = this.getModelName();
|
|
1100
1132
|
if (modelName) {
|
|
@@ -1103,21 +1135,21 @@ sap.ui.define([
|
|
|
1103
1135
|
return path;
|
|
1104
1136
|
};
|
|
1105
1137
|
|
|
1106
|
-
|
|
1138
|
+
oDecisionTableSettings.prototype._getCellFormat = function () {
|
|
1107
1139
|
//Handling the valueOnly when the DecisionTableFormat is set to RuleFormat
|
|
1108
|
-
var sCellFormat = this.getProperty("cellFormat");
|
|
1140
|
+
//var sCellFormat = this.getProperty("cellFormat");
|
|
1109
1141
|
var sdecisionTableFormat = this.getProperty("decisionTableFormat");
|
|
1110
|
-
if (sdecisionTableFormat ===
|
|
1111
|
-
return (this.getModel().getData().RuleFormat ===
|
|
1142
|
+
if (sdecisionTableFormat === library.DecisionTableFormat.RuleFormat) {
|
|
1143
|
+
return (this.getModel().getData().RuleFormat === library.RuleFormat.Basic) ? true : false;
|
|
1112
1144
|
}
|
|
1113
|
-
return (sCellFormat !==
|
|
1145
|
+
//return (sCellFormat !== library.DecisionTableCellFormat.Text) ? true : false;
|
|
1114
1146
|
};
|
|
1115
1147
|
|
|
1116
1148
|
//structure definition for the visibility of columns. This will be a part of the settings model
|
|
1117
|
-
|
|
1118
|
-
var sCellFormat = this.getProperty("cellFormat");
|
|
1149
|
+
oDecisionTableSettings.prototype._getCellFormatAcccessOptions = function () {
|
|
1150
|
+
//var sCellFormat = this.getProperty("cellFormat");
|
|
1119
1151
|
var oCellFormatData = {
|
|
1120
|
-
CellFormat: sCellFormat,
|
|
1152
|
+
//CellFormat: sCellFormat,
|
|
1121
1153
|
cellFormatEnumration: [{
|
|
1122
1154
|
key: Constants.KEY_EDITABLE,
|
|
1123
1155
|
value: this.editableModeText
|
|
@@ -1129,7 +1161,7 @@ sap.ui.define([
|
|
|
1129
1161
|
return oCellFormatData;
|
|
1130
1162
|
};
|
|
1131
1163
|
|
|
1132
|
-
|
|
1164
|
+
/*oDecisionTableSettings.prototype._getCellFormatData = function () {
|
|
1133
1165
|
var sCellFormat = this.getProperty("cellFormat");
|
|
1134
1166
|
var oCellFormatData = {
|
|
1135
1167
|
CellFormat: sCellFormat,
|
|
@@ -1142,9 +1174,9 @@ sap.ui.define([
|
|
|
1142
1174
|
}]
|
|
1143
1175
|
};
|
|
1144
1176
|
return oCellFormatData;
|
|
1145
|
-
}
|
|
1177
|
+
};*/
|
|
1146
1178
|
|
|
1147
|
-
|
|
1179
|
+
oDecisionTableSettings.prototype._getColumnInputMode = function (bValueOnly) {
|
|
1148
1180
|
if (!bValueOnly) {
|
|
1149
1181
|
return this.oBundle.getText("advancedMode");
|
|
1150
1182
|
}
|
|
@@ -1152,14 +1184,14 @@ sap.ui.define([
|
|
|
1152
1184
|
};
|
|
1153
1185
|
|
|
1154
1186
|
//REL control for condition table
|
|
1155
|
-
|
|
1156
|
-
var oExpressionLanguage =
|
|
1187
|
+
oDecisionTableSettings.prototype._getExpressionAdvanceColumn = function (oBindingContext) {
|
|
1188
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1157
1189
|
|
|
1158
1190
|
return new ExpressionAdvanced({
|
|
1159
1191
|
expressionLanguage: oExpressionLanguage,
|
|
1160
1192
|
placeholder: this.oBundle.getText("expressionPlaceHolder"),
|
|
1161
1193
|
validateOnLoad: true,
|
|
1162
|
-
type:
|
|
1194
|
+
type: library.ExpressionType.NonComparison,
|
|
1163
1195
|
value: {
|
|
1164
1196
|
path: "Condition/Expression",
|
|
1165
1197
|
events: {
|
|
@@ -1198,7 +1230,7 @@ sap.ui.define([
|
|
|
1198
1230
|
});
|
|
1199
1231
|
};
|
|
1200
1232
|
|
|
1201
|
-
|
|
1233
|
+
oDecisionTableSettings.prototype._getExpressionFieldForCondition = function (oContext) {
|
|
1202
1234
|
var oControl;
|
|
1203
1235
|
//Check expressionlanguage type
|
|
1204
1236
|
if (this.getExpressionLanguage()) {
|
|
@@ -1209,7 +1241,7 @@ sap.ui.define([
|
|
|
1209
1241
|
return oControl;
|
|
1210
1242
|
};
|
|
1211
1243
|
|
|
1212
|
-
|
|
1244
|
+
oDecisionTableSettings.prototype._getExpressionFieldForPredefined = function (oContext, expressionID, expression,
|
|
1213
1245
|
businessDataType, astNodes) {
|
|
1214
1246
|
var oControl;
|
|
1215
1247
|
//Check expressionlanguage type
|
|
@@ -1221,9 +1253,9 @@ sap.ui.define([
|
|
|
1221
1253
|
return oControl;
|
|
1222
1254
|
};
|
|
1223
1255
|
|
|
1224
|
-
|
|
1256
|
+
oDecisionTableSettings.prototype._getExpressionFromAstNodes = function (oContext, astNodes) {
|
|
1225
1257
|
var that = this;
|
|
1226
|
-
var oAstExpressionLanguage =
|
|
1258
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1227
1259
|
var termsProvider = oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
|
|
1228
1260
|
var displayExpression = "";
|
|
1229
1261
|
var displayTermExpression = "";
|
|
@@ -1256,7 +1288,7 @@ sap.ui.define([
|
|
|
1256
1288
|
return displayExpression;
|
|
1257
1289
|
};
|
|
1258
1290
|
|
|
1259
|
-
|
|
1291
|
+
oDecisionTableSettings.prototype._getFixedOperatorDataForExpression = function (sExpression, bValueOnly, astControl) {
|
|
1260
1292
|
var fixOperatorEnabled = sExpression ? true : false;
|
|
1261
1293
|
var fixedOperatorData = {
|
|
1262
1294
|
fixOperatorEnumration: [{
|
|
@@ -1267,26 +1299,26 @@ sap.ui.define([
|
|
|
1267
1299
|
};
|
|
1268
1300
|
var oSuggestions = [];
|
|
1269
1301
|
if (this.getExpressionLanguage() && fixOperatorEnabled) {
|
|
1270
|
-
var oExpressionLanguage =
|
|
1302
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1271
1303
|
var oFilter;
|
|
1272
1304
|
if (!bValueOnly) {
|
|
1273
1305
|
oFilter = [{
|
|
1274
|
-
tokenType:
|
|
1275
|
-
tokenCategory:
|
|
1306
|
+
tokenType: library.ExpressionTokenType.reservedWord,
|
|
1307
|
+
tokenCategory: library.ExpressionCategory.comparisonOp
|
|
1276
1308
|
}, {
|
|
1277
|
-
tokenType:
|
|
1278
|
-
tokenCategory:
|
|
1309
|
+
tokenType: library.ExpressionTokenType.reservedWord,
|
|
1310
|
+
tokenCategory: library.ExpressionCategory.comparisonBetweenOp
|
|
1279
1311
|
}, {
|
|
1280
|
-
tokenType:
|
|
1281
|
-
tokenCategory:
|
|
1312
|
+
tokenType: library.ExpressionTokenType.reservedWord,
|
|
1313
|
+
tokenCategory: library.ExpressionCategory.comparisonExistOp
|
|
1282
1314
|
}];
|
|
1283
1315
|
} else {
|
|
1284
1316
|
oFilter = [{
|
|
1285
|
-
tokenType:
|
|
1286
|
-
tokenCategory:
|
|
1317
|
+
tokenType: library.ExpressionTokenType.reservedWord,
|
|
1318
|
+
tokenCategory: library.ExpressionCategory.comparisonOp
|
|
1287
1319
|
}, {
|
|
1288
|
-
tokenType:
|
|
1289
|
-
tokenCategory:
|
|
1320
|
+
tokenType: library.ExpressionTokenType.reservedWord,
|
|
1321
|
+
tokenCategory: library.ExpressionCategory.comparisonBetweenOp
|
|
1290
1322
|
}];
|
|
1291
1323
|
}
|
|
1292
1324
|
|
|
@@ -1359,7 +1391,7 @@ sap.ui.define([
|
|
|
1359
1391
|
return fixedOperatorData;
|
|
1360
1392
|
};
|
|
1361
1393
|
|
|
1362
|
-
|
|
1394
|
+
oDecisionTableSettings.prototype._getHitPoliciesData = function () {
|
|
1363
1395
|
var hitPolicy = this.getProperty("hitPolicies");
|
|
1364
1396
|
var length = hitPolicy.length;
|
|
1365
1397
|
var oHitPolicyData = {
|
|
@@ -1375,26 +1407,26 @@ sap.ui.define([
|
|
|
1375
1407
|
return oHitPolicyData;
|
|
1376
1408
|
};
|
|
1377
1409
|
|
|
1378
|
-
|
|
1379
|
-
if (sCellFormat !==
|
|
1410
|
+
/*oDecisionTableSettings.prototype._getInputModeEnabled = function (sCellFormat, bValueOnly) {
|
|
1411
|
+
if (sCellFormat !== library.DecisionTableCellFormat.Both || bValueOnly === false) {
|
|
1380
1412
|
return false;
|
|
1381
1413
|
}
|
|
1382
1414
|
return true;
|
|
1383
|
-
}
|
|
1415
|
+
};*/
|
|
1384
1416
|
|
|
1385
1417
|
//Rebinding predefined table when result is change or refresh event
|
|
1386
|
-
|
|
1418
|
+
oDecisionTableSettings.prototype._getLatestResultDataObjects = function (newResultDataObjectId) {
|
|
1387
1419
|
var that = this;
|
|
1388
1420
|
var oModel = that.getModel().getData();
|
|
1389
1421
|
var sProjectId = oModel.ProjectId;
|
|
1390
1422
|
var settingsModel = that.getModel("settingsModel");
|
|
1391
1423
|
var oExpressionLanguage;
|
|
1392
1424
|
if (this.getExpressionLanguage()) {
|
|
1393
|
-
oExpressionLanguage =
|
|
1425
|
+
oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1394
1426
|
} else {
|
|
1395
|
-
oExpressionLanguage =
|
|
1427
|
+
oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1396
1428
|
}
|
|
1397
|
-
var vocabularyModel = new
|
|
1429
|
+
var vocabularyModel = new ODataModel(oExpressionLanguage.getModel().sServiceUrl);
|
|
1398
1430
|
var sPath = "/DataObjects(VocabularyId='" + sProjectId + "',Id='" + newResultDataObjectId + "')";
|
|
1399
1431
|
//Resetting the path before reusing the factory function to load predefined results table
|
|
1400
1432
|
// Error mentioned in the CSN : 1880262342
|
|
@@ -1405,7 +1437,7 @@ sap.ui.define([
|
|
|
1405
1437
|
return that.oPredefinedTable;
|
|
1406
1438
|
};
|
|
1407
1439
|
|
|
1408
|
-
|
|
1440
|
+
oDecisionTableSettings.prototype._getMessageByResultUpdates = function (resultUpdates) {
|
|
1409
1441
|
var messageRefreshWillDelete = this.oBundle.getText("refreshingWillDeleteMsg");
|
|
1410
1442
|
var messageAreyouSure = this.oBundle.getText("refreshAreyouSureMsg");
|
|
1411
1443
|
var countChanges = resultUpdates.addedColumns.length + resultUpdates.changedColumns.length + resultUpdates.removedColumns.length;
|
|
@@ -1430,7 +1462,7 @@ sap.ui.define([
|
|
|
1430
1462
|
};
|
|
1431
1463
|
|
|
1432
1464
|
//REL control for predefined
|
|
1433
|
-
|
|
1465
|
+
oDecisionTableSettings.prototype._getPredefinedExpressionAdvanced = function (oContext, expressionID, expression,
|
|
1434
1466
|
businessDataType) {
|
|
1435
1467
|
var that = this;
|
|
1436
1468
|
var sAttributeId = "";
|
|
@@ -1438,8 +1470,8 @@ sap.ui.define([
|
|
|
1438
1470
|
if (oResultData && !sAttributeId) {
|
|
1439
1471
|
sAttributeId = oResultData.DataObjectAttributeId ? oResultData.DataObjectAttributeId : oResultData.Id;
|
|
1440
1472
|
}
|
|
1441
|
-
var oExpressionLanguage =
|
|
1442
|
-
var sbusinessDataType = businessDataType ? businessDataType :
|
|
1473
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1474
|
+
var sbusinessDataType = businessDataType ? businessDataType : library.ExpressionType.NonComparison;
|
|
1443
1475
|
|
|
1444
1476
|
return new ExpressionAdvanced({
|
|
1445
1477
|
expressionLanguage: oExpressionLanguage,
|
|
@@ -1458,12 +1490,12 @@ sap.ui.define([
|
|
|
1458
1490
|
});
|
|
1459
1491
|
};
|
|
1460
1492
|
|
|
1461
|
-
|
|
1493
|
+
oDecisionTableSettings.prototype._getResultsData = function () {
|
|
1462
1494
|
var oExpressionLanguage;
|
|
1463
1495
|
if (this.getAstExpressionLanguage()) {
|
|
1464
|
-
oExpressionLanguage =
|
|
1496
|
+
oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1465
1497
|
} else {
|
|
1466
|
-
oExpressionLanguage =
|
|
1498
|
+
oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1467
1499
|
}
|
|
1468
1500
|
var oResultsEnumration = [{
|
|
1469
1501
|
id: Constants.NO_RESULT,
|
|
@@ -1477,7 +1509,7 @@ sap.ui.define([
|
|
|
1477
1509
|
return oResultsData;
|
|
1478
1510
|
};
|
|
1479
1511
|
|
|
1480
|
-
|
|
1512
|
+
oDecisionTableSettings.prototype._getResultsUpdates = function (resultColumnsOld, resultColumnsNew) {
|
|
1481
1513
|
var addedColumns = [],
|
|
1482
1514
|
removedColumns = [],
|
|
1483
1515
|
changedColumns = [];
|
|
@@ -1524,7 +1556,7 @@ sap.ui.define([
|
|
|
1524
1556
|
};
|
|
1525
1557
|
|
|
1526
1558
|
//Read the existing visibility status from Odata
|
|
1527
|
-
|
|
1559
|
+
oDecisionTableSettings.prototype._getSelectedVisibilityStatus = function (sAccess) {
|
|
1528
1560
|
if (sAccess === this.hiddenModeText) {
|
|
1529
1561
|
return Constants.KEY_HIDDEN;
|
|
1530
1562
|
} else {
|
|
@@ -1532,12 +1564,12 @@ sap.ui.define([
|
|
|
1532
1564
|
}
|
|
1533
1565
|
};
|
|
1534
1566
|
|
|
1535
|
-
|
|
1567
|
+
oDecisionTableSettings.prototype._initServiceModel = function () {
|
|
1536
1568
|
var odataModel = this.getModel("oDataModel");
|
|
1537
1569
|
var sServiceURL = odataModel.sServiceUrl;
|
|
1538
|
-
var oModel = new
|
|
1570
|
+
var oModel = new ODataModel({
|
|
1539
1571
|
serviceUrl: sServiceURL,
|
|
1540
|
-
defaultBindingMode:
|
|
1572
|
+
defaultBindingMode: BindingMode.TwoWay
|
|
1541
1573
|
});
|
|
1542
1574
|
var model = oModel.getMetaModel();
|
|
1543
1575
|
if (model && model.oMetadata && model.oMetadata.bLoaded) {
|
|
@@ -1549,12 +1581,12 @@ sap.ui.define([
|
|
|
1549
1581
|
}
|
|
1550
1582
|
};
|
|
1551
1583
|
|
|
1552
|
-
|
|
1584
|
+
oDecisionTableSettings.prototype._initSettingsModel = function () {
|
|
1553
1585
|
var initialData = {};
|
|
1554
1586
|
initialData.hitPolicy = this._getHitPoliciesData();
|
|
1555
1587
|
initialData.tableData = {};
|
|
1556
1588
|
initialData.removeRowEnabled = false;
|
|
1557
|
-
initialData.cellFormat = this._getCellFormatData();
|
|
1589
|
+
//initialData.cellFormat = this._getCellFormatData();
|
|
1558
1590
|
initialData.accessOptions = this._getCellFormatAcccessOptions();
|
|
1559
1591
|
initialData.updateAllRows = false;
|
|
1560
1592
|
initialData.predefinedResults = [];
|
|
@@ -1562,13 +1594,13 @@ sap.ui.define([
|
|
|
1562
1594
|
initialData.resultAttributeChanged = false;
|
|
1563
1595
|
initialData.refreshButtonClicked = false;
|
|
1564
1596
|
initialData.results = this._getResultsData();
|
|
1565
|
-
this._internalModel = new
|
|
1597
|
+
this._internalModel = new JSONModel(initialData);
|
|
1566
1598
|
this.setModel(this._internalModel, "settingsModel");
|
|
1567
1599
|
this._initServiceModel();
|
|
1568
1600
|
};
|
|
1569
1601
|
|
|
1570
|
-
|
|
1571
|
-
var dialog = new
|
|
1602
|
+
oDecisionTableSettings.prototype._openWarningDialog = function (oSelect, oContext) {
|
|
1603
|
+
var dialog = new Dialog({
|
|
1572
1604
|
title: this.oBundle.getText("changeInputModeDialogTitle"),
|
|
1573
1605
|
width: "70%",
|
|
1574
1606
|
type: 'Message',
|
|
@@ -1602,7 +1634,7 @@ sap.ui.define([
|
|
|
1602
1634
|
};
|
|
1603
1635
|
|
|
1604
1636
|
// Factory function to display and control access options column
|
|
1605
|
-
|
|
1637
|
+
oDecisionTableSettings.prototype._predefinedFactory = function (sId, oContext) {
|
|
1606
1638
|
//basic display of predefinedResults reads from oContext
|
|
1607
1639
|
//colid is used only element. On refresh we wont get the Sequence, hence we use the name here
|
|
1608
1640
|
var expressionID = "exp" + sId;
|
|
@@ -1641,25 +1673,25 @@ sap.ui.define([
|
|
|
1641
1673
|
|
|
1642
1674
|
var sAccessKey = this._getSelectedVisibilityStatus(sSelectedKey);
|
|
1643
1675
|
|
|
1644
|
-
return new
|
|
1676
|
+
return new ColumnListItem({
|
|
1645
1677
|
visible: true,
|
|
1646
|
-
vAlign:
|
|
1678
|
+
vAlign: coreLibrary.VerticalAlign.Middle,
|
|
1647
1679
|
cells: [
|
|
1648
|
-
new
|
|
1680
|
+
new Label({
|
|
1649
1681
|
visible: true,
|
|
1650
|
-
design:
|
|
1682
|
+
design: mobileLibrary.LabelDesign.Standard,
|
|
1651
1683
|
text: displayText,
|
|
1652
1684
|
labelFor: expressionID,
|
|
1653
|
-
textAlign:
|
|
1654
|
-
textDirection:
|
|
1685
|
+
textAlign: coreLibrary.TextAlign.Begin,
|
|
1686
|
+
textDirection: coreLibrary.TextDirection.Inherit
|
|
1655
1687
|
}),
|
|
1656
1688
|
|
|
1657
|
-
new
|
|
1689
|
+
new Select({
|
|
1658
1690
|
width: "65%",
|
|
1659
1691
|
id: "select" + sId,
|
|
1660
1692
|
items: {
|
|
1661
1693
|
path: "settingsModel>/accessOptions/cellFormatEnumration",
|
|
1662
|
-
template: new
|
|
1694
|
+
template: new Item({
|
|
1663
1695
|
key: "{settingsModel>key}",
|
|
1664
1696
|
text: "{settingsModel>value}"
|
|
1665
1697
|
})
|
|
@@ -1673,18 +1705,18 @@ sap.ui.define([
|
|
|
1673
1705
|
|
|
1674
1706
|
this._getExpressionFieldForPredefined(oContext, expressionID, expression, businessDataType, astNodes),
|
|
1675
1707
|
|
|
1676
|
-
new
|
|
1708
|
+
new HorizontalLayout({
|
|
1677
1709
|
content: [
|
|
1678
|
-
new
|
|
1679
|
-
type:
|
|
1710
|
+
new Button({
|
|
1711
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
1680
1712
|
icon: "sap-icon://arrow-top",
|
|
1681
1713
|
visible: true,
|
|
1682
1714
|
press: function (oEvent) {
|
|
1683
1715
|
this._moveAttributePosition(oContext, Constants.UP);
|
|
1684
1716
|
}.bind(this)
|
|
1685
1717
|
}).setTooltip(this.oBundle.getText("MoveResultAttributeUP")),
|
|
1686
|
-
new
|
|
1687
|
-
type:
|
|
1718
|
+
new Button({
|
|
1719
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
1688
1720
|
icon: "sap-icon://arrow-bottom",
|
|
1689
1721
|
press: function (oEvent) {
|
|
1690
1722
|
this._moveAttributePosition(oContext, Constants.DOWN);
|
|
@@ -1696,7 +1728,7 @@ sap.ui.define([
|
|
|
1696
1728
|
});
|
|
1697
1729
|
};
|
|
1698
1730
|
|
|
1699
|
-
|
|
1731
|
+
oDecisionTableSettings.prototype._moveAttributePosition = function (oContext, sDirection) {
|
|
1700
1732
|
var settingsModel = this.getModel("settingsModel");
|
|
1701
1733
|
var settingsData = settingsModel.getData();
|
|
1702
1734
|
var oModel = this.getModel().getData();
|
|
@@ -1745,7 +1777,7 @@ sap.ui.define([
|
|
|
1745
1777
|
this.oPredefinedTable.setBusyIndicatorDelay(0);
|
|
1746
1778
|
};
|
|
1747
1779
|
|
|
1748
|
-
|
|
1780
|
+
oDecisionTableSettings.prototype._prepareNewRule = function () {
|
|
1749
1781
|
this._updateDecisionTableHeader();
|
|
1750
1782
|
this._createDefaultColumn();
|
|
1751
1783
|
//Set default result only in case of ABAP
|
|
@@ -1754,7 +1786,7 @@ sap.ui.define([
|
|
|
1754
1786
|
}
|
|
1755
1787
|
};
|
|
1756
1788
|
|
|
1757
|
-
|
|
1789
|
+
oDecisionTableSettings.prototype._removeColumnFromJsonModel = function (sequence, status) {
|
|
1758
1790
|
var displayModel = this.getModel();
|
|
1759
1791
|
var modelData = displayModel.getData();
|
|
1760
1792
|
var aColumns = modelData.DecisionTable.DecisionTableColumns.results;
|
|
@@ -1781,7 +1813,7 @@ sap.ui.define([
|
|
|
1781
1813
|
this._setDisplayModelData(modelData);
|
|
1782
1814
|
};
|
|
1783
1815
|
|
|
1784
|
-
|
|
1816
|
+
oDecisionTableSettings.prototype._ruleResultColumns = function () {
|
|
1785
1817
|
var currentColumns = this.getModel().oData.DecisionTable.DecisionTableColumns.results;
|
|
1786
1818
|
|
|
1787
1819
|
function isResult(currentColumn) {
|
|
@@ -1792,11 +1824,11 @@ sap.ui.define([
|
|
|
1792
1824
|
|
|
1793
1825
|
// if the user chooses the result col to be hidden, enable expression advanced or read from the existing Odata entry
|
|
1794
1826
|
// if the user chooses the result col to be editable, diable expression advanced and make it available in decision table
|
|
1795
|
-
|
|
1827
|
+
oDecisionTableSettings.prototype._setColumnAccessMode = function (oContext, oEvent) {
|
|
1796
1828
|
this.enableAccessValue = !this.enableAccessValue;
|
|
1797
1829
|
var cell = oEvent.oSource.sId.split("select")[1];
|
|
1798
1830
|
var updateCellID = "exp" + cell;
|
|
1799
|
-
this.expressionControl =
|
|
1831
|
+
this.expressionControl = Element.getElementById(updateCellID);
|
|
1800
1832
|
//var resultEntryNumber = oContext.getProperty("Sequence");
|
|
1801
1833
|
//resultEntryNumber = resultEntryNumber - 1;
|
|
1802
1834
|
this.getModel("settingsModel").setProperty("/resultAttributeChanged", true);
|
|
@@ -1822,7 +1854,7 @@ sap.ui.define([
|
|
|
1822
1854
|
"expId": expId
|
|
1823
1855
|
};
|
|
1824
1856
|
|
|
1825
|
-
var oEventBus =
|
|
1857
|
+
var oEventBus = EventBus.getInstance();
|
|
1826
1858
|
oEventBus.publish("sap.ui.rules", "_onHiddenSelected", obj);
|
|
1827
1859
|
this._updateResultAttributeJSON(oContext, Constants.HIDDEN, null, null, null, false, false, false);
|
|
1828
1860
|
} else {
|
|
@@ -1834,7 +1866,7 @@ sap.ui.define([
|
|
|
1834
1866
|
};
|
|
1835
1867
|
|
|
1836
1868
|
// Function to enable /disable Apply based on hidden attributes
|
|
1837
|
-
|
|
1869
|
+
oDecisionTableSettings.prototype._updateApplyBtnActions = function() {
|
|
1838
1870
|
if (this._internalModel) {
|
|
1839
1871
|
var predefinedResults = this._internalModel.oData.predefinedResults;
|
|
1840
1872
|
var hiddenAttributeWithNoExpression = false;
|
|
@@ -1852,14 +1884,14 @@ sap.ui.define([
|
|
|
1852
1884
|
}
|
|
1853
1885
|
}
|
|
1854
1886
|
if (hiddenAttributeWithNoExpression) {
|
|
1855
|
-
|
|
1887
|
+
Element.getElementById("ApplyBtn").setEnabled(false);
|
|
1856
1888
|
} else {
|
|
1857
|
-
|
|
1889
|
+
Element.getElementById("ApplyBtn").setEnabled(true);
|
|
1858
1890
|
}
|
|
1859
1891
|
}
|
|
1860
1892
|
};
|
|
1861
1893
|
|
|
1862
|
-
|
|
1894
|
+
oDecisionTableSettings.prototype._setDefaultResult = function () {
|
|
1863
1895
|
var _displayModel = this.getModel();
|
|
1864
1896
|
var modelData = _displayModel.getData();
|
|
1865
1897
|
var resultsEnumration = this._internalModel.getData().results.resultsEnumration;
|
|
@@ -1872,25 +1904,25 @@ sap.ui.define([
|
|
|
1872
1904
|
}
|
|
1873
1905
|
};
|
|
1874
1906
|
|
|
1875
|
-
|
|
1907
|
+
oDecisionTableSettings.prototype._setDisplayModelData = function (modelData) {
|
|
1876
1908
|
this.resultCounter = 0;
|
|
1877
1909
|
var displayModel = this.getModel();
|
|
1878
1910
|
displayModel.setData(modelData);
|
|
1879
1911
|
};
|
|
1880
1912
|
|
|
1881
|
-
|
|
1913
|
+
oDecisionTableSettings.prototype.setExpressionLanguage = function (oExpressionLanguage) {
|
|
1882
1914
|
this.setAssociation("expressionLanguage", oExpressionLanguage, true);
|
|
1883
1915
|
this._decisionTableHeaderSettingFormatter.setExpressionLanguage(oExpressionLanguage);
|
|
1884
1916
|
};
|
|
1885
1917
|
|
|
1886
|
-
|
|
1918
|
+
oDecisionTableSettings.prototype._setExpressionRelevantOperators = function (displayExpression, colId, bValueOnly,
|
|
1887
1919
|
astControl) {
|
|
1888
1920
|
var oFixedOperatorData = this._getFixedOperatorDataForExpression(displayExpression, bValueOnly, astControl);
|
|
1889
1921
|
this._internalModel.setProperty("/tableData/" + colId, oFixedOperatorData, false);
|
|
1890
1922
|
this._updateRemoveRowEnabled();
|
|
1891
1923
|
};
|
|
1892
1924
|
|
|
1893
|
-
|
|
1925
|
+
oDecisionTableSettings.prototype._tableColumnsFactory = function (sId, oContext) {
|
|
1894
1926
|
var that = this;
|
|
1895
1927
|
var colId = oContext.getProperty("Id");
|
|
1896
1928
|
var sequence = oContext.getProperty("Sequence");
|
|
@@ -1900,13 +1932,13 @@ sap.ui.define([
|
|
|
1900
1932
|
var fixedOperator = oContext.getProperty("Condition/FixedOperator");
|
|
1901
1933
|
var sOperator = this.getAstExpressionLanguage() ? this.astUtil._getCapitalOperatorName(fixedOperator) : fixedOperator;
|
|
1902
1934
|
|
|
1903
|
-
return new
|
|
1904
|
-
visible: type ===
|
|
1935
|
+
return new ColumnListItem({
|
|
1936
|
+
visible: type === library.DecisionTableColumn.Condition,
|
|
1905
1937
|
cells: [
|
|
1906
1938
|
// gets the expression col
|
|
1907
1939
|
this._getExpressionFieldForCondition(oContext),
|
|
1908
1940
|
|
|
1909
|
-
new
|
|
1941
|
+
new Input({
|
|
1910
1942
|
value: label,
|
|
1911
1943
|
maxLength: Constants.MAX_LABEL_LENGTH,
|
|
1912
1944
|
change: function (oEvent) {
|
|
@@ -1919,12 +1951,12 @@ sap.ui.define([
|
|
|
1919
1951
|
}),
|
|
1920
1952
|
|
|
1921
1953
|
// gets the vocab col
|
|
1922
|
-
new
|
|
1954
|
+
new Select({
|
|
1923
1955
|
width: "100%",
|
|
1924
1956
|
showSecondaryValues: true,
|
|
1925
1957
|
items: {
|
|
1926
1958
|
path: "settingsModel>/tableData/" + colId + "/fixOperatorEnumration",
|
|
1927
|
-
template: new
|
|
1959
|
+
template: new ListItem({
|
|
1928
1960
|
key: "{settingsModel>key}",
|
|
1929
1961
|
text: "{settingsModel>key}",
|
|
1930
1962
|
additionalText: "{settingsModel>value}"
|
|
@@ -1972,11 +2004,11 @@ sap.ui.define([
|
|
|
1972
2004
|
}.bind(this)
|
|
1973
2005
|
|
|
1974
2006
|
}),*/
|
|
1975
|
-
new
|
|
2007
|
+
new HorizontalLayout({
|
|
1976
2008
|
content: [
|
|
1977
|
-
new
|
|
1978
|
-
type:
|
|
1979
|
-
icon:
|
|
2009
|
+
new Button({
|
|
2010
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
2011
|
+
icon: IconPool.getIconURI("sys-cancel"),
|
|
1980
2012
|
visible: "{settingsModel>/removeRowEnabled}",
|
|
1981
2013
|
press: function (oEvent) {
|
|
1982
2014
|
//Clear tableData since the columns will be build again
|
|
@@ -1985,9 +2017,9 @@ sap.ui.define([
|
|
|
1985
2017
|
this._removeColumnFromJsonModel(sequence, status);
|
|
1986
2018
|
}.bind(this)
|
|
1987
2019
|
}).setTooltip(this.oBundle.getText("removeColumn")),
|
|
1988
|
-
new
|
|
1989
|
-
type:
|
|
1990
|
-
icon:
|
|
2020
|
+
new Button({
|
|
2021
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
2022
|
+
icon: IconPool.getIconURI("add"),
|
|
1991
2023
|
press: function (oEvent) {
|
|
1992
2024
|
//Add coulmn from JSON model
|
|
1993
2025
|
this._addColumnToJsonModel(sequence);
|
|
@@ -1999,23 +2031,23 @@ sap.ui.define([
|
|
|
1999
2031
|
}).addStyleClass("sapRULDecisionTableSettingsConditionRow");
|
|
2000
2032
|
};
|
|
2001
2033
|
|
|
2002
|
-
|
|
2034
|
+
oDecisionTableSettings.prototype._updateDecisionTableHeader = function () {
|
|
2003
2035
|
var _displayModel = this.getModel();
|
|
2004
2036
|
var oExpressionLanguage;
|
|
2005
2037
|
if (this.getAstExpressionLanguage()) {
|
|
2006
|
-
oExpressionLanguage =
|
|
2038
|
+
oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
2007
2039
|
} else {
|
|
2008
|
-
oExpressionLanguage =
|
|
2040
|
+
oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
2009
2041
|
}
|
|
2010
2042
|
var sExpressionLanguageVersion = oExpressionLanguage.getExpressionLanguageVersion();
|
|
2011
2043
|
var modelData = _displayModel.getData();
|
|
2012
2044
|
//Fullfill decisiontable header data
|
|
2013
|
-
modelData.Type =
|
|
2045
|
+
modelData.Type = library.RuleType.DecisionTable;
|
|
2014
2046
|
//modelData.RuleFormat = sap.rules.ui.RuleFormat.Advanced;
|
|
2015
2047
|
modelData.ExpressionLanguageVersion = sExpressionLanguageVersion;
|
|
2016
2048
|
};
|
|
2017
2049
|
|
|
2018
|
-
|
|
2050
|
+
oDecisionTableSettings.prototype._updateRefreshFlags = function (needRefresh, isEnabled, bRefreshed) {
|
|
2019
2051
|
this.getModel().getData().needToRefresh = needRefresh;
|
|
2020
2052
|
this.getModel("settingsModel").setProperty("/refreshButtonEnabled", isEnabled, null, true);
|
|
2021
2053
|
/////////////////// Non ABAP Requires Predefined results table. Hence, calling function import before Apply/////////
|
|
@@ -2023,7 +2055,7 @@ sap.ui.define([
|
|
|
2023
2055
|
this._callRefreshResultsFunctionImport();
|
|
2024
2056
|
};
|
|
2025
2057
|
|
|
2026
|
-
|
|
2058
|
+
oDecisionTableSettings.prototype._updateRemoveRowEnabled = function () {
|
|
2027
2059
|
//var columns = this.conditionsTable.getAggregation("items");
|
|
2028
2060
|
var columns = this.getModel().getProperty("/DecisionTable/DecisionTableColumns/results");
|
|
2029
2061
|
var visibleCounter = 0;
|
|
@@ -2038,7 +2070,7 @@ sap.ui.define([
|
|
|
2038
2070
|
};
|
|
2039
2071
|
|
|
2040
2072
|
//Updates the array of DataObjectAttributes with properties when result/AccessMode/Expression is changed
|
|
2041
|
-
|
|
2073
|
+
oDecisionTableSettings.prototype._updateResultAttributeJSON = function (
|
|
2042
2074
|
oContext, sAccessMode, sExpression, astNodes, bResultChanged, isRefreshed, isSequenceChanged) {
|
|
2043
2075
|
var sAttributeId = oContext.getProperty("DataObjectAttributeId") || oContext.getProperty("Id") || (oContext.DataObjectAttributeinfo ? oContext.DataObjectAttributeinfo.Id : undefined);
|
|
2044
2076
|
var sDataPath = "/predefinedResults/" + sAttributeId;
|
|
@@ -2145,7 +2177,7 @@ sap.ui.define([
|
|
|
2145
2177
|
|
|
2146
2178
|
};
|
|
2147
2179
|
|
|
2148
|
-
|
|
2180
|
+
oDecisionTableSettings.prototype.getButtons = function (oDialog) {
|
|
2149
2181
|
var aButtons = [];
|
|
2150
2182
|
//Create cancel button
|
|
2151
2183
|
var oCancelButton = new Button({
|
|
@@ -2156,7 +2188,7 @@ sap.ui.define([
|
|
|
2156
2188
|
}, this);
|
|
2157
2189
|
|
|
2158
2190
|
//Create apply button
|
|
2159
|
-
var oApplyBtn =
|
|
2191
|
+
var oApplyBtn = Element.getElementById("ApplyBtn");
|
|
2160
2192
|
if (!oApplyBtn) {
|
|
2161
2193
|
oApplyBtn = new Button({
|
|
2162
2194
|
text: this.oBundle.getText("applyChangesBtn"),
|
|
@@ -2166,7 +2198,7 @@ sap.ui.define([
|
|
|
2166
2198
|
|
|
2167
2199
|
oApplyBtn.attachPress(function () {
|
|
2168
2200
|
if (!this._applyButtonPressed) {
|
|
2169
|
-
|
|
2201
|
+
BusyIndicator.show();
|
|
2170
2202
|
this.multiHeaderFlag = false; //flag for calculate only once header span for multi header in columnFactory function
|
|
2171
2203
|
//In case of successfull apply, the oDialog is closed from the success callback
|
|
2172
2204
|
this._applySettingsModelChangesToOData(oDialog);
|
|
@@ -2179,8 +2211,8 @@ sap.ui.define([
|
|
|
2179
2211
|
return aButtons;
|
|
2180
2212
|
};
|
|
2181
2213
|
|
|
2182
|
-
|
|
2183
|
-
this.oBundle =
|
|
2214
|
+
oDecisionTableSettings.prototype.init = function () {
|
|
2215
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
2184
2216
|
this.editableModeText = Constants.EDITABLE;
|
|
2185
2217
|
this.hiddenModeText = Constants.HIDDEN;
|
|
2186
2218
|
this.needCreateLayout = true;
|
|
@@ -2208,7 +2240,7 @@ sap.ui.define([
|
|
|
2208
2240
|
|
|
2209
2241
|
};
|
|
2210
2242
|
|
|
2211
|
-
|
|
2243
|
+
oDecisionTableSettings.prototype.onBeforeRendering = function () {
|
|
2212
2244
|
this.mNextColumnId = this._calcNextColumnId();
|
|
2213
2245
|
if (this.firstLoad) {
|
|
2214
2246
|
this._initSettingsModel();
|
|
@@ -2238,7 +2270,7 @@ sap.ui.define([
|
|
|
2238
2270
|
};
|
|
2239
2271
|
|
|
2240
2272
|
//In case of reference object we will have attribues with ":" which should be replace by /
|
|
2241
|
-
|
|
2273
|
+
oDecisionTableSettings.prototype._formatAttributeId = function (attributeId) {
|
|
2242
2274
|
var formattedAttributeId = attributeId;
|
|
2243
2275
|
if(formattedAttributeId && formattedAttributeId.indexOf(":") > -1) {
|
|
2244
2276
|
formattedAttributeId = formattedAttributeId.replace(/:/g, "/");
|
|
@@ -2249,13 +2281,13 @@ sap.ui.define([
|
|
|
2249
2281
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2250
2282
|
////////////// Closure - this code is relevant only when pressing "apply" ////////////////////
|
|
2251
2283
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
2252
|
-
|
|
2284
|
+
oDecisionTableSettings.prototype._applySettingsModelChangesToOData = function (oDialog) {
|
|
2253
2285
|
var that = this;
|
|
2254
2286
|
var _oExpressionLanguage;
|
|
2255
2287
|
if (this.getExpressionLanguage()) {
|
|
2256
|
-
_oExpressionLanguage =
|
|
2288
|
+
_oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
2257
2289
|
} else {
|
|
2258
|
-
_oExpressionLanguage =
|
|
2290
|
+
_oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
2259
2291
|
}
|
|
2260
2292
|
var nextColumnId = this.mNextColumnId;
|
|
2261
2293
|
var oModel = this.getModel();
|
|
@@ -2418,7 +2450,7 @@ sap.ui.define([
|
|
|
2418
2450
|
RuleId: mConditionColumnData.RuleId,
|
|
2419
2451
|
Version: mConditionColumnData.Version,
|
|
2420
2452
|
Id: mConditionColumnData.Id,
|
|
2421
|
-
Type:
|
|
2453
|
+
Type: library.DecisionTableColumn.Condition,
|
|
2422
2454
|
Sequence: mSequence,
|
|
2423
2455
|
Label: mLabel
|
|
2424
2456
|
};
|
|
@@ -2439,7 +2471,7 @@ sap.ui.define([
|
|
|
2439
2471
|
/////////////////////////////////////////////_validateConditionColumns ////////////////////////////////////////////
|
|
2440
2472
|
var _validateConditionColumns = function (aSettingsModelColumns) {
|
|
2441
2473
|
var settingsModelColumn;
|
|
2442
|
-
var messageBundle =
|
|
2474
|
+
var messageBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
2443
2475
|
|
|
2444
2476
|
for (var i = 0; i < aSettingsModelColumns.length; i++) {
|
|
2445
2477
|
settingsModelColumn = aSettingsModelColumns[i];
|
|
@@ -2599,15 +2631,15 @@ sap.ui.define([
|
|
|
2599
2631
|
oDataModel.submitChanges({
|
|
2600
2632
|
groupId: changesGroupID.groupId,
|
|
2601
2633
|
success: function () {
|
|
2602
|
-
|
|
2603
|
-
oDialog.setState(
|
|
2634
|
+
BusyIndicator.hide();
|
|
2635
|
+
oDialog.setState(coreLibrary.ValueState.Success);
|
|
2604
2636
|
oDialog.close();
|
|
2605
2637
|
return;
|
|
2606
2638
|
}
|
|
2607
2639
|
});
|
|
2608
2640
|
} else {
|
|
2609
|
-
|
|
2610
|
-
oDialog.setState(
|
|
2641
|
+
BusyIndicator.hide();
|
|
2642
|
+
oDialog.setState(coreLibrary.ValueState.Success);
|
|
2611
2643
|
oDialog.close();
|
|
2612
2644
|
}
|
|
2613
2645
|
}
|
|
@@ -2616,9 +2648,9 @@ sap.ui.define([
|
|
|
2616
2648
|
};
|
|
2617
2649
|
|
|
2618
2650
|
var submitSuccess = function (batchRequestResponse) {
|
|
2619
|
-
var messageBundle =
|
|
2651
|
+
var messageBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
2620
2652
|
var foundErrorInBatch = false;
|
|
2621
|
-
|
|
2653
|
+
BusyIndicator.hide();
|
|
2622
2654
|
var batchResponseArray = batchRequestResponse.__batchResponses["0"].__changeResponses;
|
|
2623
2655
|
for (var responseEntry in batchResponseArray) {
|
|
2624
2656
|
if (batchResponseArray[responseEntry].message) {
|
|
@@ -2626,11 +2658,11 @@ sap.ui.define([
|
|
|
2626
2658
|
MessageBox.error(
|
|
2627
2659
|
errorMessage, {
|
|
2628
2660
|
title: messageBundle.getText("RequestFailedText"),
|
|
2629
|
-
actions: [
|
|
2661
|
+
actions: [MessageBox.Action.OK]
|
|
2630
2662
|
|
|
2631
2663
|
}
|
|
2632
2664
|
);
|
|
2633
|
-
oDialog.setState(
|
|
2665
|
+
oDialog.setState(coreLibrary.ValueState.Error);
|
|
2634
2666
|
foundErrorInBatch = true;
|
|
2635
2667
|
|
|
2636
2668
|
}
|
|
@@ -2640,13 +2672,13 @@ sap.ui.define([
|
|
|
2640
2672
|
if (bResultChanged) {
|
|
2641
2673
|
getDTColResults();
|
|
2642
2674
|
} else {
|
|
2643
|
-
|
|
2644
|
-
oDialog.setState(
|
|
2675
|
+
BusyIndicator.hide();
|
|
2676
|
+
oDialog.setState(coreLibrary.ValueState.Success);
|
|
2645
2677
|
oDialog.close();
|
|
2646
2678
|
}
|
|
2647
2679
|
}
|
|
2648
2680
|
if (!foundErrorInBatch) {
|
|
2649
|
-
|
|
2681
|
+
MessageToast.show(that.oBundle.getText("settingsApplySuccess"));
|
|
2650
2682
|
}
|
|
2651
2683
|
|
|
2652
2684
|
};
|
|
@@ -2666,7 +2698,7 @@ sap.ui.define([
|
|
|
2666
2698
|
RuleId: sRuleId,
|
|
2667
2699
|
Version: sVersion,
|
|
2668
2700
|
Id: nextColumnId,
|
|
2669
|
-
Type:
|
|
2701
|
+
Type: library.DecisionTableColumn.Result,
|
|
2670
2702
|
Sequence: nextSequence
|
|
2671
2703
|
};
|
|
2672
2704
|
|
|
@@ -2764,18 +2796,18 @@ sap.ui.define([
|
|
|
2764
2796
|
/*work around for CSN : 1880262342 - After Refresh of table type DO -sumbitChanges call is never made if there are no attributes
|
|
2765
2797
|
and no other changes are made in DT Settings*/
|
|
2766
2798
|
if (bRefreshed && this.attributeListEmpty) {
|
|
2767
|
-
oDialog.setState(
|
|
2768
|
-
|
|
2799
|
+
oDialog.setState(coreLibrary.ValueState.Success);
|
|
2800
|
+
BusyIndicator.hide();
|
|
2769
2801
|
oDialog.close();
|
|
2770
|
-
|
|
2802
|
+
MessageToast.show(this.oBundle.getText("settingsApplySuccess"));
|
|
2771
2803
|
return;
|
|
2772
2804
|
}
|
|
2773
2805
|
|
|
2774
2806
|
if (!isNeedToSubmitChanges && !bResultChanged && !bRefreshed && !bAttributeChanged) {
|
|
2775
|
-
oDialog.setState(
|
|
2776
|
-
|
|
2807
|
+
oDialog.setState(coreLibrary.ValueState.Success);
|
|
2808
|
+
BusyIndicator.hide();
|
|
2777
2809
|
oDialog.close();
|
|
2778
|
-
|
|
2810
|
+
MessageToast.show(this.oBundle.getText("settingsApplySuccess"));
|
|
2779
2811
|
}
|
|
2780
2812
|
|
|
2781
2813
|
};
|