@sapui5/sap.fe.templates 1.112.0 → 1.114.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 +23 -14
- 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 +24 -11
- package/src/sap/fe/templates/ListReport/ListReportTemplating-dbg.js +7 -7
- package/src/sap/fe/templates/ListReport/ListReportTemplating.js.map +1 -1
- package/src/sap/fe/templates/ListReport/ListReportTemplating.ts +8 -6
- 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/ListReport/overrides/ViewState-dbg.js +14 -39
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +1 -1
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js.map +1 -1
- package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +14 -42
- package/src/sap/fe/templates/ListReport/view/fragments/MacroChart.fragment.xml +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 +21 -6
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +1 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +21 -9
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +5 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPageController-dbg.controller.js +149 -87
- 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 +166 -95
- 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/overrides/Share-dbg.js +7 -2
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +5 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +3 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block-dbg.js +7 -6
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block.js +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block.js.map +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block.tsx +8 -7
- package/src/sap/fe/templates/ObjectPage/view/fragments/MacroChart.fragment.xml +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 +20 -20
- 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.properties +6 -0
- package/src/sap/fe/templates/messagebundle_ar.properties +2 -0
- package/src/sap/fe/templates/messagebundle_bg.properties +3 -1
- package/src/sap/fe/templates/messagebundle_ca.properties +2 -0
- package/src/sap/fe/templates/messagebundle_cs.properties +2 -0
- package/src/sap/fe/templates/messagebundle_cy.properties +2 -0
- package/src/sap/fe/templates/messagebundle_da.properties +2 -0
- package/src/sap/fe/templates/messagebundle_de.properties +4 -2
- package/src/sap/fe/templates/messagebundle_el.properties +2 -0
- package/src/sap/fe/templates/messagebundle_en.properties +2 -2
- package/src/sap/fe/templates/messagebundle_en_GB.properties +3 -1
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +2 -0
- package/src/sap/fe/templates/messagebundle_es.properties +2 -0
- package/src/sap/fe/templates/messagebundle_es_MX.properties +2 -0
- package/src/sap/fe/templates/messagebundle_et.properties +2 -0
- package/src/sap/fe/templates/messagebundle_fi.properties +2 -0
- package/src/sap/fe/templates/messagebundle_fr.properties +2 -0
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +3 -1
- package/src/sap/fe/templates/messagebundle_hi.properties +3 -1
- package/src/sap/fe/templates/messagebundle_hr.properties +2 -0
- package/src/sap/fe/templates/messagebundle_hu.properties +2 -0
- package/src/sap/fe/templates/messagebundle_id.properties +3 -1
- package/src/sap/fe/templates/messagebundle_it.properties +2 -0
- package/src/sap/fe/templates/messagebundle_iw.properties +2 -0
- package/src/sap/fe/templates/messagebundle_ja.properties +2 -0
- package/src/sap/fe/templates/messagebundle_kk.properties +2 -0
- package/src/sap/fe/templates/messagebundle_ko.properties +3 -1
- package/src/sap/fe/templates/messagebundle_lt.properties +2 -0
- package/src/sap/fe/templates/messagebundle_lv.properties +3 -1
- package/src/sap/fe/templates/messagebundle_ms.properties +2 -0
- package/src/sap/fe/templates/messagebundle_nl.properties +2 -0
- package/src/sap/fe/templates/messagebundle_no.properties +2 -0
- package/src/sap/fe/templates/messagebundle_pl.properties +3 -1
- package/src/sap/fe/templates/messagebundle_pt.properties +2 -0
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +2 -0
- package/src/sap/fe/templates/messagebundle_ro.properties +3 -1
- package/src/sap/fe/templates/messagebundle_ru.properties +3 -1
- package/src/sap/fe/templates/messagebundle_sh.properties +2 -0
- package/src/sap/fe/templates/messagebundle_sk.properties +2 -0
- package/src/sap/fe/templates/messagebundle_sl.properties +2 -0
- package/src/sap/fe/templates/messagebundle_sv.properties +3 -1
- package/src/sap/fe/templates/messagebundle_th.properties +2 -0
- package/src/sap/fe/templates/messagebundle_tr.properties +2 -0
- package/src/sap/fe/templates/messagebundle_uk.properties +2 -0
- package/src/sap/fe/templates/messagebundle_vi.properties +2 -0
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +3 -1
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +3 -1
|
@@ -20,12 +20,15 @@ import { defineUI5Class, extensible, finalExtension, publicExtension, usingExten
|
|
|
20
20
|
import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
21
21
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
22
22
|
import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
|
|
23
|
+
import FELibrary from "sap/fe/core/library";
|
|
23
24
|
import PageController from "sap/fe/core/PageController";
|
|
24
25
|
import CommonHelper from "sap/fe/macros/CommonHelper";
|
|
25
26
|
import DelegateUtil from "sap/fe/macros/DelegateUtil";
|
|
27
|
+
import type TableAPI from "sap/fe/macros/table/TableAPI";
|
|
26
28
|
import TableHelper from "sap/fe/macros/table/TableHelper";
|
|
27
29
|
import TableUtils from "sap/fe/macros/table/Utils";
|
|
28
30
|
import SelectionVariant from "sap/fe/navigation/SelectionVariant";
|
|
31
|
+
import type SubSectionBlock from "sap/fe/templates/ObjectPage/controls/SubSectionBlock";
|
|
29
32
|
import type { default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
30
33
|
import { default as ExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
31
34
|
import TableScroller from "sap/fe/templates/TableScroller";
|
|
@@ -34,9 +37,10 @@ import Link from "sap/m/Link";
|
|
|
34
37
|
import MessageBox from "sap/m/MessageBox";
|
|
35
38
|
import type Popover from "sap/m/Popover";
|
|
36
39
|
import Core from "sap/ui/core/Core";
|
|
37
|
-
import
|
|
40
|
+
import Message from "sap/ui/core/message/Message";
|
|
38
41
|
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
39
42
|
import type View from "sap/ui/core/mvc/View";
|
|
43
|
+
import type Table from "sap/ui/mdc/Table";
|
|
40
44
|
import type Binding from "sap/ui/model/Binding";
|
|
41
45
|
import type JSONModel from "sap/ui/model/json/JSONModel";
|
|
42
46
|
import type Context from "sap/ui/model/odata/v4/Context";
|
|
@@ -55,6 +59,7 @@ import PaginatorOverride from "./overrides/Paginator";
|
|
|
55
59
|
import ShareOverrides from "./overrides/Share";
|
|
56
60
|
import ViewStateOverrides from "./overrides/ViewState";
|
|
57
61
|
|
|
62
|
+
const ProgrammingModel = FELibrary.ProgrammingModel;
|
|
58
63
|
@defineUI5Class("sap.fe.templates.ObjectPage.ObjectPageController")
|
|
59
64
|
class ObjectPageController extends PageController {
|
|
60
65
|
oView!: any;
|
|
@@ -194,6 +199,8 @@ class ObjectPageController extends PageController {
|
|
|
194
199
|
_fnShowOPMessage() {
|
|
195
200
|
const extensionAPI = this.getExtensionAPI();
|
|
196
201
|
const view = this.getView();
|
|
202
|
+
const internalContext = view?.getBindingContext("internal");
|
|
203
|
+
const stripVisible = internalContext?.getProperty("OPMessageStripVisibility");
|
|
197
204
|
const messages = this.messageButton.oMessagePopover
|
|
198
205
|
.getItems()
|
|
199
206
|
.map((item: any) => item.getBindingContext("message").getObject())
|
|
@@ -201,7 +208,7 @@ class ObjectPageController extends PageController {
|
|
|
201
208
|
return message.getTargets()[0] === view.getBindingContext()?.getPath();
|
|
202
209
|
});
|
|
203
210
|
|
|
204
|
-
if (extensionAPI) {
|
|
211
|
+
if (extensionAPI && !(messages.length === 0 && stripVisible)) {
|
|
205
212
|
extensionAPI.showMessages(messages);
|
|
206
213
|
}
|
|
207
214
|
}
|
|
@@ -210,6 +217,55 @@ class ObjectPageController extends PageController {
|
|
|
210
217
|
return oTable && oTable.getRowBinding();
|
|
211
218
|
}
|
|
212
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Find the last visible subsection and add the sapUxAPObjectPageSubSectionFitContainer CSS class if it contains only a GridTable or a TreeTable.
|
|
222
|
+
*
|
|
223
|
+
* @param subSections The sub sections to look for
|
|
224
|
+
* @private
|
|
225
|
+
*/
|
|
226
|
+
private checkSectionsForNonResponsiveTable(subSections: ObjectPageSubSection[]) {
|
|
227
|
+
const changeClassForTables = (event: Event, lastVisibleSubSection: ObjectPageSubSection) => {
|
|
228
|
+
const blocks = [...lastVisibleSubSection.getBlocks(), ...lastVisibleSubSection.getMoreBlocks()];
|
|
229
|
+
const tableType = blocks.length === 1 && this.searchTableInBlock(blocks[0] as SubSectionBlock)?.getType();
|
|
230
|
+
if (tableType && (tableType?.isA("sap.ui.mdc.table.GridTableType") || tableType?.isA("sap.ui.mdc.table.TreeTableType"))) {
|
|
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.checkSectionsForNonResponsiveTable(subSections);
|
|
284
|
+
}
|
|
285
|
+
} else {
|
|
286
|
+
subSections = this._getAllSubSections();
|
|
287
|
+
this.checkSectionsForNonResponsiveTable(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(),
|
|
@@ -447,7 +517,7 @@ class ObjectPageController extends PageController {
|
|
|
447
517
|
}
|
|
448
518
|
|
|
449
519
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
450
|
-
_onAfterBinding(
|
|
520
|
+
_onAfterBinding(inputBindingContext: any, mParameters: any) {
|
|
451
521
|
const oObjectPage = this._getObjectPageLayoutControl();
|
|
452
522
|
const aTables = this._findTables();
|
|
453
523
|
|
|
@@ -455,7 +525,7 @@ class ObjectPageController extends PageController {
|
|
|
455
525
|
|
|
456
526
|
// TODO: this is only a temp solution as long as the model fix the cache issue and we use this additional
|
|
457
527
|
// binding with ownRequest
|
|
458
|
-
|
|
528
|
+
const bindingContext = oObjectPage.getBindingContext() as Context;
|
|
459
529
|
|
|
460
530
|
let aIBNActions: any[] = [];
|
|
461
531
|
oObjectPage.getSections().forEach(function (oSection: any) {
|
|
@@ -472,33 +542,35 @@ 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
|
}
|
|
489
|
-
|
|
490
|
-
// Workaround ends here!!
|
|
562
|
+
// Workaround ends here!!
|
|
491
563
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
564
|
+
// Clear the selection in the table and update action enablement accordingly
|
|
565
|
+
// Will to be fixed with BLI: FIORITECHP1-24318
|
|
566
|
+
const oActionOperationAvailableMap = JSON.parse(
|
|
495
567
|
CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
|
|
496
|
-
)
|
|
497
|
-
|
|
568
|
+
);
|
|
569
|
+
|
|
570
|
+
ActionRuntime.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, [], "table");
|
|
498
571
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
oTable.clearSelection();
|
|
572
|
+
oTable.clearSelection();
|
|
573
|
+
}
|
|
502
574
|
});
|
|
503
575
|
CommonUtils.getSemanticTargetsFromPageModel(this, "_pageModel");
|
|
504
576
|
//Retrieve Object Page header actions from Object Page title control
|
|
@@ -544,11 +616,11 @@ class ObjectPageController extends PageController {
|
|
|
544
616
|
}
|
|
545
617
|
};
|
|
546
618
|
|
|
547
|
-
if (
|
|
548
|
-
oModel =
|
|
619
|
+
if (bindingContext) {
|
|
620
|
+
oModel = bindingContext.getModel();
|
|
549
621
|
|
|
550
622
|
// Compute Edit Mode
|
|
551
|
-
oFinalUIState = this.editFlow.computeEditMode(
|
|
623
|
+
oFinalUIState = this.editFlow.computeEditMode(bindingContext);
|
|
552
624
|
|
|
553
625
|
if (ModelHelper.isCollaborationDraftSupported(oModel.getMetaModel())) {
|
|
554
626
|
oFinalUIState
|
|
@@ -567,11 +639,11 @@ class ObjectPageController extends PageController {
|
|
|
567
639
|
this._updateRelatedApps();
|
|
568
640
|
|
|
569
641
|
//Attach the patch sent and patch completed event to the object page binding so that we can react
|
|
570
|
-
const oBinding = (
|
|
642
|
+
const oBinding = (bindingContext.getBinding && bindingContext.getBinding()) || bindingContext;
|
|
571
643
|
|
|
572
644
|
// Attach the event handler only once to the same binding
|
|
573
645
|
if (this.currentBinding !== oBinding) {
|
|
574
|
-
oBinding.attachEvent("patchSent", this.editFlow.handlePatchSent, this);
|
|
646
|
+
oBinding.attachEvent("patchSent", {}, this.editFlow.handlePatchSent, this);
|
|
575
647
|
this.currentBinding = oBinding;
|
|
576
648
|
}
|
|
577
649
|
|
|
@@ -590,6 +662,35 @@ class ObjectPageController extends PageController {
|
|
|
590
662
|
//To Compute the Edit Binding of the subObject page using root object page, create a context for draft root and update the edit button in sub OP using the context
|
|
591
663
|
ActionRuntime.updateEditButtonVisibilityAndEnablement(this.getView());
|
|
592
664
|
}
|
|
665
|
+
this.displayCollaborationMessage(mParameters?.redirectedToNonDraft);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Show a message strip if a redirection to a non-draft element has been done.
|
|
670
|
+
* Remove the message strip in case we navigate to another object page.
|
|
671
|
+
*
|
|
672
|
+
* @param entityName Name of the Entity to be displayed in the message
|
|
673
|
+
* @private
|
|
674
|
+
*/
|
|
675
|
+
displayCollaborationMessage(entityName: string | undefined) {
|
|
676
|
+
const internalBindingContext = this.getView()?.getBindingContext("internal");
|
|
677
|
+
const resourceBundle = Core.getLibraryResourceBundle("sap.fe.core");
|
|
678
|
+
if (entityName) {
|
|
679
|
+
const message = new Message({
|
|
680
|
+
message: resourceBundle.getText("REROUTED_NAVIGATION_TO_SAVED_VERSION", [entityName]),
|
|
681
|
+
type: "Information"
|
|
682
|
+
});
|
|
683
|
+
this.getExtensionAPI().showMessages([message]);
|
|
684
|
+
} else {
|
|
685
|
+
const messageToCompare = resourceBundle.getText("REROUTED_NAVIGATION_TO_SAVED_VERSION", ["{0}"]);
|
|
686
|
+
const lengthUntilVariable = messageToCompare.search("{");
|
|
687
|
+
if (
|
|
688
|
+
internalBindingContext?.getProperty("OPMessageStripText")?.substring(0, lengthUntilVariable) ===
|
|
689
|
+
messageToCompare.substring(0, lengthUntilVariable)
|
|
690
|
+
) {
|
|
691
|
+
this.getExtensionAPI().showMessages([]);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
593
694
|
}
|
|
594
695
|
|
|
595
696
|
@publicExtension()
|
|
@@ -767,49 +868,6 @@ class ObjectPageController extends PageController {
|
|
|
767
868
|
});
|
|
768
869
|
}
|
|
769
870
|
|
|
770
|
-
/**
|
|
771
|
-
* Gets the context of the DraftRoot path.
|
|
772
|
-
* If a view has been created with the draft Root Path, this method returns its bindingContext.
|
|
773
|
-
* Where no view is found a new created context is returned.
|
|
774
|
-
* The new created context request the key of the entity in order to get the Etag of this entity.
|
|
775
|
-
*
|
|
776
|
-
* @function
|
|
777
|
-
* @name getDraftRootPath
|
|
778
|
-
* @returns Returns a Promise
|
|
779
|
-
*/
|
|
780
|
-
async getDraftRootContext(): Promise<Context | undefined> {
|
|
781
|
-
const view = this.getView();
|
|
782
|
-
const context = view.getBindingContext() as Context;
|
|
783
|
-
if (context) {
|
|
784
|
-
const draftRootContextPath = ModelHelper.getDraftRootPath(context);
|
|
785
|
-
let simpleDraftRootContext: Context;
|
|
786
|
-
if (draftRootContextPath) {
|
|
787
|
-
// Check if a view matches with the draft root path
|
|
788
|
-
const existingBindingContextOnPage = this.getAppComponent()
|
|
789
|
-
.getRootViewController()
|
|
790
|
-
.getInstancedViews()
|
|
791
|
-
.find((pageView: View) => pageView.getBindingContext()?.getPath() === draftRootContextPath)
|
|
792
|
-
?.getBindingContext() as Context;
|
|
793
|
-
if (existingBindingContextOnPage) {
|
|
794
|
-
return existingBindingContextOnPage;
|
|
795
|
-
}
|
|
796
|
-
const internalModel = view.getModel("internal") as JSONModel;
|
|
797
|
-
simpleDraftRootContext = internalModel.getProperty("/simpleDraftRootContext");
|
|
798
|
-
if (simpleDraftRootContext?.getPath() === draftRootContextPath) {
|
|
799
|
-
return simpleDraftRootContext;
|
|
800
|
-
}
|
|
801
|
-
const model = context.getModel();
|
|
802
|
-
simpleDraftRootContext = model.bindContext(draftRootContextPath).getBoundContext();
|
|
803
|
-
await CommonUtils.waitForContextRequested(simpleDraftRootContext);
|
|
804
|
-
// Store this new created context to use it on the next iterations
|
|
805
|
-
internalModel.setProperty("/simpleDraftRootContext", simpleDraftRootContext);
|
|
806
|
-
return simpleDraftRootContext;
|
|
807
|
-
}
|
|
808
|
-
return undefined;
|
|
809
|
-
}
|
|
810
|
-
return undefined;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
871
|
async _validateDocument(): Promise<void | any[] | ODataContextBinding> {
|
|
814
872
|
const appComponent = this.getAppComponent();
|
|
815
873
|
const control = Core.byId(Core.getCurrentFocusedControlId());
|
|
@@ -823,7 +881,7 @@ class ObjectPageController extends PageController {
|
|
|
823
881
|
await this.editFlow.syncTask();
|
|
824
882
|
return Promise.all(globalSideEffects.map((sideEffects) => this._sideEffects.requestSideEffects(sideEffects, context)));
|
|
825
883
|
}
|
|
826
|
-
const draftRootContext = await this.
|
|
884
|
+
const draftRootContext = (await CommonUtils.createRootContext(ProgrammingModel.Draft, this.getView(), appComponent)) as Context;
|
|
827
885
|
//Execute the draftValidation if there is no globalSideEffects (ignore ETags in collaboration draft)
|
|
828
886
|
if (draftRootContext) {
|
|
829
887
|
await this.editFlow.syncTask();
|
|
@@ -904,20 +962,20 @@ class ObjectPageController extends PageController {
|
|
|
904
962
|
return this.editFlow.cancelDocument(oContext, mParameters);
|
|
905
963
|
}
|
|
906
964
|
|
|
907
|
-
_applyDocument(oContext:
|
|
965
|
+
_applyDocument(oContext: Context) {
|
|
908
966
|
return this.editFlow.applyDocument(oContext).catch(() => this._showMessagePopover());
|
|
909
967
|
}
|
|
910
968
|
|
|
911
969
|
_updateRelatedApps() {
|
|
912
970
|
const oObjectPage = this._getObjectPageLayoutControl();
|
|
913
|
-
|
|
971
|
+
const showRelatedApps = oObjectPage.data("showRelatedApps");
|
|
972
|
+
if (showRelatedApps === "true" || showRelatedApps === true) {
|
|
914
973
|
const appComponent = CommonUtils.getAppComponent(this.getView());
|
|
915
974
|
CommonUtils.updateRelatedAppsDetails(oObjectPage, appComponent);
|
|
916
975
|
}
|
|
917
976
|
}
|
|
918
977
|
|
|
919
978
|
_findControlInSubSection(aParentElement: any, aSubsection: any, aControls: any, bIsChart?: boolean) {
|
|
920
|
-
const aSubSectionTables = [];
|
|
921
979
|
for (let element = 0; element < aParentElement.length; element++) {
|
|
922
980
|
let oElement = aParentElement[element].getContent instanceof Function && aParentElement[element].getContent();
|
|
923
981
|
if (bIsChart) {
|
|
@@ -949,10 +1007,6 @@ class ObjectPageController extends PageController {
|
|
|
949
1007
|
}
|
|
950
1008
|
if (oElement && oElement.isA && oElement.isA("sap.ui.mdc.Table")) {
|
|
951
1009
|
aControls.push(oElement);
|
|
952
|
-
aSubSectionTables.push({
|
|
953
|
-
table: oElement,
|
|
954
|
-
gridTable: oElement.getType().isA("sap.ui.mdc.table.GridTableType")
|
|
955
|
-
});
|
|
956
1010
|
}
|
|
957
1011
|
if (oElement && oElement.isA && oElement.isA("sap.fe.macros.chart.ChartAPI")) {
|
|
958
1012
|
oElement = oElement.getContent instanceof Function && oElement.getContent();
|
|
@@ -964,16 +1018,6 @@ class ObjectPageController extends PageController {
|
|
|
964
1018
|
aControls.push(oElement);
|
|
965
1019
|
}
|
|
966
1020
|
}
|
|
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
1021
|
}
|
|
978
1022
|
|
|
979
1023
|
_getAllSubSections() {
|
|
@@ -1112,9 +1156,9 @@ class ObjectPageController extends PageController {
|
|
|
1112
1156
|
entitySet: sMetaPathPage
|
|
1113
1157
|
});
|
|
1114
1158
|
// Adding Page Context to selection variant
|
|
1115
|
-
aPageAttributes =
|
|
1159
|
+
aPageAttributes = this._intentBasedNavigation.removeSensitiveData(aPageAttributes, sMetaPathPage);
|
|
1116
1160
|
const oPageLevelSV = CommonUtils.addPageContextToSelectionVariant(new SelectionVariant(), aPageAttributes, this.getView());
|
|
1117
|
-
aAttributes =
|
|
1161
|
+
aAttributes = this._intentBasedNavigation.removeSensitiveData(aAttributes, sMetaPathPage);
|
|
1118
1162
|
return {
|
|
1119
1163
|
selectionVariant: oPageLevelSV,
|
|
1120
1164
|
attributes: aAttributes
|
|
@@ -1352,7 +1396,34 @@ class ObjectPageController extends PageController {
|
|
|
1352
1396
|
return false;
|
|
1353
1397
|
});
|
|
1354
1398
|
|
|
1399
|
+
// set correct binding context for fast creation row
|
|
1400
|
+
const fastCreationRow = oTable.getCreationRow();
|
|
1401
|
+
|
|
1402
|
+
if (fastCreationRow && !fastCreationRow._oInnerCreationRow?.getBindingContext()) {
|
|
1403
|
+
const tableBinding = this._getTableBinding(oTable);
|
|
1404
|
+
|
|
1405
|
+
if (!tableBinding) {
|
|
1406
|
+
Log.error(`Expected binding missing for table: ${oTable.getId()}`);
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
if (tableBinding.getContext()) {
|
|
1411
|
+
const objectPage = this._getObjectPageLayoutControl();
|
|
1412
|
+
const bindingContext = objectPage.getBindingContext() as Context;
|
|
1413
|
+
const model = bindingContext.getModel();
|
|
1414
|
+
|
|
1415
|
+
TableHelper.enableFastCreationRow(
|
|
1416
|
+
fastCreationRow,
|
|
1417
|
+
tableBinding.getPath(),
|
|
1418
|
+
tableBinding.getContext(),
|
|
1419
|
+
model,
|
|
1420
|
+
oTable.getModel("ui").getProperty("/isEditable")
|
|
1421
|
+
);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1355
1425
|
const oCurrentActionPromise = this.editFlow.getCurrentActionPromise();
|
|
1426
|
+
|
|
1356
1427
|
if (oCurrentActionPromise) {
|
|
1357
1428
|
let aTableContexts: any;
|
|
1358
1429
|
if (oTable.getType().getMetadata().isA("sap.ui.mdc.table.GridTableType")) {
|