@sapui5/sap.fe.templates 1.112.0 → 1.113.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 +1 -1
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI-dbg.js +3 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js.map +1 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +2 -0
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +1 -1
- package/src/sap/fe/templates/ListReport/ListReportController-dbg.controller.js +21 -13
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +1 -1
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js.map +1 -1
- package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +18 -10
- package/src/sap/fe/templates/ListReport/controls/MultipleModeControl-dbg.js +3 -3
- package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js +1 -1
- package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js.map +1 -1
- package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.ts +1 -2
- package/src/sap/fe/templates/ListReport/manifest.json +1 -1
- package/src/sap/fe/templates/ObjectPage/Component-dbg.js +2 -2
- package/src/sap/fe/templates/ObjectPage/Component.js +1 -1
- package/src/sap/fe/templates/ObjectPage/Component.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/Component.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI-dbg.js +3 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +2 -0
- package/src/sap/fe/templates/ObjectPage/ObjectPageController-dbg.controller.js +109 -34
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +1 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +129 -43
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating-dbg.js +12 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +1 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +11 -0
- package/src/sap/fe/templates/ObjectPage/manifest.json +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +93 -45
- package/src/sap/fe/templates/library-dbg.js +1 -1
- package/src/sap/fe/templates/library-preload.js +12 -12
- package/src/sap/fe/templates/library-preload.js.map +1 -1
- package/src/sap/fe/templates/library.js +1 -1
- package/src/sap/fe/templates/manifest.json +1 -1
- package/src/sap/fe/templates/messagebundle_bg.properties +1 -1
- package/src/sap/fe/templates/messagebundle_de.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_GB.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +1 -1
- package/src/sap/fe/templates/messagebundle_hi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_id.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ko.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_pl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ro.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ru.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
|
@@ -23,9 +23,11 @@ import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
|
|
|
23
23
|
import PageController from "sap/fe/core/PageController";
|
|
24
24
|
import CommonHelper from "sap/fe/macros/CommonHelper";
|
|
25
25
|
import DelegateUtil from "sap/fe/macros/DelegateUtil";
|
|
26
|
+
import type TableAPI from "sap/fe/macros/table/TableAPI";
|
|
26
27
|
import TableHelper from "sap/fe/macros/table/TableHelper";
|
|
27
28
|
import TableUtils from "sap/fe/macros/table/Utils";
|
|
28
29
|
import SelectionVariant from "sap/fe/navigation/SelectionVariant";
|
|
30
|
+
import type SubSectionBlock from "sap/fe/templates/ObjectPage/controls/SubSectionBlock";
|
|
29
31
|
import type { default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
30
32
|
import { default as ExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
31
33
|
import TableScroller from "sap/fe/templates/TableScroller";
|
|
@@ -37,6 +39,7 @@ import Core from "sap/ui/core/Core";
|
|
|
37
39
|
import type Message from "sap/ui/core/message/Message";
|
|
38
40
|
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
39
41
|
import type View from "sap/ui/core/mvc/View";
|
|
42
|
+
import type Table from "sap/ui/mdc/Table";
|
|
40
43
|
import type Binding from "sap/ui/model/Binding";
|
|
41
44
|
import type JSONModel from "sap/ui/model/json/JSONModel";
|
|
42
45
|
import type Context from "sap/ui/model/odata/v4/Context";
|
|
@@ -210,6 +213,59 @@ class ObjectPageController extends PageController {
|
|
|
210
213
|
return oTable && oTable.getRowBinding();
|
|
211
214
|
}
|
|
212
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Find the last visible subsection and add the sapUxAPObjectPageSubSectionFitContainer CSS class if it contains only a gridTable.
|
|
218
|
+
*
|
|
219
|
+
* @param subSections The sub sections to look for
|
|
220
|
+
* @private
|
|
221
|
+
*/
|
|
222
|
+
private checkSectionsForGridTable(subSections: ObjectPageSubSection[]) {
|
|
223
|
+
const changeClassForTables = (event: Event, lastVisibleSubSection: ObjectPageSubSection) => {
|
|
224
|
+
const blocks = [...lastVisibleSubSection.getBlocks(), ...lastVisibleSubSection.getMoreBlocks()];
|
|
225
|
+
if (
|
|
226
|
+
blocks.length === 1 &&
|
|
227
|
+
this.searchTableInBlock(blocks[0] as SubSectionBlock)
|
|
228
|
+
?.getType()
|
|
229
|
+
?.isA("sap.ui.mdc.table.GridTableType")
|
|
230
|
+
) {
|
|
231
|
+
//In case there is only a single table in a subSection we fit that to the whole page so that the scrollbar comes only on table and not on page
|
|
232
|
+
lastVisibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
|
|
233
|
+
lastVisibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
for (let subSectionIndex = subSections.length - 1; subSectionIndex >= 0; subSectionIndex--) {
|
|
237
|
+
if (subSections[subSectionIndex].getVisible()) {
|
|
238
|
+
const lastVisibleSubSection = subSections[subSectionIndex];
|
|
239
|
+
// We need to attach this event in order to manage the Object Page Lazy Loading mechanism
|
|
240
|
+
lastVisibleSubSection.attachEvent("modelContextChange", lastVisibleSubSection, changeClassForTables, this);
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Find a table in blocks of section.
|
|
248
|
+
*
|
|
249
|
+
* @param block One sub section block
|
|
250
|
+
* @returns Table if exists
|
|
251
|
+
*/
|
|
252
|
+
private searchTableInBlock(block: SubSectionBlock) {
|
|
253
|
+
const control = block.content;
|
|
254
|
+
let tableAPI: TableAPI | undefined;
|
|
255
|
+
if (block.isA("sap.fe.templates.ObjectPage.controls.SubSectionBlock")) {
|
|
256
|
+
// The table may currently be shown in a full screen dialog, we can then get the reference to the TableAPI
|
|
257
|
+
// control from the custom data of the place holder panel
|
|
258
|
+
if (control.isA("sap.m.Panel") && control.data("FullScreenTablePlaceHolder")) {
|
|
259
|
+
tableAPI = control.data("tableAPIreference");
|
|
260
|
+
} else if (control.isA("sap.fe.macros.table.TableAPI")) {
|
|
261
|
+
tableAPI = control as TableAPI;
|
|
262
|
+
}
|
|
263
|
+
if (tableAPI) {
|
|
264
|
+
return tableAPI.content as Table;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
213
269
|
onBeforeRendering() {
|
|
214
270
|
PageController.prototype.onBeforeRendering.apply(this);
|
|
215
271
|
// In the retrieveTextFromValueList scenario we need to ensure in case of reload/refresh that the meta model in the methode retrieveTextFromValueList of the FieldRuntime is available
|
|
@@ -218,6 +274,20 @@ class ObjectPageController extends PageController {
|
|
|
218
274
|
}
|
|
219
275
|
}
|
|
220
276
|
|
|
277
|
+
onAfterRendering() {
|
|
278
|
+
let subSections: ObjectPageSubSection[];
|
|
279
|
+
if (this._getObjectPageLayoutControl().getUseIconTabBar()) {
|
|
280
|
+
const sections = this._getObjectPageLayoutControl().getSections();
|
|
281
|
+
for (const section of sections) {
|
|
282
|
+
subSections = section.getSubSections();
|
|
283
|
+
this.checkSectionsForGridTable(subSections);
|
|
284
|
+
}
|
|
285
|
+
} else {
|
|
286
|
+
subSections = this._getAllSubSections();
|
|
287
|
+
this.checkSectionsForGridTable(subSections);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
221
291
|
_onBeforeBinding(oContext: any, mParameters: any) {
|
|
222
292
|
// TODO: we should check how this comes together with the transaction helper, same to the change in the afterBinding
|
|
223
293
|
const aTables = this._findTables(),
|
|
@@ -472,33 +542,36 @@ class ObjectPageController extends PageController {
|
|
|
472
542
|
|
|
473
543
|
aTables.forEach(function (oTable: any) {
|
|
474
544
|
const oInternalModelContext = oTable.getBindingContext("internal");
|
|
475
|
-
oInternalModelContext
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
oTableRowBinding.
|
|
545
|
+
if (oInternalModelContext) {
|
|
546
|
+
oInternalModelContext.setProperty("creationRowFieldValidity", {});
|
|
547
|
+
oInternalModelContext.setProperty("creationRowCustomValidity", {});
|
|
548
|
+
|
|
549
|
+
aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
|
|
550
|
+
|
|
551
|
+
// temporary workaround for BCP: 2080218004
|
|
552
|
+
// Need to fix with BLI: FIORITECHP1-15274
|
|
553
|
+
// only for edit mode, we clear the table cache
|
|
554
|
+
// Workaround starts here!!
|
|
555
|
+
const oTableRowBinding = oTable.getRowBinding();
|
|
556
|
+
if (oTableRowBinding) {
|
|
557
|
+
if (ModelHelper.isStickySessionSupported(oTableRowBinding.getModel().getMetaModel())) {
|
|
558
|
+
// apply for both edit and display mode in sticky
|
|
559
|
+
oTableRowBinding.removeCachesAndMessages("");
|
|
560
|
+
}
|
|
488
561
|
}
|
|
562
|
+
// Workaround ends here!!
|
|
563
|
+
|
|
564
|
+
// Update 'enabled' property of DataFieldForAction buttons on table toolbar
|
|
565
|
+
// The same is also performed on Table selectionChange event
|
|
566
|
+
const oActionOperationAvailableMap = JSON.parse(
|
|
567
|
+
CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
|
|
568
|
+
),
|
|
569
|
+
aSelectedContexts = oTable.getSelectedContexts();
|
|
570
|
+
|
|
571
|
+
ActionRuntime.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts, "table");
|
|
572
|
+
// Clear the selection in the table, need to be fixed and review with BLI: FIORITECHP1-24318
|
|
573
|
+
oTable.clearSelection();
|
|
489
574
|
}
|
|
490
|
-
// Workaround ends here!!
|
|
491
|
-
|
|
492
|
-
// Update 'enabled' property of DataFieldForAction buttons on table toolbar
|
|
493
|
-
// The same is also performed on Table selectionChange event
|
|
494
|
-
const oActionOperationAvailableMap = JSON.parse(
|
|
495
|
-
CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
|
|
496
|
-
),
|
|
497
|
-
aSelectedContexts = oTable.getSelectedContexts();
|
|
498
|
-
|
|
499
|
-
ActionRuntime.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts, "table");
|
|
500
|
-
// Clear the selection in the table, need to be fixed and review with BLI: FIORITECHP1-24318
|
|
501
|
-
oTable.clearSelection();
|
|
502
575
|
});
|
|
503
576
|
CommonUtils.getSemanticTargetsFromPageModel(this, "_pageModel");
|
|
504
577
|
//Retrieve Object Page header actions from Object Page title control
|
|
@@ -910,14 +983,14 @@ class ObjectPageController extends PageController {
|
|
|
910
983
|
|
|
911
984
|
_updateRelatedApps() {
|
|
912
985
|
const oObjectPage = this._getObjectPageLayoutControl();
|
|
913
|
-
|
|
986
|
+
const showRelatedApps = oObjectPage.data("showRelatedApps");
|
|
987
|
+
if (showRelatedApps === "true" || showRelatedApps === true) {
|
|
914
988
|
const appComponent = CommonUtils.getAppComponent(this.getView());
|
|
915
989
|
CommonUtils.updateRelatedAppsDetails(oObjectPage, appComponent);
|
|
916
990
|
}
|
|
917
991
|
}
|
|
918
992
|
|
|
919
993
|
_findControlInSubSection(aParentElement: any, aSubsection: any, aControls: any, bIsChart?: boolean) {
|
|
920
|
-
const aSubSectionTables = [];
|
|
921
994
|
for (let element = 0; element < aParentElement.length; element++) {
|
|
922
995
|
let oElement = aParentElement[element].getContent instanceof Function && aParentElement[element].getContent();
|
|
923
996
|
if (bIsChart) {
|
|
@@ -949,10 +1022,6 @@ class ObjectPageController extends PageController {
|
|
|
949
1022
|
}
|
|
950
1023
|
if (oElement && oElement.isA && oElement.isA("sap.ui.mdc.Table")) {
|
|
951
1024
|
aControls.push(oElement);
|
|
952
|
-
aSubSectionTables.push({
|
|
953
|
-
table: oElement,
|
|
954
|
-
gridTable: oElement.getType().isA("sap.ui.mdc.table.GridTableType")
|
|
955
|
-
});
|
|
956
1025
|
}
|
|
957
1026
|
if (oElement && oElement.isA && oElement.isA("sap.fe.macros.chart.ChartAPI")) {
|
|
958
1027
|
oElement = oElement.getContent instanceof Function && oElement.getContent();
|
|
@@ -964,16 +1033,6 @@ class ObjectPageController extends PageController {
|
|
|
964
1033
|
aControls.push(oElement);
|
|
965
1034
|
}
|
|
966
1035
|
}
|
|
967
|
-
|
|
968
|
-
if (
|
|
969
|
-
aSubSectionTables.length === 1 &&
|
|
970
|
-
aParentElement.length === 1 &&
|
|
971
|
-
aSubSectionTables[0].gridTable &&
|
|
972
|
-
!aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")
|
|
973
|
-
) {
|
|
974
|
-
//In case there is only a single table in a section we fit that to the whole page so that the scrollbar comes only on table and not on page
|
|
975
|
-
aSubsection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
|
|
976
|
-
}
|
|
977
1036
|
}
|
|
978
1037
|
|
|
979
1038
|
_getAllSubSections() {
|
|
@@ -1112,9 +1171,9 @@ class ObjectPageController extends PageController {
|
|
|
1112
1171
|
entitySet: sMetaPathPage
|
|
1113
1172
|
});
|
|
1114
1173
|
// Adding Page Context to selection variant
|
|
1115
|
-
aPageAttributes =
|
|
1174
|
+
aPageAttributes = this._intentBasedNavigation.removeSensitiveData(aPageAttributes, sMetaPathPage);
|
|
1116
1175
|
const oPageLevelSV = CommonUtils.addPageContextToSelectionVariant(new SelectionVariant(), aPageAttributes, this.getView());
|
|
1117
|
-
aAttributes =
|
|
1176
|
+
aAttributes = this._intentBasedNavigation.removeSensitiveData(aAttributes, sMetaPathPage);
|
|
1118
1177
|
return {
|
|
1119
1178
|
selectionVariant: oPageLevelSV,
|
|
1120
1179
|
attributes: aAttributes
|
|
@@ -1352,7 +1411,34 @@ class ObjectPageController extends PageController {
|
|
|
1352
1411
|
return false;
|
|
1353
1412
|
});
|
|
1354
1413
|
|
|
1414
|
+
// set correct binding context for fast creation row
|
|
1415
|
+
const fastCreationRow = oTable.getCreationRow();
|
|
1416
|
+
|
|
1417
|
+
if (fastCreationRow && !fastCreationRow._oInnerCreationRow?.getBindingContext()) {
|
|
1418
|
+
const tableBinding = this._getTableBinding(oTable);
|
|
1419
|
+
|
|
1420
|
+
if (!tableBinding) {
|
|
1421
|
+
Log.error(`Expected binding missing for table: ${oTable.getId()}`);
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
if (tableBinding.getContext()) {
|
|
1426
|
+
const objectPage = this._getObjectPageLayoutControl();
|
|
1427
|
+
const bindingContext = objectPage.getBindingContext() as Context;
|
|
1428
|
+
const model = bindingContext.getModel();
|
|
1429
|
+
|
|
1430
|
+
TableHelper.enableFastCreationRow(
|
|
1431
|
+
fastCreationRow,
|
|
1432
|
+
tableBinding.getPath(),
|
|
1433
|
+
tableBinding.getContext(),
|
|
1434
|
+
model,
|
|
1435
|
+
oTable.getModel("ui").getProperty("/isEditable")
|
|
1436
|
+
);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1355
1440
|
const oCurrentActionPromise = this.editFlow.getCurrentActionPromise();
|
|
1441
|
+
|
|
1356
1442
|
if (oCurrentActionPromise) {
|
|
1357
1443
|
let aTableContexts: any;
|
|
1358
1444
|
if (oTable.getType().getMetadata().isA("sap.ui.mdc.table.GridTableType")) {
|