@sapui5/sap.suite.ui.generic.template 1.108.30 → 1.108.31

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.108.30",
3
+ "version": "1.108.31",
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.108.30</version>
10
+ <version>1.108.31</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -735,11 +735,8 @@ sap.ui.define([
735
735
  }
736
736
 
737
737
  // This method is called when editing of an entity has started and the corresponding context is available
738
- // aResult can contain both the target context for navigation in edit state and the target key,treenode of the target node or just the target context
739
- // bContinueEditing is to navigate to the context directly.
740
- // - bContinueEditing faulty: User has pressed the 'Edit' button (draft and non-draft scenario)
741
- // - bContinueEditing truthy: User has pressed the 'Continue Editing' button (only draft scenario)
742
- function fnStartEditing(oResult, bContinueEditing) {
738
+ // oResult can contain both the target context for navigation in edit state and the target key,treenode of the target node or just the target context
739
+ function fnStartEditing(oResult) {
743
740
  var oDraft, oContext;
744
741
  if (oResult) {
745
742
  // if oResult contains both the property targetSiblingKey and context/draftAdministrativeData, initialise oContext with value context/draftAdministrativeData
@@ -750,19 +747,41 @@ sap.ui.define([
750
747
  }
751
748
  }
752
749
  var bMoveToTop = !oObjectPage.getUseIconTabBar() && isObjectPageScrolledToTop();
750
+ var bWasEditable; // only used in the non-draft case
753
751
  if (oDraft) {
754
752
  // navigate to draft
755
753
  // is a kind of cross navigation -> invalidate paginator info
756
754
  oTemplateUtils.oServices.oApplication.invalidatePaginatorInfo();
757
755
  oTemplateUtils.oServices.oApplication.switchToDraft(oDraft, oResult.targetSiblingKey);
758
- oTemplateUtils.oServices.oApplication.setNextFocus(fnFocusForEdit.bind(null, bMoveToTop));
759
756
  } else {
760
757
  var oTemplatePrivateModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
761
758
  oTemplatePrivateModel.setProperty("/objectPage/displayMode", 2);
762
- fnFocusForEdit(bMoveToTop);
759
+ var oUIModel = oController.getView().getModel("ui");
760
+ bWasEditable = oUIModel.getProperty("/editable");
763
761
  }
764
- //set Editable independent of the fact that the instance is a draft or not
765
- oViewProxy.setEditable(true);
762
+ oViewProxy.setEditable(true); //set Editable independent of the fact that the instance is a draft or not
763
+ // The following logic ensures that the focus will be set correctly in the editable field.
764
+ // Note that the framework for setting the focus runs at the end of a busy session.
765
+ // In draft case this busy session will be started automatically as we are navigating to the newly created draft
766
+ // In non-draft case we start a busy session here which waits until all SmartFields have rendered to the new edit mode (if there is one).
767
+ // Even if no SmartFields needs to be rendered again a short busy session is created to trigger the focus handling infrastructure.
768
+ if (!oDraft){
769
+ var aWaitForSmartFieldsPromise = [];
770
+ if (!bWasEditable){ // Collect the Promises that are waiting for the SmartFields to be rendered
771
+ controlHelper.searchInTree(oObjectPage, function(oControl){
772
+ if (controlHelper.isSmartField(oControl)){
773
+ if (oControl.getMode() === "edit" && oControl.getBindingContext()){ // Ignore SmartFields which do not have a binding context. We assume that they are templates and not really rendered.
774
+ var oRenderedPromise = oControl._getNextModeRenderedPromise();
775
+ aWaitForSmartFieldsPromise.push(oRenderedPromise);
776
+ }
777
+ return false;
778
+ }
779
+ });
780
+ }
781
+ var oBusyHelper = oTemplateUtils.oServices.oApplication.getBusyHelper();
782
+ oBusyHelper.setBusy(Promise.all(aWaitForSmartFieldsPromise)); // setting the app busy will trigger the setting of focus finally
783
+ }
784
+ oTemplateUtils.oServices.oApplication.setNextFocus(fnFocusForEdit.bind(null, bMoveToTop));
766
785
  }
767
786
 
768
787
  var fnExpiredLockDialog; // declare function already here, to avoid usage before declaration
@@ -4,22 +4,22 @@ sap.ui.define([
4
4
 
5
5
  /**
6
6
  * Constructor for SmartVariantManagementWrapper
7
- * @param {sap.ui.comp.smartvariants.SmartVariantManagement} vTarget - The SmartVariantManagement control
7
+ * @param {sap.ui.comp.smartvariants.SmartVariantManagement} vTarget - The SmartVariantManagement control
8
8
  * or the Id of control for which this wrapper is created
9
- * @param {object} oController - the controller of the current component
9
+ * @param {object} oController - the controller of the current component
10
10
  * @param {object} oFactory - the controlStateWrapperFactory
11
- * @param {object} mParams
12
- * @param mParams.managedControlWrappers - array of controlStateWrappers for controls handled by the SVM
13
- * (currently also including SFB wrapper - to be removed)
11
+ * @param {object} mParams
12
+ * @param mParams.managedControlWrappers - array of controlStateWrappers for controls handled by the SVM
13
+ * (currently also including SFB wrapper - to be removed)
14
14
  * @param mParams.dynamicPageWrapper - dynamicPageWrapper instance handled by SVM
15
15
  * @returns
16
16
  */
17
-
17
+
18
18
  function SmartVariantManagementWrapper(vTarget, oController, oFactory, mParams) {
19
19
  // Special handling of SmartFilterBarWrapper for several reasons:
20
20
  // - Suppress selection when restoring a variant. Selection is solely triggered according to information in appState. Otherwise, erroneous selection could be triggered in
21
21
  // a few situations:
22
- // - Variant marked as execute on select, but no data selected in appState (execute on select marked when saving variant without selecting, or changed after state was
22
+ // - Variant marked as execute on select, but no data selected in appState (execute on select marked when saving variant without selecting, or changed after state was
23
23
  // stored)
24
24
  // - Fallback to standard variant in case of dirty variant in state
25
25
  // - Fallback to standard variant if variant cannot be read (logic of SVM)
@@ -42,11 +42,11 @@ sap.ui.define([
42
42
  // - not available at this point in time, and no corresponding event to attach to available
43
43
  // - provides only those controls with directly connection to SVM implemented (i.e. with wrappers marked with bVMConnection)
44
44
 
45
- // ensure managed state wrappers do not trigger change event when applying state to them.
45
+ // ensure managed state wrappers do not trigger change event when applying state to them.
46
46
  // Todo: rethink, whether this is the right place to do this (or rather when the wrappers get created)
47
47
  mParams.managedControlWrappers = mParams.managedControlWrappers.map(oFactory.getSuppressChangeEventWhenApplyingWrapper);
48
48
 
49
- // Any change of managed control should also mark variant as modified. However, this is not true for controls with direct connection to SVM (SFB, SmartTable, SmartChart).
49
+ // Any change of managed control should also mark variant as modified. However, this is not true for controls with direct connection to SVM (SFB, SmartTable, SmartChart).
50
50
  // For these controls, a real user changes are already handled by the direct connection. On the other hand, these controls also fire their change events, if their state is
51
51
  // changed from SVM (by the same connection) - setting variant dirty here would be wrong.
52
52
  mParams.managedControlWrappers.forEach(function(oWrapper){
@@ -56,18 +56,18 @@ sap.ui.define([
56
56
  });
57
57
  }
58
58
  });
59
-
60
-
59
+
60
+
61
61
 
62
62
  function fnSetControl(oControl) {
63
63
  oSmartVariantManagement = oControl;
64
64
  fnResolveControlAssigned(oSmartVariantManagement);
65
65
  }
66
-
66
+
67
67
  var oSmartFilterBarWrapper = mParams.managedControlWrappers.find(function(oWrapper){
68
68
  return oWrapper.setSVMWrapperCallbacks;
69
69
  });
70
-
70
+
71
71
  // provide callbacks needed for SFB wrapper to store/restore extnesion state with variant
72
72
  if (oSmartFilterBarWrapper){
73
73
  oSmartFilterBarWrapper.setSVMWrapperCallbacks({
@@ -94,7 +94,7 @@ sap.ui.define([
94
94
  }
95
95
 
96
96
  // Wrapper is intended to set a state to the ui, but not to trigger a selection (which should happen only after all (relevant) parts of ui state is set to the correct state
97
- // are set correct. Therefore, setting variant from here should never trigger a selection.
97
+ // are set correct. Therefore, setting variant from here should never trigger a selection.
98
98
  function fnSetVariant(sVariantId){
99
99
  if (oSmartFilterBarWrapper){
100
100
  oSmartFilterBarWrapper.suppressSelection(true);
@@ -103,24 +103,28 @@ sap.ui.define([
103
103
  var oControl = oController.getView().byId(sId);
104
104
  if (oControl && oControl.isA("sap.ui.comp.smarttable.SmartTable")) {
105
105
  oControl.attachAfterVariantInitialise(function() {
106
- oControl.setCurrentVariantId(sVariantId);
107
- oSmartVariantManagement.setModified(false);
106
+ //set currentVariantId only when sVariantId is not standard (as it might be overriding existing
107
+ //different currentVariantId) or smartTable's (oControl) currentVariantId is not equal to sVariantId.
108
+ if (sVariantId !== '*standard*' && oControl.getCurrentVariantId && oControl.getCurrentVariantId() !== sVariantId) {
109
+ oControl.setCurrentVariantId(sVariantId);
110
+ oSmartVariantManagement.setModified(false);
111
+ }
108
112
  });
109
- }
113
+ }
110
114
  oSmartVariantManagement.setCurrentVariantId(sVariantId);
111
115
  if (oSmartFilterBarWrapper){
112
116
  oSmartFilterBarWrapper.suppressSelection(false);
113
117
  }
114
118
  }
115
119
 
116
- // Restore state of all managed controls
120
+ // Restore state of all managed controls
117
121
  function fnSetManagedControlStates(oState){
118
- // Usually, looping through mParams.managedControlWrappers or through oState.managedControlStates should be equivalent, but in exceptional cases, their might be
119
- // differences, if application has changed (changing the controls managed by the SVM - in LR, this could be achieved by changing setting SmartVariantManagement).
122
+ // Usually, looping through mParams.managedControlWrappers or through oState.managedControlStates should be equivalent, but in exceptional cases, their might be
123
+ // differences, if application has changed (changing the controls managed by the SVM - in LR, this could be achieved by changing setting SmartVariantManagement).
120
124
  // mParams.managedControlWrappers reflects current state, while oState.managedControlStates reflects state at the time iAppState was written
121
125
  // - when adding a control (in LR changing setting SmartVariantManagement from false to true), state for that control would not be contained - calling the wrapper with
122
126
  // undefined to ensure initial state
123
- // - when removing a control, state would be contained that should not be applied here
127
+ // - when removing a control, state would be contained that should not be applied here
124
128
  mParams.managedControlWrappers.forEach(function(oWrapper){
125
129
  oWrapper.setState(oState.managedControlStates[oWrapper.getLocalId()]);
126
130
  });
@@ -158,8 +162,8 @@ sap.ui.define([
158
162
  // set (which is achieved by empty string)
159
163
  fnSetVariant("");
160
164
  // Usually restoring the state of any of the managed controls should mark the variant as dirty, but there might be edge cases (state from an old release not containing information for any
161
- // managed control now relevant), so to be on the safe side, we set modified=true explicitly.
162
- oSmartVariantManagement.currentVariantSetModified(true);
165
+ // managed control now relevant), so to be on the safe side, we set modified=true explicitly.
166
+ oSmartVariantManagement.currentVariantSetModified(true);
163
167
  fnSetManagedControlStates(oPreliminaryState);
164
168
  } else {
165
169
  fnSetVariant(oPreliminaryState.variantId);
@@ -171,7 +175,7 @@ sap.ui.define([
171
175
  oSmartFilterBarWrapper.setState(oPreliminaryState.managedControlStates[oSmartFilterBarWrapper.getLocalId()]);
172
176
  }
173
177
  if (oPreliminaryState.variantId !== oSmartVariantManagement.getCurrentVariantId()){
174
- // variant could not be set because it is not known, i.e. it could be private and URL was shared, or could be deleted after page was bookmarked. In this case,
178
+ // variant could not be set because it is not known, i.e. it could be private and URL was shared, or could be deleted after page was bookmarked. In this case,
175
179
  // standard variant is set (by VM). Additionally, it should be marked as modified.
176
180
  oSmartVariantManagement.currentVariantSetModified(true);
177
181
  }
@@ -187,19 +191,19 @@ sap.ui.define([
187
191
  oControlAssignedPromise.then(function() {
188
192
  // state change when user selects a different variant
189
193
  oSmartVariantManagement.attachSelect(fnHandler);
190
-
194
+
191
195
  // when user saves current state as a new variant, this is also a state change (as the variant id is part of the state)
192
196
  // note: Even if new (SFB) variant is marked as execute on select, and currently no data is selected, no need to select data here (and thus also not to collapse header).
193
- // This is one of the possible ways to get into a state with a clean variant with execute on select, but no data loaded - see also comment to identify SFB wrapper.
197
+ // This is one of the possible ways to get into a state with a clean variant with execute on select, but no data loaded - see also comment to identify SFB wrapper.
194
198
  oSmartVariantManagement.attachAfterSave(fnHandler);
195
-
199
+
196
200
  // any change of a managed control is state change
197
201
  mParams.managedControlWrappers.forEach(function(oWrapper){
198
202
  oWrapper.attachStateChanged(fnHandler);
199
203
  });
200
204
  });
201
205
  }
202
-
206
+
203
207
  return {
204
208
  getState : getState,
205
209
  setState : setState,
@@ -856,7 +856,7 @@ sap.ui.define([
856
856
  * @extends sap.ui.core.UIComponent
857
857
  * @abstract
858
858
  * @author SAP SE
859
- * @version 1.108.30
859
+ * @version 1.108.31
860
860
  * @name sap.suite.ui.generic.template.lib.AppComponent
861
861
  */
862
862
  return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -29,7 +29,7 @@ ST_CHANGES_APPLIED=Ihre \u00C4nderungen wurden \u00FCbernommen.
29
29
 
30
30
  DATA_LOSS_MESSAGE=Ihre Eintr\u00E4ge gehen beim Verlassen dieser Seite verloren.
31
31
 
32
- DATA_LOSS_GENERAL_MESSAGE=Eint. gehen verloren
32
+ DATA_LOSS_GENERAL_MESSAGE=Ihre Eintr\u00E4ge gehen verloren, wenn Sie fortfahren.
33
33
 
34
34
  PROCEED=Fortfahren
35
35
 
@@ -2943,7 +2943,7 @@ sap.ui.define(["sap/ui/base/Object",
2943
2943
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
2944
2944
  * @public
2945
2945
  * @extends sap.ui.base.Object
2946
- * @version 1.108.30
2946
+ * @version 1.108.31
2947
2947
  * @since 1.30.0
2948
2948
  * @alias sap.suite.ui.generic.template.lib.NavigationController
2949
2949
  */
@@ -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.108.30",
41
+ version: "1.108.31",
42
42
  extensions: {
43
43
  //Configuration used for rule loading of Support Assistant
44
44
  "sap.ui.support": {