@sapui5/sap.rules.ui 1.121.0 → 1.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/rules/ui/.library +1 -1
- package/src/sap/rules/ui/AstExpressionBasic.js +25 -18
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +6 -4
- package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +36 -34
- package/src/sap/rules/ui/BindingSpy.js +3 -4
- package/src/sap/rules/ui/DecisionTable.js +101 -74
- package/src/sap/rules/ui/DecisionTableCell.js +63 -33
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +17 -13
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +40 -32
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +21 -19
- package/src/sap/rules/ui/DecisionTableConfiguration.js +5 -6
- package/src/sap/rules/ui/DecisionTableRenderer.js +6 -5
- package/src/sap/rules/ui/DecisionTableSettings.js +254 -225
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +59 -59
- package/src/sap/rules/ui/ExpressionAdvanced.js +135 -111
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +17 -12
- package/src/sap/rules/ui/InstructionRenderer.js +1 -2
- package/src/sap/rules/ui/RuleBase.js +2 -3
- package/src/sap/rules/ui/RuleBuilder.js +23 -23
- package/src/sap/rules/ui/TextRule.js +70 -54
- package/src/sap/rules/ui/TextRuleConfiguration.js +2 -3
- package/src/sap/rules/ui/TextRuleSettings.js +133 -116
- package/src/sap/rules/ui/ast/autoComplete/AutoComplete.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +15 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +15 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +26 -17
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +75 -53
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +35 -23
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +93 -73
- package/src/sap/rules/ui/ast/util/AggregateFunctionDialog.js +172 -157
- package/src/sap/rules/ui/ast/util/LoopFunctionDialog.js +186 -163
- package/src/sap/rules/ui/ast/util/SelectFunctionDialog.js +205 -182
- package/src/sap/rules/ui/ast/util/utilsBase.js +85 -0
- package/src/sap/rules/ui/codemirror/addon/hint/show-hint.js +8 -4
- package/src/sap/rules/ui/i18n/messagebundle_ar.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_cnr.properties +34 -34
- package/src/sap/rules/ui/i18n/messagebundle_en_US_saprigi.properties +285 -285
- package/src/sap/rules/ui/i18n/messagebundle_hu.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_mk.properties +3 -3
- package/src/sap/rules/ui/i18n/messagebundle_sh.properties +88 -88
- package/src/sap/rules/ui/i18n/messagebundle_uk.properties +5 -5
- package/src/sap/rules/ui/library.js +6 -6
- package/src/sap/rules/ui/parser/businessLanguage/lib/IDPParser.js +115 -114
- package/src/sap/rules/ui/parser/businessLanguage/lib/antlr3_all_min.js +4 -4
- package/src/sap/rules/ui/parser/businessLanguage/lib/autoCompleteUtils.js +4 -3
- package/src/sap/rules/ui/parser/businessLanguage/lib/conversionUtils.js +10 -6
- package/src/sap/rules/ui/parser/businessLanguage/lib/entityModel.js +8 -7
- package/src/sap/rules/ui/parser/businessLanguage/lib/entityModelConstractor.js +17 -16
- package/src/sap/rules/ui/parser/businessLanguage/lib/parsingBackendMediator.js +10 -9
- package/src/sap/rules/ui/parser/businessLanguage/lib/termsUtils.js +4 -3
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_cnr.properties +57 -57
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_en_US_saprigi.properties +210 -210
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_mk.properties +1 -1
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sh.properties +90 -90
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sr.properties +1 -1
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_uk.properties +2 -2
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_cnr.properties +19 -19
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_en_US_saprigi.properties +26 -26
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_mk.properties +2 -2
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_sh.properties +26 -26
- package/src/sap/rules/ui/parser/infrastructure/errorHandling/hrfException.js +3 -3
- package/src/sap/rules/ui/parser/infrastructure/locale/lib/resourceBundleContext.js +4 -3
- package/src/sap/rules/ui/parser/infrastructure/messageHandling/lib/responseCollector.js +8 -7
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBody.js +8 -7
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyConvertor.js +4 -3
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyValidator.js +9 -8
- package/src/sap/rules/ui/providers/ValueHelpDialogProvider.js +63 -46
- package/src/sap/rules/ui/providers/ValueHelpProvider.js +8 -7
- package/src/sap/rules/ui/services/AstExpressionLanguage.js +12 -10
- package/src/sap/rules/ui/services/ExpressionLanguage.js +89 -83
- package/src/sap/rules/ui/type/DecisionTableCell.js +2 -2
- package/src/sap/rules/ui/type/DecisionTableHeader.js +3 -3
- package/src/sap/rules/ui/type/Expression.js +3 -3
- package/src/sap/rules/ui/type/ExpressionAbs.js +5 -5
|
@@ -3,14 +3,33 @@ sap.ui.define([
|
|
|
3
3
|
"sap/m/List",
|
|
4
4
|
"sap/ui/model/json/JSONModel",
|
|
5
5
|
"sap/rules/ui/ast/constants/Constants",
|
|
6
|
-
"sap/rules/ui/parser/infrastructure/util/utilsBase"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"sap/rules/ui/parser/infrastructure/util/utilsBase",
|
|
7
|
+
"sap/rules/ui/ast/util/utilsBase",
|
|
8
|
+
"sap/m/Select",
|
|
9
|
+
"sap/ui/layout/GridData",
|
|
10
|
+
"sap/ui/core/ListItem",
|
|
11
|
+
"sap/m/ColumnListItem",
|
|
12
|
+
"sap/ui/layout/HorizontalLayout",
|
|
13
|
+
"sap/m/library",
|
|
14
|
+
"sap/m/Button",
|
|
15
|
+
"sap/ui/core/IconPool",
|
|
16
|
+
"sap/m/TextArea",
|
|
17
|
+
"sap/m/Table",
|
|
18
|
+
"sap/m/Column",
|
|
19
|
+
/*"sap/ui/layout/form/GridContainerData",*/
|
|
20
|
+
"sap/m/Text",
|
|
21
|
+
"sap/ui/layout/form/SimpleForm",
|
|
22
|
+
"sap/m/Label",
|
|
23
|
+
"sap/m/Dialog",
|
|
24
|
+
"sap/ui/core/Lib",
|
|
25
|
+
"sap/ui/core/Element"
|
|
26
|
+
], function (Control, List, JSONModel, Constants, infraUtils, utilsBase, Select,GridData, ListItem, ColumnListItem, HorizontalLayout, mobileLibrary, Button, IconPool, TextArea, Table,
|
|
27
|
+
Column,/*GridContainerData,*/ Text, SimpleForm, Label, Dialog, coreLib, Element) {
|
|
9
28
|
"use strict";
|
|
10
29
|
|
|
11
30
|
var instance;
|
|
12
31
|
var SelectFunctionDialog = function () {
|
|
13
|
-
this.oBundle =
|
|
32
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
14
33
|
this.functionLabelDisplay = "";
|
|
15
34
|
this.functionLabel = "";
|
|
16
35
|
this._selectFunctionSelected = "";
|
|
@@ -61,14 +80,14 @@ sap.ui.define([
|
|
|
61
80
|
SelectFunctionDialog.prototype._createFunctionSelectionDropDown = function (selectFunction, sAriaValue) {
|
|
62
81
|
var that = this;
|
|
63
82
|
selectFunction = this._filterSelectFunction(selectFunction);
|
|
64
|
-
var model = new
|
|
83
|
+
var model = new JSONModel(selectFunction);
|
|
65
84
|
|
|
66
|
-
this.functionSelect = new
|
|
85
|
+
this.functionSelect = new Select({
|
|
67
86
|
width: "200px",
|
|
68
87
|
selectedKey: this._selectFunctionSelected,
|
|
69
88
|
forceSelection: false,
|
|
70
89
|
showSecondaryValues: true,
|
|
71
|
-
layoutData: new
|
|
90
|
+
layoutData: new GridData({
|
|
72
91
|
span: "L3 M3 S12"
|
|
73
92
|
}),
|
|
74
93
|
ariaLabelledBy: sAriaValue,
|
|
@@ -108,7 +127,7 @@ sap.ui.define([
|
|
|
108
127
|
this.functionSelect.bindItems({
|
|
109
128
|
path: "/selection",
|
|
110
129
|
//sorter : new sap.ui.model.Sorter("lastName"),
|
|
111
|
-
template: new
|
|
130
|
+
template: new ListItem({
|
|
112
131
|
text: "{name}",
|
|
113
132
|
key: "{name}",
|
|
114
133
|
additionalText: "{label}"
|
|
@@ -118,9 +137,9 @@ sap.ui.define([
|
|
|
118
137
|
return this.functionSelect;
|
|
119
138
|
};
|
|
120
139
|
|
|
121
|
-
SelectFunctionDialog.prototype._getAttributeAstExpressionBasic = function (sAriaValue) {
|
|
140
|
+
SelectFunctionDialog.prototype._getAttributeAstExpressionBasic = function (sAriaValue, AstExpressionBasic) {
|
|
122
141
|
var that = this;
|
|
123
|
-
this.astExpressionBasicForAttribute = new
|
|
142
|
+
this.astExpressionBasicForAttribute = new AstExpressionBasic({
|
|
124
143
|
astExpressionLanguage: this._oAstExpressionLanguage,
|
|
125
144
|
enableAggregateFunctionWhereClause: true,
|
|
126
145
|
value: "{attributeSelected}",
|
|
@@ -174,15 +193,15 @@ sap.ui.define([
|
|
|
174
193
|
return false;
|
|
175
194
|
};
|
|
176
195
|
|
|
177
|
-
SelectFunctionDialog.prototype._tableColumnsFactory = function (
|
|
196
|
+
SelectFunctionDialog.prototype._tableColumnsFactory = function (AstExpressionBasic) {
|
|
178
197
|
var that = this;
|
|
179
|
-
var itemTemplate = new
|
|
180
|
-
cells: [that._getAttributeAstExpressionBasic("selectAttributeLabelId" + that.selectLabelUUID),
|
|
181
|
-
new
|
|
198
|
+
var itemTemplate = new ColumnListItem({
|
|
199
|
+
cells: [that._getAttributeAstExpressionBasic("selectAttributeLabelId" + that.selectLabelUUID, AstExpressionBasic),
|
|
200
|
+
new Select({
|
|
182
201
|
enabled: "{/enabledData/enabled}",
|
|
183
202
|
items: {
|
|
184
203
|
path: "/sortOrder",
|
|
185
|
-
template: new
|
|
204
|
+
template: new ListItem({
|
|
186
205
|
key: '{name}',
|
|
187
206
|
text: '{label}'
|
|
188
207
|
})
|
|
@@ -196,11 +215,11 @@ sap.ui.define([
|
|
|
196
215
|
width: '200px',
|
|
197
216
|
tooltip: that.oBundle.getText("sort_attributes_tooltip"),
|
|
198
217
|
}).addStyleClass("sapAstExpressionDialogField sapAstExpressionSortSelect"),
|
|
199
|
-
new
|
|
218
|
+
new HorizontalLayout({
|
|
200
219
|
content: [
|
|
201
|
-
new
|
|
202
|
-
type:
|
|
203
|
-
icon:
|
|
220
|
+
new Button({
|
|
221
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
222
|
+
icon: IconPool.getIconURI("sys-cancel"),
|
|
204
223
|
visible: "{cancelButton}",
|
|
205
224
|
enabled: "{/enabledData/enabled}",
|
|
206
225
|
press: function (oEvent) {
|
|
@@ -213,9 +232,9 @@ sap.ui.define([
|
|
|
213
232
|
|
|
214
233
|
}.bind(this)
|
|
215
234
|
}),
|
|
216
|
-
new
|
|
217
|
-
type:
|
|
218
|
-
icon:
|
|
235
|
+
new Button({
|
|
236
|
+
type: mobileLibrary.ButtonType.Transparent,
|
|
237
|
+
icon: IconPool.getIconURI("add"),
|
|
219
238
|
visible: "{addButton}",
|
|
220
239
|
enabled: "{/enabledData/enabled}",
|
|
221
240
|
press: function (oEvent) {
|
|
@@ -288,14 +307,14 @@ sap.ui.define([
|
|
|
288
307
|
var that = this;
|
|
289
308
|
var autoSuggestion = this._getSuggestionsForTheGivenInput("");
|
|
290
309
|
var aDataObject = autoSuggestion.autoComplete.categories;
|
|
291
|
-
var model = new
|
|
310
|
+
var model = new JSONModel(aDataObject);
|
|
292
311
|
|
|
293
|
-
this.vocabularySelect = new
|
|
312
|
+
this.vocabularySelect = new Select({
|
|
294
313
|
width: "200px",
|
|
295
314
|
selectedKey: this.dataObjectIdSelected,
|
|
296
315
|
forceSelection: false,
|
|
297
316
|
ariaLabelledBy: sAriaValue,
|
|
298
|
-
layoutData: new
|
|
317
|
+
layoutData: new GridData({
|
|
299
318
|
span: "L3 M3 S12"
|
|
300
319
|
}),
|
|
301
320
|
change: function (oEvent) {
|
|
@@ -344,7 +363,7 @@ sap.ui.define([
|
|
|
344
363
|
this.vocabularySelect.bindItems({
|
|
345
364
|
path: "/terms",
|
|
346
365
|
//sorter : new sap.ui.model.Sorter("lastName"),
|
|
347
|
-
template: new
|
|
366
|
+
template: new ListItem({
|
|
348
367
|
text: "{label}",
|
|
349
368
|
key: "{id}"
|
|
350
369
|
})
|
|
@@ -352,7 +371,7 @@ sap.ui.define([
|
|
|
352
371
|
// Add Rules to the same path so that the dataobjects list contain rules as well
|
|
353
372
|
var vocabularyRules = autoSuggestion.autoComplete.categories.vocabularyRules;
|
|
354
373
|
for(var entry in vocabularyRules){
|
|
355
|
-
var item = new
|
|
374
|
+
var item = new ListItem({
|
|
356
375
|
text: vocabularyRules[entry].label,
|
|
357
376
|
key: vocabularyRules[entry].id
|
|
358
377
|
})
|
|
@@ -365,7 +384,7 @@ sap.ui.define([
|
|
|
365
384
|
|
|
366
385
|
SelectFunctionDialog.prototype._bindAttributes = function () {
|
|
367
386
|
/*if (this.dataObjectId) {*/
|
|
368
|
-
this.oModel = new
|
|
387
|
+
this.oModel = new JSONModel();
|
|
369
388
|
this.oModel.setData({
|
|
370
389
|
sortOrder: this.sortOrder,
|
|
371
390
|
selectionData: this.selectedData,
|
|
@@ -384,9 +403,9 @@ sap.ui.define([
|
|
|
384
403
|
this.conditionsTable.setModel(this.oModel);
|
|
385
404
|
}*/
|
|
386
405
|
};
|
|
387
|
-
SelectFunctionDialog.prototype._createWhereAstExpressionBasic = function (sAriaValue) {
|
|
406
|
+
SelectFunctionDialog.prototype._createWhereAstExpressionBasic = function (sAriaValue, AstExpressionBasic) {
|
|
388
407
|
var that = this;
|
|
389
|
-
this.astExpressionBasicForWhere = new
|
|
408
|
+
this.astExpressionBasicForWhere = new AstExpressionBasic({
|
|
390
409
|
astExpressionLanguage: this._oAstExpressionLanguage,
|
|
391
410
|
enableAggregateFunctionWhereClause: true,
|
|
392
411
|
value: this._whereExpressionId,
|
|
@@ -409,7 +428,7 @@ sap.ui.define([
|
|
|
409
428
|
}
|
|
410
429
|
};
|
|
411
430
|
SelectFunctionDialog.prototype._createFunctionLabel = function () {
|
|
412
|
-
this.functionLabelField = new
|
|
431
|
+
this.functionLabelField = new TextArea({
|
|
413
432
|
value: this.functionLabelDisplay,
|
|
414
433
|
enabled: false,
|
|
415
434
|
width: "100%"
|
|
@@ -453,31 +472,31 @@ sap.ui.define([
|
|
|
453
472
|
};
|
|
454
473
|
}
|
|
455
474
|
|
|
456
|
-
SelectFunctionDialog.prototype._createTable = function () {
|
|
475
|
+
SelectFunctionDialog.prototype._createTable = function (AstExpressionBasic) {
|
|
457
476
|
var that = this;
|
|
458
|
-
this.conditionsTable = new
|
|
459
|
-
backgroundDesign:
|
|
460
|
-
showSeparators:
|
|
461
|
-
layoutData: new sap.ui.layout.form.GridContainerData({
|
|
477
|
+
this.conditionsTable = new Table({
|
|
478
|
+
backgroundDesign: mobileLibrary.BackgroundDesign.Solid,
|
|
479
|
+
showSeparators: mobileLibrary.ListSeparators.None,
|
|
480
|
+
/*layoutData: new sap.ui.layout.form.GridContainerData({
|
|
462
481
|
halfGrid: false
|
|
463
|
-
})
|
|
482
|
+
}),*/
|
|
464
483
|
columns: [
|
|
465
|
-
new
|
|
484
|
+
new Column({
|
|
466
485
|
width: "50%"
|
|
467
486
|
}).setStyleClass("sapAstAttributeColumn"),
|
|
468
487
|
|
|
469
|
-
new
|
|
488
|
+
new Column({
|
|
470
489
|
width: "25%"
|
|
471
490
|
}).setStyleClass("sapAstSortColumn"),
|
|
472
491
|
|
|
473
|
-
new
|
|
492
|
+
new Column({
|
|
474
493
|
width: "20%"
|
|
475
494
|
})
|
|
476
495
|
]
|
|
477
496
|
}).addStyleClass("sapAstAttributeTable");
|
|
478
497
|
|
|
479
498
|
this._bindAttributes();
|
|
480
|
-
var itemTemplate = that._tableColumnsFactory();
|
|
499
|
+
var itemTemplate = that._tableColumnsFactory(AstExpressionBasic);
|
|
481
500
|
this.conditionsTable.bindItems("/selectionData", itemTemplate);
|
|
482
501
|
|
|
483
502
|
return this.conditionsTable;
|
|
@@ -485,11 +504,11 @@ sap.ui.define([
|
|
|
485
504
|
|
|
486
505
|
SelectFunctionDialog.prototype._createCountField = function (sAriaValue) {
|
|
487
506
|
var that = this;
|
|
488
|
-
this._countField = new
|
|
507
|
+
this._countField = new TextArea({
|
|
489
508
|
value: that._count,
|
|
490
509
|
enabled: this.enableCountField,
|
|
491
510
|
ariaLabelledBy: sAriaValue,
|
|
492
|
-
layoutData: new
|
|
511
|
+
layoutData: new GridData({
|
|
493
512
|
span: "L1 M1 S12"
|
|
494
513
|
}),
|
|
495
514
|
change: function (oEvent) {
|
|
@@ -532,150 +551,154 @@ sap.ui.define([
|
|
|
532
551
|
this._clearData();
|
|
533
552
|
//create a uuid and append to the existing id to enable Select within Select as the Id becomes duplicate.
|
|
534
553
|
this.selectLabelUUID = this._createUUId();
|
|
535
|
-
this.oBundle =
|
|
554
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
536
555
|
this._oAstExpressionLanguage = AstExpressionLanguage;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
556
|
+
sap.ui.require([
|
|
557
|
+
"sap/rules/ui/AstExpressionBasic"
|
|
558
|
+
], (AstExpressionBasic) => {
|
|
559
|
+
if (jsonData) {
|
|
560
|
+
this._selectFunctionSelected = jsonData.function;
|
|
561
|
+
this._whereExpressionId = jsonData.filter;
|
|
562
|
+
this.dataObjectId = jsonData.dataObject;
|
|
563
|
+
this.functionLabel = jsonData.functionLabel;
|
|
564
|
+
this.dataObjectIdSelected = jsonData.dataObject.replace("/", "");
|
|
565
|
+
this.attributeJson = jsonData.attributes;
|
|
566
|
+
if (jsonData.count) {
|
|
567
|
+
this._count = jsonData.count;
|
|
568
|
+
this.enableCountField = true;
|
|
569
|
+
}
|
|
570
|
+
that.functionLabelDisplay = this._convertFunctionLabelToText(jsonData.dataObject, jsonData.functionLabel);;
|
|
571
|
+
if (this.dataObjectId) {
|
|
572
|
+
var dataObjectWithCommonInfo = this._returnDataObjectBasedOnCommonAssociationoReferenceSelection(jsonData.doVocabId, jsonData.attributes);
|
|
573
|
+
this.attributeJson = this._addTableIdFromAttribute(jsonData.attributes, dataObjectWithCommonInfo, this.dataObjectId);
|
|
574
|
+
this.dataObjectIdData.dataObjectId = this.dataObjectId;
|
|
575
|
+
this.enabledData.enabled = true;
|
|
576
|
+
this.termsProvider = this._oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
|
|
577
|
+
this.dataObjectLabel = this.termsProvider.getTermNameFromASTNodeReference(this.dataObjectId);
|
|
578
|
+
}
|
|
579
|
+
if (!jQuery.isEmptyObject(this.attributeJson)) {
|
|
580
|
+
this.selectedData = [];
|
|
581
|
+
for (var key in this.attributeJson) {
|
|
582
|
+
var newjson = {
|
|
583
|
+
attributeSelected: "",
|
|
584
|
+
sortOrder: Constants.NOSORT,
|
|
585
|
+
cancelButton: true,
|
|
586
|
+
addButton: true,
|
|
587
|
+
}
|
|
588
|
+
newjson.attributeSelected = key;
|
|
589
|
+
newjson.sortOrder = this.attributeJson[key];
|
|
590
|
+
this.selectedData.push(newjson);
|
|
591
|
+
sequence++;
|
|
592
|
+
}
|
|
593
|
+
if (sequence === 1) {
|
|
594
|
+
this.selectedData[0].cancelButton = false;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (this._selectFunctionSelected === Constants.SELECT) {
|
|
598
|
+
this.enableCountField = false;
|
|
599
|
+
}
|
|
580
600
|
|
|
581
|
-
|
|
582
|
-
var countText = new sap.m.Text({
|
|
583
|
-
text: "Count",
|
|
584
|
-
tooltip: "Count",
|
|
585
|
-
textAlign: "End",
|
|
586
|
-
layoutData: new sap.ui.layout.GridData({
|
|
587
|
-
span: "L1 M1 S12"
|
|
588
|
-
})
|
|
589
|
-
});
|
|
590
|
-
var oVocabularyText = new sap.m.Text({
|
|
591
|
-
text: that.oBundle.getText("vocabulary"),
|
|
592
|
-
tooltip: that.oBundle.getText("vocabulary"),
|
|
593
|
-
textAlign: "End",
|
|
594
|
-
layoutData: new sap.ui.layout.GridData({
|
|
595
|
-
span: "L2 M2 S12"
|
|
596
|
-
})
|
|
597
|
-
});
|
|
598
|
-
var attributeTable = that._createTable();
|
|
599
|
-
var oWhereControl = that._createWhereAstExpressionBasic("selectWhereLabelId" + that.selectLabelUUID);
|
|
600
|
-
var oFunctionLabelControl = that._createFunctionLabel();
|
|
601
|
-
|
|
602
|
-
var verticalLayoutForSelectFunction = new sap.ui.layout.form.SimpleForm({
|
|
603
|
-
layout: sap.ui.layout.form.SimpleFormLayout.ResponsiveGridLayout,
|
|
604
|
-
editable: true,
|
|
605
|
-
content: [
|
|
606
|
-
new sap.m.Label("selectFunctionSelectionLabelId" + that.selectLabelUUID ,{
|
|
607
|
-
text: that.oBundle.getText("function"),
|
|
608
|
-
tooltip: that.oBundle.getText("function"),
|
|
609
|
-
labelFor: functionSelect.getId()
|
|
610
|
-
}), functionSelect,
|
|
611
|
-
countText,
|
|
612
|
-
that._createCountField(countText.getId()),
|
|
613
|
-
oVocabularyText,
|
|
614
|
-
that._createDataObjectDropDown(oVocabularyText.getId()),
|
|
615
|
-
|
|
616
|
-
new sap.m.Label("selectAttributeLabelId" + that.selectLabelUUID ,{
|
|
617
|
-
text: that.oBundle.getText("attributes"),
|
|
618
|
-
tooltip: that.oBundle.getText("attributes"),
|
|
619
|
-
labelFor: attributeTable.getId()
|
|
620
|
-
}).addStyleClass("sapAstAttributeLabel"),
|
|
621
|
-
attributeTable,
|
|
622
|
-
new sap.m.Label("selectWhereLabelId" + that.selectLabelUUID,{
|
|
623
|
-
text: that.oBundle.getText("where"),
|
|
624
|
-
tooltip: that.oBundle.getText("where"),
|
|
625
|
-
labelFor: oWhereControl.getId()
|
|
626
|
-
}),
|
|
627
|
-
oWhereControl,
|
|
628
|
-
new sap.m.Label({
|
|
629
|
-
text: that.oBundle.getText("function_label"),
|
|
630
|
-
tooltip: that.oBundle.getText("function_label"),
|
|
631
|
-
labelFor: oFunctionLabelControl.getId()
|
|
632
|
-
}),
|
|
633
|
-
oFunctionLabelControl
|
|
634
|
-
]
|
|
635
|
-
});
|
|
601
|
+
}
|
|
636
602
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
603
|
+
var functionSelect = that._createFunctionSelectionDropDown(data,"selectFunctionSelectionLabelId", + that.selectLabelUUID);
|
|
604
|
+
var countText = new Text({
|
|
605
|
+
text: "Count",
|
|
606
|
+
tooltip: "Count",
|
|
607
|
+
textAlign: "End",
|
|
608
|
+
layoutData: new GridData({
|
|
609
|
+
span: "L1 M1 S12"
|
|
610
|
+
})
|
|
611
|
+
});
|
|
612
|
+
var oVocabularyText = new Text({
|
|
613
|
+
text: that.oBundle.getText("vocabulary"),
|
|
614
|
+
tooltip: that.oBundle.getText("vocabulary"),
|
|
615
|
+
textAlign: "End",
|
|
616
|
+
layoutData: new GridData({
|
|
617
|
+
span: "L2 M2 S12"
|
|
618
|
+
})
|
|
619
|
+
});
|
|
620
|
+
var attributeTable = that._createTable(AstExpressionBasic);
|
|
621
|
+
var oWhereControl = that._createWhereAstExpressionBasic("selectWhereLabelId" + that.selectLabelUUID, AstExpressionBasic);
|
|
622
|
+
var oFunctionLabelControl = that._createFunctionLabel();
|
|
623
|
+
|
|
624
|
+
var verticalLayoutForSelectFunction = new SimpleForm({
|
|
625
|
+
layout: "ResponsiveGridLayout",
|
|
626
|
+
editable: true,
|
|
627
|
+
content: [
|
|
628
|
+
new Label("selectFunctionSelectionLabelId" + that.selectLabelUUID ,{
|
|
629
|
+
text: that.oBundle.getText("function"),
|
|
630
|
+
tooltip: that.oBundle.getText("function"),
|
|
631
|
+
labelFor: functionSelect.getId()
|
|
632
|
+
}), functionSelect,
|
|
633
|
+
countText,
|
|
634
|
+
that._createCountField(countText.getId()),
|
|
635
|
+
oVocabularyText,
|
|
636
|
+
that._createDataObjectDropDown(oVocabularyText.getId(), AstExpressionBasic),
|
|
637
|
+
|
|
638
|
+
new Label("selectAttributeLabelId" + that.selectLabelUUID ,{
|
|
639
|
+
text: that.oBundle.getText("attributes"),
|
|
640
|
+
tooltip: that.oBundle.getText("attributes"),
|
|
641
|
+
labelFor: attributeTable.getId()
|
|
642
|
+
}).addStyleClass("sapAstAttributeLabel"),
|
|
643
|
+
attributeTable,
|
|
644
|
+
new Label("selectWhereLabelId" + that.selectLabelUUID,{
|
|
645
|
+
text: that.oBundle.getText("where"),
|
|
646
|
+
tooltip: that.oBundle.getText("where"),
|
|
647
|
+
labelFor: oWhereControl.getId()
|
|
648
|
+
}),
|
|
649
|
+
oWhereControl,
|
|
650
|
+
new Label({
|
|
651
|
+
text: that.oBundle.getText("function_label"),
|
|
652
|
+
tooltip: that.oBundle.getText("function_label"),
|
|
653
|
+
labelFor: oFunctionLabelControl.getId()
|
|
654
|
+
}),
|
|
655
|
+
oFunctionLabelControl
|
|
656
|
+
]
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
var selectFunctionsDialog = new Dialog({
|
|
660
|
+
title: this.oBundle.getText("selectFunctionTitle"),
|
|
661
|
+
contentWidth: "800px",
|
|
662
|
+
showHeader: true,
|
|
663
|
+
draggable: true,
|
|
664
|
+
beforeClose: function () {
|
|
665
|
+
dialogOpenedCallbackReference(false);
|
|
666
|
+
},
|
|
667
|
+
content: [verticalLayoutForSelectFunction],
|
|
668
|
+
buttons: [
|
|
669
|
+
this.applyButton = new Button({
|
|
670
|
+
text: this.oBundle.getText("apply"),
|
|
671
|
+
tooltip: this.oBundle.getText("applyChangesBtnTooltip"),
|
|
672
|
+
press: function (event) {
|
|
673
|
+
var selectFunctionData = that._createJson()
|
|
674
|
+
event.getSource().mProperties = {
|
|
675
|
+
value: that.functionLabel,
|
|
676
|
+
jsonData: selectFunctionData
|
|
677
|
+
};
|
|
678
|
+
callBack(event);
|
|
679
|
+
that._setModal(false);
|
|
680
|
+
selectFunctionsDialog.close();
|
|
681
|
+
selectFunctionsDialog.destroy();
|
|
682
|
+
}
|
|
683
|
+
}),
|
|
684
|
+
new Button({
|
|
685
|
+
text: this.oBundle.getText("cancel"),
|
|
686
|
+
tooltip: this.oBundle.getText("cancelBtnTooltip"),
|
|
687
|
+
press: function (event) {
|
|
688
|
+
that._setModal(false);
|
|
689
|
+
selectFunctionsDialog.close();
|
|
690
|
+
selectFunctionsDialog.destroy();
|
|
691
|
+
}
|
|
692
|
+
})
|
|
693
|
+
]
|
|
694
|
+
}).addStyleClass("sapUiSizeCompact");;
|
|
695
|
+
that._setModal(true);
|
|
696
|
+
selectFunctionsDialog.open();
|
|
697
|
+
});
|
|
675
698
|
};
|
|
676
699
|
|
|
677
700
|
SelectFunctionDialog.prototype._setModal = function (value) {
|
|
678
|
-
var pop =
|
|
701
|
+
var pop = Element.getElementById("popover");
|
|
679
702
|
if (pop) {
|
|
680
703
|
pop.setModal(value);
|
|
681
704
|
}
|
|
@@ -965,7 +988,7 @@ sap.ui.define([
|
|
|
965
988
|
};
|
|
966
989
|
|
|
967
990
|
SelectFunctionDialog.prototype._createUUId = function () {
|
|
968
|
-
this.infraUtils = new
|
|
991
|
+
this.infraUtils = new utilsBase.utilsBaseLib();
|
|
969
992
|
return this.infraUtils.createUUID()
|
|
970
993
|
};
|
|
971
994
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/rules/ui/ast/constants/Constants"
|
|
3
|
+
], function(utilConstantsLib) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function utilsBaseLib() {
|
|
7
|
+
//Constructor to enable usage of public method on the client side.
|
|
8
|
+
//This mechanism was used in HRF to enable association to corresponding namespace in the client side.
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
utilsBaseLib.prototype.buildJsonPath = function(prefix, property, propertyIndex){
|
|
12
|
+
var path = '';
|
|
13
|
+
|
|
14
|
+
//adding prefix
|
|
15
|
+
if(prefix === null || prefix === undefined){
|
|
16
|
+
path += utilConstantsLib.JSON_PATH_ROOT;
|
|
17
|
+
}
|
|
18
|
+
else{
|
|
19
|
+
path += prefix;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//adding additional property
|
|
23
|
+
path += '.' + property;
|
|
24
|
+
|
|
25
|
+
//adding property index in case property is a collection
|
|
26
|
+
if(propertyIndex !== null &&
|
|
27
|
+
propertyIndex !== undefined &&
|
|
28
|
+
propertyIndex >= 0){
|
|
29
|
+
path += '[' + propertyIndex + ']';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return path;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
utilsBaseLib.prototype.setJsonValueAccordingPath = function (jsonObj, jsonPath, propToAddName, objToAdd){
|
|
36
|
+
var pathArray = jsonPath.replace(/\[/g, '.').replace(/\]/g, '').split('.');
|
|
37
|
+
var i, jsonIndex;
|
|
38
|
+
var currObj = jsonObj;
|
|
39
|
+
|
|
40
|
+
for(i = 1; i < pathArray.length; i++){ //starting after $
|
|
41
|
+
jsonIndex = parseInt(pathArray[i], 10);
|
|
42
|
+
|
|
43
|
+
if(jsonIndex >= 0){ //A number
|
|
44
|
+
currObj = currObj[jsonIndex];
|
|
45
|
+
}
|
|
46
|
+
else{ //A property
|
|
47
|
+
currObj = currObj[pathArray[i]];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if(currObj){
|
|
52
|
+
currObj[propToAddName] = objToAdd;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Creates 32-char UUID
|
|
57
|
+
utilsBaseLib.prototype.createUUID = function() {
|
|
58
|
+
var result, i, j;
|
|
59
|
+
result = '';
|
|
60
|
+
for (j = 0; j < 32; j++) {
|
|
61
|
+
// SECURITY CODE SCAN:
|
|
62
|
+
// Must use Math.random (), because In XS JavaScript there is no currently
|
|
63
|
+
// solution for a robust cryptographic PRNG
|
|
64
|
+
i = Math.floor(Math.random() * 16).toString(16);
|
|
65
|
+
result = result + i;
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
utilsBaseLib.prototype.findObjectById = function (objectId, array) {
|
|
72
|
+
var result = null;
|
|
73
|
+
for (var i = 0; i < array.length; i++) {
|
|
74
|
+
if (array[i].id === objectId) {
|
|
75
|
+
result = array[i];
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
utilsBaseLib: utilsBaseLib
|
|
84
|
+
};
|
|
85
|
+
}, true);
|
|
@@ -265,10 +265,14 @@
|
|
|
265
265
|
},
|
|
266
266
|
|
|
267
267
|
_setModal : function(value){
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
sap.ui.require([
|
|
269
|
+
"sap/ui/core/Element"
|
|
270
|
+
], (Element) => {
|
|
271
|
+
var pop = Element.getElementById("popover");
|
|
272
|
+
if (pop) {
|
|
273
|
+
pop.setModal(value);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
272
276
|
},
|
|
273
277
|
|
|
274
278
|
showHints: function(data) {
|