@sapui5/sap.suite.ui.generic.template 1.120.42 → 1.120.44
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/i18n/i18n_id.properties +2 -2
- 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_id.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_de.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_id.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pt.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_uk.properties +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/detailTemplates/detailUtils.js +18 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +30 -27
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +5 -1
- package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +93 -55
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +8 -2
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -63,9 +63,9 @@ VISUAL_FILTER_CHART_TYPE_Donut=Bagan Donat
|
|
|
63
63
|
|
|
64
64
|
VISUAL_FILTER_SORTING=Pengurutan
|
|
65
65
|
|
|
66
|
-
VISUAL_FILTER_SORTING_ASCENDING=
|
|
66
|
+
VISUAL_FILTER_SORTING_ASCENDING=Menaik
|
|
67
67
|
|
|
68
|
-
VISUAL_FILTER_SORTING_DESCENDING=
|
|
68
|
+
VISUAL_FILTER_SORTING_DESCENDING=Menurun
|
|
69
69
|
|
|
70
70
|
VISUAL_FILTER_LINE_CHART_TIME_LINE=Tampilkan
|
|
71
71
|
|
|
@@ -92,7 +92,7 @@ LOCKED_OBJECT_FILTER=Dikunci oleh Pengguna Lain
|
|
|
92
92
|
|
|
93
93
|
UNSAVED_CHANGES=Perubahan Belum Disimpan
|
|
94
94
|
|
|
95
|
-
UNSAVED_CHANGES_FILTER=Perubahan oleh Pengguna Lain
|
|
95
|
+
UNSAVED_CHANGES_FILTER=Perubahan yang Belum Disimpan oleh Pengguna Lain
|
|
96
96
|
|
|
97
97
|
SHARE=Bagikan
|
|
98
98
|
|
|
@@ -1503,7 +1503,7 @@ sap.ui.define([
|
|
|
1503
1503
|
return null;
|
|
1504
1504
|
}
|
|
1505
1505
|
if (controlHelper.isSmartField(oControl)){ // check whether the SmartField is the correct target for focussing
|
|
1506
|
-
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl).then(function(bIsFocussable){
|
|
1506
|
+
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl, true).then(function(bIsFocussable){
|
|
1507
1507
|
return bIsFocussable && oControl; // If the SmartField has turned out to be focussable take it. Otherwise no need to investigate the subtree below it.
|
|
1508
1508
|
});
|
|
1509
1509
|
}
|
|
@@ -1563,7 +1563,7 @@ sap.ui.define([
|
|
|
1563
1563
|
//set the focus on the control passed by application
|
|
1564
1564
|
if (controlHelper.isSmartField(oFocusControl)) {
|
|
1565
1565
|
// check whether the SmartField is the correct target for focussing
|
|
1566
|
-
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl).then(function (bIsFocusable) {
|
|
1566
|
+
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl, true).then(function (bIsFocusable) {
|
|
1567
1567
|
if (bIsFocusable) {
|
|
1568
1568
|
controlHelper.focusUI5Control(oFocusControl);
|
|
1569
1569
|
} else {
|
|
@@ -19,7 +19,7 @@ SAVE=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438
|
|
|
19
19
|
|
|
20
20
|
SAVE_AND_EDIT=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0456 \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438
|
|
21
21
|
|
|
22
|
-
SAVE_AND_NEXT=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \
|
|
22
|
+
SAVE_AND_NEXT=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0442\u0430 \u0434\u0430\u043B\u0456
|
|
23
23
|
|
|
24
24
|
VALIDATE_DRAFT=\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438
|
|
25
25
|
|
|
@@ -160,7 +160,24 @@ sap.ui.define([ "sap/suite/ui/generic/template/genericUtilities/FeLogger", "sap/
|
|
|
160
160
|
function fnApplyAndUp(oEvent) {
|
|
161
161
|
var oControl = oEvent.getSource();
|
|
162
162
|
var oCRUDActionHandler = oTemplateUtils.oComponentUtils.getCRUDActionHandler();
|
|
163
|
-
|
|
163
|
+
|
|
164
|
+
// Pre-check validation to decide navigation
|
|
165
|
+
var oAppComponent = oController.getOwnerComponent().getAppComponent();
|
|
166
|
+
var oManifestSettings = oAppComponent.getManifest()["sap.ui.generic.app"];
|
|
167
|
+
var bNavigateImmediately = oManifestSettings &&
|
|
168
|
+
oManifestSettings.settings &&
|
|
169
|
+
oManifestSettings.settings.applyButtonNavigatesImmediately;
|
|
170
|
+
if (bNavigateImmediately) {
|
|
171
|
+
oCRUDActionHandler.hasValidationMessageOnDetailsViews().then(function(bHasValidationErrors) {
|
|
172
|
+
if (!bHasValidationErrors) {
|
|
173
|
+
// No frontend errors - navigate immediately
|
|
174
|
+
fnNavigateUp();
|
|
175
|
+
oTemplateUtils.oServices.oApplicationController.synchronizeDraftAsync();
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
oCRUDActionHandler.handleCRUDScenario(2, fnApplyAndUpImpl.bind(null, oControl));
|
|
180
|
+
}
|
|
164
181
|
}
|
|
165
182
|
|
|
166
183
|
var oDiscardEditHandler; // singleton, initialized on demand
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
sap.ui.define([
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/dom/getFirstEditableInput",
|
|
3
|
+
"sap/suite/ui/generic/template/genericUtilities/FeLogger"
|
|
4
|
+
], function(getFirstEditableInput, FeLogger) {
|
|
2
5
|
"use strict";
|
|
3
|
-
|
|
6
|
+
|
|
4
7
|
var oFeLogger = new FeLogger("genericUtilities.controlHelper");
|
|
5
8
|
var oLogger = oFeLogger.getLogger();
|
|
6
|
-
|
|
9
|
+
|
|
7
10
|
var byId = sap.ui.getCore().byId;
|
|
8
|
-
|
|
11
|
+
|
|
9
12
|
function isControlOfType(sPathToType, oControl){
|
|
10
13
|
var FNClass = sap.ui.require(sPathToType);
|
|
11
14
|
return typeof FNClass === "function" && (oControl instanceof FNClass);
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
|
|
14
17
|
function getUI5ControlForDomElement(oDom){
|
|
15
18
|
for (; oDom; oDom = oDom.parentNode) {
|
|
16
19
|
if (oDom.hasAttribute && oDom.hasAttribute("data-sap-ui")) {
|
|
17
20
|
return sap.ui.getCore().byId(oDom.id);
|
|
18
21
|
}
|
|
19
|
-
}
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
|
-
|
|
24
|
+
|
|
22
25
|
function focusUI5Control(oControl, oFocusInfo){
|
|
23
26
|
if (oControl && oControl.focus) {
|
|
24
27
|
oLogger.debug("Set focus on control with id " + oControl.getId());
|
|
@@ -40,9 +43,9 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
40
43
|
if (oTest !== oControl){
|
|
41
44
|
oLogger.warning(oCurrentFocus ? ("Focus is now on control with id " + oCurrentFocus.getId()) : "There is no focus now");
|
|
42
45
|
}
|
|
43
|
-
}
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
|
|
46
49
|
function focusDom(oDom, oFocusInfo){
|
|
47
50
|
var oUi5Control = getUI5ControlForDomElement(oDom);
|
|
48
51
|
focusUI5Control(oUi5Control, oFocusInfo);
|
|
@@ -54,12 +57,12 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
// returns a Promise that resolves to the boolean information whether the SmartField is a possible focus target for input.
|
|
57
|
-
function getSmartFieldIsFocussableForInputPromise(oSmartField) {
|
|
60
|
+
function getSmartFieldIsFocussableForInputPromise(oSmartField, isSmartForm) {
|
|
58
61
|
return oSmartField._getComputedMetadata().then(function () {
|
|
59
62
|
return (oSmartField.getMode() === "edit") && (oSmartField._getICRenderedPromise() || Promise.resolve());
|
|
60
63
|
}).then(function () {
|
|
61
|
-
var oFirstFocusableInput = !oSmartField._bEdmBoolDetected && getFirstEditableInput(oSmartField.getDomRef());
|
|
62
|
-
return !(!oFirstFocusableInput || oFirstFocusableInput.type === "checkbox");
|
|
64
|
+
var oFirstFocusableInput = (!oSmartField._bEdmBoolDetected || isSmartForm) && getFirstEditableInput(oSmartField.getDomRef());
|
|
65
|
+
return !(!oFirstFocusableInput || (oFirstFocusableInput.type === "checkbox" && !isSmartForm));
|
|
63
66
|
}).catch(function () {
|
|
64
67
|
return false;
|
|
65
68
|
});
|
|
@@ -70,7 +73,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
70
73
|
function getControlWithFocus(){
|
|
71
74
|
return getUI5ControlForDomElement(document.activeElement);
|
|
72
75
|
}
|
|
73
|
-
|
|
76
|
+
|
|
74
77
|
// If oChild is identified to be invisible, null is returned. Otherwise its parent is returned.
|
|
75
78
|
// If the parent does not exist a faulty value is returned.
|
|
76
79
|
// This is a heuristic method.
|
|
@@ -99,7 +102,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
99
102
|
}
|
|
100
103
|
return vRet;
|
|
101
104
|
}
|
|
102
|
-
|
|
105
|
+
|
|
103
106
|
// Return a list of all children of the given control (in the 'correct' order). Only implemented for certain control types.
|
|
104
107
|
// For the other control types it returns null or an empty array depending on bAlwaysReturnAList.
|
|
105
108
|
function getChildren(oControl, bAlwaysReturnAList){
|
|
@@ -113,7 +116,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
113
116
|
return oControl.getBlocks().concat(oControl.getMoreBlocks());
|
|
114
117
|
}
|
|
115
118
|
if (isControlOfType("sap/ui/comp/smartform/Group", oControl)){
|
|
116
|
-
return oControl.getFormElements();
|
|
119
|
+
return oControl.getFormElements();
|
|
117
120
|
}
|
|
118
121
|
if (isControlOfType("sap/ui/table/Column", oControl)){
|
|
119
122
|
var aRet = oControl.getMultiLabels();
|
|
@@ -121,11 +124,11 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
121
124
|
if (oLabel){
|
|
122
125
|
aRet.push(oLabel);
|
|
123
126
|
}
|
|
124
|
-
return aRet;
|
|
125
|
-
}
|
|
127
|
+
return aRet;
|
|
128
|
+
}
|
|
126
129
|
return bAlwaysReturnAList ? [] : null;
|
|
127
130
|
}
|
|
128
|
-
|
|
131
|
+
|
|
129
132
|
// Sorter that compares the position of two child controls which have a common parent.
|
|
130
133
|
// Returns a positive integer when oChild1 is larger, a negative number if oChild2 is larger, and 0 if they are identical.
|
|
131
134
|
// Depends on getChildren() being implemented for commonParent. If this is not the case, at least a reproducable order is guaranteed.
|
|
@@ -146,13 +149,13 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
146
149
|
}
|
|
147
150
|
if (iPositionCompare & Node.DOCUMENT_POSITION_FOLLOWING){
|
|
148
151
|
return -1;
|
|
149
|
-
}
|
|
152
|
+
}
|
|
150
153
|
}
|
|
151
154
|
return 1 - 2 * (!oDomRef1 === !oDomRef2 ? oChild1.getId() < oChild2.getId() : !oDomRef2); // if we cannot determine a reasonable order we still want to have a reproducable order. Note that elements with DomRef must clearly be separated from those without.
|
|
152
155
|
}
|
|
153
156
|
return (iPos1 >= 0 && iPos2 >= 0) ? (iPos1 - iPos2) : (iPos2 - iPos1); // if only one child has been identified in the list of children it takes precedence.
|
|
154
157
|
}
|
|
155
|
-
|
|
158
|
+
|
|
156
159
|
// This function defines which instances of sap.ui.core.Element are relevant for investigation (Currently used in fnSearchInTree).
|
|
157
160
|
// They must posess a property 'visible' (which is guaranteed for all instances of sap.ui.core.Control) which is true.
|
|
158
161
|
// If they have a property 'enabled' this must be true as well.
|
|
@@ -162,7 +165,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
162
165
|
return checkForRelevance(oCell);
|
|
163
166
|
}) : (typeof oElement.getVisible === "function" && oElement.getVisible() && (typeof oElement.getEnabled !== "function" || oElement.getEnabled()));
|
|
164
167
|
}
|
|
165
|
-
|
|
168
|
+
|
|
166
169
|
// This function allows a depth-first search in an element tree starting with root oElement
|
|
167
170
|
// Thereby, the following logic is applied
|
|
168
171
|
// - Children of an element are determined by function getChildren in this class. If this provides an empty array method findElements of the element is used
|
|
@@ -174,14 +177,14 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
174
177
|
// Note that mAlreadyAnalyzed will be updated by this function
|
|
175
178
|
// fnHandleElement(oElement) is a function that will be called on all relevant elements of the tree.
|
|
176
179
|
// This function can work asynchronously (i.e. return a Promise) or synchronously (i.e. return something which is not a Promise) on a case-by-case basis.
|
|
177
|
-
// In the second case the return value will be considered as the result of the function. In the first case the value the Promise resolves to will be considered as the result.
|
|
180
|
+
// In the second case the return value will be considered as the result of the function. In the first case the value the Promise resolves to will be considered as the result.
|
|
178
181
|
// If the result is a truthy value for one element this value is considered as the result of fnSearchInTree and the processing is stopped.
|
|
179
182
|
// fnSearchInTree returns this result synchronously if all calls of fnHandleElement which have been performed until then have worked synchronously.
|
|
180
183
|
// If the result of fnHandleElement is faulty the depth-first search of the tree proceeds. Thereby the processing of the subtree of oElement is
|
|
181
184
|
// skipped if the result was exactly false. For other faulty values the subtree will be processed next.
|
|
182
185
|
// Note that this process will never work on two elements in parallel. If the processing of one element is asynchronous the process is interrupted until
|
|
183
186
|
// the result of this step is available. Only then the next element will be analyzed.
|
|
184
|
-
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
187
|
+
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
185
188
|
function fnSearchInTree(mAlreadyAnalyzed, oElement, fnHandleElement){
|
|
186
189
|
mAlreadyAnalyzed = mAlreadyAnalyzed || Object.create(null);
|
|
187
190
|
var sId = oElement.getId();
|
|
@@ -199,7 +202,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
199
202
|
if (!aChildren){ // if getChildren does not care for the control type of oElement
|
|
200
203
|
aChildren = oElement.findElements(false);
|
|
201
204
|
aChildren.sort(fnSortChildControls.bind(null, oElement));
|
|
202
|
-
}
|
|
205
|
+
}
|
|
203
206
|
aChildren.some(function(oChild){
|
|
204
207
|
vResult = fnSearchInTree(mAlreadyAnalyzed, oChild, fnHandleElement);
|
|
205
208
|
return vResult; // If vResult is truthy it is either a Promise (which makes the processing asynchronous) or the result of fnSearchInTree. In both cases we should stop now.
|
|
@@ -219,7 +222,7 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
219
222
|
}
|
|
220
223
|
// When coming here we have synchronously either found a node with a truthy result or have processed the whole tree without finding any truthy result
|
|
221
224
|
mAlreadyAnalyzed[sId] = 2;
|
|
222
|
-
return vResult || null;
|
|
225
|
+
return vResult || null;
|
|
223
226
|
}
|
|
224
227
|
|
|
225
228
|
var oControlHelper = {
|
|
@@ -261,10 +264,10 @@ sap.ui.define(["sap/ui/dom/getFirstEditableInput", "sap/suite/ui/generic/templat
|
|
|
261
264
|
sortChildControls: fnSortChildControls,
|
|
262
265
|
searchInTree: fnSearchInTree.bind(null, null)
|
|
263
266
|
};
|
|
264
|
-
|
|
267
|
+
|
|
265
268
|
oControlHelper.isTable = function(oControl){
|
|
266
269
|
return oControlHelper.isSmartTable(oControl) || oControlHelper.isUiTable(oControl) || oControlHelper.isMTable(oControl);
|
|
267
270
|
};
|
|
268
|
-
|
|
271
|
+
|
|
269
272
|
return oControlHelper;
|
|
270
273
|
});
|
|
@@ -939,7 +939,7 @@ sap.ui.define([
|
|
|
939
939
|
* @extends sap.ui.core.UIComponent
|
|
940
940
|
* @abstract
|
|
941
941
|
* @author SAP SE
|
|
942
|
-
* @version 1.120.
|
|
942
|
+
* @version 1.120.44
|
|
943
943
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
944
944
|
*/
|
|
945
945
|
return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -994,6 +994,10 @@ sap.ui.define([
|
|
|
994
994
|
type: "string",
|
|
995
995
|
defaultValue: "Middle"
|
|
996
996
|
},
|
|
997
|
+
applyButtonNavigatesImmediately : {
|
|
998
|
+
type:"boolean",
|
|
999
|
+
defaultValue: false
|
|
1000
|
+
},
|
|
997
1001
|
//The column layout is used by default in the SmartForm on the object page
|
|
998
1002
|
useColumnLayoutForSmartForm: {
|
|
999
1003
|
type: "boolean",
|
|
@@ -333,67 +333,105 @@ sap.ui.define(["sap/ui/model/Context", "sap/suite/ui/generic/template/lib/Messag
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
/*
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
336
|
+
* Initiates editing of a list entry directly (without navigating to the object page first).
|
|
337
|
+
* Unlike the 'edit' method above, the first editEntity call uses preserveChanges=true.
|
|
338
|
+
* If the backend responds with a 409 (conflict) the DraftAdministrativeData is read to
|
|
339
|
+
* distinguish between a locked record and a record with unsaved changes by another user.
|
|
340
|
+
* A corresponding dialog is shown to let the user decide how to proceed.
|
|
341
|
+
*
|
|
342
|
+
* @param {object} oTransactionController - transaction controller providing editEntity
|
|
343
|
+
* @param {string} sEntitySet - name of the entity set
|
|
344
|
+
* @param {object} oBindingContext - UI5 Context of the row being edited;
|
|
345
|
+
* the OData model and binding path are derived
|
|
346
|
+
* from it via .getModel() / .getPath()
|
|
347
|
+
* @param {object} oApplication - application proxy (busy helper, component utils, …)
|
|
348
|
+
* @param {string} sAppId - ID of the AppComponent; used as the localStorage cache
|
|
349
|
+
* key for the content-id batch optimisation
|
|
350
|
+
* @param {object} oCommonUtils - common utilities (getText, …)
|
|
351
|
+
* @param {object} oViewDependencyHelper - used to mark the root page as dirty
|
|
352
|
+
* @param {object} oViewProxy - used for navigateUp on cancellation
|
|
353
|
+
* @param {boolean} bOpenInEditMode - whether the page was opened directly in edit mode
|
|
354
|
+
*/
|
|
355
|
+
function directEdit(oTransactionController, sEntitySet, oBindingContext, oApplication, sAppId, oCommonUtils, oViewDependencyHelper, oViewProxy, bOpenInEditMode){
|
|
340
356
|
var oDraftContext = oTransactionController.getDraftController().getDraftContext();
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
});
|
|
374
|
-
var unSavedChangesDialogPromise = fnUnsavedChangesDialog(undefined, oResponse.DraftAdministrativeData,oCommonUtils, oViewProxy, bOpenInEditMode);
|
|
375
|
-
unSavedChangesDialogPromise.then(editConfirmation,editRejection);
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
function(oResponse) {
|
|
379
|
-
// DraftAdminData read failed
|
|
357
|
+
|
|
358
|
+
if (!oDraftContext.isDraftEnabled(sEntitySet)) {
|
|
359
|
+
return Promise.resolve({ context: oBindingContext });
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
var oModel = oBindingContext.getModel();
|
|
363
|
+
// Fetch sRootExpand for the content-id batch optimisation.
|
|
364
|
+
// getRootExpand is intentionally not provided: directEdit is always invoked from
|
|
365
|
+
// the List Report before the Object Page is active, so getRootExpand is not yet
|
|
366
|
+
// available. CacheHelper falls back to the localStorage cache, which is still
|
|
367
|
+
// much faster than fetching expands in a separate backend request.
|
|
368
|
+
var oInfoForContentIdPromise = CacheHelper.getInfoForContentIdPromise(sEntitySet, oModel, sAppId);
|
|
369
|
+
|
|
370
|
+
var oRet = oInfoForContentIdPromise.then(function(oInfoObject) {
|
|
371
|
+
var sRootExpand = oInfoObject.contentIdRequestPossible ? oInfoObject.parametersForContentIdRequest.sRootExpand : null;
|
|
372
|
+
|
|
373
|
+
return new Promise(function(resolve, reject) {
|
|
374
|
+
var oFirstEditPromise = oTransactionController.editEntity(oBindingContext, true, sRootExpand);
|
|
375
|
+
// Track the busy state against the individual network request so the busy
|
|
376
|
+
// indicator remains active for exactly as long as the request is in flight.
|
|
377
|
+
oApplication.getBusyHelper().setBusy(oFirstEditPromise, true);
|
|
378
|
+
oFirstEditPromise.then(function(oResponse) {
|
|
379
|
+
oModel.invalidateEntry(oBindingContext);
|
|
380
|
+
oViewDependencyHelper.setRootPageToDirty();
|
|
381
|
+
resolve({ context: oResponse.context });
|
|
382
|
+
}, function(oResponse) {
|
|
383
|
+
if (oResponse && oResponse.response && oResponse.response.statusCode === "409") {
|
|
384
|
+
//remove transient message associated with rc 409 in order to prevent message pop-up
|
|
385
|
+
oApplication.removeTransientMessages();
|
|
386
|
+
fnReadDraftAdministrativeData(oModel, oBindingContext.getPath(), oApplication.getBusyHelper()).then(
|
|
387
|
+
function(oResponse) {
|
|
388
|
+
if (oResponse.DraftAdministrativeData.InProcessByUser) {
|
|
380
389
|
reject({
|
|
381
|
-
|
|
390
|
+
lockedByUser: oResponse.DraftAdministrativeData.InProcessByUserDescription || oResponse.DraftAdministrativeData.InProcessByUser
|
|
382
391
|
});
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
+
} else { //unsaved changes
|
|
393
|
+
var editConfirmation = function() {
|
|
394
|
+
// Re-run editEntity without preserveChanges so the
|
|
395
|
+
// unsaved changes of another user are overwritten.
|
|
396
|
+
var oUnsavedChangesEditPromise = oTransactionController.editEntity(oBindingContext, false, sRootExpand).then(function(oResponse) {
|
|
397
|
+
oModel.invalidateEntry(oBindingContext);
|
|
398
|
+
oViewDependencyHelper.setRootPageToDirty();
|
|
399
|
+
resolve({ context: oResponse.context });
|
|
400
|
+
});
|
|
401
|
+
oApplication.getBusyHelper().setBusy(oUnsavedChangesEditPromise, true);
|
|
402
|
+
};
|
|
403
|
+
// editRejection is passed as the rejection handler of Promise.then(),
|
|
404
|
+
// so it must be a function reference; calling reject() inline here
|
|
405
|
+
// would execute it immediately instead of on dialog cancellation.
|
|
406
|
+
var editRejection = function() { reject({ cancelled: true }); };
|
|
407
|
+
var unSavedChangesDialogPromise = fnUnsavedChangesDialog(undefined, oResponse.DraftAdministrativeData, oCommonUtils, oViewProxy, bOpenInEditMode);
|
|
408
|
+
unSavedChangesDialogPromise.then(editConfirmation, editRejection);
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
function(oResponse) {
|
|
412
|
+
// DraftAdminData read failed
|
|
413
|
+
reject({ draftAdminReadResponse: oResponse });
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
} else {
|
|
417
|
+
reject(oResponse);
|
|
418
|
+
}
|
|
392
419
|
});
|
|
393
|
-
}
|
|
394
420
|
});
|
|
395
421
|
});
|
|
396
|
-
|
|
422
|
+
|
|
423
|
+
// Ensure the active context is registered in ContextBookkeeping before the edit
|
|
424
|
+
// resolves. This caches the draft sibling path so subsequent navigation can use
|
|
425
|
+
// the cached value without an additional /SiblingEntity request.
|
|
426
|
+
// editingStarted() notifies all listeners (e.g. the message button helper) that
|
|
427
|
+
// the editing phase has begun for this context.
|
|
428
|
+
var bContextRegistered = oApplication.checkContextData(oBindingContext);
|
|
429
|
+
if (!bContextRegistered) {
|
|
430
|
+
oApplication.registerContext(oBindingContext, 1, sEntitySet);
|
|
431
|
+
}
|
|
432
|
+
oApplication.editingStarted(oBindingContext, oRet);
|
|
433
|
+
|
|
434
|
+
return oRet;
|
|
397
435
|
}
|
|
398
436
|
|
|
399
437
|
function deleteEntity(oDraftController, fnExecuteDelete, oApplicationProxy, oContext, bIsActiveEntity, sActionType){
|
|
@@ -166,7 +166,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
166
166
|
oCurrentPaginatorInfo = oRet; // make sure that the navigation below does not create a new paginator info but reuses the existing one
|
|
167
167
|
onListNavigate(oSourceItem, oState, oTargetContext, true, oViewProxy);
|
|
168
168
|
};
|
|
169
|
-
|
|
169
|
+
var oComponent = oController.getOwnerComponent();
|
|
170
|
+
var bOpenInEditMode = !!oComponent.getEditFlow && oComponent.getEditFlow() === "direct";
|
|
171
|
+
|
|
172
|
+
if (bIsActive && bIsEditItem && !bOpenInEditMode){ // in this case oListBinding (and thus oContext which was derived from it) points to the active version, but we are already in the draft version
|
|
170
173
|
oServices.oApplication.registerContext(oContext, oComponentUtils.getViewLevel() + 1); // determine the sibling context
|
|
171
174
|
var oSiblingPromise = oServices.oApplication.getDraftSiblingPromise(oContext); // as the "real" target of this pagination
|
|
172
175
|
oSiblingPromise.then(fnPaginateImpl);
|
|
@@ -1582,7 +1585,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1582
1585
|
var bOpenInEditMode = !!oComponent.getEditFlow && oComponent.getEditFlow() === "direct";
|
|
1583
1586
|
if (bOpenInEditMode){
|
|
1584
1587
|
var sEntitySet = oTable.getEntitySet();
|
|
1585
|
-
|
|
1588
|
+
// oBindingContext is passed directly; the OData model and binding path are resolved inside directEdit.
|
|
1589
|
+
// sAppId is derived here because oController is not accessible inside CRUDHelper.
|
|
1590
|
+
var sAppId = oComponent.getAppComponent().getId();
|
|
1591
|
+
var oEditPromise = CRUDHelper.directEdit(oServices.oTransactionController, sEntitySet, oBindingContext, oServices.oApplication, sAppId, oCommonUtils, oServices.oViewDependencyHelper, oViewProxy, bOpenInEditMode);
|
|
1586
1592
|
oEditPromise.then(function(oResult){
|
|
1587
1593
|
oCommonUtils.navigateFromListItem(oResult.context, bReplace, bOpenInEditMode);
|
|
1588
1594
|
}, function(oError){
|
|
@@ -3094,7 +3094,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3094
3094
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3095
3095
|
* @public
|
|
3096
3096
|
* @extends sap.ui.base.Object
|
|
3097
|
-
* @version 1.120.
|
|
3097
|
+
* @version 1.120.44
|
|
3098
3098
|
* @since 1.30.0
|
|
3099
3099
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3100
3100
|
*/
|