@sapui5/sap.suite.ui.generic.template 1.151.1 → 1.152.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 +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/SmartVisualFilterBar.js +4 -3
- 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/Component.js +4 -2
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sv.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/FullscreenPage.fragment.xml +3 -0
- 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 +5 -4
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +21 -17
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/Application.js +0 -13
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +4 -19
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +4 -4
- package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillAIOrchestrator.js +1 -6
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillApplyHandler.js +25 -44
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillDialogController.js +80 -64
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFieldCollector.js +442 -259
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFormRenderer.js +125 -161
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +134 -160
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillTableRenderer.js +55 -189
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +67 -85
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +27 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saptrc.properties +6 -6
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +4 -4
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +1 -1
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +16 -4
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +3 -2
- package/src/sap/suite/ui/generic/template/library.js +1 -1
- package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +1 -1
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ sap.ui.define([
|
|
|
13
13
|
"sap/m/VBox",
|
|
14
14
|
"sap/m/Button",
|
|
15
15
|
"sap/m/Title",
|
|
16
|
+
"sap/m/Text",
|
|
16
17
|
"sap/suite/ui/generic/template/AnalyticalListPage/controller/DropDownController",
|
|
17
18
|
"sap/suite/ui/generic/template/AnalyticalListPage/controller/DynamicDateRangeController",
|
|
18
19
|
"sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/FilterItemMicroBar",
|
|
@@ -49,6 +50,7 @@ sap.ui.define([
|
|
|
49
50
|
VBox,
|
|
50
51
|
Button,
|
|
51
52
|
Title,
|
|
53
|
+
Text,
|
|
52
54
|
DropDownController,
|
|
53
55
|
DynamicDateRangeController,
|
|
54
56
|
FilterItemMicroBar,
|
|
@@ -854,10 +856,9 @@ sap.ui.define([
|
|
|
854
856
|
titleMD.addStyleClass("sapSmartTemplatesAnalyticalListPageRequired");
|
|
855
857
|
}
|
|
856
858
|
//second part of the title i.e unit and currency
|
|
857
|
-
var titleUnitCurr = new
|
|
859
|
+
var titleUnitCurr = new Text({
|
|
858
860
|
text: titleObject.titleUnitCurr.length > 1 ? "| " + titleObject.titleUnitCurr : "",
|
|
859
|
-
|
|
860
|
-
level: SapCoreLibrary.TitleLevel.Auto,
|
|
861
|
+
wrapping: false,
|
|
861
862
|
width: titleObject.titleUnitCurr.length > 1 ? "4.15rem" : "0rem"
|
|
862
863
|
});
|
|
863
864
|
|
|
@@ -59,8 +59,10 @@ sap.ui.define(["sap/ui/core/mvc/OverrideExecution",
|
|
|
59
59
|
var oTemplatePrivate = oComponent.getModel("_templPriv");
|
|
60
60
|
oTemplatePrivate.setProperty("/listReport", {}); // Note that component properties are not yet available here
|
|
61
61
|
},
|
|
62
|
-
onActivate: function() {
|
|
63
|
-
|
|
62
|
+
onActivate: function(sBindingPath, bIsComponentCurrentlyActive, bIsBackwards) {
|
|
63
|
+
if (bIsBackwards) {
|
|
64
|
+
oViewProxy.onComponentActivate();
|
|
65
|
+
}
|
|
64
66
|
},
|
|
65
67
|
adaptToChildContext: function(sCurrentChildContext) {
|
|
66
68
|
oViewProxy.adaptToChildContext(sCurrentChildContext);
|
|
@@ -33,6 +33,8 @@ sap.ui.define([
|
|
|
33
33
|
// not yet been called (race condition on second navigation: bAllControlsInitialized=true
|
|
34
34
|
// causes fnApplyVariantState to run synchronously, triggering afterVariantLoad before the
|
|
35
35
|
// Promise.all in SmartVariantManagementWrapper resolves and calls setSVMWrapperCallbacks).
|
|
36
|
+
// Cold-start _CUSTOM restore is also handled there: afterVariantLoad("INIT") fires before
|
|
37
|
+
// getInitializedPromise() resolves, so modifyStartupExtension always gets the final word.
|
|
36
38
|
var oSVMWrapperCallbacks = null;
|
|
37
39
|
|
|
38
40
|
var oVariantManagementInitializedPromise;
|
|
@@ -59,10 +61,9 @@ sap.ui.define([
|
|
|
59
61
|
if (oCustomData && oCustomData[dataPropertyNameGeneric]) {
|
|
60
62
|
oGenericData = oCustomData[dataPropertyNameGeneric];
|
|
61
63
|
} else {
|
|
62
|
-
// getCustomFilterData() returns null
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
// variant content — fall back to reading it via getVariantContent().
|
|
64
|
+
// getCustomFilterData() returns null when no beforeVariantFetch has run yet for this
|
|
65
|
+
// variant (e.g. a named variant being switched to for the first time in the session, or cold-start INIT).
|
|
66
|
+
// The _CUSTOM section is present in the variant content — fall back to reading it via getVariantContent().
|
|
66
67
|
try {
|
|
67
68
|
var oSVM = oSmartFilterBar.getSmartVariant();
|
|
68
69
|
// getCurrentVariantId() converts STANDARDVARIANTKEY to "" which _getVariantById can't look up.
|
|
@@ -924,26 +924,30 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
924
924
|
oDataField = oCollection[i];
|
|
925
925
|
oResult = null;
|
|
926
926
|
// if type is DataFieldForAnnotation, then loop over target annotations
|
|
927
|
-
|
|
928
|
-
oDataField.
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
927
|
+
try {
|
|
928
|
+
if (oDataField.RecordType === "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" &&
|
|
929
|
+
oDataField.Target.AnnotationPath.indexOf("com.sap.vocabularies.UI.v1.FieldGroup") >= 0) {
|
|
930
|
+
// oDataField = oAnnotationHelper.getDataFieldFromDataFieldForAnnotation(oInterface, oDataField);
|
|
931
|
+
var oTargetLineItem = oMetaModel.getContext(oInterface.getPath() + "/" + i + "/Target");
|
|
932
|
+
var sResolvedPath = AnnotationHelperModel.resolvePath(oTargetLineItem);
|
|
933
|
+
var oDataFieldTarget = oMetaModel.getObject(sResolvedPath);
|
|
934
|
+
|
|
935
|
+
if (oDataFieldTarget.Data && oDataFieldTarget.Data.length > 0) {
|
|
936
|
+
for (var j = 0; j < oDataFieldTarget.Data.length; j++) {
|
|
937
|
+
oResult = oAnnotationHelper.generateAnnotatedActionCustomData(oDataFieldTarget.Data[j], oFacet, oTabItem, oChartItem);
|
|
938
|
+
if (oResult) {
|
|
939
|
+
aButtonsData.push(oResult);
|
|
940
|
+
}
|
|
939
941
|
}
|
|
940
942
|
}
|
|
943
|
+
} else {
|
|
944
|
+
oResult = oAnnotationHelper.generateAnnotatedActionCustomData(oDataField, oFacet, oTabItem, oChartItem);
|
|
945
|
+
if (oResult) {
|
|
946
|
+
aButtonsData.push(oResult);
|
|
947
|
+
}
|
|
941
948
|
}
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
if (oResult) {
|
|
945
|
-
aButtonsData.push(oResult);
|
|
946
|
-
}
|
|
949
|
+
} catch (oError) {
|
|
950
|
+
oLogger.error("configure - " + JSON.stringify(oDataField));
|
|
947
951
|
}
|
|
948
952
|
}
|
|
949
953
|
}
|
|
@@ -961,7 +961,7 @@ sap.ui.define([
|
|
|
961
961
|
* @public
|
|
962
962
|
* @extends sap.ui.core.UIComponent
|
|
963
963
|
* @author SAP SE
|
|
964
|
-
* @version 1.
|
|
964
|
+
* @version 1.152.1
|
|
965
965
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
966
966
|
*/
|
|
967
967
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -810,18 +810,6 @@ 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
|
-
|
|
825
813
|
oTemplateContract.oApplicationProxy = { // inject own api for AppComponent into the Template Contract. Other classes (NavigationController, BusyHelper) will call these functions accordingly.
|
|
826
814
|
createDraftSiblingPromise: oContextBookkeeping.createDraftSiblingPromise,
|
|
827
815
|
getDraftSiblingPromise: oContextBookkeeping.getDraftSiblingPromise,
|
|
@@ -928,7 +916,6 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
928
916
|
mustRequireRequestsCanonical: mustRequireRequestsCanonical,
|
|
929
917
|
getNavigationHandler: getNavigationHandler,
|
|
930
918
|
navigateExternal: fnNavigateExternal,
|
|
931
|
-
isExplaceNavigation: fnIsExplaceNavigation,
|
|
932
919
|
getStatePreservationMode: getStatePreservationMode,
|
|
933
920
|
setObjectInEditMode: fnSetObjectInEditMode,
|
|
934
921
|
getObjectInEditMode: fnGetObjectInEditMode,
|
|
@@ -722,7 +722,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
722
722
|
// 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
|
|
723
723
|
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
724
724
|
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
725
|
-
if (
|
|
725
|
+
if (oOutbound.parameters && oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
726
726
|
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
727
727
|
if (oNavHandler.navigate) {
|
|
728
728
|
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
@@ -742,15 +742,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
742
742
|
oCommonUtils.removePropertiesFromNavigationContext(oSelectionVariant, oEventSource);
|
|
743
743
|
oController.adaptNavigationParameterExtension(oSelectionVariant, oObjectInfo);
|
|
744
744
|
oCommonUtils.setComponentRefreshBehaviour(oOutbound);
|
|
745
|
-
|
|
746
|
-
// System-level sap-ushell-next-navmode can still force a new tab — bypass the re-entry guard in that case.
|
|
747
|
-
if (oServices.oApplication.isExplaceNavigation()) {
|
|
748
|
-
if (oNavigationHandler.navigate) {
|
|
749
|
-
oNavigationHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
750
|
-
}
|
|
751
|
-
} else {
|
|
752
|
-
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
753
|
-
}
|
|
745
|
+
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
754
746
|
}
|
|
755
747
|
|
|
756
748
|
function fnHideTitleArea(oSmLiContent,aContactTitleArea) {
|
|
@@ -1123,15 +1115,8 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1123
1115
|
// The value "sEntitySet" holds the entity set of an object page or a table.
|
|
1124
1116
|
//
|
|
1125
1117
|
// Sometimes, the SmartLink is located on a field group which belongs to the child entity set of object page.
|
|
1126
|
-
// So, we
|
|
1118
|
+
// So, we have to always derive the entity type from the smart link's binding context.
|
|
1127
1119
|
var oEntityType = ModelUtil.getEntityTypeFromContext(oControl.getBindingContext());
|
|
1128
|
-
// CS20260013063140: ModelUtil.getEntityTypeFromContext returns null when the SmartLink
|
|
1129
|
-
// is resolved via SmartLinkDelegate, because the binding context is not yet resolvable
|
|
1130
|
-
// to an entity type at that point.
|
|
1131
|
-
// Fall back to deriving the entity type from the enclosing entity set instead.
|
|
1132
|
-
if (!oEntityType) {
|
|
1133
|
-
oEntityType = oMetaModel.getODataEntityType(oEntitySet.entityType);
|
|
1134
|
-
}
|
|
1135
1120
|
var oField = oEntityType.property.find(function (oProperty) { return oProperty.name === sSourceClickedField; });
|
|
1136
1121
|
var sTextArrangement = "descriptionAndId";
|
|
1137
1122
|
if (oField) { // TODO: Need to provide the correct field Object using the entityType and corresponding association (should be handled by a BLI)
|
|
@@ -2739,7 +2724,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2739
2724
|
oCommonUtils.setComponentRefreshBehaviour(oOutbound);
|
|
2740
2725
|
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
2741
2726
|
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
2742
|
-
if (
|
|
2727
|
+
if (oOutbound.parameters && oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
2743
2728
|
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
2744
2729
|
if (oNavHandler.navigate) {
|
|
2745
2730
|
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
@@ -835,10 +835,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
835
835
|
|
|
836
836
|
setComponentRefreshBehaviour(oOutbound);
|
|
837
837
|
|
|
838
|
-
// We now
|
|
839
|
-
// the
|
|
840
|
-
if (
|
|
841
|
-
oNavigationHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, null, null, "
|
|
838
|
+
// We now ensure that the 'sap-ushell-navmode' parameter is passed to the NavigationHandler.navigate method
|
|
839
|
+
// and skip setting the app to busy mode when opening a new tab
|
|
840
|
+
if (oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
841
|
+
oNavigationHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, null, null, oOutbound.parameters["sap-ushell-navmode"]);
|
|
842
842
|
} else {
|
|
843
843
|
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, fnHandleError);
|
|
844
844
|
//null object has to be passed to the NavigationHandler as an
|
|
@@ -13,7 +13,7 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
|
|
|
13
13
|
// Here we have introduced probing as for test scenarios as sap.ushell is not present all the iframe cases
|
|
14
14
|
var UShellContainer = sap.ui.require("sap/ushell/Container");
|
|
15
15
|
return UShellContainer ? new Promise(function(fnResolve){
|
|
16
|
-
UShellContainer.getFLPUrlAsync(true).
|
|
16
|
+
UShellContainer.getFLPUrlAsync(true).then(function (sFLPUrl){
|
|
17
17
|
fnResolve(sFLPUrl);
|
|
18
18
|
});
|
|
19
19
|
}) : Promise.resolve(document.URL);
|
|
@@ -188,14 +188,9 @@ sap.ui.define([
|
|
|
188
188
|
oSplitResult.collectionsWithRejectedNewRows[sFieldName] = sRejectionType;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
// All proposed new rows are accepted when creation is allowed
|
|
191
192
|
var aNewRows = bAllowsCreation ? aRawNewRows : [];
|
|
192
193
|
|
|
193
|
-
// Cap new rows to one per table; flag if the AI proposed more
|
|
194
|
-
if (aNewRows.length > 1) {
|
|
195
|
-
oSplitResult.attemptedMultipleNewRows = true;
|
|
196
|
-
aNewRows = [aNewRows[0]];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
194
|
var aRowUpdates = aExistingRowUpdates.concat(aNewRows);
|
|
200
195
|
|
|
201
196
|
var oValidation = oFieldCollector.isValidSmartTable(oFieldMeta.entitySet, oObjectPage);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
2
|
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
3
|
-
"sap/suite/ui/generic/template/genericUtilities/FeError"
|
|
4
|
-
|
|
3
|
+
"sap/suite/ui/generic/template/genericUtilities/FeError",
|
|
4
|
+
"sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFieldCollector"
|
|
5
|
+
], function(FeLogger, FeError, EasyFillFieldCollector) {
|
|
5
6
|
"use strict";
|
|
6
7
|
|
|
7
8
|
var sClassName = "lib.ai.EasyFill.EasyFillApplyHandler";
|
|
@@ -45,7 +46,8 @@ sap.ui.define([
|
|
|
45
46
|
|
|
46
47
|
// Copy each AI-suggested property value from the transient context to the live OP context
|
|
47
48
|
for (var sProp in oTransientObject) {
|
|
48
|
-
if (
|
|
49
|
+
if (!Object.prototype.hasOwnProperty.call(oTransientObject, sProp)) { continue; }
|
|
50
|
+
if (sProp !== "__metadata" && Object.prototype.hasOwnProperty.call(mUpdatableLookupMap, sProp)) {
|
|
49
51
|
oObjectPageContext.setProperty(sProp, oTransientObject[sProp]);
|
|
50
52
|
iApplied++;
|
|
51
53
|
}
|
|
@@ -84,7 +86,7 @@ sap.ui.define([
|
|
|
84
86
|
*
|
|
85
87
|
* @param {object} oTableStagingState - table staging state { mPendingNewRowContexts }
|
|
86
88
|
* @param {object} mCollectionState - collection tracking state (mCollectionProperties)
|
|
87
|
-
* @returns {object} map of { navProperty: plainValuesObject }
|
|
89
|
+
* @returns {object} map of { navProperty: plainValuesObject[] }
|
|
88
90
|
*/
|
|
89
91
|
extractPendingNewRowValues: function(oTableStagingState, mCollectionState) {
|
|
90
92
|
var mNewRowValues = Object.create(null);
|
|
@@ -96,18 +98,20 @@ sap.ui.define([
|
|
|
96
98
|
var mCollectionPropertyMap = (mCollectionState && mCollectionState.mCollectionProperties &&
|
|
97
99
|
mCollectionState.mCollectionProperties[sCollectionName]) || Object.create(null);
|
|
98
100
|
|
|
99
|
-
// Extract scalar values
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
// Extract scalar values for ALL new row contexts — multiple row creation is supported
|
|
102
|
+
var aRowValues = aNewContexts.map(function(oNewContext) {
|
|
103
|
+
var oValues = Object.create(null);
|
|
104
|
+
Object.keys(mCollectionPropertyMap).forEach(function(sPropName) {
|
|
105
|
+
var vValue = oNewContext.getProperty && oNewContext.getProperty(sPropName);
|
|
106
|
+
if (vValue !== undefined && vValue !== null && typeof vValue !== "object") {
|
|
107
|
+
oValues[sPropName] = vValue;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return oValues;
|
|
107
111
|
});
|
|
108
|
-
mNewRowValues[sCollectionName] =
|
|
109
|
-
oLogger.debug("extractPendingNewRowValues: extracted " +
|
|
110
|
-
"
|
|
112
|
+
mNewRowValues[sCollectionName] = aRowValues;
|
|
113
|
+
oLogger.debug("extractPendingNewRowValues: extracted " + aRowValues.length +
|
|
114
|
+
" new row(s) for '" + sCollectionName + "'");
|
|
111
115
|
});
|
|
112
116
|
return mNewRowValues;
|
|
113
117
|
},
|
|
@@ -208,7 +212,6 @@ sap.ui.define([
|
|
|
208
212
|
* @param {function} fnResetTransientContext - EasyFillFormRenderer.resetTransientContext
|
|
209
213
|
*/
|
|
210
214
|
resetEasyFill: function(bRemoveTextAreaValue, oDialogModel, oController, mCollectionUpdates, oEasyFillLayoutMode, fnRevertStagedUpdates, fnResetTransientContext) {
|
|
211
|
-
// Remove dynamically-added table ObjectPageSections from the shared OPL
|
|
212
215
|
var sTableSectionMarker = "easyfillTableSection";
|
|
213
216
|
var oObjectPageLayout = oController.byId("EasyFillObjectPageLayout");
|
|
214
217
|
if (oObjectPageLayout) {
|
|
@@ -222,13 +225,9 @@ sap.ui.define([
|
|
|
222
225
|
});
|
|
223
226
|
}
|
|
224
227
|
|
|
225
|
-
// Revert any staged table row values back to original
|
|
226
228
|
fnRevertStagedUpdates();
|
|
227
|
-
|
|
228
|
-
// Reset the transient context (discard all staged scalar AI values)
|
|
229
229
|
fnResetTransientContext();
|
|
230
230
|
|
|
231
|
-
// Reset all dialog model properties to their initial state
|
|
232
231
|
oDialogModel.setProperty("/isFormVisible", false);
|
|
233
232
|
oDialogModel.setProperty("/isIllustrationVisible", true);
|
|
234
233
|
oDialogModel.setProperty("/isSaveEnabled", false);
|
|
@@ -246,16 +245,13 @@ sap.ui.define([
|
|
|
246
245
|
oDialogModel.setProperty("/nonUpdatableFields", {});
|
|
247
246
|
oDialogModel.setProperty("/hasNonUpdatableFields", false);
|
|
248
247
|
|
|
249
|
-
// Clear the mutable collection updates map in place
|
|
250
248
|
Object.keys(mCollectionUpdates).forEach(function(sKey) {
|
|
251
249
|
delete mCollectionUpdates[sKey];
|
|
252
250
|
});
|
|
253
251
|
|
|
254
252
|
if (bRemoveTextAreaValue) {
|
|
255
253
|
var oTextArea = oController.byId("EasyFillInputTextArea");
|
|
256
|
-
if (oTextArea) {
|
|
257
|
-
oTextArea.setValue("");
|
|
258
|
-
}
|
|
254
|
+
if (oTextArea) { oTextArea.setValue(""); }
|
|
259
255
|
oDialogModel.setProperty("/isEasyFillButtonEnabled", false);
|
|
260
256
|
}
|
|
261
257
|
|
|
@@ -289,30 +285,15 @@ sap.ui.define([
|
|
|
289
285
|
},
|
|
290
286
|
|
|
291
287
|
_isEditableProperty: function(oPropertyMeta, oRowObject) {
|
|
292
|
-
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
var sUpdatable = oPropertyMeta["sap:updatable"];
|
|
296
|
-
if (sUpdatable) {
|
|
297
|
-
return sUpdatable !== "false";
|
|
298
|
-
}
|
|
299
|
-
var oAnnotation = oPropertyMeta["com.sap.vocabularies.Common.v1.FieldControl"];
|
|
300
|
-
if (oAnnotation && oAnnotation["EnumMember"]) {
|
|
301
|
-
return oAnnotation["EnumMember"] !== "com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly";
|
|
302
|
-
}
|
|
303
|
-
var sFieldControl = oPropertyMeta["sap:field-control"];
|
|
304
|
-
if (sFieldControl) {
|
|
305
|
-
var iFieldControlValue = oRowObject && oRowObject[sFieldControl];
|
|
306
|
-
return iFieldControlValue !== 1;
|
|
307
|
-
}
|
|
308
|
-
return true;
|
|
288
|
+
return EasyFillFieldCollector.isEditableByContextObject(oPropertyMeta, oRowObject, undefined);
|
|
309
289
|
},
|
|
310
290
|
|
|
311
291
|
_isSupportedStagedValue: function(vValue) {
|
|
312
|
-
return vValue
|
|
313
|
-
vValue ===
|
|
292
|
+
return vValue !== undefined && (
|
|
293
|
+
vValue === null ||
|
|
314
294
|
typeof vValue !== "object" ||
|
|
315
|
-
vValue instanceof Date
|
|
295
|
+
vValue instanceof Date
|
|
296
|
+
);
|
|
316
297
|
},
|
|
317
298
|
|
|
318
299
|
_areValuesEqual: function(vLeft, vRight) {
|