@sapui5/sap.suite.ui.generic.template 1.136.16 → 1.136.17
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_de.properties +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/genericUtilities/controlHelper.js +29 -29
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +93 -55
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +4 -1
- 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
|
|
|
@@ -96,7 +96,7 @@ LOCKED_OBJECT_FILTER=Dikunci oleh Pengguna Lain
|
|
|
96
96
|
|
|
97
97
|
UNSAVED_CHANGES=Perubahan Belum Disimpan
|
|
98
98
|
|
|
99
|
-
UNSAVED_CHANGES_FILTER=Perubahan oleh Pengguna Lain
|
|
99
|
+
UNSAVED_CHANGES_FILTER=Perubahan yang Belum Disimpan oleh Pengguna Lain
|
|
100
100
|
|
|
101
101
|
SHARE=Bagikan
|
|
102
102
|
|
|
@@ -1457,7 +1457,7 @@ sap.ui.define([
|
|
|
1457
1457
|
return null;
|
|
1458
1458
|
}
|
|
1459
1459
|
if (controlHelper.isSmartField(oControl)){ // check whether the SmartField is the correct target for focussing
|
|
1460
|
-
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl).then(function(bIsFocussable){
|
|
1460
|
+
return controlHelper.getSmartFieldIsFocussableForInputPromise(oControl, true).then(function(bIsFocussable){
|
|
1461
1461
|
return bIsFocussable && oControl; // If the SmartField has turned out to be focussable take it. Otherwise no need to investigate the subtree below it.
|
|
1462
1462
|
});
|
|
1463
1463
|
}
|
|
@@ -1517,7 +1517,7 @@ sap.ui.define([
|
|
|
1517
1517
|
//set the focus on the control passed by application
|
|
1518
1518
|
if (controlHelper.isSmartField(oFocusControl)) {
|
|
1519
1519
|
// check whether the SmartField is the correct target for focussing
|
|
1520
|
-
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl).then(function (bIsFocusable) {
|
|
1520
|
+
controlHelper.getSmartFieldIsFocussableForInputPromise(oFocusControl, true).then(function (bIsFocusable) {
|
|
1521
1521
|
if (bIsFocusable) {
|
|
1522
1522
|
controlHelper.focusUI5Control(oFocusControl);
|
|
1523
1523
|
} 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
|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
|
-
"sap/ui/dom/getFirstEditableInput",
|
|
2
|
+
"sap/ui/dom/getFirstEditableInput",
|
|
3
3
|
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
4
4
|
"sap/ui/core/Element",
|
|
5
5
|
"sap/ui/table/plugins/MultiSelectionPlugin"
|
|
6
6
|
], function(getFirstEditableInput, FeLogger, Element, MultiSelectionPlugin) {
|
|
7
7
|
"use strict";
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
var oFeLogger = new FeLogger("genericUtilities.controlHelper");
|
|
10
10
|
var oLogger = oFeLogger.getLogger();
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
var byId = Element.getElementById;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
function isControlOfType(sPathToType, oControl){
|
|
15
15
|
var FNClass = sap.ui.require(sPathToType);
|
|
16
16
|
return typeof FNClass === "function" && (oControl instanceof FNClass);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
function getUI5ControlForDomElement(oDom){
|
|
20
20
|
for (; oDom; oDom = oDom.parentNode) {
|
|
21
21
|
if (oDom.hasAttribute && oDom.hasAttribute("data-sap-ui")) {
|
|
22
22
|
return byId(oDom.id);
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
function focusUI5Control(oControl, oFocusInfo){
|
|
28
28
|
if (oControl && oControl.focus) {
|
|
29
29
|
oLogger.debug("Set focus on control with id " + oControl.getId());
|
|
@@ -50,9 +50,9 @@ sap.ui.define([
|
|
|
50
50
|
if (oTest !== oControl){
|
|
51
51
|
oLogger.warning(oCurrentFocus ? ("Focus is now on control with id " + oCurrentFocus.getId()) : "There is no focus now");
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
function focusDom(oDom, oFocusInfo){
|
|
57
57
|
var oUi5Control = getUI5ControlForDomElement(oDom);
|
|
58
58
|
focusUI5Control(oUi5Control, oFocusInfo);
|
|
@@ -64,12 +64,12 @@ sap.ui.define([
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// returns a Promise that resolves to the boolean information whether the SmartField is a possible focus target for input.
|
|
67
|
-
function getSmartFieldIsFocussableForInputPromise(oSmartField) {
|
|
67
|
+
function getSmartFieldIsFocussableForInputPromise(oSmartField, isSmartForm) {
|
|
68
68
|
return oSmartField._getComputedMetadata().then(function () {
|
|
69
69
|
return (oSmartField.getMode() === "edit") && (oSmartField._getICRenderedPromise() || Promise.resolve());
|
|
70
70
|
}).then(function () {
|
|
71
|
-
var oFirstFocusableInput = !oSmartField._bEdmBoolDetected && getFirstEditableInput(oSmartField.getDomRef());
|
|
72
|
-
return !(!oFirstFocusableInput || oFirstFocusableInput.type === "checkbox");
|
|
71
|
+
var oFirstFocusableInput = (!oSmartField._bEdmBoolDetected || isSmartForm) && getFirstEditableInput(oSmartField.getDomRef());
|
|
72
|
+
return !(!oFirstFocusableInput || (oFirstFocusableInput.type === "checkbox" && !isSmartForm));
|
|
73
73
|
}).catch(function () {
|
|
74
74
|
return false;
|
|
75
75
|
});
|
|
@@ -80,12 +80,12 @@ sap.ui.define([
|
|
|
80
80
|
function getControlWithFocus(){
|
|
81
81
|
return getUI5ControlForDomElement(document.activeElement);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
// Returns the parent of a given sap.ui.core.Element, but considers that for Components the parent is to be found via the oContainer property.
|
|
85
85
|
function getParent(oElement){
|
|
86
86
|
return oElement.getParent() || oElement.oContainer;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
// If oChild is identified to be invisible, null is returned. Otherwise its parent is returned.
|
|
90
90
|
// If the parent does not exist a faulty value is returned.
|
|
91
91
|
// This is a heuristic method.
|
|
@@ -111,7 +111,7 @@ sap.ui.define([
|
|
|
111
111
|
}
|
|
112
112
|
return vRet;
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
// Return a list of all children of the given control (in the 'correct' order). Only implemented for certain control types.
|
|
116
116
|
// For the other control types it returns null or an empty array depending on bAlwaysReturnAList.
|
|
117
117
|
function getChildren(oControl, bAlwaysReturnAList){
|
|
@@ -125,7 +125,7 @@ sap.ui.define([
|
|
|
125
125
|
return oControl.getBlocks().concat(oControl.getMoreBlocks());
|
|
126
126
|
}
|
|
127
127
|
if (isControlOfType("sap/ui/comp/smartform/Group", oControl)){
|
|
128
|
-
return oControl.getFormElements();
|
|
128
|
+
return oControl.getFormElements();
|
|
129
129
|
}
|
|
130
130
|
if (isControlOfType("sap/ui/table/Column", oControl)){
|
|
131
131
|
var aRet = oControl.getMultiLabels();
|
|
@@ -133,11 +133,11 @@ sap.ui.define([
|
|
|
133
133
|
if (oLabel){
|
|
134
134
|
aRet.push(oLabel);
|
|
135
135
|
}
|
|
136
|
-
return aRet;
|
|
137
|
-
}
|
|
136
|
+
return aRet;
|
|
137
|
+
}
|
|
138
138
|
return bAlwaysReturnAList ? [] : null;
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
|
|
141
141
|
// Sorter that compares the position of two child controls which have a common parent.
|
|
142
142
|
// Returns a positive integer when oChild1 is larger, a negative number if oChild2 is larger, and 0 if they are identical.
|
|
143
143
|
// Depends on getChildren() being implemented for commonParent. If this is not the case, at least a reproducable order is guaranteed.
|
|
@@ -158,13 +158,13 @@ sap.ui.define([
|
|
|
158
158
|
}
|
|
159
159
|
if (iPositionCompare & Node.DOCUMENT_POSITION_FOLLOWING){
|
|
160
160
|
return -1;
|
|
161
|
-
}
|
|
161
|
+
}
|
|
162
162
|
}
|
|
163
163
|
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.
|
|
164
164
|
}
|
|
165
165
|
return (iPos1 >= 0 && iPos2 >= 0) ? (iPos1 - iPos2) : (iPos2 - iPos1); // if only one child has been identified in the list of children it takes precedence.
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
// This function defines which instances of sap.ui.core.Element are relevant for investigation (Currently used in fnSearchInTree).
|
|
169
169
|
// They must posess a property 'visible' (which is guaranteed for all instances of sap.ui.core.Control) which is true.
|
|
170
170
|
// If they have a property 'enabled' this must be true as well.
|
|
@@ -174,7 +174,7 @@ sap.ui.define([
|
|
|
174
174
|
return checkForRelevance(oCell);
|
|
175
175
|
}) : (typeof oElement.getVisible === "function" && oElement.getVisible() && (typeof oElement.getEnabled !== "function" || oElement.getEnabled()));
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
// This function allows a depth-first search in an element tree starting with root oElement
|
|
179
179
|
// Thereby, the following logic is applied
|
|
180
180
|
// - 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
|
|
@@ -186,14 +186,14 @@ sap.ui.define([
|
|
|
186
186
|
// Note that mAlreadyAnalyzed will be updated by this function
|
|
187
187
|
// fnHandleElement(oElement) is a function that will be called on all relevant elements of the tree.
|
|
188
188
|
// 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.
|
|
189
|
-
// 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.
|
|
189
|
+
// 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.
|
|
190
190
|
// If the result is a truthy value for one element this value is considered as the result of fnSearchInTree and the processing is stopped.
|
|
191
191
|
// fnSearchInTree returns this result synchronously if all calls of fnHandleElement which have been performed until then have worked synchronously.
|
|
192
192
|
// If the result of fnHandleElement is faulty the depth-first search of the tree proceeds. Thereby the processing of the subtree of oElement is
|
|
193
193
|
// skipped if the result was exactly false. For other faulty values the subtree will be processed next.
|
|
194
194
|
// 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
|
|
195
195
|
// the result of this step is available. Only then the next element will be analyzed.
|
|
196
|
-
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
196
|
+
// If fnHandleElement never results in a truthy value then fnSearchInTree results in null.
|
|
197
197
|
function fnSearchInTree(mAlreadyAnalyzed, oElement, fnHandleElement){
|
|
198
198
|
mAlreadyAnalyzed = mAlreadyAnalyzed || Object.create(null);
|
|
199
199
|
var sId = oElement.getId();
|
|
@@ -211,7 +211,7 @@ sap.ui.define([
|
|
|
211
211
|
if (!aChildren){ // if getChildren does not care for the control type of oElement
|
|
212
212
|
aChildren = oElement.findElements(false);
|
|
213
213
|
aChildren.sort(fnSortChildControls.bind(null, oElement));
|
|
214
|
-
}
|
|
214
|
+
}
|
|
215
215
|
aChildren.some(function(oChild){
|
|
216
216
|
vResult = fnSearchInTree(mAlreadyAnalyzed, oChild, fnHandleElement);
|
|
217
217
|
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.
|
|
@@ -231,12 +231,12 @@ sap.ui.define([
|
|
|
231
231
|
}
|
|
232
232
|
// 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
|
|
233
233
|
mAlreadyAnalyzed[sId] = 2;
|
|
234
|
-
return vResult || null;
|
|
234
|
+
return vResult || null;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
* Returns the selection plugin for the given UI table
|
|
239
|
-
* @param {sap.ui.table.Table} oUiTable
|
|
239
|
+
* @param {sap.ui.table.Table} oUiTable
|
|
240
240
|
* @returns {sap.ui.table.plugins.MultiSelectionPlugin|undefined}
|
|
241
241
|
*/
|
|
242
242
|
function fnGetSelectionPluginForUITable (oUiTable) {
|
|
@@ -284,10 +284,10 @@ sap.ui.define([
|
|
|
284
284
|
searchInTree: fnSearchInTree.bind(null, null),
|
|
285
285
|
getSelectionPluginForUITable: fnGetSelectionPluginForUITable
|
|
286
286
|
};
|
|
287
|
-
|
|
287
|
+
|
|
288
288
|
oControlHelper.isTable = function(oControl){
|
|
289
289
|
return oControlHelper.isSmartTable(oControl) || oControlHelper.isUiTable(oControl) || oControlHelper.isMTable(oControl);
|
|
290
290
|
};
|
|
291
|
-
|
|
291
|
+
|
|
292
292
|
return oControlHelper;
|
|
293
293
|
});
|
|
@@ -964,7 +964,7 @@ sap.ui.define([
|
|
|
964
964
|
* @public
|
|
965
965
|
* @extends sap.ui.core.UIComponent
|
|
966
966
|
* @author SAP SE
|
|
967
|
-
* @version 1.136.
|
|
967
|
+
* @version 1.136.17
|
|
968
968
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
969
969
|
*/
|
|
970
970
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -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){
|
|
@@ -1677,7 +1677,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1677
1677
|
var bOpenInEditMode = !!oComponent.getEditFlow && oComponent.getEditFlow() === "direct";
|
|
1678
1678
|
if (bOpenInEditMode){
|
|
1679
1679
|
var sEntitySet = oTable.getEntitySet();
|
|
1680
|
-
|
|
1680
|
+
// oBindingContext is passed directly; the OData model and binding path are resolved inside directEdit.
|
|
1681
|
+
// sAppId is derived here because oController is not accessible inside CRUDHelper.
|
|
1682
|
+
var sAppId = oComponent.getAppComponent().getId();
|
|
1683
|
+
var oEditPromise = CRUDHelper.directEdit(oServices.oTransactionController, sEntitySet, oBindingContext, oServices.oApplication, sAppId, oCommonUtils, oServices.oViewDependencyHelper, oViewProxy, bOpenInEditMode);
|
|
1681
1684
|
oEditPromise.then(function(oResult){
|
|
1682
1685
|
oCommonUtils.navigateFromListItem(oResult.context, bReplace, true);
|
|
1683
1686
|
}, function(oError){
|
|
@@ -3206,7 +3206,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3206
3206
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3207
3207
|
* @public
|
|
3208
3208
|
* @extends sap.ui.base.Object
|
|
3209
|
-
* @version 1.136.
|
|
3209
|
+
* @version 1.136.17
|
|
3210
3210
|
* @since 1.30.0
|
|
3211
3211
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3212
3212
|
*/
|