@sapui5/sap.suite.ui.generic.template 1.136.21 → 1.136.22
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/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_CN.properties +2 -2
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +32 -20
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +7 -0
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/Application.js +13 -0
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +18 -3
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +4 -4
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +110 -13
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +24 -4
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +12 -3
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ CONTACT_FAX=\u4F20\u771F
|
|
|
39
39
|
|
|
40
40
|
CONTACT_ADDRESS=\u5730\u5740
|
|
41
41
|
|
|
42
|
-
MESSAGE_SINGLE_VALUE_L_FORM=\u8FC7\u6EE4\u5668
|
|
42
|
+
MESSAGE_SINGLE_VALUE_L_FORM=\u8FC7\u6EE4\u5668\u201C{0}\u201D\u4E0E\u6807\u7B7E\u201C{1}\u201D\u65E0\u5173\u3002\u8BBE\u7F6E\u6B64\u8FC7\u6EE4\u5668\u5BF9\u7ED3\u679C\u6CA1\u6709\u5F71\u54CD\u3002
|
|
43
43
|
|
|
44
44
|
MESSAGE_SINGLE_VALUE_S_FORM=\u65E0\u6CD5\u5728 "{1}" \u6807\u7B7E\u4E0A\u6309 "{0}" \u8FDB\u884C\u8FC7\u6EE4\u3002
|
|
45
45
|
|
|
@@ -55,7 +55,7 @@ EDIT_REMAINING={1} \u4E2A\u5BF9\u8C61\u4E2D\u6709 {0} \u4E2A\u65E0\u6CD5\u8FDB\u
|
|
|
55
55
|
|
|
56
56
|
EDIT_REMAINING_PLURAL={1} \u4E2A\u5BF9\u8C61\u4E2D\u6709 {0} \u4E2A\u65E0\u6CD5\u8FDB\u884C\u7F16\u8F91\u3002\u5982\u679C\u6709\u4EBA\u6B63\u5728\u5904\u7406\u8BE5\u5BF9\u8C61\u6216\u4E0D\u5141\u8BB8\u7F16\u8F91\uFF0C\u5C31\u53EF\u80FD\u4F1A\u53D1\u751F\u8FD9\u79CD\u60C5\u51B5\u3002\n\n \u662F\u5426\u8981\u7F16\u8F91\u5176\u4F59 {2} \u4E2A\u5BF9\u8C61\uFF1F
|
|
57
57
|
|
|
58
|
-
MESSAGE_MULTIPLE_VALUES_L_FORM=\u67D0\u4E9B\u8FC7\u6EE4\u5668\u4E0E\u6807\u7B7E
|
|
58
|
+
MESSAGE_MULTIPLE_VALUES_L_FORM=\u67D0\u4E9B\u8FC7\u6EE4\u5668\u4E0E\u6807\u7B7E\u201C{1}\u201D\u65E0\u5173 ({0})\u3002\u8BBE\u7F6E\u8FD9\u4E9B\u8FC7\u6EE4\u5668\u5BF9\u7ED3\u679C\u6CA1\u6709\u5F71\u54CD\u3002
|
|
59
59
|
|
|
60
60
|
MESSAGE_MULTIPLE_VALUES_S_FORM=\u65E0\u6CD5\u5728 "{1}" \u6807\u7B7E\u4E0A\u4F7F\u7528\u4EE5\u4E0B\u8FC7\u6EE4\u5668\uFF1A"{0}"\u3002
|
|
61
61
|
|
|
@@ -26,6 +26,12 @@ sap.ui.define([
|
|
|
26
26
|
var bIsApplying = false;
|
|
27
27
|
var aBasicFilters = [];
|
|
28
28
|
var oSmartFilterBar = oControl;
|
|
29
|
+
// Holds SVM callbacks once setSVMWrapperCallbacks is called. The afterVariantLoad handler
|
|
30
|
+
// is attached eagerly (in fnInitialize) so it fires even when setSVMWrapperCallbacks has
|
|
31
|
+
// not yet been called (race condition on second navigation: bAllControlsInitialized=true
|
|
32
|
+
// causes fnApplyVariantState to run synchronously, triggering afterVariantLoad before the
|
|
33
|
+
// Promise.all in SmartVariantManagementWrapper resolves and calls setSVMWrapperCallbacks).
|
|
34
|
+
var oSVMWrapperCallbacks = null;
|
|
29
35
|
|
|
30
36
|
var oVariantManagementInitializedPromise;
|
|
31
37
|
|
|
@@ -40,14 +46,39 @@ sap.ui.define([
|
|
|
40
46
|
|
|
41
47
|
// Initialize variant management promise
|
|
42
48
|
oVariantManagementInitializedPromise = oSmartFilterBar.getInitializedPromise();
|
|
49
|
+
|
|
50
|
+
// Attach afterVariantLoad eagerly so custom filter state is restored regardless of
|
|
51
|
+
// when setSVMWrapperCallbacks is called. setManagedControlStates is only called if
|
|
52
|
+
// SVM callbacks are already available; otherwise those controls are restored via the
|
|
53
|
+
// iAppState path (SmartVariantManagementWrapper.fnSetManagedControlStates).
|
|
54
|
+
oSmartFilterBar.attachAfterVariantLoad(function(){
|
|
55
|
+
var oCustomData = oSmartFilterBar.getCustomFilterData();
|
|
56
|
+
// variant stored with 1.103 or later: all customFilter data stored in property customFilters
|
|
57
|
+
// legacy variant stored with 1.102 or earlier: customFilters (from storing point of view) separated according to their origin
|
|
58
|
+
var oCustomFiltersState = oCustomData[dataPropertyNameGeneric].customFilters || {
|
|
59
|
+
editState: oCustomData[dataPropertyNameGeneric].editStateFilter,
|
|
60
|
+
appExtension: oCustomData[dataPropertyNameCustom],
|
|
61
|
+
adaptationExtensions: oCustomData[dataPropertyNameExtension]
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
mParams.oCustomFiltersWrapper.setState(oCustomFiltersState);
|
|
65
|
+
if (oSVMWrapperCallbacks) {
|
|
66
|
+
oSVMWrapperCallbacks.setManagedControlStates(oCustomData[dataPropertyNameGeneric]);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
43
69
|
}
|
|
44
70
|
|
|
71
|
+
// When a variant is loaded, correspondingly we have to get the customData and apply the states to the controls not known to SVM. Again, event and method are implemented
|
|
72
|
+
// in SFB instead of SVM where it would make more sense.
|
|
73
|
+
// Here the event is afterVariantLoad, as the variant content known to SVM/SFB has first to be applied to the SFB, which will also pass the custom data accordingly. Only
|
|
74
|
+
// after this has happened, we can get the custom data from SFB.
|
|
45
75
|
// Attach to variantFetch and variantLoad events to be able to store and restore also custom filters and state of other controls (in case of page VM) with variant.
|
|
46
76
|
// Events for storing/restoring are provided by SFB, data to be stored/restored can come from 3 sources:
|
|
47
77
|
// - standard filters: handled directly by SFB
|
|
48
78
|
// - extension filters: provided from mParams.oCustomFiltersWrapper
|
|
49
79
|
// - other controls being part of VM: provided by oSVMWrapperCallbacks (controls with direct connection to VM are skipped in SVM wrapper)
|
|
50
|
-
function setSVMWrapperCallbacks(
|
|
80
|
+
function setSVMWrapperCallbacks(oCallbacks){
|
|
81
|
+
oSVMWrapperCallbacks = oCallbacks;
|
|
51
82
|
// Before saving the current state as a new variant, we need to provide all state data of controls controlled by VM, but not known to it with setCustomFilterData. From a
|
|
52
83
|
// logical point of view, the event (beforeVariantFetch) as well as the method to store the extension data (setCustomFilterData) belong to SVM, but both are implemented
|
|
53
84
|
// in SFB. Additionally, beforeVariantSave would actually be the name more logical to the consumer, however that name had been used earlier and was deprecated and
|
|
@@ -58,25 +89,6 @@ sap.ui.define([
|
|
|
58
89
|
oCustomData[dataPropertyNameGeneric].customFilters = mParams.oCustomFiltersWrapper.getState();
|
|
59
90
|
oSmartFilterBar.setCustomFilterData(oCustomData);
|
|
60
91
|
});
|
|
61
|
-
|
|
62
|
-
// When a variant is loaded, correspondingly we have to get the customData and apply the states to the controls not known to SVM. Again, event and method are implemented
|
|
63
|
-
// in SFB instead of SVM where it would make more sense.
|
|
64
|
-
// Here the event is afterVariantLoad, as the variant content known to SVM/SFB has first to be applied to the SFB, which will also pass the custom data accordingly. Only
|
|
65
|
-
// after this has happened, we can get the custom data from SFB.
|
|
66
|
-
oSmartFilterBar.attachAfterVariantLoad(function(){
|
|
67
|
-
var oCustomData = oSmartFilterBar.getCustomFilterData();
|
|
68
|
-
// variant stored with 1.103 or later: all customFilter data stored in property customFilters
|
|
69
|
-
// legacy variant stored with 1.102 or earlier: customFilters (from storing point of view) separated according to their origin
|
|
70
|
-
var oCustomFiltersState = oCustomData[dataPropertyNameGeneric].customFilters || {
|
|
71
|
-
editState: oCustomData[dataPropertyNameGeneric].editStateFilter,
|
|
72
|
-
appExtension: oCustomData[dataPropertyNameCustom],
|
|
73
|
-
adaptationExtensions: oCustomData[dataPropertyNameExtension]
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
mParams.oCustomFiltersWrapper.setState(oCustomFiltersState);
|
|
77
|
-
oSVMWrapperCallbacks.setManagedControlStates(oCustomData[dataPropertyNameGeneric]);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
92
|
}
|
|
81
93
|
|
|
82
94
|
function fnGetState() {
|
|
@@ -153,6 +153,13 @@ sap.ui.define([
|
|
|
153
153
|
oState.variantId = oState.sVariantId;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
// Compare current passed and control states. If states are same, setting state make no change, but trigger table refresh.
|
|
157
|
+
// For performance reason we compare object stringified versions. Object key order should not change as it only get applied at runtime.
|
|
158
|
+
var oControlState = bVariantManagementActive ? oVariantManagementStateWrapper.getState() : oSmartControlStateWrapper.getState();
|
|
159
|
+
if (JSON.stringify(oState) === JSON.stringify(oControlState)) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
156
163
|
if (bVariantManagementActive) {
|
|
157
164
|
// In case VariantManagement is configured
|
|
158
165
|
oVariantManagementStateWrapper.setState(oState);
|
|
@@ -966,7 +966,7 @@ sap.ui.define([
|
|
|
966
966
|
* @public
|
|
967
967
|
* @extends sap.ui.core.UIComponent
|
|
968
968
|
* @author SAP SE
|
|
969
|
-
* @version 1.136.
|
|
969
|
+
* @version 1.136.22
|
|
970
970
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
971
971
|
*/
|
|
972
972
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -810,6 +810,18 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
810
810
|
return oTemplateContract.oNavigationControllerProxy.preloadComponent(sRouteName);
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
+
// Returns true when a navigation call will open in a new tab rather than replacing the current app.
|
|
814
|
+
// sap-ushell-navmode (manifest-level) takes priority; sap-ushell-next-navmode (FLP startup parameter,
|
|
815
|
+
// system-level) is the fallback — mirroring how NavigationHandler itself determines explace.
|
|
816
|
+
function fnIsExplaceNavigation(oOutboundParameters) {
|
|
817
|
+
if (oOutboundParameters && oOutboundParameters["sap-ushell-navmode"] === "explace") {
|
|
818
|
+
return true;
|
|
819
|
+
}
|
|
820
|
+
var oComponentData = oTemplateContract.oAppComponent.getComponentData && oTemplateContract.oAppComponent.getComponentData();
|
|
821
|
+
var oStartupParams = oComponentData && oComponentData.startupParameters;
|
|
822
|
+
return !!(oStartupParams && oStartupParams["sap-ushell-next-navmode"] && oStartupParams["sap-ushell-next-navmode"][0] === "explace");
|
|
823
|
+
}
|
|
824
|
+
|
|
813
825
|
oTemplateContract.oApplicationProxy = { // inject own api for AppComponent into the Template Contract. Other classes (NavigationController, BusyHelper) will call these functions accordingly.
|
|
814
826
|
createDraftSiblingPromise: oContextBookkeeping.createDraftSiblingPromise,
|
|
815
827
|
getDraftSiblingPromise: oContextBookkeeping.getDraftSiblingPromise,
|
|
@@ -916,6 +928,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
916
928
|
mustRequireRequestsCanonical: mustRequireRequestsCanonical,
|
|
917
929
|
getNavigationHandler: getNavigationHandler,
|
|
918
930
|
navigateExternal: fnNavigateExternal,
|
|
931
|
+
isExplaceNavigation: fnIsExplaceNavigation,
|
|
919
932
|
getStatePreservationMode: getStatePreservationMode,
|
|
920
933
|
setObjectInEditMode: fnSetObjectInEditMode,
|
|
921
934
|
getObjectInEditMode: fnGetObjectInEditMode,
|
|
@@ -716,7 +716,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
716
716
|
// null object has to be passed as the fourth argument (i.e. for oInnerAppData) to the navigate method as an indicator that the state should not be overwritten
|
|
717
717
|
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
718
718
|
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
719
|
-
if (
|
|
719
|
+
if (oServices.oApplication.isExplaceNavigation(oOutbound.parameters)) {
|
|
720
720
|
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
721
721
|
if (oNavHandler.navigate) {
|
|
722
722
|
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
@@ -736,7 +736,15 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
736
736
|
oCommonUtils.removePropertiesFromNavigationContext(oSelectionVariant, oEventSource);
|
|
737
737
|
oController.adaptNavigationParameterExtension(oSelectionVariant, oObjectInfo);
|
|
738
738
|
oCommonUtils.setComponentRefreshBehaviour(oOutbound);
|
|
739
|
-
|
|
739
|
+
// SmartLink outbounds have no manifest parameters so sap-ushell-navmode is never set.
|
|
740
|
+
// System-level sap-ushell-next-navmode can still force a new tab — bypass the re-entry guard in that case.
|
|
741
|
+
if (oServices.oApplication.isExplaceNavigation()) {
|
|
742
|
+
if (oNavigationHandler.navigate) {
|
|
743
|
+
oNavigationHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
744
|
+
}
|
|
745
|
+
} else {
|
|
746
|
+
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
747
|
+
}
|
|
740
748
|
}
|
|
741
749
|
|
|
742
750
|
function fnHideTitleArea(oSmLiContent,aContactTitleArea) {
|
|
@@ -1111,6 +1119,13 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1111
1119
|
// Sometimes, the SmartLink is located on a field group which belongs to the child entity set of object page.
|
|
1112
1120
|
// So, we have to always derive the entity type from the smart link's binding context.
|
|
1113
1121
|
var oEntityType = ModelUtil.getEntityTypeFromContext(oControl.getBindingContext());
|
|
1122
|
+
// CS20260013063140: ModelUtil.getEntityTypeFromContext returns null when the SmartLink
|
|
1123
|
+
// is resolved via SmartLinkDelegate, because the binding context is not yet resolvable
|
|
1124
|
+
// to an entity type at that point.
|
|
1125
|
+
// Fall back to deriving the entity type from the enclosing entity set instead.
|
|
1126
|
+
if (!oEntityType) {
|
|
1127
|
+
oEntityType = oMetaModel.getODataEntityType(oEntitySet.entityType);
|
|
1128
|
+
}
|
|
1114
1129
|
var oField = oEntityType.property.find(function (oProperty) { return oProperty.name === sSourceClickedField; });
|
|
1115
1130
|
var sTextArrangement = "descriptionAndId";
|
|
1116
1131
|
if (oField) { // TODO: Need to provide the correct field Object using the entityType and corresponding association (should be handled by a BLI)
|
|
@@ -2635,7 +2650,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2635
2650
|
oCommonUtils.setComponentRefreshBehaviour(oOutbound);
|
|
2636
2651
|
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
2637
2652
|
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
2638
|
-
if (
|
|
2653
|
+
if (oServices.oApplication.isExplaceNavigation(oOutbound.parameters)) {
|
|
2639
2654
|
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
2640
2655
|
if (oNavHandler.navigate) {
|
|
2641
2656
|
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
@@ -788,10 +788,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
788
788
|
|
|
789
789
|
setComponentRefreshBehaviour(oOutbound);
|
|
790
790
|
|
|
791
|
-
// We now
|
|
792
|
-
//
|
|
793
|
-
if (oOutbound.parameters
|
|
794
|
-
oNavigationHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, null, null,
|
|
791
|
+
// We now skip setting the app to busy mode when opening a new tab and bypass the re-entry guard (fnNavigateExternal) for explace navigations:
|
|
792
|
+
// the source app stays alive when a new tab is opened, so without the bypass AppComponent.restore() is never called and the guard is never reset.
|
|
793
|
+
if (oServices.oApplication.isExplaceNavigation(oOutbound.parameters)) {
|
|
794
|
+
oNavigationHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, null, null, "explace");
|
|
795
795
|
} else {
|
|
796
796
|
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, fnHandleError);
|
|
797
797
|
//null object has to be passed to the NavigationHandler as an
|
|
@@ -58,10 +58,43 @@ sap.ui.define([
|
|
|
58
58
|
|
|
59
59
|
var mFilterProperties = {}; // todo : Add the properties from navigation entites
|
|
60
60
|
var oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sEntitySet);
|
|
61
|
-
oEntityType.property.map(function (oProperty) {
|
|
62
|
-
var sTokenType = "ValueHelp"; // Other values are "Calendar" | "Time" | "MenuWithCheckBox" | "MenuWithSingleSelect"
|
|
63
|
-
if (filterHelper.isPropertyFilterable(oProperty)) {
|
|
64
61
|
|
|
62
|
+
// Capabilities.FilterRestrictions takes priority over sap:filterable (matches SFB behaviour).
|
|
63
|
+
var oEntitySetMeta = oSFBMetaModel.getODataEntitySet(sEntitySet);
|
|
64
|
+
var oCapFilterRestrictions = oEntitySetMeta &&
|
|
65
|
+
oEntitySetMeta["Org.OData.Capabilities.V1.FilterRestrictions"];
|
|
66
|
+
var bEntityNonFilterable = !!oCapFilterRestrictions &&
|
|
67
|
+
oCapFilterRestrictions.Filterable === "false";
|
|
68
|
+
var mCapNonFilterable = {};
|
|
69
|
+
if (oCapFilterRestrictions && oCapFilterRestrictions.NonFilterableProperties) {
|
|
70
|
+
oCapFilterRestrictions.NonFilterableProperties.forEach(function(oEntry) {
|
|
71
|
+
if (oEntry.PropertyPath) {
|
|
72
|
+
mCapNonFilterable[oEntry.PropertyPath] = true;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Helper: add properties from a 1:1 nav property's entity type into mFilterProperties,
|
|
78
|
+
// applying Capabilities.FilterRestrictions from the nav entity-set metadata.
|
|
79
|
+
function addNavPropertiesFromEntityType(entityType, prefix, oNavEntitySetMeta) {
|
|
80
|
+
var oNavCapFilterRestrictions = oNavEntitySetMeta &&
|
|
81
|
+
oNavEntitySetMeta["Org.OData.Capabilities.V1.FilterRestrictions"];
|
|
82
|
+
var bNavEntityNonFilterable = !!oNavCapFilterRestrictions &&
|
|
83
|
+
oNavCapFilterRestrictions.Filterable === "false";
|
|
84
|
+
var mNavCapNonFilterable = {};
|
|
85
|
+
if (oNavCapFilterRestrictions && oNavCapFilterRestrictions.NonFilterableProperties) {
|
|
86
|
+
oNavCapFilterRestrictions.NonFilterableProperties.forEach(function(oEntry) {
|
|
87
|
+
if (oEntry.PropertyPath) {
|
|
88
|
+
mNavCapNonFilterable[oEntry.PropertyPath] = true;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
entityType.property && entityType.property.forEach(function(oProperty) {
|
|
93
|
+
var bFilterable = filterHelper.isPropertyFilterable(oProperty);
|
|
94
|
+
if (oNavCapFilterRestrictions) {
|
|
95
|
+
bFilterable = !bNavEntityNonFilterable && !mNavCapNonFilterable[oProperty.name];
|
|
96
|
+
}
|
|
97
|
+
var sTokenType = "ValueHelp";
|
|
65
98
|
var bIsCodeListRequired;
|
|
66
99
|
oProperty.extensions && oProperty.extensions.forEach(function(oExtension) {
|
|
67
100
|
if (oExtension.name === "value-list" && oExtension.value === "fixed-values") {
|
|
@@ -69,31 +102,95 @@ sap.ui.define([
|
|
|
69
102
|
bIsCodeListRequired = true;
|
|
70
103
|
}
|
|
71
104
|
});
|
|
72
|
-
|
|
73
|
-
// Calculate the token type based on the property type and display format
|
|
74
|
-
// It will be better if this is done at the control level
|
|
75
105
|
if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
|
|
76
106
|
(oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
|
|
77
107
|
sTokenType = "Calendar";
|
|
78
108
|
} else if (oProperty.type === "Edm.DateTimeOffset") {
|
|
79
109
|
sTokenType = "Time";
|
|
80
110
|
}
|
|
81
|
-
|
|
82
|
-
mFilterProperties[
|
|
83
|
-
name:
|
|
84
|
-
//label: oProperty.label, Name is added from the filter item control
|
|
111
|
+
var propName = prefix + "." + oProperty.name;
|
|
112
|
+
mFilterProperties[propName] = {
|
|
113
|
+
name: propName,
|
|
85
114
|
dataType: oProperty.type,
|
|
86
|
-
defaultValue
|
|
87
|
-
filterable:
|
|
115
|
+
defaultValue: [],
|
|
116
|
+
filterable: bFilterable,
|
|
88
117
|
sortable: false,
|
|
89
|
-
codeList
|
|
118
|
+
codeList: bIsCodeListRequired,
|
|
90
119
|
type: sTokenType,
|
|
91
120
|
unit: oProperty["sap:unit"] || "",
|
|
92
121
|
required: oProperty["sap:required-in-filter"] === "true" ? true : false
|
|
93
122
|
};
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
oEntityType.property.map(function (oProperty) {
|
|
127
|
+
var sTokenType = "ValueHelp"; // Other values are "Calendar" | "Time" | "MenuWithCheckBox" | "MenuWithSingleSelect"
|
|
128
|
+
var bFilterable = filterHelper.isPropertyFilterable(oProperty);
|
|
129
|
+
|
|
130
|
+
// When Capabilities.FilterRestrictions is present, its answer is authoritative.
|
|
131
|
+
// A property absent from NonFilterableProperties is filterable even if sap:filterable="false".
|
|
132
|
+
if (oCapFilterRestrictions) {
|
|
133
|
+
bFilterable = !bEntityNonFilterable && !mCapNonFilterable[oProperty.name];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var bIsCodeListRequired;
|
|
137
|
+
oProperty.extensions && oProperty.extensions.forEach(function(oExtension) {
|
|
138
|
+
if (oExtension.name === "value-list" && oExtension.value === "fixed-values") {
|
|
139
|
+
sTokenType = "MenuWithCheckBox";
|
|
140
|
+
bIsCodeListRequired = true;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// Calculate the token type based on the property type and display format
|
|
145
|
+
// It will be better if this is done at the control level
|
|
146
|
+
if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
|
|
147
|
+
(oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
|
|
148
|
+
sTokenType = "Calendar";
|
|
149
|
+
} else if (oProperty.type === "Edm.DateTimeOffset") {
|
|
150
|
+
sTokenType = "Time";
|
|
94
151
|
}
|
|
152
|
+
|
|
153
|
+
mFilterProperties[oProperty.name] = {
|
|
154
|
+
name: oProperty.name,
|
|
155
|
+
//label: oProperty.label, Name is added from the filter item control
|
|
156
|
+
dataType: oProperty.type,
|
|
157
|
+
defaultValue : [], // Fill values from FLP user defaults , SV or other sources
|
|
158
|
+
filterable: bFilterable,
|
|
159
|
+
sortable: false,
|
|
160
|
+
codeList : bIsCodeListRequired,
|
|
161
|
+
type: sTokenType,
|
|
162
|
+
unit: oProperty["sap:unit"] || "",
|
|
163
|
+
required: oProperty["sap:required-in-filter"] === "true" ? true : false
|
|
164
|
+
};
|
|
95
165
|
});
|
|
96
166
|
|
|
167
|
+
// Add 1:1 navigation properties' properties
|
|
168
|
+
if (oEntityType.navigationProperty) {
|
|
169
|
+
oEntityType.navigationProperty.forEach(function(navProp) {
|
|
170
|
+
var oAssocEnd = null;
|
|
171
|
+
var oAssoc = null;
|
|
172
|
+
if (oSFBMetaModel && navProp.relationship) {
|
|
173
|
+
oAssoc = oSFBMetaModel.getODataAssociationEnd && oSFBMetaModel.getODataAssociationEnd(oEntityType, navProp.name);
|
|
174
|
+
oAssocEnd = oAssoc;
|
|
175
|
+
}
|
|
176
|
+
var isOneToOne = false;
|
|
177
|
+
if (oAssocEnd && oAssocEnd.multiplicity && (oAssocEnd.multiplicity === "0..1" || oAssocEnd.multiplicity === "1")) {
|
|
178
|
+
isOneToOne = true;
|
|
179
|
+
}
|
|
180
|
+
if (isOneToOne) {
|
|
181
|
+
var sTargetType = navProp.type || (oAssocEnd && oAssocEnd.type);
|
|
182
|
+
if (sTargetType) {
|
|
183
|
+
var oTargetEntityType = oSFBMetaModel.getODataEntityType && oSFBMetaModel.getODataEntityType(sTargetType);
|
|
184
|
+
if (oTargetEntityType) {
|
|
185
|
+
var oAssocSetEnd = oSFBMetaModel.getODataAssociationSetEnd && oSFBMetaModel.getODataAssociationSetEnd(oEntityType, navProp.name);
|
|
186
|
+
var oNavEntitySetMeta = oAssocSetEnd && oAssocSetEnd.entitySet && oSFBMetaModel.getODataEntitySet(oAssocSetEnd.entitySet);
|
|
187
|
+
addNavPropertiesFromEntityType(oTargetEntityType, navProp.name, oNavEntitySetMeta);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
97
194
|
oEasyFilterMetadata = {
|
|
98
195
|
version: 1,
|
|
99
196
|
entitySet: sEntitySet,
|
|
@@ -50,6 +50,7 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
50
50
|
var oAppComponent = oComponent.getAppComponent();
|
|
51
51
|
var oUIManifest = oAppComponent.getManifestEntry("sap.ui");
|
|
52
52
|
var oAppManifest = oAppComponent.getManifestEntry("sap.app");
|
|
53
|
+
var oOutbounds = oAppManifest && oAppManifest["crossNavigation"] && oAppManifest["crossNavigation"]["outbounds"];
|
|
53
54
|
if (oAppManifest && oAppManifest["crossNavigation"]) {
|
|
54
55
|
delete oAppManifest["crossNavigation"];
|
|
55
56
|
}
|
|
@@ -57,7 +58,7 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
57
58
|
oAppManifest.id = InsightsCardHelper.getCardId(oAppComponent);
|
|
58
59
|
oManifest["sap.app"] = fnCreateManifestSapApp(oAppManifest);
|
|
59
60
|
oManifest["sap.ui"] = oUIManifest;
|
|
60
|
-
oManifest["sap.card"] = fnCreateManifestSapCard(oCardDefinition);
|
|
61
|
+
oManifest["sap.card"] = fnCreateManifestSapCard(oCardDefinition, oOutbounds);
|
|
61
62
|
oManifest["sap.insights"] = fnCreateManifestSapInsight(oCardDefinition);
|
|
62
63
|
oManifest["sap.ui5"] = fnCreateSapui5();
|
|
63
64
|
return oManifest;
|
|
@@ -91,7 +92,7 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
91
92
|
return oManifestAppData;
|
|
92
93
|
};
|
|
93
94
|
|
|
94
|
-
var fnCreateManifestSapCard = function (oCardDefinition) {
|
|
95
|
+
var fnCreateManifestSapCard = function (oCardDefinition, oOutbounds) {
|
|
95
96
|
var oCardConfig = {};
|
|
96
97
|
var sComponentName = oCardDefinition['component'].getMetadata().getName();
|
|
97
98
|
oCardConfig["type"] = getCardType(sComponentName);
|
|
@@ -104,7 +105,7 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
104
105
|
} else {
|
|
105
106
|
oCardConfig["content"] = InsightsCardHelper.fnCreateManifestSapTableCardContent(oCardDefinition, oCardConfig);
|
|
106
107
|
}
|
|
107
|
-
InsightsCardHelper.getCardActions(oCardDefinition, oCardConfig);
|
|
108
|
+
InsightsCardHelper.getCardActions(oCardDefinition, oCardConfig, oOutbounds);
|
|
108
109
|
return oCardConfig;
|
|
109
110
|
};
|
|
110
111
|
|
|
@@ -693,7 +694,7 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
693
694
|
return aDimensions;
|
|
694
695
|
};
|
|
695
696
|
|
|
696
|
-
InsightsCardHelper.getCardActions = function (oCardDefinition, oSapCard) {
|
|
697
|
+
InsightsCardHelper.getCardActions = function (oCardDefinition, oSapCard, oOutbounds) {
|
|
697
698
|
var sHash = window.hasher.getHash(), aSemanticObjAction = sHash.split('&/')[0], sAppVarId;
|
|
698
699
|
|
|
699
700
|
if (aSemanticObjAction.includes('?')) {
|
|
@@ -725,6 +726,10 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
725
726
|
}];
|
|
726
727
|
|
|
727
728
|
var oContentParams = JSON.parse(JSON.stringify(oHeaderParams));
|
|
729
|
+
var oRowOutbound = fnGetRowNavigationOutbound(oOutbounds, aSemanticObjAction[0]);
|
|
730
|
+
if (oRowOutbound) {
|
|
731
|
+
oContentParams.ibnTarget = oRowOutbound;
|
|
732
|
+
}
|
|
728
733
|
|
|
729
734
|
var oContentParameterValue = [{
|
|
730
735
|
"type": "Navigation",
|
|
@@ -747,6 +752,21 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
|
|
|
747
752
|
}
|
|
748
753
|
};
|
|
749
754
|
|
|
755
|
+
var fnGetRowNavigationOutbound = function (oOutbounds, sSemanticObject) {
|
|
756
|
+
if (!oOutbounds || !sSemanticObject) {
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
var oResult = null;
|
|
760
|
+
Object.keys(oOutbounds).some(function (sKey) {
|
|
761
|
+
var oOutbound = oOutbounds[sKey];
|
|
762
|
+
if (oOutbound && oOutbound.semanticObject === sSemanticObject && oOutbound.action) {
|
|
763
|
+
oResult = { semanticObject: oOutbound.semanticObject, action: oOutbound.action };
|
|
764
|
+
return oOutbound.action === "displayFactSheet";
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
return oResult;
|
|
768
|
+
};
|
|
769
|
+
|
|
750
770
|
var fnGetLineItemAnnotation = function (oCardDefinition) {
|
|
751
771
|
var oEntityType = oCardDefinition['entityType'];
|
|
752
772
|
var aCustomData = oCardDefinition['currentControlHandler'].getControl().getCustomData();
|
|
@@ -2429,7 +2429,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2429
2429
|
};
|
|
2430
2430
|
for (var oHistoricHash = oCurrentHash; oHistoricHash.iHashChangeCount > 0; oHistoricHash = aPreviousHashes[oHistoricHash.backTarget]){
|
|
2431
2431
|
var oIdentity = (oHistoricHash === oCurrentHash) ? oCurrentIdentity : oHistoricHash.identity;
|
|
2432
|
-
var oReducedIdentity = oIdentity.treeNode && {
|
|
2432
|
+
var oReducedIdentity = oIdentity && oIdentity.treeNode && {
|
|
2433
2433
|
sRouteName: oIdentity.treeNode.sRouteName,
|
|
2434
2434
|
keys: oIdentity.keys,
|
|
2435
2435
|
appStates: oIdentity.appStates
|
|
@@ -3109,6 +3109,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3109
3109
|
var fnPrepareHostView = testableHelper.testable(fnPrepareHostView, "prepareHostView");
|
|
3110
3110
|
var fnPreloadComponent = testableHelper.testable(fnPreloadComponent, "preloadComponent");
|
|
3111
3111
|
var fnGetRouteInfoByHash = testableHelper.testable(fnGetRouteInfoByHash, "getRouteInfoByHash");
|
|
3112
|
+
var fnUpdateHistoryState = testableHelper.testable(fnUpdateHistoryState, "updateHistoryState");
|
|
3112
3113
|
|
|
3113
3114
|
// Note: Function createHostView will be added by routingHelper.
|
|
3114
3115
|
// Allow to mock this by unit tests
|
|
@@ -3119,8 +3120,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3119
3120
|
testableHelper.testable(function(fnPrepareHostViewStub){
|
|
3120
3121
|
fnPrepareHostView = fnPrepareHostViewStub;
|
|
3121
3122
|
}, "setPrepareHostView");
|
|
3122
|
-
/* eslint-enable */
|
|
3123
3123
|
|
|
3124
|
+
testableHelper.testable(function(oCurrentHashParam, aPreviousHashesParam, oCurrentIdentityParam, oHistoryStateParam){
|
|
3125
|
+
oCurrentHash = oCurrentHashParam;
|
|
3126
|
+
aPreviousHashes = aPreviousHashesParam;
|
|
3127
|
+
oCurrentIdentity = oCurrentIdentityParam;
|
|
3128
|
+
if (oHistoryStateParam !== undefined){
|
|
3129
|
+
oHistoryState = oHistoryStateParam;
|
|
3130
|
+
}
|
|
3131
|
+
}, "setInternalNavigationState");
|
|
3132
|
+
/* eslint-enable */
|
|
3124
3133
|
|
|
3125
3134
|
oTemplateContract.oBusyHelper.setBusy((getParsedShellHashFromFLP() || Promise.resolve()).then(function(oResults){
|
|
3126
3135
|
var oParsedUrl = oResults && oResults.parseParameters(document.location.search);
|
|
@@ -3206,7 +3215,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3206
3215
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3207
3216
|
* @public
|
|
3208
3217
|
* @extends sap.ui.base.Object
|
|
3209
|
-
* @version 1.136.
|
|
3218
|
+
* @version 1.136.22
|
|
3210
3219
|
* @since 1.30.0
|
|
3211
3220
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3212
3221
|
*/
|