@sapui5/sap.fe.core 1.94.0 → 1.96.3
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/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +3 -3
- package/src/sap/fe/core/AppComponent.js +10 -41
- package/src/sap/fe/core/AppStateHandler.js +18 -4
- package/src/sap/fe/core/BaseController.js +1 -1
- package/src/sap/fe/core/BusyLocker.js +13 -1
- package/src/sap/fe/core/CommonUtils.js +372 -9
- package/src/sap/fe/core/ExtensionAPI.js +1 -1
- package/src/sap/fe/core/PageController.js +11 -3
- package/src/sap/fe/core/RouterProxy.js +59 -69
- package/src/sap/fe/core/Synchronization.js +1 -1
- package/src/sap/fe/core/TemplateComponent.js +9 -3
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TransactionHelper.js +157 -111
- package/src/sap/fe/core/actions/draft.js +1 -1
- package/src/sap/fe/core/actions/messageHandling.js +1 -1
- package/src/sap/fe/core/actions/nonDraft.js +1 -1
- package/src/sap/fe/core/actions/operations.js +25 -3
- package/src/sap/fe/core/actions/sticky.js +1 -1
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.js +89 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +14 -7
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +128 -25
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +197 -210
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +844 -168
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +903 -189
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +1 -1
- package/src/sap/fe/core/controllerextensions/PageReady.js +31 -17
- package/src/sap/fe/core/controllerextensions/PageReady.ts +50 -15
- package/src/sap/fe/core/controllerextensions/Paginator.js +20 -4
- package/src/sap/fe/core/controllerextensions/Placeholder.js +134 -271
- package/src/sap/fe/core/controllerextensions/Routing.js +1 -1
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js +20 -7
- package/src/sap/fe/core/controllerextensions/SideEffects.js +2 -3
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +13 -12
- package/src/sap/fe/core/controllerextensions/ViewState.js +174 -7
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +39 -34
- package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +35 -0
- package/src/sap/fe/core/controls/CommandExecution.js +1 -1
- package/src/sap/fe/core/controls/ConditionalWrapper.js +1 -1
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +4 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
- package/src/sap/fe/core/controls/FieldWrapper.js +1 -1
- package/src/sap/fe/core/controls/FilterBar.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +5 -8
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +83 -23
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +2 -6
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +25 -18
- package/src/sap/fe/core/converters/ConverterContext.js +18 -4
- package/src/sap/fe/core/converters/ConverterContext.ts +13 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +4 -1
- package/src/sap/fe/core/converters/MetaModelConverter.js +855 -868
- package/src/sap/fe/core/converters/MetaModelConverter.ts +763 -826
- package/src/sap/fe/core/converters/annotations/DataField.js +52 -2
- package/src/sap/fe/core/converters/annotations/DataField.ts +52 -2
- package/src/sap/fe/core/converters/controls/Common/Action.js +6 -1
- package/src/sap/fe/core/converters/controls/Common/Action.ts +3 -0
- package/src/sap/fe/core/converters/controls/Common/Chart.js +85 -6
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +80 -2
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +15 -16
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +16 -30
- package/src/sap/fe/core/converters/controls/Common/Form.js +17 -8
- package/src/sap/fe/core/converters/controls/Common/Form.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/KPI.js +287 -109
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +314 -139
- package/src/sap/fe/core/converters/controls/Common/Table.js +273 -105
- package/src/sap/fe/core/converters/controls/Common/Table.ts +319 -111
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +8 -20
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +11 -15
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +44 -15
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +41 -19
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +74 -0
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +50 -0
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +15 -7
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +27 -6
- package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -30
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +17 -28
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +2 -2
- package/src/sap/fe/core/converters/helpers/ID.js +1 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +2 -2
- package/src/sap/fe/core/converters/helpers/IssueManager.js +3 -3
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +2 -2
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +11 -6
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +9 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +15 -2
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +14 -14
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +2 -2
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +1 -1
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +73 -8
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +70 -10
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +82 -16
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +100 -17
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +8 -3
- package/src/sap/fe/core/fpm/Component.js +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +17 -2
- package/src/sap/fe/core/helpers/BindingExpression.ts +14 -1
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -1
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -3
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/ModelHelper.js +28 -1
- package/src/sap/fe/core/helpers/PasteHelper.js +7 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/StableIdHelper.js +2 -2
- package/src/sap/fe/core/helpers/StableIdHelper.ts +1 -1
- package/src/sap/fe/core/library.js +2 -2
- package/src/sap/fe/core/library.support.js +1 -1
- package/src/sap/fe/core/messagebundle.properties +30 -1
- package/src/sap/fe/core/messagebundle_ar.properties +14 -0
- package/src/sap/fe/core/messagebundle_bg.properties +14 -0
- package/src/sap/fe/core/messagebundle_ca.properties +15 -1
- package/src/sap/fe/core/messagebundle_cs.properties +14 -0
- package/src/sap/fe/core/messagebundle_cy.properties +14 -0
- package/src/sap/fe/core/messagebundle_da.properties +14 -0
- package/src/sap/fe/core/messagebundle_de.properties +14 -0
- package/src/sap/fe/core/messagebundle_el.properties +14 -0
- package/src/sap/fe/core/messagebundle_en.properties +14 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +14 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +14 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +20 -2
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +14 -0
- package/src/sap/fe/core/messagebundle_es.properties +21 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +15 -1
- package/src/sap/fe/core/messagebundle_et.properties +14 -0
- package/src/sap/fe/core/messagebundle_fi.properties +14 -0
- package/src/sap/fe/core/messagebundle_fr.properties +18 -4
- package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -0
- package/src/sap/fe/core/messagebundle_hi.properties +14 -0
- package/src/sap/fe/core/messagebundle_hr.properties +14 -0
- package/src/sap/fe/core/messagebundle_hu.properties +14 -0
- package/src/sap/fe/core/messagebundle_id.properties +14 -0
- package/src/sap/fe/core/messagebundle_it.properties +14 -0
- package/src/sap/fe/core/messagebundle_iw.properties +15 -1
- package/src/sap/fe/core/messagebundle_ja.properties +14 -0
- package/src/sap/fe/core/messagebundle_kk.properties +14 -0
- package/src/sap/fe/core/messagebundle_ko.properties +14 -0
- package/src/sap/fe/core/messagebundle_lt.properties +14 -0
- package/src/sap/fe/core/messagebundle_lv.properties +14 -0
- package/src/sap/fe/core/messagebundle_ms.properties +14 -0
- package/src/sap/fe/core/messagebundle_nl.properties +18 -4
- package/src/sap/fe/core/messagebundle_no.properties +15 -1
- package/src/sap/fe/core/messagebundle_pl.properties +15 -1
- package/src/sap/fe/core/messagebundle_pt.properties +14 -0
- package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -0
- package/src/sap/fe/core/messagebundle_ro.properties +14 -0
- package/src/sap/fe/core/messagebundle_ru.properties +14 -0
- package/src/sap/fe/core/messagebundle_sh.properties +14 -0
- package/src/sap/fe/core/messagebundle_sk.properties +14 -0
- package/src/sap/fe/core/messagebundle_sl.properties +14 -0
- package/src/sap/fe/core/messagebundle_sv.properties +14 -0
- package/src/sap/fe/core/messagebundle_th.properties +14 -0
- package/src/sap/fe/core/messagebundle_tr.properties +14 -0
- package/src/sap/fe/core/messagebundle_uk.properties +14 -0
- package/src/sap/fe/core/messagebundle_vi.properties +14 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +14 -0
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.js +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +114 -44
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +2 -2
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +12 -2
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.js +3 -14
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +3 -10
- package/src/sap/fe/core/templating/EntitySetHelper.js +13 -3
- package/src/sap/fe/core/templating/EntitySetHelper.ts +4 -0
- package/src/sap/fe/core/templating/FilterHelper.js +2 -2
- package/src/sap/fe/core/templating/FilterHelper.ts +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js +41 -3
- package/src/sap/fe/core/templating/UIFormatters.ts +74 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
sap.ui.define(
|
|
@@ -693,14 +693,24 @@ sap.ui.define(
|
|
|
693
693
|
return aOutAttributes;
|
|
694
694
|
}
|
|
695
695
|
|
|
696
|
+
function _fnCheckIsMatch(oObject, oKeysToCheck) {
|
|
697
|
+
for (var sKey in oKeysToCheck) {
|
|
698
|
+
if (oKeysToCheck[sKey] !== oObject[sKey]) {
|
|
699
|
+
return false;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
return true;
|
|
703
|
+
}
|
|
704
|
+
|
|
696
705
|
/**
|
|
697
706
|
* Method to get metadata of entityset properties.
|
|
698
707
|
*
|
|
699
708
|
* @param {object} oMetaModel MetaModel for annotations
|
|
700
709
|
* @param {string} sContextPath ContextPath for properities
|
|
710
|
+
* @param {object} oFilter Filter for the properties
|
|
701
711
|
* @returns {object} The entity type properties
|
|
702
712
|
*/
|
|
703
|
-
function fnGetContextPathProperties(oMetaModel, sContextPath) {
|
|
713
|
+
function fnGetContextPathProperties(oMetaModel, sContextPath, oFilter) {
|
|
704
714
|
var oEntityType = oMetaModel.getObject(sContextPath + "/") || {},
|
|
705
715
|
oProperties = {};
|
|
706
716
|
|
|
@@ -709,7 +719,7 @@ sap.ui.define(
|
|
|
709
719
|
oEntityType.hasOwnProperty(sKey) &&
|
|
710
720
|
!/^\$/i.test(sKey) &&
|
|
711
721
|
oEntityType[sKey].$kind &&
|
|
712
|
-
oEntityType[sKey]
|
|
722
|
+
_fnCheckIsMatch(oEntityType[sKey], oFilter || { $kind: "Property" })
|
|
713
723
|
) {
|
|
714
724
|
oProperties[sKey] = oEntityType[sKey];
|
|
715
725
|
}
|
|
@@ -787,7 +797,7 @@ sap.ui.define(
|
|
|
787
797
|
params: oParams
|
|
788
798
|
})
|
|
789
799
|
.then(function(aLink) {
|
|
790
|
-
oIBNAction.setVisible(aLink && aLink.length === 1);
|
|
800
|
+
oIBNAction.setVisible(oIBNAction.getVisible() && aLink && aLink.length === 1);
|
|
791
801
|
})
|
|
792
802
|
.catch(function(oError) {
|
|
793
803
|
Log.error("Cannot retrieve the links from the shell service", oError);
|
|
@@ -815,8 +825,8 @@ sap.ui.define(
|
|
|
815
825
|
*
|
|
816
826
|
* @param {string} sFrameworkKey Current key.
|
|
817
827
|
* @param {object} oResourceBundle Contains the local resource bundle
|
|
818
|
-
* @param {object} oParams Parameter object for the resource value
|
|
819
|
-
* @param {
|
|
828
|
+
* @param {object} [oParams] Parameter object for the resource value
|
|
829
|
+
* @param {string} [sEntitySetName] EntitySet name of the control where the resource is being used
|
|
820
830
|
* @returns {string} The translated text
|
|
821
831
|
*/
|
|
822
832
|
function getTranslatedText(sFrameworkKey, oResourceBundle, oParams, sEntitySetName) {
|
|
@@ -929,11 +939,39 @@ sap.ui.define(
|
|
|
929
939
|
return oTextAnnotation ? "DescriptionValue" : "Value";
|
|
930
940
|
}
|
|
931
941
|
|
|
942
|
+
function _getEntityType(oContext) {
|
|
943
|
+
var oMetaModel = oContext.getModel().getMetaModel();
|
|
944
|
+
return oMetaModel.getObject(oMetaModel.getMetaPath(oContext.getPath()) + "/$Type");
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
function _requestObject(sAction, oSelectedContext, sProperty) {
|
|
948
|
+
var oContext = oSelectedContext,
|
|
949
|
+
nBracketIndex = sAction.indexOf("(");
|
|
950
|
+
|
|
951
|
+
if (nBracketIndex > -1) {
|
|
952
|
+
var sTargetType = sAction.slice(nBracketIndex + 1, -1),
|
|
953
|
+
sCurrentType = _getEntityType(oContext);
|
|
954
|
+
|
|
955
|
+
while (sCurrentType !== sTargetType) {
|
|
956
|
+
// Find parent binding context and retrieve entity type
|
|
957
|
+
oContext = oContext.getBinding().getContext();
|
|
958
|
+
if (oContext) {
|
|
959
|
+
sCurrentType = _getEntityType(oContext);
|
|
960
|
+
} else {
|
|
961
|
+
Log.warn("Cannot determine target type to request property value for bound action invocation");
|
|
962
|
+
return Promise.resolve(undefined);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
return oContext.requestObject(sProperty);
|
|
968
|
+
}
|
|
969
|
+
|
|
932
970
|
function _requestProperty(oSelectedContext, sAction, sProperty, sDynamicActionEnabledPath) {
|
|
933
971
|
var oPromise =
|
|
934
972
|
sProperty && sProperty.indexOf("/") === 0
|
|
935
973
|
? requestSingletonProperty(sProperty, oSelectedContext.getModel())
|
|
936
|
-
: oSelectedContext
|
|
974
|
+
: _requestObject(sAction, oSelectedContext, sProperty);
|
|
937
975
|
|
|
938
976
|
return oPromise.then(function(vPropertyValue) {
|
|
939
977
|
return Promise.resolve({
|
|
@@ -1410,13 +1448,14 @@ sap.ui.define(
|
|
|
1410
1448
|
* @param {object} oSelectionVariant Instance of {@link sap.fe.navigation.SelectionVariant} SelectionVariant to be used.
|
|
1411
1449
|
* @param {object} mFilters Conditons to be added to the SelectionVariant
|
|
1412
1450
|
* @param {object} oTargetInfo Object returned after selection variant from the table is prepared.
|
|
1451
|
+
* @param {object} oFilterInfo Object containing the converted FilterBar filters
|
|
1413
1452
|
* @returns {object} Instance of {@link sap.fe.navigation.SelectionVariant} SelectionVariant with the conditions.
|
|
1414
1453
|
* @private
|
|
1415
1454
|
* @ui5-restricted
|
|
1416
1455
|
* @example <code>
|
|
1417
1456
|
* </code>
|
|
1418
1457
|
*/
|
|
1419
|
-
function addExternalStateFiltersToSelectionVariant(oSelectionVariant, mFilters, oTargetInfo) {
|
|
1458
|
+
function addExternalStateFiltersToSelectionVariant(oSelectionVariant, mFilters, oTargetInfo, oFilterInfo) {
|
|
1420
1459
|
var sFilter,
|
|
1421
1460
|
sLow = "",
|
|
1422
1461
|
sHigh = null;
|
|
@@ -1447,6 +1486,10 @@ sap.ui.define(
|
|
|
1447
1486
|
case "EQ":
|
|
1448
1487
|
oSelectOptionState.option = sOperator;
|
|
1449
1488
|
break;
|
|
1489
|
+
case "TODAY":
|
|
1490
|
+
case "DATE":
|
|
1491
|
+
oSelectOptionState.option = "EQ";
|
|
1492
|
+
break;
|
|
1450
1493
|
case "EEQ":
|
|
1451
1494
|
oSelectOptionState.option = "EQ";
|
|
1452
1495
|
break;
|
|
@@ -1506,6 +1549,13 @@ sap.ui.define(
|
|
|
1506
1549
|
var oFilter = aFilters[item];
|
|
1507
1550
|
sLow = (oFilter.values[0] && oFilter.values[0].toString()) || "";
|
|
1508
1551
|
sHigh = (oFilter.values[1] && oFilter.values[1].toString()) || null;
|
|
1552
|
+
if (oFilter.operator === "TODAY" || oFilter.operator === "DATE") {
|
|
1553
|
+
var aFilter = oFilterInfo[0].aFilters.filter(function(oFilter) {
|
|
1554
|
+
return oFilter.sPath === sFilter;
|
|
1555
|
+
});
|
|
1556
|
+
sLow = aFilter[0].oValue1 || "";
|
|
1557
|
+
sHigh = null;
|
|
1558
|
+
}
|
|
1509
1559
|
var oSelectOptionValues = fnGetSignAndOption(oFilter.operator, sLow, sHigh);
|
|
1510
1560
|
if (oSelectOptionValues.option) {
|
|
1511
1561
|
oSelectionVariant.addSelectOption(
|
|
@@ -2172,6 +2222,52 @@ sap.ui.define(
|
|
|
2172
2222
|
return Promise.resolve(null);
|
|
2173
2223
|
}
|
|
2174
2224
|
|
|
2225
|
+
/**
|
|
2226
|
+
* Add binding event listener.
|
|
2227
|
+
*
|
|
2228
|
+
* @param {object} oControl Control instance
|
|
2229
|
+
* @param {object} sEventName Event name
|
|
2230
|
+
* @param {object} fHandler Handler to be called
|
|
2231
|
+
* @private
|
|
2232
|
+
* @ui5-restricted
|
|
2233
|
+
*/
|
|
2234
|
+
function addEventToBindingInfo(oControl, sEventName, fHandler) {
|
|
2235
|
+
var oBindingInfo;
|
|
2236
|
+
var setBindingInfo = function() {
|
|
2237
|
+
if (oBindingInfo) {
|
|
2238
|
+
if (!oBindingInfo.events) {
|
|
2239
|
+
oBindingInfo.events = {};
|
|
2240
|
+
}
|
|
2241
|
+
if (!oBindingInfo.events[sEventName]) {
|
|
2242
|
+
oBindingInfo.events[sEventName] = fHandler;
|
|
2243
|
+
} else {
|
|
2244
|
+
var fOriginalHandler = oBindingInfo.events[sEventName];
|
|
2245
|
+
oBindingInfo.events[sEventName] = function() {
|
|
2246
|
+
fHandler.apply(this, arguments);
|
|
2247
|
+
fOriginalHandler.apply(this, arguments);
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
};
|
|
2252
|
+
if (oControl.isA("sap.ui.mdc.ChartNew")) {
|
|
2253
|
+
oControl
|
|
2254
|
+
.innerChartBound()
|
|
2255
|
+
.then(function() {
|
|
2256
|
+
oBindingInfo = oControl
|
|
2257
|
+
.getControlDelegate()
|
|
2258
|
+
._getChart(oControl)
|
|
2259
|
+
.getBindingInfo("data");
|
|
2260
|
+
setBindingInfo();
|
|
2261
|
+
})
|
|
2262
|
+
.catch(function(sError) {
|
|
2263
|
+
Log.error(sError);
|
|
2264
|
+
});
|
|
2265
|
+
} else {
|
|
2266
|
+
oBindingInfo = oControl.data("rowsBindingInfo");
|
|
2267
|
+
setBindingInfo();
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2175
2271
|
function loadMacroLibrary() {
|
|
2176
2272
|
return new Promise(function(resolve, reject) {
|
|
2177
2273
|
sap.ui.require(["sap/fe/macros/macroLibrary"], function(/*macroLibrary*/) {
|
|
@@ -2180,6 +2276,263 @@ sap.ui.define(
|
|
|
2180
2276
|
});
|
|
2181
2277
|
}
|
|
2182
2278
|
|
|
2279
|
+
/**
|
|
2280
|
+
* Check if given path resides in the context path provided.
|
|
2281
|
+
*
|
|
2282
|
+
* @function
|
|
2283
|
+
* @name sap.fe.core.CommonUtils.isPathApplicableToContextPath
|
|
2284
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2285
|
+
* @param {object} [oMetaModel] MetaModel to be used
|
|
2286
|
+
* @param {string} [sContextPath] Context path to be used
|
|
2287
|
+
* @param {string} [sPath] Path to be used
|
|
2288
|
+
* @param {string} [sStrategy] Strategy, it could be 'self' | 'includingDependents'
|
|
2289
|
+
* @returns {boolean} If path is applicable to context.
|
|
2290
|
+
**/
|
|
2291
|
+
function isPathApplicableToContextPath(oMetaModel, sContextPath, sPath, sStrategy) {
|
|
2292
|
+
var sContextPathToCheck = sContextPath.startsWith("/") ? sContextPath : "/" + sContextPath,
|
|
2293
|
+
sPathToCheck = sPath.startsWith("/") ? sPath : "/" + sPath,
|
|
2294
|
+
fnIsApplicable = function(sPrimaryPath, sKey) {
|
|
2295
|
+
return sPrimaryPath === sKey || (sStrategy === "includingDependents" && sPrimaryPath.startsWith(sKey));
|
|
2296
|
+
},
|
|
2297
|
+
fnSimplifyEntitySetPath = function(sEntitySetPathToUse) {
|
|
2298
|
+
var sEntitySetPath = ModelHelper.getEntitySetPath(sEntitySetPathToUse);
|
|
2299
|
+
var sEntitySet = sEntitySetPath.indexOf("$NavigationPropertyBinding") > -1 && oMetaModel.getObject(sEntitySetPath);
|
|
2300
|
+
return sEntitySet ? "/" + sEntitySet : sEntitySetPathToUse;
|
|
2301
|
+
};
|
|
2302
|
+
|
|
2303
|
+
if (!fnIsApplicable(sContextPathToCheck, sPathToCheck)) {
|
|
2304
|
+
sContextPathToCheck = fnSimplifyEntitySetPath(sContextPathToCheck);
|
|
2305
|
+
|
|
2306
|
+
if (!fnIsApplicable(sContextPathToCheck, sPathToCheck)) {
|
|
2307
|
+
sPathToCheck = fnSimplifyEntitySetPath(sPathToCheck);
|
|
2308
|
+
} else {
|
|
2309
|
+
return true;
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
return fnIsApplicable(sContextPathToCheck, sPathToCheck);
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* Get controls to refresh in a view.
|
|
2318
|
+
*
|
|
2319
|
+
* @function
|
|
2320
|
+
* @name sap.fe.core.CommonUtils.getControlsForRefresh
|
|
2321
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2322
|
+
* @param {object} [oView] View of the controls
|
|
2323
|
+
* @param {Array} [aViewControls] Controls to be checked
|
|
2324
|
+
* @returns {Array} Controls that need to be refreshed
|
|
2325
|
+
**/
|
|
2326
|
+
function getControlsForRefresh(oView, aViewControls) {
|
|
2327
|
+
var aControls = [],
|
|
2328
|
+
oMetaModel = oView.getModel().getMetaModel(),
|
|
2329
|
+
oInternalModel = oView.getModel("internal"),
|
|
2330
|
+
oRefreshStrategyForKeepAliveRestore = oInternalModel.getProperty("/refreshStrategyOnAppRestore") || {};
|
|
2331
|
+
|
|
2332
|
+
if (aViewControls) {
|
|
2333
|
+
aViewControls.forEach(function(oControl) {
|
|
2334
|
+
var sContextPath = oControl.data("targetCollectionPath");
|
|
2335
|
+
|
|
2336
|
+
for (var sKey in oRefreshStrategyForKeepAliveRestore) {
|
|
2337
|
+
var sStrategy = oRefreshStrategyForKeepAliveRestore[sKey];
|
|
2338
|
+
if (CommonUtils.isPathApplicableToContextPath(oMetaModel, sContextPath, sKey, sStrategy)) {
|
|
2339
|
+
aControls.push(oControl);
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
return aControls;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
/**
|
|
2349
|
+
* Get refresh strategy for the control for a context path.
|
|
2350
|
+
*
|
|
2351
|
+
* @function
|
|
2352
|
+
* @name sap.fe.core.CommonUtils.getControlRefreshStrategyForContextPath
|
|
2353
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2354
|
+
* @param {object} [oControl] Control from which refresh info is needed
|
|
2355
|
+
* @param {string} sContextPath ContextPath for properities
|
|
2356
|
+
* @returns {string} Strategy for control refresh
|
|
2357
|
+
**/
|
|
2358
|
+
|
|
2359
|
+
function getControlRefreshStrategyForContextPath(oControl, sContextPath) {
|
|
2360
|
+
var oMetaModel = oControl.getModel().getMetaModel(),
|
|
2361
|
+
oInternalModel = oControl.getModel("internal"),
|
|
2362
|
+
oRefreshStrategyForKeepAliveRestore = oInternalModel.getProperty("/refreshStrategyOnAppRestore"),
|
|
2363
|
+
sStrategy;
|
|
2364
|
+
|
|
2365
|
+
if (sContextPath) {
|
|
2366
|
+
for (var sKey in oRefreshStrategyForKeepAliveRestore) {
|
|
2367
|
+
var sStrategyToCheck = oRefreshStrategyForKeepAliveRestore[sKey];
|
|
2368
|
+
if (CommonUtils.isPathApplicableToContextPath(oMetaModel, sContextPath, sKey, sStrategyToCheck)) {
|
|
2369
|
+
sStrategy = sStrategyToCheck;
|
|
2370
|
+
if (sStrategy === "includingDependents") {
|
|
2371
|
+
break;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
return sStrategy;
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
/**
|
|
2381
|
+
* Get refresh info from view.
|
|
2382
|
+
*
|
|
2383
|
+
* @function
|
|
2384
|
+
* @name sap.fe.core.CommonUtils.getViewRefreshInfo
|
|
2385
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2386
|
+
* @param {object} [oView] View from which refresh info is needed
|
|
2387
|
+
* @returns {string} Strategy for view refresh
|
|
2388
|
+
**/
|
|
2389
|
+
function getViewRefreshInfo(oView) {
|
|
2390
|
+
var mViewData = oView.getViewData(),
|
|
2391
|
+
sContextPath = mViewData && (mViewData.contextPath || "/" + mViewData.entitySet);
|
|
2392
|
+
|
|
2393
|
+
return CommonUtils.getControlRefreshStrategyForContextPath(oView, sContextPath);
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
/**
|
|
2397
|
+
* Get MetaPath for the context.
|
|
2398
|
+
*
|
|
2399
|
+
* @function
|
|
2400
|
+
* @name sap.fe.core.CommonUtils.getMetaPathForContext
|
|
2401
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2402
|
+
* @param {object} [oContext] Outbound defined in app descriptor
|
|
2403
|
+
* @returns {string} Meta path for the context
|
|
2404
|
+
**/
|
|
2405
|
+
function getMetaPathForContext(oContext) {
|
|
2406
|
+
var oModel = oContext && oContext.getModel && oContext.getModel(),
|
|
2407
|
+
oMetaModel = oModel && oModel.getMetaModel && oModel.getMetaModel(),
|
|
2408
|
+
sPath = oContext && oContext.getPath && oContext.getPath();
|
|
2409
|
+
|
|
2410
|
+
return oMetaModel && sPath && oMetaModel.getMetaPath && oMetaModel.getMetaPath(sPath);
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
/**
|
|
2414
|
+
* Get MetaPath for the listbinding.
|
|
2415
|
+
*
|
|
2416
|
+
* @function
|
|
2417
|
+
* @name sap.fe.core.CommonUtils.getAbsoluteMetaPathForListBinding
|
|
2418
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2419
|
+
* @param {object} [oView] The View
|
|
2420
|
+
* @param {sap.ui.model.odata.v4.ODataListBinding|string} vListBinding ODataListBinding object or the binding path for a temporary list binding
|
|
2421
|
+
* @returns {string} Meta path for the listbinding
|
|
2422
|
+
**/
|
|
2423
|
+
function getAbsoluteMetaPathForListBinding(oView, vListBinding) {
|
|
2424
|
+
var oMetaModel = oView.getModel().getMetaModel(),
|
|
2425
|
+
sMetaPath;
|
|
2426
|
+
if (vListBinding && typeof vListBinding === "object") {
|
|
2427
|
+
// we already get a list binding use this one
|
|
2428
|
+
var oBinding = vListBinding;
|
|
2429
|
+
var oRootBinding = oBinding.getRootBinding();
|
|
2430
|
+
if (oBinding === oRootBinding) {
|
|
2431
|
+
// absolute path
|
|
2432
|
+
sMetaPath = oMetaModel.getMetaPath(oBinding.getPath());
|
|
2433
|
+
} else {
|
|
2434
|
+
// relative path
|
|
2435
|
+
var sRootBindingPath = oRootBinding.getPath();
|
|
2436
|
+
var sRelativePath = oBinding.getPath();
|
|
2437
|
+
sMetaPath = oMetaModel.getMetaPath(sRootBindingPath + "/" + sRelativePath);
|
|
2438
|
+
}
|
|
2439
|
+
} else if (typeof vListBinding === "string") {
|
|
2440
|
+
if (vListBinding.startsWith("/")) {
|
|
2441
|
+
// absolute path
|
|
2442
|
+
sMetaPath = oMetaModel.getMetaPath(vListBinding);
|
|
2443
|
+
} else {
|
|
2444
|
+
// relative path
|
|
2445
|
+
var oBindingContext = oView.getBindingContext();
|
|
2446
|
+
var sRootContextPath = oBindingContext.getPath();
|
|
2447
|
+
sMetaPath = oMetaModel.getMetaPath(sRootContextPath + "/" + vListBinding);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
return sMetaPath;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/**
|
|
2454
|
+
* Get refresh strategy for an intent.
|
|
2455
|
+
*
|
|
2456
|
+
* @function
|
|
2457
|
+
* @name sap.fe.core.CommonUtils.getRefreshStrategyForIntent
|
|
2458
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2459
|
+
* @param {object} mRefreshStrategies RefreshStrategies to consider
|
|
2460
|
+
* @param {string} sSemanticObject Outbound Semantic Object
|
|
2461
|
+
* @param {string} sAction Outbound Action
|
|
2462
|
+
* @returns {object} Meta path for the context
|
|
2463
|
+
**/
|
|
2464
|
+
function getRefreshStrategyForIntent(mRefreshStrategies, sSemanticObject, sAction) {
|
|
2465
|
+
return (
|
|
2466
|
+
(mRefreshStrategies.intents &&
|
|
2467
|
+
((sSemanticObject && sAction && mRefreshStrategies.intents[sSemanticObject + "-" + sAction]) ||
|
|
2468
|
+
(sSemanticObject && mRefreshStrategies.intents[sSemanticObject]))) ||
|
|
2469
|
+
mRefreshStrategies["defaultBehavior"] ||
|
|
2470
|
+
mRefreshStrategies["_feDefault"]
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* Store control refresh strategy for hash in the internal model.
|
|
2476
|
+
*
|
|
2477
|
+
* @function
|
|
2478
|
+
* @name sap.fe.core.CommonUtils.storeControlRefreshStrategyForHash
|
|
2479
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2480
|
+
* @param {object} oControl Control for the refresh strategy
|
|
2481
|
+
* @param {object} oHash Shell hash object
|
|
2482
|
+
**/
|
|
2483
|
+
function storeControlRefreshStrategyForHash(oControl, oHash) {
|
|
2484
|
+
if (oControl && oControl.getModel("viewData") && oControl.getModel("internal")) {
|
|
2485
|
+
var mViewData = oControl.getModel("viewData");
|
|
2486
|
+
var oRefreshStrategies = mViewData.getObject("/refreshStrategyOnAppRestore");
|
|
2487
|
+
if (oRefreshStrategies) {
|
|
2488
|
+
var mInternalModel = oControl.getModel("internal");
|
|
2489
|
+
var oRefreshStrategy = CommonUtils.getRefreshStrategyForIntent(
|
|
2490
|
+
oRefreshStrategies,
|
|
2491
|
+
oHash && oHash.semanticObject,
|
|
2492
|
+
oHash && oHash.action
|
|
2493
|
+
);
|
|
2494
|
+
|
|
2495
|
+
mInternalModel.setProperty("/refreshStrategyOnAppRestore", oRefreshStrategy);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* Method to refresh and restore the view if neccessary.
|
|
2501
|
+
*
|
|
2502
|
+
* @function
|
|
2503
|
+
* @name sap.fe.core.CommonUtils.restoreView
|
|
2504
|
+
* @memberof sap.fe.core.CommonUtils
|
|
2505
|
+
* @param {object} oView Control for the refresh strategy
|
|
2506
|
+
* @returns {Promise} A promise after view refresh and restore are triggered
|
|
2507
|
+
**/
|
|
2508
|
+
function restoreView(oView) {
|
|
2509
|
+
var oInternalModelContext = oView.getBindingContext("internal");
|
|
2510
|
+
var oController = oView.getController();
|
|
2511
|
+
var oViewState = oController.viewState;
|
|
2512
|
+
var pRefreshBindings = Promise.resolve();
|
|
2513
|
+
if (oInternalModelContext.getProperty("restoreStatus") === "pending") {
|
|
2514
|
+
if (oViewState.refreshViewBindings) {
|
|
2515
|
+
pRefreshBindings = oViewState.refreshViewBindings();
|
|
2516
|
+
pRefreshBindings
|
|
2517
|
+
.then(function() {
|
|
2518
|
+
Log.info("FE V4: Refresh was triggered successfull: " + oView.getId());
|
|
2519
|
+
})
|
|
2520
|
+
.catch(function(err) {
|
|
2521
|
+
Log.warning("FE V4: Refresh was unsuccessfull: " + oView.getId(), err);
|
|
2522
|
+
});
|
|
2523
|
+
}
|
|
2524
|
+
pRefreshBindings
|
|
2525
|
+
.then(function() {
|
|
2526
|
+
oViewState.onRestore();
|
|
2527
|
+
oInternalModelContext.setProperty("restoreStatus", "done");
|
|
2528
|
+
})
|
|
2529
|
+
.catch(function(err) {
|
|
2530
|
+
Log.warning("FE V4: Restore was unsuccessfull: " + oView.getId());
|
|
2531
|
+
});
|
|
2532
|
+
}
|
|
2533
|
+
return pRefreshBindings;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2183
2536
|
var CommonUtils = {
|
|
2184
2537
|
isPropertyFilterable: isPropertyFilterable,
|
|
2185
2538
|
isFieldControlPathInapplicable: isFieldControlPathInapplicable,
|
|
@@ -2224,6 +2577,7 @@ sap.ui.define(
|
|
|
2224
2577
|
getSpecificAllowedExpression: getSpecificAllowedExpression,
|
|
2225
2578
|
requestSingletonProperty: requestSingletonProperty,
|
|
2226
2579
|
templateControlFragment: templateControlFragment,
|
|
2580
|
+
addEventToBindingInfo: addEventToBindingInfo,
|
|
2227
2581
|
FilterRestrictions: {
|
|
2228
2582
|
REQUIRED_PROPERTIES: "RequiredProperties",
|
|
2229
2583
|
NON_FILTERABLE_PROPERTIES: "NonFilterableProperties",
|
|
@@ -2237,7 +2591,16 @@ sap.ui.define(
|
|
|
2237
2591
|
"SearchExpression",
|
|
2238
2592
|
"MultiRangeOrSearchExpression"
|
|
2239
2593
|
],
|
|
2240
|
-
fnProcessDataLossOrDraftDiscardConfirmation: fnProcessDataLossOrDraftDiscardConfirmation
|
|
2594
|
+
fnProcessDataLossOrDraftDiscardConfirmation: fnProcessDataLossOrDraftDiscardConfirmation,
|
|
2595
|
+
isPathApplicableToContextPath: isPathApplicableToContextPath,
|
|
2596
|
+
getControlsForRefresh: getControlsForRefresh,
|
|
2597
|
+
getViewRefreshInfo: getViewRefreshInfo,
|
|
2598
|
+
getMetaPathForContext: getMetaPathForContext,
|
|
2599
|
+
getAbsoluteMetaPathForListBinding: getAbsoluteMetaPathForListBinding,
|
|
2600
|
+
getControlRefreshStrategyForContextPath: getControlRefreshStrategyForContextPath,
|
|
2601
|
+
getRefreshStrategyForIntent: getRefreshStrategyForIntent,
|
|
2602
|
+
storeControlRefreshStrategyForHash: storeControlRefreshStrategyForHash,
|
|
2603
|
+
restoreView: restoreView
|
|
2241
2604
|
};
|
|
2242
2605
|
|
|
2243
2606
|
return CommonUtils;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
sap.ui.define(
|
|
6
6
|
["sap/ui/base/Object", "sap/fe/core/CommonUtils", "sap/base/Log", "sap/ui/core/Component", "sap/ui/model/json/JSONModel"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
sap.ui.define(
|
|
6
6
|
[
|
|
@@ -16,7 +16,8 @@ sap.ui.define(
|
|
|
16
16
|
"sap/fe/core/controllerextensions/InternalIntentBasedNavigation",
|
|
17
17
|
"sap/fe/core/controllerextensions/Share",
|
|
18
18
|
"sap/fe/core/controllerextensions/ViewState",
|
|
19
|
-
"sap/fe/core/controllerextensions/Paginator"
|
|
19
|
+
"sap/fe/core/controllerextensions/Paginator",
|
|
20
|
+
"sap/fe/core/controllerextensions/Placeholder"
|
|
20
21
|
],
|
|
21
22
|
function(
|
|
22
23
|
Controller,
|
|
@@ -31,7 +32,8 @@ sap.ui.define(
|
|
|
31
32
|
InternalIntentBasedNavigation,
|
|
32
33
|
Share,
|
|
33
34
|
ViewState,
|
|
34
|
-
Paginator
|
|
35
|
+
Paginator,
|
|
36
|
+
Placeholder
|
|
35
37
|
) {
|
|
36
38
|
"use strict";
|
|
37
39
|
|
|
@@ -57,6 +59,7 @@ sap.ui.define(
|
|
|
57
59
|
share: Share,
|
|
58
60
|
paginator: Paginator,
|
|
59
61
|
viewState: ViewState,
|
|
62
|
+
placeholder: Placeholder,
|
|
60
63
|
/**
|
|
61
64
|
* @private
|
|
62
65
|
* @name sap.fe.core.PageController.getMetadata
|
|
@@ -101,6 +104,11 @@ sap.ui.define(
|
|
|
101
104
|
this.getView().setModel(oInternalModel, "internal");
|
|
102
105
|
},
|
|
103
106
|
|
|
107
|
+
onBeforeRendering: function() {
|
|
108
|
+
if (this.placeholder.attachHideCallback) {
|
|
109
|
+
this.placeholder.attachHideCallback();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
104
112
|
getExtensionAPI: function() {
|
|
105
113
|
if (!this.extensionAPI) {
|
|
106
114
|
this.extensionAPI = new ExtensionAPI(this);
|