@sapui5/sap.suite.ui.generic.template 1.114.2 → 1.114.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.114.2",
3
+ "version": "1.114.4",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "keywords": [
6
6
  "sapui5",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.114.2</version>
10
+ <version>1.114.4</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.114.2"
11
+ "version": "1.114.4"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.114.2"
11
+ "version": "1.114.4"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.114.2"
11
+ "version": "1.114.4"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -226,19 +226,22 @@ sap.ui.define([
226
226
  oTemplateUtils.oCommonEventHandlers.submitChangesForSmartMultiInput();
227
227
  var oSaveEntityPromise = oTemplateUtils.oServices.oCRUDManager.saveEntity(); // This Promise may include a dialog step (warning scenario) -> do not use it for busy handling
228
228
  var bSuccess = false; // will be set before the busy session ends
229
- oSaveEntityPromise.then(function (oContext) {
230
- if (!bStayInEdit) {
231
- var oTemplatePrivateModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
232
- // switch to display mode
233
- oTemplatePrivateModel.setProperty("/objectPage/displayMode", 1);
234
- fnReturnToDisplayNonDraft();
235
- oViewProxy.setEditable(false);
236
- }
237
- performAfterSaveOperations(oContext, oView, bIsComponentDirty, mPendingChangesToContextInfo, bStayInEdit, bEditNextObject);
238
- bSuccess = true;
239
- }, function(){
240
- oTemplateUtils.oInfoObjectHandler.executeForAllInformationObjects("smartTable", function(oInfoObject){
241
- oInfoObject.onSaveWithError();
229
+ var oSideEffectsExecutedPromise = new Promise(function(fnSideEffectsExecuted, fnSideEffectsRejected){
230
+ oSaveEntityPromise.then(function (oContext) {
231
+ if (!bStayInEdit) {
232
+ var oTemplatePrivateModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
233
+ // switch to display mode
234
+ oTemplatePrivateModel.setProperty("/objectPage/displayMode", 1);
235
+ fnReturnToDisplayNonDraft();
236
+ oViewProxy.setEditable(false);
237
+ }
238
+ performAfterSaveOperations(oContext, oView, bIsComponentDirty, mPendingChangesToContextInfo, bStayInEdit, bEditNextObject, fnSideEffectsExecuted, fnSideEffectsRejected);
239
+ bSuccess = true;
240
+ }, function(){
241
+ oTemplateUtils.oInfoObjectHandler.executeForAllInformationObjects("smartTable", function(oInfoObject){
242
+ oInfoObject.onSaveWithError();
243
+ });
244
+ fnSideEffectsRejected();
242
245
  });
243
246
  });
244
247
  // Define a function that is called after the end of the busy session to set the focus. It can rely on bSuccess
@@ -249,13 +252,14 @@ sap.ui.define([
249
252
  };
250
253
  oTemplateUtils.oServices.oApplication.setNextFocus(fnSetFocusAfterwards);
251
254
  var oEvent = {
252
- saveEntityPromise: oSaveEntityPromise
255
+ saveEntityPromise: oSaveEntityPromise,
256
+ sideEffectsExecutedPromise: oSideEffectsExecutedPromise
253
257
  };
254
258
  oTemplateUtils.oComponentUtils.fire(oController, "AfterSave", oEvent);
255
259
  }
256
260
 
257
261
  //common flow for Save and Save-continue Edit (Non draft)
258
- function performAfterSaveOperations(oContext, oView, bSomethingWasChanged, mPendingChangesToContextInfo, bStayInEdit, bEditNextObject) {
262
+ function performAfterSaveOperations(oContext, oView, bSomethingWasChanged, mPendingChangesToContextInfo, bStayInEdit, bEditNextObject, fnSideEffectsExecuted, fnSideEffectsRejected) {
259
263
  var oUIModel = oObjectPage.getModel("ui");
260
264
  var bCreateMode = oUIModel.getProperty("/createMode");
261
265
  var oComponent = oController.getOwnerComponent();
@@ -285,7 +289,7 @@ sap.ui.define([
285
289
  sSuccessMessageKey = bSomethingWasChanged ? "OBJECT_SAVED" : "OBJECT_NOT_MODIFIED";
286
290
  }
287
291
  MessageUtils.showSuccessMessageIfRequired(oTemplateUtils.oCommonUtils.getText(sSuccessMessageKey), oTemplateUtils.oServices);
288
-
292
+ var aSideEffectPromises = [];
289
293
  for (var sProperty in mPendingChangesToContextInfo) {
290
294
  var oInfo = mPendingChangesToContextInfo[sProperty];
291
295
  var oCurrentContext = oInfo.context;
@@ -300,8 +304,12 @@ sap.ui.define([
300
304
  if (iMetaDataIndex > -1) {
301
305
  aSourceProperties.splice(iMetaDataIndex, 1);
302
306
  }
303
- oTemplateUtils.oServices.oApplicationController.executeSideEffects(oCurrentContext, aSourceProperties);
307
+ var oSideEffectForPropertyPromise = oTemplateUtils.oServices.oApplicationController.executeSideEffects(oCurrentContext, aSourceProperties);
308
+ aSideEffectPromises.push(oSideEffectForPropertyPromise);
304
309
  }
310
+ Promise.allSettled(aSideEffectPromises).then(function(){
311
+ fnSideEffectsExecuted(); // do not expose the arguments passed to the members of aSideEffectPromises to the outside
312
+ });
305
313
  }
306
314
 
307
315
  function onSaveAndContinueEdit(oEvent) {
@@ -15,6 +15,12 @@ sap.ui.define(["sap/ui/base/Object", "sap/base/util/extend"], function(BaseObjec
15
15
  * Attach a handler to the save event
16
16
  *
17
17
  * @param {function} fnFunction the handler function
18
+ * This function will receive an object which contains two properties: <code>saveEntityPromise</code> and <code>sideEffectsExecutedPromise</code> which both point to Promises.
19
+ * Both Promises will be rejected in case the save operation fails in the backend.
20
+ * Otherwise both Promises will be resolved, but at different point in time.
21
+ * The <code>saveEntityPromise</code> will be resolved immediately when the save operation has finished successfully.
22
+ * The <code>sideEffectsExecutedPromise</code> will be resolved as soon as the processing of all side-effects connected to this action has finished as well.
23
+ * Note that even a side-effect execution which results in an error would be considered as finished processing here.
18
24
  * @public
19
25
  */
20
26
  attachAfterSave: function(fnFunction) {
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.114.2"
9
+ "version": "1.114.4"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -1394,7 +1394,7 @@ sap.ui.define([
1394
1394
  text: "{= ${ui>/createMode} ? ${i18n>CREATE} : ${i18n>SAVE}}",
1395
1395
  type: sEmphasiedButtonType,
1396
1396
  press: "cmd:Save",
1397
- visible: !(!oDevice.system.desktop && (oDevice.system.tablet || oDevice.system.phone)) && "{ui>/editable}",
1397
+ visible: oComponentUtils.isDraftEnabled() ? !(!oDevice.system.desktop && (oDevice.system.tablet || oDevice.system.phone)) && "{ui>/editable}" : "{ui>/editable}",
1398
1398
  isStandardAction: true,
1399
1399
  determining: true
1400
1400
  }
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.114.2"
9
+ "version": "1.114.4"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.114.2"
9
+ "version": "1.114.4"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -852,7 +852,7 @@ sap.ui.define([
852
852
  * @extends sap.ui.core.UIComponent
853
853
  * @abstract
854
854
  * @author SAP SE
855
- * @version 1.114.2
855
+ * @version 1.114.4
856
856
  * @name sap.suite.ui.generic.template.lib.AppComponent
857
857
  */
858
858
  return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -2996,7 +2996,7 @@ sap.ui.define(["sap/ui/base/Object",
2996
2996
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
2997
2997
  * @public
2998
2998
  * @extends sap.ui.base.Object
2999
- * @version 1.114.2
2999
+ * @version 1.114.4
3000
3000
  * @since 1.30.0
3001
3001
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3002
3002
  */
@@ -38,7 +38,7 @@ sap.ui.define(['sap/ui/core/Core', 'sap/ui/core/library','sap/fe/placeholder/lib
38
38
  interfaces: [],
39
39
  controls: [],
40
40
  elements: [],
41
- version: "1.114.2",
41
+ version: "1.114.4",
42
42
  extensions: {
43
43
  //Configuration used for rule loading of Support Assistant
44
44
  "sap.ui.support": {