@sapui5/sap.fe.macros 1.90.3 → 1.93.1
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 +2 -3
- package/src/sap/fe/macros/.library +10 -1
- package/src/sap/fe/macros/ChartDelegate.js +92 -61
- package/src/sap/fe/macros/CommonHelper.js +319 -3
- package/src/sap/fe/macros/Contact.designtime.js +2 -2
- package/src/sap/fe/macros/DelegateUtil.js +10 -34
- package/src/sap/fe/macros/DraftIndicator.fragment.xml +2 -0
- package/src/sap/fe/macros/DraftIndicator.metadata.js +6 -0
- package/src/sap/fe/macros/DraftIndicatorRuntime.js +2 -2
- package/src/sap/fe/macros/Field.fragment.xml +2 -1
- package/src/sap/fe/macros/Field.metadata.js +9 -1
- package/src/sap/fe/macros/Field.metadata.ts +7 -0
- package/src/sap/fe/macros/FieldAPI.js +21 -4
- package/src/sap/fe/macros/FieldAPI.ts +19 -5
- package/src/sap/fe/macros/FieldValueHelpDelegate.js +2 -2
- package/src/sap/fe/macros/FilterBar.designtime.js +2 -2
- package/src/sap/fe/macros/FilterBar.fragment.xml +13 -11
- package/src/sap/fe/macros/FilterBar.metadata.js +12 -8
- package/src/sap/fe/macros/FilterBarDelegate.js +35 -23
- package/src/sap/fe/macros/FilterField.designtime.js +2 -2
- package/src/sap/fe/macros/FilterField.fragment.xml +25 -7
- package/src/sap/fe/macros/FilterField.metadata.js +17 -1
- package/src/sap/fe/macros/FlexibleColumnLayoutActions.fragment.xml +24 -0
- package/src/sap/fe/macros/FlexibleColumnLayoutActions.metadata.js +67 -0
- package/src/sap/fe/macros/Form.designtime.js +2 -2
- package/src/sap/fe/macros/Form.fragment.xml +12 -5
- package/src/sap/fe/macros/Form.metadata.js +8 -7
- package/src/sap/fe/macros/FormContainer.designtime.js +2 -2
- package/src/sap/fe/macros/FormContainer.fragment.xml +3 -6
- package/src/sap/fe/macros/FormContainer.metadata.js +2 -8
- package/src/sap/fe/macros/KPITag.fragment.xml +33 -0
- package/src/sap/fe/macros/KPITag.metadata.js +103 -0
- package/src/sap/fe/macros/KPITag.metadata.ts +104 -0
- package/src/sap/fe/macros/MacroAPI.js +34 -7
- package/src/sap/fe/macros/MacroAPI.ts +22 -3
- package/src/sap/fe/macros/MacroMetadata.js +26 -6
- package/src/sap/fe/macros/MacroRuntime.js +33 -0
- package/src/sap/fe/macros/MacroRuntime.ts +12 -0
- package/src/sap/fe/macros/MicroChart.designtime.js +5 -5
- package/src/sap/fe/macros/MicroChart.fragment.xml +3 -2
- package/src/sap/fe/macros/MicroChart.metadata.js +50 -43
- package/src/sap/fe/macros/PhantomUtil.js +28 -3
- package/src/sap/fe/macros/QuickViewForm.designtime.js +2 -2
- package/src/sap/fe/macros/QuickViewForm.fragment.xml +3 -3
- package/src/sap/fe/macros/QuickViewForm.metadata.js +3 -0
- package/src/sap/fe/macros/ResourceModel.js +23 -3
- package/src/sap/fe/macros/Share.fragment.xml +21 -0
- package/src/sap/fe/macros/Share.metadata.js +81 -0
- package/src/sap/fe/macros/Table.fragment.xml +8 -3
- package/src/sap/fe/macros/Table.metadata.js +67 -33
- package/src/sap/fe/macros/TableAPI.js +68 -67
- package/src/sap/fe/macros/TableAPI.ts +148 -63
- package/src/sap/fe/macros/ValueHelp.metadata.js +3 -1
- package/src/sap/fe/macros/VisualFilter.fragment.xml +71 -0
- package/src/sap/fe/macros/VisualFilter.metadata.js +211 -0
- package/src/sap/fe/macros/chart/ChartHelper.js +2 -2
- package/src/sap/fe/macros/chart/ChartRuntime.js +2 -2
- package/src/sap/fe/macros/field/FieldHelper.js +129 -298
- package/src/sap/fe/macros/field/FieldRuntime.js +173 -10
- package/src/sap/fe/macros/field/FieldTemplating.js +41 -18
- package/src/sap/fe/macros/field/FieldTemplating.ts +38 -8
- package/src/sap/fe/macros/field/QuickViewLinkDelegate.js +347 -120
- package/src/sap/fe/macros/field/QuickViewLinkForContact.fragment.xml +1 -1
- package/src/sap/fe/macros/field/QuickViewLinkForDataField.fragment.xml +8 -8
- package/src/sap/fe/macros/field/QuickViewLinkForEntity.fragment.xml +5 -5
- package/src/sap/fe/macros/field/QuickViewLinkWithFacets.fragment.xml +3 -2
- package/src/sap/fe/macros/filter/CustomFilter.fragment.xml +2 -1
- package/src/sap/fe/macros/filter/DraftEditState.fragment.xml +0 -3
- package/src/sap/fe/macros/filter/DraftEditState.js +5 -0
- package/src/sap/fe/macros/filter/FilterFieldHelper.js +143 -0
- package/src/sap/fe/macros/filter/FilterUtils.js +7 -6
- package/src/sap/fe/macros/filter/type/MultiValue.js +2 -2
- package/src/sap/fe/macros/filter/type/Range.js +2 -2
- package/src/sap/fe/macros/filter/type/Value.js +2 -2
- package/src/sap/fe/macros/flexibility/FormDelegate.js +4 -207
- package/src/sap/fe/macros/flexibility/ValueHelpWrapper.fragment.xml +1 -5
- package/src/sap/fe/macros/form/AddressSection.fragment.xml +35 -0
- package/src/sap/fe/macros/form/DataFieldCollection.fragment.xml +0 -2
- package/src/sap/fe/macros/form/FormHelper.js +17 -3
- package/src/sap/fe/macros/fpm/CustomFragment.fragment.xml +3 -1
- package/src/sap/fe/macros/fpm/CustomSection.fragment.xml +3 -1
- package/src/sap/fe/macros/internal/DataPoint.fragment.xml +1 -2
- package/src/sap/fe/macros/internal/DataPoint.metadata.js +5 -2
- package/src/sap/fe/macros/internal/Field.designtime.js +2 -2
- package/src/sap/fe/macros/internal/Field.metadata.js +117 -6
- package/src/sap/fe/macros/internal/field/ConnectedDataField.fragment.xml +1 -0
- package/src/sap/fe/macros/internal/field/FieldContent.fragment.xml +3 -0
- package/src/sap/fe/macros/internal/field/displayStyle/AmountWithCurrency.fragment.xml +12 -2
- package/src/sap/fe/macros/internal/field/displayStyle/LabelSemanticKey.fragment.xml +16 -3
- package/src/sap/fe/macros/internal/field/displayStyle/LinkWithQuickViewForm.fragment.xml +16 -2
- package/src/sap/fe/macros/internal/field/displayStyle/LinkWrapper.fragment.xml +15 -2
- package/src/sap/fe/macros/internal/field/displayStyle/ObjectIdentifier.fragment.xml +3 -3
- package/src/sap/fe/macros/internal/field/displayStyle/SemanticKeyWithDraftIndicator.fragment.xml +1 -1
- package/src/sap/fe/macros/internal/field/editStyle/InputWithUnit.fragment.xml +22 -17
- package/src/sap/fe/macros/internal/field/editStyle/InputWithValueHelp.fragment.xml +2 -0
- package/src/sap/fe/macros/internal/field/editStyle/TextArea.fragment.xml +3 -0
- package/src/sap/fe/macros/internal/helpers/DataPointTemplating.js +18 -6
- package/src/sap/fe/macros/internal/helpers/DataPointTemplating.ts +21 -7
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +15 -6
- package/src/sap/fe/macros/internal/valuehelp/ValueHelp.designtime.js +2 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueHelpContent.fragment.xml +1 -0
- package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +2 -1
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +85 -13
- package/src/sap/fe/macros/internal/valuehelp/ValueListTable.fragment.xml +5 -4
- package/src/sap/fe/macros/library.js +7 -5
- package/src/sap/fe/macros/macroLibrary.js +15 -3
- package/src/sap/fe/macros/massedit/MassEditDialog.fragment.xml +45 -0
- package/src/sap/fe/macros/massedit/MassEditHandler.js +687 -0
- package/src/sap/fe/macros/massedit/MassEditRuntime.js +106 -0
- package/src/sap/fe/macros/messagebundle.properties +46 -7
- package/src/sap/fe/macros/messagebundle_ar.properties +24 -4
- package/src/sap/fe/macros/messagebundle_bg.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ca.properties +24 -4
- package/src/sap/fe/macros/messagebundle_cs.properties +24 -57
- package/src/sap/fe/macros/messagebundle_cy.properties +24 -4
- package/src/sap/fe/macros/messagebundle_da.properties +24 -4
- package/src/sap/fe/macros/messagebundle_de.properties +24 -4
- package/src/sap/fe/macros/messagebundle_el.properties +24 -4
- package/src/sap/fe/macros/messagebundle_en.properties +24 -4
- package/src/sap/fe/macros/messagebundle_en_GB.properties +24 -4
- package/src/sap/fe/macros/messagebundle_en_US_sappsd.properties +16 -4
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +30 -4
- package/src/sap/fe/macros/messagebundle_en_US_saptrc.properties +24 -4
- package/src/sap/fe/macros/messagebundle_es.properties +24 -4
- package/src/sap/fe/macros/messagebundle_es_MX.properties +24 -4
- package/src/sap/fe/macros/messagebundle_et.properties +24 -4
- package/src/sap/fe/macros/messagebundle_fi.properties +24 -4
- package/src/sap/fe/macros/messagebundle_fr.properties +24 -4
- package/src/sap/fe/macros/messagebundle_fr_CA.properties +24 -4
- package/src/sap/fe/macros/messagebundle_hi.properties +24 -4
- package/src/sap/fe/macros/messagebundle_hr.properties +24 -4
- package/src/sap/fe/macros/messagebundle_hu.properties +24 -4
- package/src/sap/fe/macros/messagebundle_id.properties +24 -4
- package/src/sap/fe/macros/messagebundle_it.properties +24 -4
- package/src/sap/fe/macros/messagebundle_iw.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ja.properties +24 -4
- package/src/sap/fe/macros/messagebundle_kk.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ko.properties +24 -4
- package/src/sap/fe/macros/messagebundle_lt.properties +24 -4
- package/src/sap/fe/macros/messagebundle_lv.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ms.properties +24 -4
- package/src/sap/fe/macros/messagebundle_nl.properties +24 -4
- package/src/sap/fe/macros/messagebundle_no.properties +24 -4
- package/src/sap/fe/macros/messagebundle_pl.properties +24 -4
- package/src/sap/fe/macros/messagebundle_pt.properties +25 -5
- package/src/sap/fe/macros/messagebundle_pt_PT.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ro.properties +24 -4
- package/src/sap/fe/macros/messagebundle_ru.properties +24 -4
- package/src/sap/fe/macros/messagebundle_sh.properties +24 -4
- package/src/sap/fe/macros/messagebundle_sk.properties +24 -4
- package/src/sap/fe/macros/messagebundle_sl.properties +24 -4
- package/src/sap/fe/macros/messagebundle_sv.properties +24 -4
- package/src/sap/fe/macros/messagebundle_th.properties +24 -4
- package/src/sap/fe/macros/messagebundle_tr.properties +24 -4
- package/src/sap/fe/macros/messagebundle_uk.properties +24 -4
- package/src/sap/fe/macros/messagebundle_vi.properties +24 -4
- package/src/sap/fe/macros/messagebundle_zh_CN.properties +24 -4
- package/src/sap/fe/macros/messagebundle_zh_TW.properties +24 -4
- package/src/sap/fe/macros/microchart/MicroChartContainer.js +8 -12
- package/src/sap/fe/macros/microchart/MicroChartHelper.js +26 -280
- package/src/sap/fe/macros/microchart/fragments/AreaMicroChart.fragment.xml +20 -21
- package/src/sap/fe/macros/microchart/fragments/BulletMicroChart.fragment.xml +7 -8
- package/src/sap/fe/macros/microchart/fragments/ColumnMicroChart.fragment.xml +12 -13
- package/src/sap/fe/macros/microchart/fragments/ComparisonMicroChart.fragment.xml +11 -12
- package/src/sap/fe/macros/microchart/fragments/HarveyBallMicroChart.fragment.xml +6 -7
- package/src/sap/fe/macros/microchart/fragments/LineMicroChart.fragment.xml +14 -14
- package/src/sap/fe/macros/microchart/fragments/MicroChartContent.fragment.xml +8 -8
- package/src/sap/fe/macros/microchart/fragments/MicroChartTitle.fragment.xml +12 -12
- package/src/sap/fe/macros/microchart/fragments/RadialMicroChart.fragment.xml +5 -6
- package/src/sap/fe/macros/microchart/fragments/StackedBarMicroChart.fragment.xml +6 -7
- package/src/sap/fe/macros/share/ShareSheet.fragment.xml +26 -0
- package/src/sap/fe/macros/table/Actions.fragment.xml +20 -8
- package/src/sap/fe/macros/table/ColumnContent.fragment.xml +10 -5
- package/src/sap/fe/macros/table/Columns.fragment.xml +8 -0
- package/src/sap/fe/macros/table/CreationRow.fragment.xml +1 -0
- package/src/sap/fe/macros/table/QuickFilterContainer.js +2 -2
- package/src/sap/fe/macros/table/TableFullScreenUtil.js +2 -2
- package/src/sap/fe/macros/table/TableHelper.js +83 -71
- package/src/sap/fe/macros/table/TableRuntime.js +50 -48
- package/src/sap/fe/macros/table/Utils.js +20 -6
- package/src/sap/fe/macros/table/ValueHelp.fragment.xml +2 -2
- package/src/sap/fe/macros/table/delegates/ALPTableDelegate.js +3 -3
- package/src/sap/fe/macros/table/{ALPTableDelegateBaseMixin.js → delegates/ALPTableDelegateBaseMixin.js} +4 -4
- package/src/sap/fe/macros/table/delegates/AnalyticalALPTableDelegate.js +3 -3
- package/src/sap/fe/macros/table/delegates/AnalyticalTableDelegate.js +24 -12
- package/src/sap/fe/macros/table/delegates/TableDelegate.js +747 -7
- package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.designtime.js +2 -2
- package/src/sap/fe/macros/valuehelp/ValueHelpFilterBar.metadata.js +2 -2
- package/src/sap/fe/macros/visualfilters/InteractiveChartHelper.js +451 -0
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +204 -0
- package/src/sap/fe/macros/visualfilters/VisualFilterUtils.js +312 -0
- package/src/sap/fe/macros/visualfilters/fragments/InteractiveBarChart.fragment.xml +64 -0
- package/src/sap/fe/macros/visualfilters/fragments/InteractiveDonutChart.fragment.xml +64 -0
- package/src/sap/fe/macros/visualfilters/fragments/InteractiveLineChart.fragment.xml +64 -0
- package/ui5.yaml +1 -0
- package/src/sap/fe/macros/table/TableDelegateBaseMixin.js +0 -724
- package/src/sap/fe/macros/table/TableTemplating.js +0 -8
- package/src/sap/fe/macros/table/TableTemplating.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapui5/sap.fe.macros",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.93.1",
|
|
4
4
|
"description": "SAPUI5 Library sap.fe.macros",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "SAP SE (https://www.sap.com)",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"ts-node": "^9.1.1",
|
|
22
22
|
"@babel/cli": "7.8.4",
|
|
23
|
-
"@ui5/cli": "^2.10.0"
|
|
24
|
-
"yarn": "1.22.10"
|
|
23
|
+
"@ui5/cli": "^2.10.0"
|
|
25
24
|
}
|
|
26
25
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>SAP UI development toolkit for HTML5 (SAPUI5)
|
|
7
7
|
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
8
8
|
</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.93.1</version>
|
|
10
10
|
|
|
11
11
|
<documentation>UI5 library: sap.fe.macros</documentation>
|
|
12
12
|
|
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
<dependency>
|
|
21
21
|
<libraryName>sap.ui.core</libraryName>
|
|
22
22
|
</dependency>
|
|
23
|
+
<dependency>
|
|
24
|
+
<libraryName>sap.fe.core</libraryName>
|
|
25
|
+
</dependency>
|
|
23
26
|
<dependency>
|
|
24
27
|
<libraryName>sap.ui.layout</libraryName>
|
|
25
28
|
</dependency>
|
|
@@ -40,6 +43,12 @@
|
|
|
40
43
|
<jscoverage xmlns="http://www.sap.com/ui5/buildext/jscoverage">
|
|
41
44
|
<exclude name="sap.fe.macros.js."/>
|
|
42
45
|
</jscoverage>
|
|
46
|
+
<releasenotes xmlns="http://www.sap.com/ui5/buildext/releasenotes"
|
|
47
|
+
url="../../../../test-resources/sap/fe/macros/relnotes/changes-{major}.{minor}.json"
|
|
48
|
+
resolve="lib" />
|
|
49
|
+
<ownership xmlns="http://www.sap.com/ui5/buildext/ownership">
|
|
50
|
+
<component>CA-UI5-FE</component><!-- default component for library, embedded text as a shortcut for <name>text</name> -->
|
|
51
|
+
</ownership>
|
|
43
52
|
</appData>
|
|
44
53
|
|
|
45
54
|
</library>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/*!
|
|
2
|
+
* SAPUI5
|
|
3
3
|
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -72,9 +72,32 @@ sap.ui.define(
|
|
|
72
72
|
return this;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
function handleProperty(mKnownAggregatableProps, aResults) {
|
|
76
|
-
var
|
|
75
|
+
function handleProperty(mKnownAggregatableProps, mCustomAggregates, oApplySupported, aResults) {
|
|
76
|
+
var aGroupableProperties = oApplySupported && oApplySupported.GroupableProperties;
|
|
77
|
+
var aAggregatableProperties = oApplySupported && oApplySupported.AggregatableProperties;
|
|
78
|
+
var bGroupable, bAggregatable;
|
|
79
|
+
if (aGroupableProperties && aGroupableProperties.length) {
|
|
80
|
+
for (var i = 0; i < aGroupableProperties.length; i++) {
|
|
81
|
+
if (aGroupableProperties[i].$PropertyPath === aResults[2]) {
|
|
82
|
+
bGroupable = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (aAggregatableProperties && aAggregatableProperties.length) {
|
|
88
|
+
for (var j = 0; j < aAggregatableProperties.length; j++) {
|
|
89
|
+
if (aAggregatableProperties[j].Property.$PropertyPath === aResults[2]) {
|
|
90
|
+
bAggregatable = true;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (!aGroupableProperties || (aGroupableProperties && !aGroupableProperties.length)) {
|
|
96
|
+
bGroupable = aResults[0];
|
|
97
|
+
}
|
|
98
|
+
if (!aAggregatableProperties || (aAggregatableProperties && !aAggregatableProperties.length)) {
|
|
77
99
|
bAggregatable = aResults[1];
|
|
100
|
+
}
|
|
78
101
|
|
|
79
102
|
var oHeadItem = {},
|
|
80
103
|
oProperty = {},
|
|
@@ -111,6 +134,19 @@ sap.ui.define(
|
|
|
111
134
|
oItem.default = undefined;
|
|
112
135
|
oProperty.chartItems.push(oItem);
|
|
113
136
|
}
|
|
137
|
+
} else if (Object.keys(mCustomAggregates).indexOf(oProperty.name) > -1) {
|
|
138
|
+
for (var sCustom in mCustomAggregates) {
|
|
139
|
+
if (sCustom === oProperty.name) {
|
|
140
|
+
oItem = merge({}, mCustomAggregates[sCustom], {
|
|
141
|
+
propertyPath: sCustom,
|
|
142
|
+
kind: MDCLib.ChartItemType.Measure,
|
|
143
|
+
role: MDCLib.ChartItemRoleType.axis1,
|
|
144
|
+
sortable: mCustomAggregates[sCustom].sortable
|
|
145
|
+
});
|
|
146
|
+
oProperty.chartItems.push(oItem);
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
114
150
|
}
|
|
115
151
|
}
|
|
116
152
|
}
|
|
@@ -138,13 +174,13 @@ sap.ui.define(
|
|
|
138
174
|
aMeasures = [],
|
|
139
175
|
aDimensions = [],
|
|
140
176
|
aChartItems = [],
|
|
141
|
-
bSetFilterable,
|
|
142
177
|
bSetSortable,
|
|
143
178
|
mKnownAggregatableProps = {},
|
|
144
179
|
oEntitySetAnnotations = mAnnos.entitySetAnnotations,
|
|
145
|
-
oEntityTypeAnnotations = mAnnos.entityTypeAnnotations
|
|
180
|
+
oEntityTypeAnnotations = mAnnos.entityTypeAnnotations,
|
|
181
|
+
oApplySupported = mAnnos.applySupported;
|
|
146
182
|
|
|
147
|
-
var mCustomAggregates = MetaModelUtil.getAllCustomAggregates(
|
|
183
|
+
var mCustomAggregates = MetaModelUtil.getAllCustomAggregates(oEntitySetAnnotations);
|
|
148
184
|
|
|
149
185
|
if (Object.keys(mCustomAggregates).length >= 1) {
|
|
150
186
|
aChartItems = oChart.getItems();
|
|
@@ -163,18 +199,6 @@ sap.ui.define(
|
|
|
163
199
|
Log.error("Dimension and Measure has the sameProperty Configured");
|
|
164
200
|
}
|
|
165
201
|
}
|
|
166
|
-
//Collect custom aggegates
|
|
167
|
-
for (var sCustom in mCustomAggregates) {
|
|
168
|
-
aItems.push(
|
|
169
|
-
merge({}, mCustomAggregates[sCustom], {
|
|
170
|
-
propertyPath: sCustom,
|
|
171
|
-
kind: MDCLib.ChartItemType.Measure,
|
|
172
|
-
role: MDCLib.ChartItemRoleType.axis1,
|
|
173
|
-
sortable: mCustomAggregates[sCustom].sortable,
|
|
174
|
-
filterable: mCustomAggregates[sCustom].filterable
|
|
175
|
-
})
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
202
|
|
|
179
203
|
var mTypeAggregatableProps = MetaModelUtil.getAllAggregatableProperties(oEntityTypeAnnotations);
|
|
180
204
|
|
|
@@ -190,9 +214,6 @@ sap.ui.define(
|
|
|
190
214
|
var oSortRestrictionsInfo = MetaModelUtil.getSortRestrictionsInfo(
|
|
191
215
|
oEntitySetAnnotations["@Org.OData.Capabilities.V1.SortRestrictions"]
|
|
192
216
|
);
|
|
193
|
-
var oFilterRestrictionsInfo = MetaModelUtil.getFilterRestrictionsInfo(
|
|
194
|
-
oEntitySetAnnotations["@Org.OData.Capabilities.V1.FilterRestrictions"]
|
|
195
|
-
);
|
|
196
217
|
|
|
197
218
|
function push(oProperty) {
|
|
198
219
|
var sName = oProperty.name || "",
|
|
@@ -207,43 +228,41 @@ sap.ui.define(
|
|
|
207
228
|
bIsNavigationText = true;
|
|
208
229
|
}
|
|
209
230
|
aProperties.push(oProperty);
|
|
210
|
-
//calculate Sortable
|
|
231
|
+
//calculate Sortable
|
|
211
232
|
MetaModelUtil.addSortInfoForProperty(oProperty, oSortRestrictionsInfo);
|
|
212
|
-
MetaModelUtil.addFilterInfoForProperty(oProperty, oFilterRestrictionsInfo);
|
|
213
233
|
if (oProperty.inChart) {
|
|
214
234
|
for (var i = 0; i < oProperty.chartItems.length; i++) {
|
|
215
235
|
var oItem = oProperty.chartItems[i];
|
|
216
|
-
oItem.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
236
|
+
if (!oItem.custom) {
|
|
237
|
+
oItem.propertyPath = oProperty.name;
|
|
238
|
+
oItem.type = oProperty.type;
|
|
239
|
+
oItem.timeUnit = oProperty.timeUnit;
|
|
240
|
+
oItem.criticality = oProperty.criticality;
|
|
241
|
+
if (oItem.kind == MDCLib.ChartItemType.Measure) {
|
|
242
|
+
if (
|
|
243
|
+
mKnownAggregatableProps[oItem.propertyPath] &&
|
|
244
|
+
mKnownAggregatableProps[oItem.propertyPath][oItem.aggregationMethod]
|
|
245
|
+
) {
|
|
246
|
+
oItem.name = mKnownAggregatableProps[oItem.propertyPath][oItem.aggregationMethod].name;
|
|
247
|
+
oItem.label = mKnownAggregatableProps[oItem.propertyPath][oItem.aggregationMethod].label;
|
|
248
|
+
} else {
|
|
249
|
+
oItem.name = oItem.aggregationMethod + oItem.propertyPath;
|
|
250
|
+
oItem.label = oProperty.label + " (" + oItem.aggregationMethod + ")";
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
oItem.customAggregate = false;
|
|
254
|
+
//in the first wave let us only sort by used items
|
|
255
|
+
oItem.sortable = oProperty.sortable;
|
|
256
|
+
oItem.sortDirection = oProperty.sortDirection;
|
|
227
257
|
} else {
|
|
228
|
-
oItem.name =
|
|
229
|
-
oItem.
|
|
258
|
+
oItem.name = oProperty.name;
|
|
259
|
+
oItem.textProperty = !bIsNavigationText ? oProperty.textProperty : undefined;
|
|
260
|
+
oItem.label = oProperty.label;
|
|
261
|
+
//in the first wave let us only sort by used items
|
|
262
|
+
oItem.sortable = oProperty.sortable;
|
|
263
|
+
oItem.sortDirection = oProperty.sortDirection;
|
|
264
|
+
oItem.allowedExpressions = oProperty.allowedExpressions;
|
|
230
265
|
}
|
|
231
|
-
|
|
232
|
-
oItem.customAggregate = false;
|
|
233
|
-
//in the first wave let us only sort by used items
|
|
234
|
-
oItem.sortable = true;
|
|
235
|
-
oItem.sortDirection = "both";
|
|
236
|
-
oItem.filterable = true;
|
|
237
|
-
} else {
|
|
238
|
-
oItem.name = oProperty.name;
|
|
239
|
-
oItem.textProperty = !bIsNavigationText ? oProperty.textProperty : undefined;
|
|
240
|
-
oItem.label = oProperty.label;
|
|
241
|
-
//in the first wave let us only sort by used items
|
|
242
|
-
oItem.sortable = oProperty.sortable;
|
|
243
|
-
oItem.sortDirection = oProperty.sortDirection;
|
|
244
|
-
//Allow filtering on each possible dimension
|
|
245
|
-
oItem.filterable = oProperty.filterable;
|
|
246
|
-
oItem.allowedExpressions = oProperty.allowedExpressions;
|
|
247
266
|
}
|
|
248
267
|
aItems.push(oItem);
|
|
249
268
|
}
|
|
@@ -266,7 +285,14 @@ sap.ui.define(
|
|
|
266
285
|
// oMetaModel.requestObject(sPrefix + ".RecommendedAggregationMethod"),
|
|
267
286
|
oMetaModel.requestObject(sPrefix + ".ContextDefiningProperties")
|
|
268
287
|
])
|
|
269
|
-
.then(
|
|
288
|
+
.then(
|
|
289
|
+
handleProperty.bind(
|
|
290
|
+
oMetaModel.getMetaContext(sPath + sKey),
|
|
291
|
+
mKnownAggregatableProps,
|
|
292
|
+
mCustomAggregates,
|
|
293
|
+
oApplySupported
|
|
294
|
+
)
|
|
295
|
+
)
|
|
270
296
|
|
|
271
297
|
.then(push)
|
|
272
298
|
);
|
|
@@ -276,7 +302,7 @@ sap.ui.define(
|
|
|
276
302
|
}
|
|
277
303
|
|
|
278
304
|
return Promise.all(aPropertyPromise).then(function() {
|
|
279
|
-
return [bSetSortable,
|
|
305
|
+
return [bSetSortable, aProperties, aItems];
|
|
280
306
|
});
|
|
281
307
|
}
|
|
282
308
|
|
|
@@ -352,7 +378,7 @@ sap.ui.define(
|
|
|
352
378
|
* Fetches the relevant metadata for the Chart and returns property info array.
|
|
353
379
|
*
|
|
354
380
|
* @param {object} oChart
|
|
355
|
-
* @returns {Promise<{
|
|
381
|
+
* @returns {Promise<{attributes: *, sortable: *, properties: *}>} A Promise containing the property information
|
|
356
382
|
*/
|
|
357
383
|
ChartDelegate.retrieveAllMetadata = function(oChart) {
|
|
358
384
|
var oModelPromise = ChartDelegate.getModel(oChart);
|
|
@@ -372,19 +398,23 @@ sap.ui.define(
|
|
|
372
398
|
function resolve(aResult) {
|
|
373
399
|
var oMetadata = {
|
|
374
400
|
sortable: aResult[0],
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
properties: aResult[3]
|
|
401
|
+
attributes: aResult[1],
|
|
402
|
+
properties: aResult[2]
|
|
378
403
|
};
|
|
379
404
|
|
|
380
405
|
return oMetadata;
|
|
381
406
|
}
|
|
382
407
|
|
|
383
|
-
var aSetAndTypePromise = [
|
|
408
|
+
var aSetAndTypePromise = [
|
|
409
|
+
oMetaModel.requestObject(sTypePath),
|
|
410
|
+
oMetaModel.requestObject(sSetPath),
|
|
411
|
+
oMetaModel.requestObject(sSetPath + AGGREGATION_ANNO + ".ApplySupported")
|
|
412
|
+
];
|
|
384
413
|
|
|
385
414
|
return Promise.all(aSetAndTypePromise)
|
|
386
415
|
.then(function(aTypeAndSet) {
|
|
387
416
|
var oEntity = aTypeAndSet[0];
|
|
417
|
+
var oApplySupported = aTypeAndSet[2];
|
|
388
418
|
var aAnnotationsPromises = [
|
|
389
419
|
MetaModelUtil.fetchAllAnnotations(oMetaModel, sTypePath),
|
|
390
420
|
MetaModelUtil.fetchAllAnnotations(oMetaModel, sSetPath)
|
|
@@ -394,7 +424,8 @@ sap.ui.define(
|
|
|
394
424
|
//annotations of set and type
|
|
395
425
|
var oAnnotations = {
|
|
396
426
|
entityTypeAnnotations: aAnnotations[0],
|
|
397
|
-
entitySetAnnotations: aAnnotations[1]
|
|
427
|
+
entitySetAnnotations: aAnnotations[1],
|
|
428
|
+
applySupported: oApplySupported
|
|
398
429
|
};
|
|
399
430
|
return retrieveItems(oEntity, sTypePath, oMetaModel, oAnnotations, oChart);
|
|
400
431
|
});
|
|
@@ -12,10 +12,23 @@ sap.ui.define(
|
|
|
12
12
|
"sap/fe/core/helpers/StableIdHelper",
|
|
13
13
|
"sap/fe/core/helpers/ModelHelper",
|
|
14
14
|
"sap/ui/model/Context",
|
|
15
|
-
"sap/ui/Device"
|
|
15
|
+
"sap/ui/Device",
|
|
16
|
+
"sap/m/library"
|
|
16
17
|
],
|
|
17
|
-
function(
|
|
18
|
+
function(
|
|
19
|
+
ResourceModel,
|
|
20
|
+
ODataModelAnnotationHelper,
|
|
21
|
+
Log,
|
|
22
|
+
CommonUtils,
|
|
23
|
+
SelectionVariant,
|
|
24
|
+
StableIdHelper,
|
|
25
|
+
ModelHelper,
|
|
26
|
+
Context,
|
|
27
|
+
Device,
|
|
28
|
+
mobilelibrary
|
|
29
|
+
) {
|
|
18
30
|
"use strict";
|
|
31
|
+
var ValueColor = mobilelibrary.ValueColor;
|
|
19
32
|
var Helper = {
|
|
20
33
|
getPathToKey: function(oCtx) {
|
|
21
34
|
return oCtx.getObject();
|
|
@@ -124,7 +137,10 @@ sap.ui.define(
|
|
|
124
137
|
aParts,
|
|
125
138
|
entitySet,
|
|
126
139
|
navigationCollection;
|
|
127
|
-
if (
|
|
140
|
+
if (
|
|
141
|
+
oContext.getMetadata().getName() === "sap.ui.model.Context" &&
|
|
142
|
+
(oContext.getObject("$kind") === "EntitySet" || oContext.getObject("$ContainsTarget") === true)
|
|
143
|
+
) {
|
|
128
144
|
return sPath;
|
|
129
145
|
}
|
|
130
146
|
if (oContext.getModel) {
|
|
@@ -845,6 +861,306 @@ sap.ui.define(
|
|
|
845
861
|
}
|
|
846
862
|
return combinedConditions.length > 0 ? "{= " + combinedConditions.join(" || ") + "}" : sVisibleValue;
|
|
847
863
|
},
|
|
864
|
+
/**
|
|
865
|
+
* Method to do the calculation of criticality in case CriticalityCalculation present in the annotation
|
|
866
|
+
*
|
|
867
|
+
* The calculation is done by comparing a value to the threshold values relevant for the specified improvement direction.
|
|
868
|
+
* For improvement direction Target, the criticality is calculated using both low and high threshold values. It will be
|
|
869
|
+
*
|
|
870
|
+
* - Positive if the value is greater than or equal to AcceptanceRangeLowValue and lower than or equal to AcceptanceRangeHighValue
|
|
871
|
+
* - Neutral if the value is greater than or equal to ToleranceRangeLowValue and lower than AcceptanceRangeLowValue OR greater than AcceptanceRangeHighValue and lower than or equal to ToleranceRangeHighValue
|
|
872
|
+
* - Critical if the value is greater than or equal to DeviationRangeLowValue and lower than ToleranceRangeLowValue OR greater than ToleranceRangeHighValue and lower than or equal to DeviationRangeHighValue
|
|
873
|
+
* - Negative if the value is lower than DeviationRangeLowValue or greater than DeviationRangeHighValue
|
|
874
|
+
*
|
|
875
|
+
* For improvement direction Minimize, the criticality is calculated using the high threshold values. It is
|
|
876
|
+
* - Positive if the value is lower than or equal to AcceptanceRangeHighValue
|
|
877
|
+
* - Neutral if the value is greater than AcceptanceRangeHighValue and lower than or equal to ToleranceRangeHighValue
|
|
878
|
+
* - Critical if the value is greater than ToleranceRangeHighValue and lower than or equal to DeviationRangeHighValue
|
|
879
|
+
* - Negative if the value is greater than DeviationRangeHighValue
|
|
880
|
+
*
|
|
881
|
+
* For improvement direction Maximize, the criticality is calculated using the low threshold values. It is
|
|
882
|
+
*
|
|
883
|
+
* - Positive if the value is greater than or equal to AcceptanceRangeLowValue
|
|
884
|
+
* - Neutral if the value is less than AcceptanceRangeLowValue and greater than or equal to ToleranceRangeLowValue
|
|
885
|
+
* - Critical if the value is lower than ToleranceRangeLowValue and greater than or equal to DeviationRangeLowValue
|
|
886
|
+
* - Negative if the value is lower than DeviationRangeLowValue
|
|
887
|
+
*
|
|
888
|
+
* Thresholds are optional. For unassigned values, defaults are determined in this order:
|
|
889
|
+
*
|
|
890
|
+
* - For DeviationRange, an omitted LowValue translates into the smallest possible number (-INF), an omitted HighValue translates into the largest possible number (+INF)
|
|
891
|
+
* - For ToleranceRange, an omitted LowValue will be initialized with DeviationRangeLowValue, an omitted HighValue will be initialized with DeviationRangeHighValue
|
|
892
|
+
* - For AcceptanceRange, an omitted LowValue will be initialized with ToleranceRangeLowValue, an omitted HighValue will be initialized with ToleranceRangeHighValue.
|
|
893
|
+
*
|
|
894
|
+
* @param {string} sImprovementDirection ImprovementDirection to be used for creating the criticality binding
|
|
895
|
+
* @param {string} sValue Value from Datapoint to be measured
|
|
896
|
+
* @param {string} sDeviationLow ExpressionBinding for Lower Deviation level
|
|
897
|
+
* @param {string} sToleranceLow ExpressionBinding for Lower Tolerance level
|
|
898
|
+
* @param {string} sAcceptanceLow ExpressionBinding for Lower Acceptance level
|
|
899
|
+
* @param {string} sAcceptanceHigh ExpressionBinding for Higher Acceptance level
|
|
900
|
+
* @param {string} sToleranceHigh ExpressionBinding for Higher Tolerance level
|
|
901
|
+
* @param {string} sDeviationHigh ExpressionBinding for Higher Deviation level
|
|
902
|
+
* @returns {string} Returns criticality calculation as expression binding
|
|
903
|
+
*/
|
|
904
|
+
getCriticalityCalculationBinding: function(
|
|
905
|
+
sImprovementDirection,
|
|
906
|
+
sValue,
|
|
907
|
+
sDeviationLow,
|
|
908
|
+
sToleranceLow,
|
|
909
|
+
sAcceptanceLow,
|
|
910
|
+
sAcceptanceHigh,
|
|
911
|
+
sToleranceHigh,
|
|
912
|
+
sDeviationHigh
|
|
913
|
+
) {
|
|
914
|
+
var sCriticalityExpression = ValueColor.Neutral; // Default Criticality State
|
|
915
|
+
|
|
916
|
+
sValue = "%" + sValue;
|
|
917
|
+
|
|
918
|
+
// Setting Unassigned Values
|
|
919
|
+
sDeviationLow = sDeviationLow || -Infinity;
|
|
920
|
+
sToleranceLow = sToleranceLow || sDeviationLow;
|
|
921
|
+
sAcceptanceLow = sAcceptanceLow || sToleranceLow;
|
|
922
|
+
sDeviationHigh = sDeviationHigh || Infinity;
|
|
923
|
+
sToleranceHigh = sToleranceHigh || sDeviationHigh;
|
|
924
|
+
sAcceptanceHigh = sAcceptanceHigh || sToleranceHigh;
|
|
925
|
+
|
|
926
|
+
// Dealing with Decimal and Path based bingdings
|
|
927
|
+
sDeviationLow = sDeviationLow && (+sDeviationLow ? +sDeviationLow : "%" + sDeviationLow);
|
|
928
|
+
sToleranceLow = sToleranceLow && (+sToleranceLow ? +sToleranceLow : "%" + sToleranceLow);
|
|
929
|
+
sAcceptanceLow = sAcceptanceLow && (+sAcceptanceLow ? +sAcceptanceLow : "%" + sAcceptanceLow);
|
|
930
|
+
sAcceptanceHigh = sAcceptanceHigh && (+sAcceptanceHigh ? +sAcceptanceHigh : "%" + sAcceptanceHigh);
|
|
931
|
+
sToleranceHigh = sToleranceHigh && (+sToleranceHigh ? +sToleranceHigh : "%" + sToleranceHigh);
|
|
932
|
+
sDeviationHigh = sDeviationHigh && (+sDeviationHigh ? +sDeviationHigh : "%" + sDeviationHigh);
|
|
933
|
+
|
|
934
|
+
// Creating runtime expression binding from criticality calculation for Criticality State
|
|
935
|
+
if (sImprovementDirection.indexOf("Minimize") > -1) {
|
|
936
|
+
sCriticalityExpression =
|
|
937
|
+
"{= " +
|
|
938
|
+
sValue +
|
|
939
|
+
" <= " +
|
|
940
|
+
sAcceptanceHigh +
|
|
941
|
+
" ? '" +
|
|
942
|
+
ValueColor.Good +
|
|
943
|
+
"' : " +
|
|
944
|
+
sValue +
|
|
945
|
+
" <= " +
|
|
946
|
+
sToleranceHigh +
|
|
947
|
+
" ? '" +
|
|
948
|
+
ValueColor.Neutral +
|
|
949
|
+
"' : " +
|
|
950
|
+
"(" +
|
|
951
|
+
sDeviationHigh +
|
|
952
|
+
" && " +
|
|
953
|
+
sValue +
|
|
954
|
+
" <= " +
|
|
955
|
+
sDeviationHigh +
|
|
956
|
+
") ? '" +
|
|
957
|
+
ValueColor.Critical +
|
|
958
|
+
"' : '" +
|
|
959
|
+
ValueColor.Error +
|
|
960
|
+
"' }";
|
|
961
|
+
} else if (sImprovementDirection.indexOf("Maximize") > -1) {
|
|
962
|
+
sCriticalityExpression =
|
|
963
|
+
"{= " +
|
|
964
|
+
sValue +
|
|
965
|
+
" >= " +
|
|
966
|
+
sAcceptanceLow +
|
|
967
|
+
" ? '" +
|
|
968
|
+
ValueColor.Good +
|
|
969
|
+
"' : " +
|
|
970
|
+
sValue +
|
|
971
|
+
" >= " +
|
|
972
|
+
sToleranceLow +
|
|
973
|
+
" ? '" +
|
|
974
|
+
ValueColor.Neutral +
|
|
975
|
+
"' : " +
|
|
976
|
+
"(" +
|
|
977
|
+
sDeviationLow +
|
|
978
|
+
" && " +
|
|
979
|
+
sValue +
|
|
980
|
+
" >= " +
|
|
981
|
+
sDeviationLow +
|
|
982
|
+
") ? '" +
|
|
983
|
+
ValueColor.Critical +
|
|
984
|
+
"' : '" +
|
|
985
|
+
ValueColor.Error +
|
|
986
|
+
"' }";
|
|
987
|
+
} else if (sImprovementDirection.indexOf("Target") > -1) {
|
|
988
|
+
sCriticalityExpression =
|
|
989
|
+
"{= (" +
|
|
990
|
+
sValue +
|
|
991
|
+
" <= " +
|
|
992
|
+
sAcceptanceHigh +
|
|
993
|
+
" && " +
|
|
994
|
+
sValue +
|
|
995
|
+
" >= " +
|
|
996
|
+
sAcceptanceLow +
|
|
997
|
+
") ? '" +
|
|
998
|
+
ValueColor.Good +
|
|
999
|
+
"' : " +
|
|
1000
|
+
"((" +
|
|
1001
|
+
sValue +
|
|
1002
|
+
" >= " +
|
|
1003
|
+
sToleranceLow +
|
|
1004
|
+
" && " +
|
|
1005
|
+
sValue +
|
|
1006
|
+
" < " +
|
|
1007
|
+
sAcceptanceLow +
|
|
1008
|
+
") || (" +
|
|
1009
|
+
sValue +
|
|
1010
|
+
" > " +
|
|
1011
|
+
sAcceptanceHigh +
|
|
1012
|
+
" && " +
|
|
1013
|
+
sValue +
|
|
1014
|
+
" <= " +
|
|
1015
|
+
sToleranceHigh +
|
|
1016
|
+
")) ? '" +
|
|
1017
|
+
ValueColor.Neutral +
|
|
1018
|
+
"' : " +
|
|
1019
|
+
"((" +
|
|
1020
|
+
sDeviationLow +
|
|
1021
|
+
" && (" +
|
|
1022
|
+
sValue +
|
|
1023
|
+
" >= " +
|
|
1024
|
+
sDeviationLow +
|
|
1025
|
+
") && (" +
|
|
1026
|
+
sValue +
|
|
1027
|
+
" < " +
|
|
1028
|
+
sToleranceLow +
|
|
1029
|
+
")) || ((" +
|
|
1030
|
+
sValue +
|
|
1031
|
+
" > " +
|
|
1032
|
+
sToleranceHigh +
|
|
1033
|
+
") && " +
|
|
1034
|
+
sDeviationHigh +
|
|
1035
|
+
" && (" +
|
|
1036
|
+
sValue +
|
|
1037
|
+
" <= " +
|
|
1038
|
+
sDeviationHigh +
|
|
1039
|
+
"))) ? '" +
|
|
1040
|
+
ValueColor.Critical +
|
|
1041
|
+
"' : '" +
|
|
1042
|
+
ValueColor.Error +
|
|
1043
|
+
"' }";
|
|
1044
|
+
} else {
|
|
1045
|
+
Log.warning("Case not supported, returning the default Value Neutral");
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
return sCriticalityExpression;
|
|
1049
|
+
},
|
|
1050
|
+
/**
|
|
1051
|
+
* This function returns the criticality indicator from annotations if criticality is EnumMember.
|
|
1052
|
+
*
|
|
1053
|
+
* @param {string} sCriticality Criticality provided in the annotations
|
|
1054
|
+
* @returns {sIndicator} Return the indicator for criticality
|
|
1055
|
+
* @private
|
|
1056
|
+
*/
|
|
1057
|
+
_getCriticalityFromEnum: function(sCriticality) {
|
|
1058
|
+
var sIndicator;
|
|
1059
|
+
if (sCriticality === "com.sap.vocabularies.UI.v1.CriticalityType/Negative") {
|
|
1060
|
+
sIndicator = ValueColor.Error;
|
|
1061
|
+
} else if (sCriticality === "com.sap.vocabularies.UI.v1.CriticalityType/Positive") {
|
|
1062
|
+
sIndicator = ValueColor.Good;
|
|
1063
|
+
} else if (sCriticality === "com.sap.vocabularies.UI.v1.CriticalityType/Critical") {
|
|
1064
|
+
sIndicator = ValueColor.Critical;
|
|
1065
|
+
} else {
|
|
1066
|
+
sIndicator = ValueColor.Neutral;
|
|
1067
|
+
}
|
|
1068
|
+
return sIndicator;
|
|
1069
|
+
},
|
|
1070
|
+
getValueCriticality: function(sDimension, aValueCriticality) {
|
|
1071
|
+
var sResult,
|
|
1072
|
+
aValues = [];
|
|
1073
|
+
if (aValueCriticality && aValueCriticality.length > 0) {
|
|
1074
|
+
aValueCriticality.forEach(function(oVC) {
|
|
1075
|
+
if (oVC.Value && oVC.Criticality.$EnumMember) {
|
|
1076
|
+
var sValue =
|
|
1077
|
+
"${" +
|
|
1078
|
+
sDimension +
|
|
1079
|
+
"} === '" +
|
|
1080
|
+
oVC.Value +
|
|
1081
|
+
"' ? '" +
|
|
1082
|
+
Helper._getCriticalityFromEnum(oVC.Criticality.$EnumMember) +
|
|
1083
|
+
"'";
|
|
1084
|
+
aValues.push(sValue);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
sResult = aValues.length > 0 && aValues.join(" : ") + " : undefined";
|
|
1088
|
+
}
|
|
1089
|
+
return sResult ? "{= " + sResult + " }" : undefined;
|
|
1090
|
+
},
|
|
1091
|
+
/**
|
|
1092
|
+
* To fetch measure attribute index.
|
|
1093
|
+
*
|
|
1094
|
+
* @param {Integer} iMeasure Chart Annotations
|
|
1095
|
+
* @param {object} oChartAnnotations Chart Annotations
|
|
1096
|
+
* @returns {string} MeasureAttribute index.
|
|
1097
|
+
* @private
|
|
1098
|
+
*/
|
|
1099
|
+
getMeasureAttributeIndex: function(iMeasure, oChartAnnotations) {
|
|
1100
|
+
var aMeasures = oChartAnnotations.Measures,
|
|
1101
|
+
aMeasureAttributes = oChartAnnotations.MeasureAttributes,
|
|
1102
|
+
sMeasurePropertyPath = aMeasures && aMeasures[iMeasure] && aMeasures[iMeasure].$PropertyPath,
|
|
1103
|
+
iMeasureAttribute = -1,
|
|
1104
|
+
fnCheckMeasure = function(sMeasure, oMeasureAttribute, index) {
|
|
1105
|
+
if ((oMeasureAttribute && oMeasureAttribute.Measure && oMeasureAttribute.Measure.$PropertyPath) === sMeasure) {
|
|
1106
|
+
iMeasureAttribute = index;
|
|
1107
|
+
return true;
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
bMeasureAttributeExists = aMeasureAttributes.some(fnCheckMeasure.bind(null, sMeasurePropertyPath));
|
|
1111
|
+
return bMeasureAttributeExists && iMeasureAttribute > -1 && iMeasureAttribute;
|
|
1112
|
+
},
|
|
1113
|
+
/**
|
|
1114
|
+
* This function returns the measureAttribute for the measure.
|
|
1115
|
+
*
|
|
1116
|
+
* @param {object} oContext Context to the measure annotation
|
|
1117
|
+
* @returns {string} Path to the measureAttribute of the measure
|
|
1118
|
+
*/
|
|
1119
|
+
getMeasureAttributeForMeasure: function(oContext) {
|
|
1120
|
+
var oMetaModel = oContext.getModel(),
|
|
1121
|
+
sMeasurePath = oContext.getPath(),
|
|
1122
|
+
sChartAnnotationPath = sMeasurePath.substring(0, sMeasurePath.lastIndexOf("Measure")),
|
|
1123
|
+
iMeasure = sMeasurePath.replace(/.*\//, "");
|
|
1124
|
+
|
|
1125
|
+
return oMetaModel.requestObject(sChartAnnotationPath).then(function(oChartAnnotations) {
|
|
1126
|
+
var aMeasureAttributes = oChartAnnotations.MeasureAttributes,
|
|
1127
|
+
iMeasureAttribute = Helper.getMeasureAttributeIndex(iMeasure, oChartAnnotations);
|
|
1128
|
+
var sMeasureAttributePath =
|
|
1129
|
+
iMeasureAttribute > -1 && aMeasureAttributes[iMeasureAttribute] && aMeasureAttributes[iMeasureAttribute].DataPoint
|
|
1130
|
+
? sChartAnnotationPath + "MeasureAttributes/" + iMeasureAttribute + "/"
|
|
1131
|
+
: Log.warning("DataPoint missing for the measure") && undefined;
|
|
1132
|
+
return sMeasureAttributePath ? sMeasureAttributePath + "DataPoint/$AnnotationPath/" : sMeasureAttributePath;
|
|
1133
|
+
});
|
|
1134
|
+
},
|
|
1135
|
+
/**
|
|
1136
|
+
* Method to determine if the contained navigation property has a draft root/node parent entitySet.
|
|
1137
|
+
*
|
|
1138
|
+
* @function
|
|
1139
|
+
* @name isDraftParentEntityForContainment
|
|
1140
|
+
* @param {object} oTargetCollectionContainsTarget Target collection has ContainsTarget property
|
|
1141
|
+
* @param {object} oTableMetadata Table metadata for which draft support shall be checked
|
|
1142
|
+
* @returns {boolean} Returns true if draft
|
|
1143
|
+
*/
|
|
1144
|
+
isDraftParentEntityForContainment: function(oTargetCollectionContainsTarget, oTableMetadata) {
|
|
1145
|
+
if (oTargetCollectionContainsTarget) {
|
|
1146
|
+
if (oTableMetadata && oTableMetadata.parentEntitySet && oTableMetadata.parentEntitySet.sPath) {
|
|
1147
|
+
var sParentEntitySetPath = oTableMetadata.parentEntitySet.sPath;
|
|
1148
|
+
var oDraftRoot = oTableMetadata.parentEntitySet.oModel.getObject(
|
|
1149
|
+
sParentEntitySetPath + "@com.sap.vocabularies.Common.v1.DraftRoot"
|
|
1150
|
+
);
|
|
1151
|
+
var oDraftNode = oTableMetadata.parentEntitySet.oModel.getObject(
|
|
1152
|
+
sParentEntitySetPath + "@com.sap.vocabularies.Common.v1.DraftNode"
|
|
1153
|
+
);
|
|
1154
|
+
if (oDraftRoot || oDraftNode) {
|
|
1155
|
+
return true;
|
|
1156
|
+
} else {
|
|
1157
|
+
return false;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
} else {
|
|
1161
|
+
return false;
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
848
1164
|
|
|
849
1165
|
/**
|
|
850
1166
|
* Ensures the data is processed as defined in the template.
|