@sapui5/sap.fe.core 1.95.0 → 1.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +3 -3
- package/src/sap/fe/core/AppComponent.js +9 -44
- package/src/sap/fe/core/AppStateHandler.js +2 -2
- 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 +129 -219
- package/src/sap/fe/core/ExtensionAPI.js +14 -6
- package/src/sap/fe/core/PageController.js +9 -35
- package/src/sap/fe/core/RouterProxy.js +79 -75
- package/src/sap/fe/core/Synchronization.js +1 -1
- package/src/sap/fe/core/TemplateComponent.js +16 -7
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TransactionHelper.js +183 -65
- package/src/sap/fe/core/actions/draft.js +50 -23
- package/src/sap/fe/core/actions/messageHandling.js +86 -7
- package/src/sap/fe/core/actions/nonDraft.js +1 -1
- package/src/sap/fe/core/actions/operations.js +75 -33
- 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 +276 -122
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +14 -6
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +90 -46
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +234 -232
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +539 -209
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +550 -213
- package/src/sap/fe/core/controllerextensions/MassEdit.js +79 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +227 -103
- package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
- package/src/sap/fe/core/controllerextensions/PageReady.ts +3 -7
- package/src/sap/fe/core/controllerextensions/Paginator.js +38 -12
- package/src/sap/fe/core/controllerextensions/Placeholder.js +16 -19
- package/src/sap/fe/core/controllerextensions/Routing.js +17 -2
- 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 +8 -9
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +19 -17
- package/src/sap/fe/core/controllerextensions/ViewState.js +54 -9
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +40 -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 +110 -109
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +7 -4
- package/src/sap/fe/core/controls/FieldWrapper.js +10 -4
- package/src/sap/fe/core/controls/FilterBar.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -6
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +45 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +78 -0
- package/src/sap/fe/core/converters/ConverterContext.js +13 -1
- package/src/sap/fe/core/converters/ConverterContext.ts +10 -0
- package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +7 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +18 -7
- package/src/sap/fe/core/converters/ManifestWrapper.ts +15 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +920 -882
- package/src/sap/fe/core/converters/MetaModelConverter.ts +829 -853
- package/src/sap/fe/core/converters/annotations/DataField.js +54 -4
- package/src/sap/fe/core/converters/annotations/DataField.ts +53 -3
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +83 -48
- package/src/sap/fe/core/converters/controls/Common/Action.js +15 -3
- package/src/sap/fe/core/converters/controls/Common/Action.ts +12 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +0 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +68 -21
- package/src/sap/fe/core/converters/controls/Common/Form.ts +60 -16
- package/src/sap/fe/core/converters/controls/Common/KPI.js +331 -248
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +355 -287
- package/src/sap/fe/core/converters/controls/Common/Table.js +426 -332
- package/src/sap/fe/core/converters/controls/Common/Table.ts +516 -383
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +468 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +609 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +30 -13
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +31 -12
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- 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 +8 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +9 -1
- 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 +9 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +6 -2
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -4
- 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 +34 -4
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -7
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +2 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +1 -2
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
- 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/formatters/TableFormatter.js +27 -4
- package/src/sap/fe/core/formatters/TableFormatter.ts +20 -3
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +25 -3
- package/src/sap/fe/core/fpm/Component.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +388 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +199 -111
- package/src/sap/fe/core/helpers/BindingExpression.ts +193 -102
- 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/KeepAliveHelper.js +211 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
- package/src/sap/fe/core/helpers/MassEditHelper.js +678 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +64 -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 +1 -1
- 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 +28 -2
- package/src/sap/fe/core/library.support.js +10 -4
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
- package/src/sap/fe/core/messagebundle.properties +67 -3
- package/src/sap/fe/core/messagebundle_ar.properties +40 -3
- package/src/sap/fe/core/messagebundle_bg.properties +40 -3
- package/src/sap/fe/core/messagebundle_ca.properties +41 -4
- package/src/sap/fe/core/messagebundle_cs.properties +41 -4
- package/src/sap/fe/core/messagebundle_cy.properties +40 -3
- package/src/sap/fe/core/messagebundle_da.properties +40 -3
- package/src/sap/fe/core/messagebundle_de.properties +40 -3
- package/src/sap/fe/core/messagebundle_el.properties +40 -3
- package/src/sap/fe/core/messagebundle_en.properties +37 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +37 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +37 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +46 -2
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -0
- package/src/sap/fe/core/messagebundle_es.properties +40 -3
- package/src/sap/fe/core/messagebundle_es_MX.properties +41 -4
- package/src/sap/fe/core/messagebundle_et.properties +40 -3
- package/src/sap/fe/core/messagebundle_fi.properties +40 -3
- package/src/sap/fe/core/messagebundle_fr.properties +41 -4
- package/src/sap/fe/core/messagebundle_fr_CA.properties +40 -3
- package/src/sap/fe/core/messagebundle_hi.properties +40 -3
- package/src/sap/fe/core/messagebundle_hr.properties +40 -3
- package/src/sap/fe/core/messagebundle_hu.properties +41 -4
- package/src/sap/fe/core/messagebundle_id.properties +42 -5
- package/src/sap/fe/core/messagebundle_it.properties +40 -3
- package/src/sap/fe/core/messagebundle_iw.properties +40 -3
- package/src/sap/fe/core/messagebundle_ja.properties +49 -12
- package/src/sap/fe/core/messagebundle_kk.properties +40 -3
- package/src/sap/fe/core/messagebundle_ko.properties +40 -3
- package/src/sap/fe/core/messagebundle_lt.properties +40 -3
- package/src/sap/fe/core/messagebundle_lv.properties +40 -3
- package/src/sap/fe/core/messagebundle_ms.properties +40 -3
- package/src/sap/fe/core/messagebundle_nl.properties +40 -3
- package/src/sap/fe/core/messagebundle_no.properties +40 -3
- package/src/sap/fe/core/messagebundle_pl.properties +40 -3
- package/src/sap/fe/core/messagebundle_pt.properties +42 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +40 -3
- package/src/sap/fe/core/messagebundle_ro.properties +40 -3
- package/src/sap/fe/core/messagebundle_ru.properties +40 -3
- package/src/sap/fe/core/messagebundle_sh.properties +40 -3
- package/src/sap/fe/core/messagebundle_sk.properties +40 -3
- package/src/sap/fe/core/messagebundle_sl.properties +40 -3
- package/src/sap/fe/core/messagebundle_sv.properties +41 -4
- package/src/sap/fe/core/messagebundle_th.properties +40 -3
- package/src/sap/fe/core/messagebundle_tr.properties +40 -3
- package/src/sap/fe/core/messagebundle_uk.properties +40 -3
- package/src/sap/fe/core/messagebundle_vi.properties +40 -3
- package/src/sap/fe/core/messagebundle_zh_CN.properties +40 -3
- package/src/sap/fe/core/messagebundle_zh_TW.properties +40 -3
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -0
- 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 +98 -328
- package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
- package/src/sap/fe/core/services/ShellServicesFactory.ts +30 -1
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +8 -5
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +11 -6
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +14 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +8 -37
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +13 -33
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/EntitySetHelper.js +86 -3
- package/src/sap/fe/core/templating/EntitySetHelper.ts +44 -0
- package/src/sap/fe/core/templating/FilterHelper.js +10 -7
- package/src/sap/fe/core/templating/FilterHelper.ts +8 -6
- package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js +47 -107
- package/src/sap/fe/core/templating/UIFormatters.ts +76 -72
|
@@ -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
|
[
|
|
@@ -76,7 +76,13 @@ sap.ui.define(
|
|
|
76
76
|
},
|
|
77
77
|
getProgrammingModel: function(oContext) {
|
|
78
78
|
if (!this.sProgrammingModel && oContext) {
|
|
79
|
-
|
|
79
|
+
var sPath;
|
|
80
|
+
if (oContext.isA("sap.ui.model.odata.v4.Context")) {
|
|
81
|
+
sPath = oContext.getPath();
|
|
82
|
+
} else {
|
|
83
|
+
sPath = oContext.isRelative() ? oContext.getResolvedPath() : oContext.getPath();
|
|
84
|
+
}
|
|
85
|
+
if (ModelHelper.isDraftSupported(oContext.getModel().getMetaModel(), sPath)) {
|
|
80
86
|
this.sProgrammingModel = ProgrammingModel.Draft;
|
|
81
87
|
} else if (ModelHelper.isStickySessionSupported(oContext.getModel().getMetaModel())) {
|
|
82
88
|
this.sProgrammingModel = ProgrammingModel.Sticky;
|
|
@@ -93,9 +99,8 @@ sap.ui.define(
|
|
|
93
99
|
*
|
|
94
100
|
* @memberof sap.fe.core.TransactionHelper
|
|
95
101
|
* @static
|
|
96
|
-
* @param {sap.ui.model.odata.v4.ODataListBinding} oMainListBinding OData
|
|
102
|
+
* @param {sap.ui.model.odata.v4.ODataListBinding} oMainListBinding OData V4 ListBinding object
|
|
97
103
|
* @param {object} [mParameters] Optional, can contain the following attributes:
|
|
98
|
-
* @param {boolean} [mParameters.refreshList] If the list shall be refreshed immediately after creating the instance
|
|
99
104
|
* @param {map} [mParameters.data] A map of data that should be sent within the POST
|
|
100
105
|
* @param {string} [mParameters.busyMode] Global (default), Local, None TODO: to be refactored
|
|
101
106
|
* @param {map} [mParameters.keepTransientContextOnFailed] If set, the context stays in the list if the POST failed and POST will be repeated with the next change
|
|
@@ -109,14 +114,17 @@ sap.ui.define(
|
|
|
109
114
|
createDocument: function(oMainListBinding, mParameters, oResourceBundle, messageHandler, bFromCopyPaste) {
|
|
110
115
|
var oNewDocumentContext,
|
|
111
116
|
that = this,
|
|
112
|
-
bSkipRefresh,
|
|
113
117
|
oModel = oMainListBinding.getModel(),
|
|
114
118
|
oMetaModel = oModel.getMetaModel(),
|
|
115
119
|
sMetaPath = oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath()),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
sCreateHash = this._getAppComponent()
|
|
121
|
+
.getRouterProxy()
|
|
122
|
+
.getHash(),
|
|
123
|
+
oComponentData = this._getAppComponent().getComponentData(),
|
|
124
|
+
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
125
|
+
sNewAction = !oMainListBinding.isRelative()
|
|
126
|
+
? this._getNewAction(oStartupParameters, sCreateHash, oMetaModel, sMetaPath)
|
|
127
|
+
: undefined,
|
|
120
128
|
oCreationPromise,
|
|
121
129
|
mBindingParameters = { "$$patchWithoutSideEffects": true },
|
|
122
130
|
sMessagesPath = oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path"),
|
|
@@ -127,7 +135,18 @@ sap.ui.define(
|
|
|
127
135
|
oMetaModel.getObject(
|
|
128
136
|
ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath)) +
|
|
129
137
|
"@com.sap.vocabularies.Common.v1.DefaultValuesFunction"
|
|
130
|
-
)
|
|
138
|
+
),
|
|
139
|
+
bFunctionOnNavProp;
|
|
140
|
+
if (sFunctionName) {
|
|
141
|
+
if (
|
|
142
|
+
oMetaModel.getObject(sMetaPath + "@com.sap.vocabularies.Common.v1.DefaultValuesFunction") &&
|
|
143
|
+
ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath)) !== sMetaPath
|
|
144
|
+
) {
|
|
145
|
+
bFunctionOnNavProp = true;
|
|
146
|
+
} else {
|
|
147
|
+
bFunctionOnNavProp = false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
131
150
|
if (sMessagesPath) {
|
|
132
151
|
mBindingParameters["$select"] = sMessagesPath;
|
|
133
152
|
}
|
|
@@ -145,7 +164,6 @@ sap.ui.define(
|
|
|
145
164
|
sBusyPath = "/busyLocal/" + oMainListBinding.sId;
|
|
146
165
|
}
|
|
147
166
|
BusyLocker.lock(this.oLockObject, sBusyPath);
|
|
148
|
-
bSkipRefresh = !mParameters.refreshList;
|
|
149
167
|
var oResourceBundleCore = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core");
|
|
150
168
|
if (sNewAction) {
|
|
151
169
|
oCreationPromise = this.callAction(
|
|
@@ -153,7 +171,7 @@ sap.ui.define(
|
|
|
153
171
|
{
|
|
154
172
|
contexts: oMainListBinding.getHeaderContext(),
|
|
155
173
|
showActionParameterDialog: true,
|
|
156
|
-
label:
|
|
174
|
+
label: this._getSpecificCreateActionDialogLabel(oMetaModel, sMetaPath, sNewAction, oResourceBundleCore),
|
|
157
175
|
bindingParameters: mBindingParameters,
|
|
158
176
|
parentControl: mParameters.parentControl,
|
|
159
177
|
bIsCreateAction: true
|
|
@@ -168,8 +186,29 @@ sap.ui.define(
|
|
|
168
186
|
? CommonUtils.getNonComputedVisibleFields(oMetaModel, sMetaPath)
|
|
169
187
|
: [];
|
|
170
188
|
sFunctionName = bFromCopyPaste ? null : sFunctionName;
|
|
171
|
-
|
|
172
|
-
|
|
189
|
+
var sFunctionPath, oFunctionContext;
|
|
190
|
+
if (sFunctionName) {
|
|
191
|
+
//bound to the source entity:
|
|
192
|
+
if (bFunctionOnNavProp) {
|
|
193
|
+
sFunctionPath =
|
|
194
|
+
oMainListBinding.getContext() &&
|
|
195
|
+
oMetaModel.getMetaPath(oMainListBinding.getContext().getPath()) + "/" + sFunctionName;
|
|
196
|
+
oFunctionContext = oMainListBinding.getContext();
|
|
197
|
+
} else {
|
|
198
|
+
sFunctionPath =
|
|
199
|
+
oMainListBinding.getHeaderContext() &&
|
|
200
|
+
oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath()) + "/" + sFunctionName;
|
|
201
|
+
oFunctionContext = oMainListBinding.getHeaderContext();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var oFunction = sFunctionPath && oMetaModel.createBindingContext(sFunctionPath);
|
|
205
|
+
if (oFunction && oFunction.getObject() && oFunction.getObject()[0].$IsBound) {
|
|
206
|
+
oCreationPromise = operations.callBoundFunction(sFunctionName, oFunctionContext, oModel);
|
|
207
|
+
} else {
|
|
208
|
+
oCreationPromise = operations.callFunctionImport(sFunctionName, oModel);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
oCreationPromise = oCreationPromise
|
|
173
212
|
.then(function(oContext) {
|
|
174
213
|
if (oContext) {
|
|
175
214
|
return oContext.getObject();
|
|
@@ -178,7 +217,7 @@ sap.ui.define(
|
|
|
178
217
|
}
|
|
179
218
|
})
|
|
180
219
|
.catch(function(oError) {
|
|
181
|
-
Log.error("Error while
|
|
220
|
+
Log.error("Error while executing the function " + sFunctionName, oError);
|
|
182
221
|
throw oError;
|
|
183
222
|
})
|
|
184
223
|
.then(function(oData) {
|
|
@@ -197,7 +236,7 @@ sap.ui.define(
|
|
|
197
236
|
}
|
|
198
237
|
);
|
|
199
238
|
oTransientListBinding.refreshInternal = function() {};
|
|
200
|
-
oNewDocumentContext = oTransientListBinding.create(mParameters.data,
|
|
239
|
+
oNewDocumentContext = oTransientListBinding.create(mParameters.data, true);
|
|
201
240
|
return that._launchDialogWithKeyFields(
|
|
202
241
|
oMainListBinding,
|
|
203
242
|
oTransientListBinding,
|
|
@@ -205,11 +244,10 @@ sap.ui.define(
|
|
|
205
244
|
aNonComputedVisibleKeyFields,
|
|
206
245
|
oModel,
|
|
207
246
|
mParameters,
|
|
208
|
-
messageHandler
|
|
209
|
-
sFunctionName
|
|
247
|
+
messageHandler
|
|
210
248
|
);
|
|
211
249
|
} else {
|
|
212
|
-
oNewDocumentContext = oMainListBinding.create(mParameters.data,
|
|
250
|
+
oNewDocumentContext = oMainListBinding.create(mParameters.data, true, mParameters.createAtEnd);
|
|
213
251
|
return that.onAfterCreateCompletion(
|
|
214
252
|
oMainListBinding,
|
|
215
253
|
oNewDocumentContext,
|
|
@@ -403,22 +441,13 @@ sap.ui.define(
|
|
|
403
441
|
}
|
|
404
442
|
mParameters = getParameters(mParameters);
|
|
405
443
|
if (mParameters.title) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
);
|
|
414
|
-
} else {
|
|
415
|
-
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
416
|
-
"C_TRANSACTION_HELPER_OBJECT_PAGE_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
417
|
-
oResourceBundle,
|
|
418
|
-
null,
|
|
419
|
-
mParameters.entitySetName
|
|
420
|
-
);
|
|
421
|
-
}
|
|
444
|
+
aParams = [mParameters.title, mParameters.description];
|
|
445
|
+
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
446
|
+
"C_TRANSACTION_HELPER_OBJECT_PAGE_CONFIRM_DELETE_WITH_OBJECTINFO",
|
|
447
|
+
oResourceBundle,
|
|
448
|
+
aParams,
|
|
449
|
+
mParameters.entitySetName
|
|
450
|
+
);
|
|
422
451
|
} else {
|
|
423
452
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
424
453
|
"C_TRANSACTION_HELPER_OBJECT_PAGE_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
@@ -628,8 +657,14 @@ sap.ui.define(
|
|
|
628
657
|
bDialogConfirmed = true;
|
|
629
658
|
BusyLocker.lock(that.oLockObject);
|
|
630
659
|
var aContexts = aDeletableContexts;
|
|
631
|
-
|
|
632
|
-
|
|
660
|
+
var onBeforeDeletePromise;
|
|
661
|
+
if (mParameters.beforeDeleteCallBack) {
|
|
662
|
+
onBeforeDeletePromise = mParameters.beforeDeleteCallBack({ contexts: aContexts });
|
|
663
|
+
} else {
|
|
664
|
+
onBeforeDeletePromise = Promise.resolve();
|
|
665
|
+
}
|
|
666
|
+
return onBeforeDeletePromise
|
|
667
|
+
.then(that.findActiveDraftRootContexts.bind(that, aContexts, mParameters.bFindActiveContexts))
|
|
633
668
|
.then(function(activeContexts) {
|
|
634
669
|
//make sure to fetch the active contexts before deleting the drafts
|
|
635
670
|
return Promise.all(
|
|
@@ -639,7 +674,7 @@ sap.ui.define(
|
|
|
639
674
|
})
|
|
640
675
|
)
|
|
641
676
|
.catch(function(oError) {
|
|
642
|
-
return messageHandler.
|
|
677
|
+
return messageHandler.showMessages().then(function() {
|
|
643
678
|
// re-throw error to enforce rejecting the general promise
|
|
644
679
|
throw oError;
|
|
645
680
|
});
|
|
@@ -763,7 +798,7 @@ sap.ui.define(
|
|
|
763
798
|
});
|
|
764
799
|
})
|
|
765
800
|
.catch(function(err) {
|
|
766
|
-
return messageHandler.
|
|
801
|
+
return messageHandler.showMessages().then(function() {
|
|
767
802
|
return Promise.reject(err);
|
|
768
803
|
});
|
|
769
804
|
})
|
|
@@ -779,7 +814,7 @@ sap.ui.define(
|
|
|
779
814
|
* @param {sap.ui.model.odata.v4.Context} oContext Context of the document to be canceled or deleted
|
|
780
815
|
* @param {object} [mParameters] Optional, can contain the following attributes:
|
|
781
816
|
* @param {sap.m.Button} mParameters.cancelButton Cancel Button of the discard popover (mandatory for now)
|
|
782
|
-
* @param {boolean} mParameters.
|
|
817
|
+
* @param {boolean} mParameters.skipDiscardPopover Optional, supresses the discard popover incase of draft applications while navigating out of OP
|
|
783
818
|
* @param oResourceBundle
|
|
784
819
|
* @param messageHandler
|
|
785
820
|
* @returns {Promise} Promise resolves with ???
|
|
@@ -798,6 +833,7 @@ sap.ui.define(
|
|
|
798
833
|
var oParamsContext = oContext,
|
|
799
834
|
oCancelButton = mParameters.cancelButton,
|
|
800
835
|
oModel = oParamsContext.getModel(),
|
|
836
|
+
onBeforeCancelPromise,
|
|
801
837
|
sCanonicalPath;
|
|
802
838
|
return Promise.resolve(this.getProgrammingModel(oContext))
|
|
803
839
|
.then(function(sPModel) {
|
|
@@ -816,12 +852,20 @@ sap.ui.define(
|
|
|
816
852
|
}
|
|
817
853
|
})
|
|
818
854
|
.then(function() {
|
|
819
|
-
if (!mParameters.
|
|
855
|
+
if (!mParameters.skipDiscardPopover) {
|
|
820
856
|
return that._showDiscardPopover(oCancelButton, that._bIsModified, oResourceBundle);
|
|
821
857
|
} else {
|
|
822
858
|
return Promise.resolve();
|
|
823
859
|
}
|
|
824
860
|
})
|
|
861
|
+
.then(function() {
|
|
862
|
+
if (mParameters.beforeCancelCallBack) {
|
|
863
|
+
onBeforeCancelPromise = mParameters.beforeCancelCallBack({ context: oContext });
|
|
864
|
+
} else {
|
|
865
|
+
onBeforeCancelPromise = Promise.resolve();
|
|
866
|
+
}
|
|
867
|
+
return onBeforeCancelPromise;
|
|
868
|
+
})
|
|
825
869
|
.then(function() {
|
|
826
870
|
// eslint-disable-next-line default-case
|
|
827
871
|
switch (sProgrammingModel) {
|
|
@@ -890,12 +934,12 @@ sap.ui.define(
|
|
|
890
934
|
// remove existing bound transition messages
|
|
891
935
|
messageHandler.removeTransitionMessages();
|
|
892
936
|
// show unbound messages
|
|
893
|
-
return messageHandler.
|
|
937
|
+
return messageHandler.showMessages().then(function() {
|
|
894
938
|
return context;
|
|
895
939
|
});
|
|
896
940
|
})
|
|
897
941
|
.catch(function(err) {
|
|
898
|
-
return messageHandler.
|
|
942
|
+
return messageHandler.showMessages().then(function() {
|
|
899
943
|
return Promise.reject(err);
|
|
900
944
|
});
|
|
901
945
|
})
|
|
@@ -962,7 +1006,7 @@ sap.ui.define(
|
|
|
962
1006
|
}
|
|
963
1007
|
});
|
|
964
1008
|
}
|
|
965
|
-
return messageHandler.
|
|
1009
|
+
return messageHandler.showMessages().then(function() {
|
|
966
1010
|
return Promise.reject(err);
|
|
967
1011
|
});
|
|
968
1012
|
})
|
|
@@ -971,7 +1015,7 @@ sap.ui.define(
|
|
|
971
1015
|
});
|
|
972
1016
|
},
|
|
973
1017
|
/**
|
|
974
|
-
* Calls a bound
|
|
1018
|
+
* Calls a bound or unbound action.
|
|
975
1019
|
*
|
|
976
1020
|
* @function
|
|
977
1021
|
* @static
|
|
@@ -979,9 +1023,9 @@ sap.ui.define(
|
|
|
979
1023
|
* @memberof sap.fe.core.TransactionHelper
|
|
980
1024
|
* @param {string} sActionName The name of the action to be called
|
|
981
1025
|
* @param {map} [mParameters] Contains the following attributes:
|
|
982
|
-
* @param {sap.ui.model.odata.v4.Context} [mParameters.contexts] Mandatory for a bound action: Either one context or an array with contexts for which the action
|
|
983
|
-
* @param {sap.ui.model.odata.v4.ODataModel} [mParameters.model] Mandatory for an unbound action: An instance of an OData
|
|
984
|
-
* @param {string} [mParameters.invocationGrouping] Mode how actions are to be called:
|
|
1026
|
+
* @param {sap.ui.model.odata.v4.Context} [mParameters.contexts] Mandatory for a bound action: Either one context or an array with contexts for which the action is to be called
|
|
1027
|
+
* @param {sap.ui.model.odata.v4.ODataModel} [mParameters.model] Mandatory for an unbound action: An instance of an OData V4 model
|
|
1028
|
+
* @param {string} [mParameters.invocationGrouping] Mode how actions are to be called: 'ChangeSet' to put all action calls into one changeset, 'Isolated' to put them into separate changesets
|
|
985
1029
|
* @param {string} [mParameters.label] A human-readable label for the action
|
|
986
1030
|
* @param {boolean} [mParameters.bGetBoundContext] If specified, the action promise returns the bound context
|
|
987
1031
|
* @param {object} oView Contains the object of the current view
|
|
@@ -1170,7 +1214,7 @@ sap.ui.define(
|
|
|
1170
1214
|
if (aTransientMessages.length > 0 && mParameters && mParameters.internalModelContext) {
|
|
1171
1215
|
mParameters.internalModelContext.setProperty("sActionName", mParameters.label ? mParameters.label : sActionName);
|
|
1172
1216
|
}
|
|
1173
|
-
return messageHandler.
|
|
1217
|
+
return messageHandler.showMessages();
|
|
1174
1218
|
},
|
|
1175
1219
|
/**
|
|
1176
1220
|
* Handles validation errors for the 'discard' action.
|
|
@@ -1304,8 +1348,7 @@ sap.ui.define(
|
|
|
1304
1348
|
mFields,
|
|
1305
1349
|
oModel,
|
|
1306
1350
|
mParameters,
|
|
1307
|
-
messageHandler
|
|
1308
|
-
sFunctionName
|
|
1351
|
+
messageHandler
|
|
1309
1352
|
) {
|
|
1310
1353
|
var that = this,
|
|
1311
1354
|
oDialog,
|
|
@@ -1318,8 +1361,9 @@ sap.ui.define(
|
|
|
1318
1361
|
oMetaModel = oModel.getMetaModel(),
|
|
1319
1362
|
aImmutableFields = [],
|
|
1320
1363
|
oAppComponent = that._getAppComponent(),
|
|
1321
|
-
|
|
1322
|
-
|
|
1364
|
+
sPath = oListBinding.isRelative() ? oListBinding.getResolvedPath() : oListBinding.getPath(),
|
|
1365
|
+
oEntitySetContext = oMetaModel.createBindingContext(sPath),
|
|
1366
|
+
sMetaPath = oMetaModel.getMetaPath(sPath);
|
|
1323
1367
|
for (var i in mFields) {
|
|
1324
1368
|
aImmutableFields.push(oMetaModel.createBindingContext(sMetaPath + "/" + mFields[i]));
|
|
1325
1369
|
}
|
|
@@ -1448,7 +1492,7 @@ sap.ui.define(
|
|
|
1448
1492
|
.finally(function() {
|
|
1449
1493
|
BusyLocker.unlock(oDialog);
|
|
1450
1494
|
oCreateButton.setEnabled(true);
|
|
1451
|
-
return messageHandler.
|
|
1495
|
+
return messageHandler.showMessages();
|
|
1452
1496
|
});
|
|
1453
1497
|
}
|
|
1454
1498
|
},
|
|
@@ -1458,15 +1502,6 @@ sap.ui.define(
|
|
|
1458
1502
|
oDialog.close();
|
|
1459
1503
|
}
|
|
1460
1504
|
},
|
|
1461
|
-
beforeOpen: function() {
|
|
1462
|
-
if (sFunctionName) {
|
|
1463
|
-
for (var i = 0; i < Object.keys(mParameters.data).length; i++) {
|
|
1464
|
-
if (mParameters.data && mFields.indexOf(Object.keys(mParameters.data)[i]) > -1) {
|
|
1465
|
-
oTransientContext.setProperty(mFields[i], mParameters.data[mFields[i]]);
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
},
|
|
1470
1505
|
afterClose: function() {
|
|
1471
1506
|
// show footer as per UX guidelines when dialog is not open
|
|
1472
1507
|
oDialog.getBindingContext("internal").setProperty("isCreateDialogOpen", false);
|
|
@@ -1488,7 +1523,14 @@ sap.ui.define(
|
|
|
1488
1523
|
}
|
|
1489
1524
|
oCreateButton = oDialog.getBeginButton();
|
|
1490
1525
|
oDialog.setBindingContext(oTransientContext);
|
|
1491
|
-
return CommonUtils.setUserDefaults(
|
|
1526
|
+
return CommonUtils.setUserDefaults(
|
|
1527
|
+
oAppComponent,
|
|
1528
|
+
aImmutableFields,
|
|
1529
|
+
oTransientContext,
|
|
1530
|
+
undefined,
|
|
1531
|
+
mParameters.createAction,
|
|
1532
|
+
mParameters.data
|
|
1533
|
+
)
|
|
1492
1534
|
.then(function() {
|
|
1493
1535
|
validateRequiredProperties();
|
|
1494
1536
|
// footer must not be visible when the dialog is open as per UX guidelines
|
|
@@ -1496,7 +1538,7 @@ sap.ui.define(
|
|
|
1496
1538
|
oDialog.open();
|
|
1497
1539
|
})
|
|
1498
1540
|
.catch(function(oError) {
|
|
1499
|
-
return messageHandler.
|
|
1541
|
+
return messageHandler.showMessages().then(function() {
|
|
1500
1542
|
return Promise.reject(oError);
|
|
1501
1543
|
});
|
|
1502
1544
|
});
|
|
@@ -1542,6 +1584,82 @@ sap.ui.define(
|
|
|
1542
1584
|
};
|
|
1543
1585
|
oListBinding.attachCreateCompleted(fnCreateCompleted, this);
|
|
1544
1586
|
return oPromise;
|
|
1587
|
+
},
|
|
1588
|
+
/**
|
|
1589
|
+
* Retrieves the name of the NewAction to be executed.
|
|
1590
|
+
*
|
|
1591
|
+
* @function
|
|
1592
|
+
* @static
|
|
1593
|
+
* @private
|
|
1594
|
+
* @name sap.fe.core.TransactionHelper._getNewAction
|
|
1595
|
+
* @memberof sap.fe.core.TransactionHelper
|
|
1596
|
+
* @param {object} oStartupParameters Startup parameters of the application
|
|
1597
|
+
* @param {string} sCreateHash Hash to be checked for action type
|
|
1598
|
+
* @param {object} oMetaModel The MetaModel used to check for NewAction parameter
|
|
1599
|
+
* @param {string} sMetaPath The MetaPath
|
|
1600
|
+
* @returns {string} The name of the action
|
|
1601
|
+
* @ui5-restricted
|
|
1602
|
+
* @final
|
|
1603
|
+
**/
|
|
1604
|
+
_getNewAction: function(oStartupParameters, sCreateHash, oMetaModel, sMetaPath) {
|
|
1605
|
+
var sNewAction;
|
|
1606
|
+
|
|
1607
|
+
if (oStartupParameters && oStartupParameters.preferredMode && sCreateHash.indexOf("i-action=createWith") > -1) {
|
|
1608
|
+
var sPreferredMode = oStartupParameters.preferredMode[0];
|
|
1609
|
+
sNewAction =
|
|
1610
|
+
sPreferredMode.indexOf("createWith:") > -1 ? sPreferredMode.substr(sPreferredMode.lastIndexOf(":") + 1) : undefined;
|
|
1611
|
+
} else {
|
|
1612
|
+
sNewAction =
|
|
1613
|
+
oMetaModel && oMetaModel.getObject !== undefined
|
|
1614
|
+
? oMetaModel.getObject(sMetaPath + "@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction") ||
|
|
1615
|
+
oMetaModel.getObject(sMetaPath + "@com.sap.vocabularies.Common.v1.DraftRoot/NewAction")
|
|
1616
|
+
: undefined;
|
|
1617
|
+
}
|
|
1618
|
+
return sNewAction;
|
|
1619
|
+
},
|
|
1620
|
+
/**
|
|
1621
|
+
* Retrieves the label for the title of a specific create action dialog, e.g. Create Sales Order from Quotation.
|
|
1622
|
+
*
|
|
1623
|
+
* The following priority is applied:
|
|
1624
|
+
* 1. label of line-item annotation.
|
|
1625
|
+
* 2. label annotated in the action.
|
|
1626
|
+
* 3. "Create" as a constant from i18n.
|
|
1627
|
+
*
|
|
1628
|
+
* @function
|
|
1629
|
+
* @static
|
|
1630
|
+
* @private
|
|
1631
|
+
* @name sap.fe.core.TransactionHelper._getSpecificCreateActionDialogLabel
|
|
1632
|
+
* @memberof sap.fe.core.TransactionHelper
|
|
1633
|
+
* @param {object} oMetaModel The MetaModel used to check for the NewAction parameter
|
|
1634
|
+
* @param {string} sMetaPath The MetaPath
|
|
1635
|
+
* @param {string} sNewAction Contains the name of the action to be executed
|
|
1636
|
+
* @param {object} oResourceBundleCore ResourceBundle to access the default Create label
|
|
1637
|
+
* @returns {string} The label for the Create Action Dialog
|
|
1638
|
+
* @ui5-restricted
|
|
1639
|
+
* @final
|
|
1640
|
+
**/
|
|
1641
|
+
_getSpecificCreateActionDialogLabel: function(oMetaModel, sMetaPath, sNewAction, oResourceBundleCore) {
|
|
1642
|
+
var fnGetLabelFromLineItemAnnotation = function() {
|
|
1643
|
+
if (oMetaModel && oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")) {
|
|
1644
|
+
var iLineItemIndex = oMetaModel
|
|
1645
|
+
.getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")
|
|
1646
|
+
.findIndex(function(oLineItem) {
|
|
1647
|
+
var aLineItemAction = oLineItem.Action ? oLineItem.Action.split("(") : undefined;
|
|
1648
|
+
return aLineItemAction ? aLineItemAction[0] === sNewAction : false;
|
|
1649
|
+
});
|
|
1650
|
+
return iLineItemIndex > -1
|
|
1651
|
+
? oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")[iLineItemIndex].Label
|
|
1652
|
+
: undefined;
|
|
1653
|
+
} else {
|
|
1654
|
+
return undefined;
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
return (
|
|
1659
|
+
fnGetLabelFromLineItemAnnotation() ||
|
|
1660
|
+
(oMetaModel && oMetaModel.getObject(sMetaPath + "/" + sNewAction + "@com.sap.vocabularies.Common.v1.Label")) ||
|
|
1661
|
+
(oResourceBundleCore && oResourceBundleCore.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"))
|
|
1662
|
+
);
|
|
1545
1663
|
}
|
|
1546
1664
|
});
|
|
1547
1665
|
}
|
|
@@ -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
|
// Provides static functions for the draft programming model
|
|
@@ -75,6 +75,21 @@ sap.ui.define(
|
|
|
75
75
|
PREPARE: "PreparationAction"
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Static functions for the draft programming model
|
|
80
|
+
*
|
|
81
|
+
* @namespace
|
|
82
|
+
* @alias sap.fe.core.actions.draft
|
|
83
|
+
* @private
|
|
84
|
+
* @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
|
|
85
|
+
* @since 1.54.0
|
|
86
|
+
*/
|
|
87
|
+
var draft = {
|
|
88
|
+
createDraftFromActiveDocument: createDraftFromActiveDocument,
|
|
89
|
+
activateDocument: activateDocument,
|
|
90
|
+
deleteDraft: deleteDraft
|
|
91
|
+
};
|
|
92
|
+
|
|
78
93
|
/**
|
|
79
94
|
* Determines action name for a draft operation.
|
|
80
95
|
*
|
|
@@ -134,23 +149,49 @@ sap.ui.define(
|
|
|
134
149
|
var oOptions = { $$inheritExpandSelect: true };
|
|
135
150
|
var oOperation = createOperation(oContext, draftOperations.EDIT, oOptions);
|
|
136
151
|
oOperation.setParameter("PreserveChanges", bPreserveChanges);
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
152
|
+
var sGroupId = "direct";
|
|
153
|
+
var oEditPromise = oOperation
|
|
154
|
+
.execute(sGroupId, undefined, fnOnStrictHandlingFailed.bind(draft, oContext, sGroupId))
|
|
155
|
+
.then(function(oDraftDocumentContext) {
|
|
156
|
+
return oDraftDocumentContext;
|
|
157
|
+
});
|
|
158
|
+
oOperation.getModel().submitBatch(sGroupId);
|
|
141
159
|
return oEditPromise;
|
|
142
160
|
} else {
|
|
143
|
-
throw new Error("
|
|
161
|
+
throw new Error("You cannot edit this draft document");
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function fnOnStrictHandlingFailed(oContext, sGroupId, aMessages) {
|
|
166
|
+
if (aMessages.length === 1) {
|
|
167
|
+
var sMessage = aMessages[0].message,
|
|
168
|
+
dialogPromise = new Promise(function(resolve) {
|
|
169
|
+
sap.ui.require(["sap/m/MessageBox"], function(MessageBox) {
|
|
170
|
+
MessageBox.warning(sMessage, {
|
|
171
|
+
title: "Warning",
|
|
172
|
+
actions: [MessageBox.Action.OK, MessageBox.Action.CANCEL],
|
|
173
|
+
onClose: function(sAction) {
|
|
174
|
+
if (sAction === MessageBox.Action.OK) {
|
|
175
|
+
resolve(true);
|
|
176
|
+
oContext.getModel().submitBatch(sGroupId);
|
|
177
|
+
} else {
|
|
178
|
+
resolve(false);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
return dialogPromise;
|
|
144
185
|
}
|
|
145
186
|
}
|
|
146
187
|
|
|
147
188
|
/**
|
|
148
|
-
* Activates a draft document. The draft will replace the sibling entity and will be deleted by the
|
|
189
|
+
* Activates a draft document. The draft will replace the sibling entity and will be deleted by the back end.
|
|
149
190
|
*
|
|
150
191
|
* @function
|
|
151
192
|
* @param {sap.ui.model.odata.v4.Context} oContext context for which the action should be performed
|
|
152
193
|
* @param {object} oAppComponent The AppComponent
|
|
153
|
-
* @param {string} [sGroupId]
|
|
194
|
+
* @param {string} [sGroupId] The optional batch group in which the operation is to be executed
|
|
154
195
|
* @returns {Promise.<sap.ui.model.odata.v4.Context>} Resolve function returns the context of the operation
|
|
155
196
|
* @private
|
|
156
197
|
* @ui5-restricted
|
|
@@ -166,7 +207,7 @@ sap.ui.define(
|
|
|
166
207
|
if (!oContext.getProperty("IsActiveEntity")) {
|
|
167
208
|
var oOperation = createOperation(oContext, draftOperations.ACTIVATION, { $$inheritExpandSelect: true });
|
|
168
209
|
return oOperation
|
|
169
|
-
.execute(sGroupId, bIgnoreEtag)
|
|
210
|
+
.execute(sGroupId, bIgnoreEtag, fnOnStrictHandlingFailed.bind(draft, oContext, sGroupId)) //3rd parameter<------
|
|
170
211
|
.then(function(oActiveDocumentContext) {
|
|
171
212
|
return oActiveDocumentContext;
|
|
172
213
|
})
|
|
@@ -563,20 +604,6 @@ sap.ui.define(
|
|
|
563
604
|
return executeDraftDiscardAction(oContext);
|
|
564
605
|
}
|
|
565
606
|
}
|
|
566
|
-
/**
|
|
567
|
-
* Static functions for the draft programming model
|
|
568
|
-
*
|
|
569
|
-
* @namespace
|
|
570
|
-
* @alias sap.fe.core.actions.draft
|
|
571
|
-
* @private
|
|
572
|
-
* @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
|
|
573
|
-
* @since 1.54.0
|
|
574
|
-
*/
|
|
575
|
-
var draft = {
|
|
576
|
-
createDraftFromActiveDocument: createDraftFromActiveDocument,
|
|
577
|
-
activateDocument: activateDocument,
|
|
578
|
-
deleteDraft: deleteDraft
|
|
579
|
-
};
|
|
580
607
|
|
|
581
608
|
return draft;
|
|
582
609
|
}
|