@sapui5/sap.fe.templates 1.102.3 → 1.105.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 +4 -5
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/Component.js +2 -2
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +2 -2
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.ts +1 -1
- package/src/sap/fe/templates/Feedback.js +18 -18
- package/src/sap/fe/templates/Feedback.ts +12 -12
- package/src/sap/fe/templates/ListComponent.js +2 -2
- package/src/sap/fe/templates/ListReport/Component.js +2 -2
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +13 -14
- package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +11 -13
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +12 -74
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +95 -392
- package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +99 -367
- package/src/sap/fe/templates/ListReport/ListReportTemplating.js +1 -1
- package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js +471 -0
- package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.ts +347 -0
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +16 -9
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +17 -11
- package/src/sap/fe/templates/ListReport/overrides/Share.js +3 -4
- package/src/sap/fe/templates/ListReport/overrides/Share.ts +6 -7
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +22 -31
- package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +33 -37
- package/src/sap/fe/templates/ListReport/view/fragments/Chart.fragment.xml +3 -0
- package/src/sap/fe/templates/ListReport/view/fragments/CollectionVisualization.fragment.xml +11 -5
- package/src/sap/fe/templates/{controls → ListReport/view/fragments}/MacroChart.fragment.xml +3 -2
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +20 -4
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +80 -48
- package/src/sap/fe/templates/{controls → ListReport/view/fragments}/Table.fragment.xml +6 -5
- package/src/sap/fe/templates/ListReport/view/fragments/VariantManagement.fragment.xml +31 -0
- package/src/sap/fe/templates/ObjectPage/Component.js +2 -2
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +21 -20
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +23 -22
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +52 -146
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +303 -268
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +191 -242
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +72 -71
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +81 -88
- package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.js +178 -0
- package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.tsx +132 -0
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +2 -2
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +2 -2
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +3 -4
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +4 -4
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +6 -6
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +67 -41
- package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +44 -56
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +4 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +3 -10
- package/src/sap/fe/templates/ObjectPage/view/fragments/Chart.fragment.xml +13 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +15 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPoint.fragment.xml +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +1 -14
- package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +2 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +3 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/MacroChart.fragment.xml +22 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderAddress.fragment.xml +7 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderContact.fragment.xml +26 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +8 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +12 -50
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +6 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionPresentationVisualization.fragment.xml +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/Table.fragment.xml +23 -0
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +26 -29
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +30 -33
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +4 -5
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +4 -5
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +141 -53
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +108 -54
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +3 -3
- package/src/sap/fe/templates/TableScroller.js +3 -3
- package/src/sap/fe/templates/TableScroller.ts +2 -2
- package/src/sap/fe/templates/library.js +7 -3
- package/src/sap/fe/templates/library.ts +5 -0
- package/src/sap/fe/templates/messagebundle.properties +7 -22
- package/src/sap/fe/templates/messagebundle_ar.properties +3 -12
- package/src/sap/fe/templates/messagebundle_bg.properties +2 -11
- package/src/sap/fe/templates/messagebundle_ca.properties +2 -11
- package/src/sap/fe/templates/messagebundle_cs.properties +3 -12
- package/src/sap/fe/templates/messagebundle_cy.properties +2 -11
- package/src/sap/fe/templates/messagebundle_da.properties +3 -12
- package/src/sap/fe/templates/messagebundle_de.properties +2 -11
- package/src/sap/fe/templates/messagebundle_el.properties +2 -11
- package/src/sap/fe/templates/messagebundle_en.properties +2 -11
- package/src/sap/fe/templates/messagebundle_en_GB.properties +2 -11
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +2 -11
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -11
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +2 -11
- package/src/sap/fe/templates/messagebundle_es.properties +0 -9
- package/src/sap/fe/templates/messagebundle_es_MX.properties +2 -11
- package/src/sap/fe/templates/messagebundle_et.properties +0 -9
- package/src/sap/fe/templates/messagebundle_fi.properties +2 -11
- package/src/sap/fe/templates/messagebundle_fr.properties +3 -12
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +2 -11
- package/src/sap/fe/templates/messagebundle_hi.properties +2 -11
- package/src/sap/fe/templates/messagebundle_hr.properties +2 -11
- package/src/sap/fe/templates/messagebundle_hu.properties +2 -11
- package/src/sap/fe/templates/messagebundle_id.properties +2 -11
- package/src/sap/fe/templates/messagebundle_it.properties +2 -11
- package/src/sap/fe/templates/messagebundle_iw.properties +2 -11
- package/src/sap/fe/templates/messagebundle_ja.properties +2 -11
- package/src/sap/fe/templates/messagebundle_kk.properties +2 -11
- package/src/sap/fe/templates/messagebundle_ko.properties +2 -11
- package/src/sap/fe/templates/messagebundle_lt.properties +2 -11
- package/src/sap/fe/templates/messagebundle_lv.properties +2 -11
- package/src/sap/fe/templates/messagebundle_ms.properties +2 -11
- package/src/sap/fe/templates/messagebundle_nl.properties +2 -11
- package/src/sap/fe/templates/messagebundle_no.properties +0 -9
- package/src/sap/fe/templates/messagebundle_pl.properties +0 -9
- package/src/sap/fe/templates/messagebundle_pt.properties +3 -12
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +2 -11
- package/src/sap/fe/templates/messagebundle_ro.properties +0 -9
- package/src/sap/fe/templates/messagebundle_ru.properties +2 -11
- package/src/sap/fe/templates/messagebundle_sh.properties +2 -11
- package/src/sap/fe/templates/messagebundle_sk.properties +2 -11
- package/src/sap/fe/templates/messagebundle_sl.properties +2 -11
- package/src/sap/fe/templates/messagebundle_sv.properties +2 -11
- package/src/sap/fe/templates/messagebundle_th.properties +1 -10
- package/src/sap/fe/templates/messagebundle_tr.properties +2 -11
- package/src/sap/fe/templates/messagebundle_uk.properties +2 -11
- package/src/sap/fe/templates/messagebundle_vi.properties +0 -9
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +0 -9
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +2 -11
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleModeOld.fragment.xml +0 -50
- package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +0 -27
- package/src/sap/fe/templates/controls/Chart.fragment.xml +0 -25
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
1
|
+
import type ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
2
2
|
import Log from "sap/base/Log";
|
|
3
3
|
import merge from "sap/base/util/merge";
|
|
4
|
+
import ActionRuntime from "sap/fe/core/ActionRuntime";
|
|
4
5
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
5
6
|
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
6
7
|
import { connect } from "sap/fe/core/controllerextensions/collaboration/ActivitySync";
|
|
@@ -19,41 +20,37 @@ import Placeholder from "sap/fe/core/controllerextensions/Placeholder";
|
|
|
19
20
|
import Share from "sap/fe/core/controllerextensions/Share";
|
|
20
21
|
import ViewState from "sap/fe/core/controllerextensions/ViewState";
|
|
21
22
|
import { defineUI5Class, extensible, finalExtension, publicExtension, usingExtension } from "sap/fe/core/helpers/ClassSupport";
|
|
22
|
-
import
|
|
23
|
+
import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
24
|
+
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
23
25
|
import PageController from "sap/fe/core/PageController";
|
|
24
26
|
import ChartRuntime from "sap/fe/macros/chart/ChartRuntime";
|
|
25
27
|
import CommonHelper from "sap/fe/macros/CommonHelper";
|
|
26
28
|
import DelegateUtil from "sap/fe/macros/DelegateUtil";
|
|
27
29
|
import TableUtils from "sap/fe/macros/table/Utils";
|
|
28
30
|
import SelectionVariant from "sap/fe/navigation/SelectionVariant";
|
|
29
|
-
import { default as
|
|
30
|
-
import
|
|
31
|
+
import type { default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
32
|
+
import { default as ExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
33
|
+
import type RootContainerBaseController from "sap/fe/templates/RootContainer/controller/RootContainerBaseController";
|
|
31
34
|
import EditFlowOverrides from "sap/fe/templates/RootContainer/overrides/EditFlow";
|
|
32
35
|
import TableScroller from "sap/fe/templates/TableScroller";
|
|
33
36
|
import InstanceManager from "sap/m/InstanceManager";
|
|
34
37
|
import Link from "sap/m/Link";
|
|
35
38
|
import MessageBox from "sap/m/MessageBox";
|
|
36
|
-
import Popover from "sap/m/Popover";
|
|
37
|
-
import SelectList from "sap/m/SelectList";
|
|
38
|
-
import Event from "sap/ui/base/Event";
|
|
39
|
-
import Control from "sap/ui/core/Control";
|
|
39
|
+
import type Popover from "sap/m/Popover";
|
|
40
40
|
import Core from "sap/ui/core/Core";
|
|
41
|
-
import Fragment from "sap/ui/core/Fragment";
|
|
42
|
-
import Item from "sap/ui/core/Item";
|
|
43
41
|
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
44
|
-
import
|
|
45
|
-
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
46
|
-
import Binding from "sap/ui/model/Binding";
|
|
42
|
+
import type Binding from "sap/ui/model/Binding";
|
|
47
43
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
48
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
44
|
+
import type Context from "sap/ui/model/odata/v4/Context";
|
|
49
45
|
import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
50
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
51
|
-
import ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
52
|
-
import ResourceModel from "sap/ui/model/resource/ResourceModel";
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
46
|
+
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
47
|
+
import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
48
|
+
import type ResourceModel from "sap/ui/model/resource/ResourceModel";
|
|
49
|
+
import type BreadCrumbs from "sap/uxap/BreadCrumbs";
|
|
50
|
+
import type ObjectPageDynamicHeaderTitle from "sap/uxap/ObjectPageDynamicHeaderTitle";
|
|
51
|
+
import type ObjectPageLayout from "sap/uxap/ObjectPageLayout";
|
|
52
|
+
import type ObjectPageSection from "sap/uxap/ObjectPageSection";
|
|
53
|
+
import type ObjectPageSubSection from "sap/uxap/ObjectPageSubSection";
|
|
57
54
|
import IntentBasedNavigationOverride from "./overrides/IntentBasedNavigation";
|
|
58
55
|
import InternalRoutingOverride from "./overrides/InternalRouting";
|
|
59
56
|
import MessageHandlerOverride from "./overrides/MessageHandler";
|
|
@@ -151,11 +148,15 @@ class ObjectPageController extends PageController {
|
|
|
151
148
|
onExit() {
|
|
152
149
|
if (this.mCustomSectionExtensionAPIs) {
|
|
153
150
|
for (const sId of Object.keys(this.mCustomSectionExtensionAPIs)) {
|
|
154
|
-
|
|
151
|
+
if (this.mCustomSectionExtensionAPIs[sId]) {
|
|
152
|
+
this.mCustomSectionExtensionAPIs[sId].destroy();
|
|
153
|
+
}
|
|
155
154
|
}
|
|
156
155
|
delete this.mCustomSectionExtensionAPIs;
|
|
157
156
|
}
|
|
158
|
-
|
|
157
|
+
if (this.extensionAPI) {
|
|
158
|
+
this.extensionAPI.destroy();
|
|
159
|
+
}
|
|
159
160
|
delete this.extensionAPI;
|
|
160
161
|
|
|
161
162
|
const oMessageButton = this.getView().byId("fe::FooterBar::MessageButton"),
|
|
@@ -177,7 +178,7 @@ class ObjectPageController extends PageController {
|
|
|
177
178
|
onBeforeRendering() {
|
|
178
179
|
PageController.prototype.onBeforeRendering.apply(this);
|
|
179
180
|
// 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
|
|
180
|
-
if (this.oView.oViewData
|
|
181
|
+
if (this.oView.oViewData?.retrieveTextFromValueList && CommonHelper.getMetaModel() === undefined) {
|
|
181
182
|
CommonHelper.setMetaModel(this.getAppComponent().getMetaModel());
|
|
182
183
|
}
|
|
183
184
|
}
|
|
@@ -195,7 +196,7 @@ class ObjectPageController extends PageController {
|
|
|
195
196
|
_onBeforeBinding(oContext: any, mParameters: any) {
|
|
196
197
|
// TODO: we should check how this comes together with the transaction helper, same to the change in the afterBinding
|
|
197
198
|
const aTables = this._findTables(),
|
|
198
|
-
oObjectPage = this._getObjectPageLayoutControl()
|
|
199
|
+
oObjectPage = this._getObjectPageLayoutControl(),
|
|
199
200
|
oInternalModelContext = this.getView().getBindingContext("internal") as InternalModelContext,
|
|
200
201
|
oInternalModel = this.getView().getModel("internal") as JSONModel,
|
|
201
202
|
aBatchGroups = oInternalModelContext.getProperty("batchGroups"),
|
|
@@ -257,18 +258,26 @@ class ObjectPageController extends PageController {
|
|
|
257
258
|
if (oBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
258
259
|
this.paginator.initialize(oBinding, oContext);
|
|
259
260
|
} else {
|
|
260
|
-
//if the binding type is not ODataListBinding because of a deeplink navigation or a refresh of the page
|
|
261
|
+
// if the binding type is not ODataListBinding because of a deeplink navigation or a refresh of the page
|
|
261
262
|
// we need to create it
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
263
|
+
const sBindingPath = oBinding.getPath();
|
|
264
|
+
if (/\([^\)]*\)$/.test(sBindingPath)) {
|
|
265
|
+
// The current binding path ends with (xxx), so we create the listBinding by removing (xxx)
|
|
266
|
+
const sListBindingPath = sBindingPath.replace(/\([^\)]*\)$/, "");
|
|
267
|
+
oBinding = new (ODataListBinding as any)(oBinding.oModel, sListBindingPath);
|
|
268
|
+
const _setListBindingAsync = () => {
|
|
269
|
+
if (oBinding.getContexts().length > 0) {
|
|
270
|
+
this.paginator.initialize(oBinding, oContext);
|
|
271
|
+
oBinding.detachEvent("change", _setListBindingAsync);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
oBinding.getContexts(0);
|
|
276
|
+
oBinding.attachEvent("change", _setListBindingAsync);
|
|
277
|
+
} else {
|
|
278
|
+
// The current binding doesn't end with (xxx) --> the last segment is a 1-1 navigation, so we don't display the paginator
|
|
279
|
+
this.paginator.initialize(undefined);
|
|
280
|
+
}
|
|
272
281
|
}
|
|
273
282
|
}
|
|
274
283
|
}
|
|
@@ -309,7 +318,13 @@ class ObjectPageController extends PageController {
|
|
|
309
318
|
oFirstClickableElement = aActions.find(function (oAction: any) {
|
|
310
319
|
// Due to the left alignment of the Draft switch and the collaborative draft avatar controls
|
|
311
320
|
// there is a ToolbarSpacer in the actions aggregation which we need to exclude here!
|
|
312
|
-
|
|
321
|
+
// Due to the ACC report, we also need not to check for the InvisibleText elements
|
|
322
|
+
return (
|
|
323
|
+
!oAction.isA("sap.ui.core.InvisibleText") &&
|
|
324
|
+
!oAction.isA("sap.m.ToolbarSpacer") &&
|
|
325
|
+
oAction.getVisible() &&
|
|
326
|
+
oAction.getEnabled()
|
|
327
|
+
);
|
|
313
328
|
});
|
|
314
329
|
}
|
|
315
330
|
return oFirstClickableElement;
|
|
@@ -348,7 +363,7 @@ class ObjectPageController extends PageController {
|
|
|
348
363
|
return aFields[0];
|
|
349
364
|
}
|
|
350
365
|
} catch (error) {
|
|
351
|
-
Log.debug(
|
|
366
|
+
Log.debug(`Error when searching for mandaotry empty field: ${error}`);
|
|
352
367
|
}
|
|
353
368
|
}
|
|
354
369
|
}
|
|
@@ -362,7 +377,7 @@ class ObjectPageController extends PageController {
|
|
|
362
377
|
}
|
|
363
378
|
|
|
364
379
|
_updateFocusInEditMode(aSubSections: any) {
|
|
365
|
-
const oObjectPage = this._getObjectPageLayoutControl()
|
|
380
|
+
const oObjectPage = this._getObjectPageLayoutControl();
|
|
366
381
|
|
|
367
382
|
const oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
|
|
368
383
|
let oFieldToFocus: any;
|
|
@@ -386,6 +401,7 @@ class ObjectPageController extends PageController {
|
|
|
386
401
|
}
|
|
387
402
|
|
|
388
403
|
_onBackNavigationInDraft(oContext: any) {
|
|
404
|
+
this.messageHandler.removeTransitionMessages();
|
|
389
405
|
if (this.getAppComponent().getRouterProxy().checkIfBackHasSameContext()) {
|
|
390
406
|
// Back nav will keep the same context --> no need to display the dialog
|
|
391
407
|
history.back();
|
|
@@ -405,7 +421,7 @@ class ObjectPageController extends PageController {
|
|
|
405
421
|
|
|
406
422
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
407
423
|
_onAfterBinding(oBindingContext: any, mParameters: any) {
|
|
408
|
-
const oObjectPage = this._getObjectPageLayoutControl()
|
|
424
|
+
const oObjectPage = this._getObjectPageLayoutControl();
|
|
409
425
|
const aTables = this._findTables();
|
|
410
426
|
|
|
411
427
|
this._sideEffects.clearPropertiesStatus();
|
|
@@ -449,11 +465,13 @@ class ObjectPageController extends PageController {
|
|
|
449
465
|
// Update 'enabled' property of DataFieldForAction buttons on table toolbar
|
|
450
466
|
// The same is also performed on Table selectionChange event
|
|
451
467
|
const oActionOperationAvailableMap = JSON.parse(
|
|
452
|
-
CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
|
|
468
|
+
CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
|
|
453
469
|
),
|
|
454
470
|
aSelectedContexts = oTable.getSelectedContexts();
|
|
455
471
|
|
|
456
|
-
|
|
472
|
+
ActionRuntime.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts, "table");
|
|
473
|
+
// Clear the selection in the table, need to be fixed and review with BLI: FIORITECHP1-24318
|
|
474
|
+
oTable.clearSelection();
|
|
457
475
|
});
|
|
458
476
|
CommonUtils.getSemanticTargetsFromPageModel(this, "_pageModel");
|
|
459
477
|
//Retrieve Object Page header actions from Object Page title control
|
|
@@ -471,40 +489,35 @@ class ObjectPageController extends PageController {
|
|
|
471
489
|
* @param oTable
|
|
472
490
|
* @param oListBinding
|
|
473
491
|
*/
|
|
474
|
-
function enableFastCreationRow(oTable: any, oListBinding: any) {
|
|
492
|
+
async function enableFastCreationRow(oTable: any, oListBinding: any) {
|
|
475
493
|
const oFastCreationRow = oTable.getCreationRow();
|
|
476
494
|
let oFastCreationListBinding, oFastCreationContext;
|
|
477
495
|
|
|
478
496
|
if (oFastCreationRow) {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
// this is needed to avoid console error
|
|
500
|
-
oFastCreationContext.created().catch(function () {
|
|
501
|
-
Log.trace("transient fast creation context deleted");
|
|
502
|
-
});
|
|
497
|
+
try {
|
|
498
|
+
await oFinalUIState;
|
|
499
|
+
if (oFastCreationRow.getModel("ui").getProperty("/isEditable")) {
|
|
500
|
+
oFastCreationListBinding = oModel.bindList(oListBinding.getPath(), oListBinding.getContext(), [], [], {
|
|
501
|
+
$$updateGroupId: "doNotSubmit",
|
|
502
|
+
$$groupId: "doNotSubmit"
|
|
503
|
+
});
|
|
504
|
+
// Workaround suggested by OData model v4 colleagues
|
|
505
|
+
oFastCreationListBinding.refreshInternal = function () {
|
|
506
|
+
/* do nothing */
|
|
507
|
+
};
|
|
508
|
+
oFastCreationContext = oFastCreationListBinding.create();
|
|
509
|
+
oFastCreationRow.setBindingContext(oFastCreationContext);
|
|
510
|
+
|
|
511
|
+
// this is needed to avoid console error
|
|
512
|
+
try {
|
|
513
|
+
await oFastCreationContext.created();
|
|
514
|
+
} catch (e) {
|
|
515
|
+
Log.trace("transient fast creation context deleted");
|
|
503
516
|
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
517
|
+
}
|
|
518
|
+
} catch (oError: any) {
|
|
519
|
+
Log.error("Error while computing the final UI state", oError);
|
|
520
|
+
}
|
|
508
521
|
}
|
|
509
522
|
}
|
|
510
523
|
|
|
@@ -519,7 +532,7 @@ class ObjectPageController extends PageController {
|
|
|
519
532
|
};
|
|
520
533
|
|
|
521
534
|
if (!oBinding) {
|
|
522
|
-
Log.error(
|
|
535
|
+
Log.error(`Expected binding missing for table: ${oTable.getId()}`);
|
|
523
536
|
return;
|
|
524
537
|
}
|
|
525
538
|
|
|
@@ -640,9 +653,7 @@ class ObjectPageController extends PageController {
|
|
|
640
653
|
/**
|
|
641
654
|
* Get the status of edit mode for sticky session.
|
|
642
655
|
*
|
|
643
|
-
* @returns
|
|
644
|
-
*
|
|
645
|
-
*
|
|
656
|
+
* @returns The status of edit mode for sticky session
|
|
646
657
|
*/
|
|
647
658
|
getStickyEditMode() {
|
|
648
659
|
const oBindingContext = this.getView().getBindingContext && (this.getView().getBindingContext() as Context);
|
|
@@ -665,18 +676,16 @@ class ObjectPageController extends PageController {
|
|
|
665
676
|
const oObjectPageSubtitle = oObjectPage.getCustomData().find(function (oCustomData: any) {
|
|
666
677
|
return oCustomData.getKey() === "ObjectPageSubtitle";
|
|
667
678
|
});
|
|
668
|
-
|
|
679
|
+
return {
|
|
669
680
|
title: oObjectPage.data("ObjectPageTitle") || "",
|
|
670
681
|
subtitle: oObjectPageSubtitle && oObjectPageSubtitle.getValue(),
|
|
671
682
|
intent: "",
|
|
672
683
|
icon: ""
|
|
673
684
|
};
|
|
674
|
-
|
|
675
|
-
return oTitleInfo;
|
|
676
685
|
}
|
|
677
686
|
|
|
678
687
|
_executeHeaderShortcut(sId: any) {
|
|
679
|
-
const sButtonId = this.getView().getId()
|
|
688
|
+
const sButtonId = `${this.getView().getId()}--${sId}`,
|
|
680
689
|
oButton = (this._getObjectPageLayoutControl().getHeaderTitle() as ObjectPageDynamicHeaderTitle)
|
|
681
690
|
.getActions()
|
|
682
691
|
.find(function (oElement: any) {
|
|
@@ -686,7 +695,7 @@ class ObjectPageController extends PageController {
|
|
|
686
695
|
}
|
|
687
696
|
|
|
688
697
|
_executeFooterShortcut(sId: any) {
|
|
689
|
-
const sButtonId = this.getView().getId()
|
|
698
|
+
const sButtonId = `${this.getView().getId()}--${sId}`,
|
|
690
699
|
oButton = (this._getObjectPageLayoutControl().getFooter() as any).getContent().find(function (oElement: any) {
|
|
691
700
|
return oElement.getMetadata().getName() === "sap.m.Button" && oElement.getId() === sButtonId;
|
|
692
701
|
});
|
|
@@ -705,12 +714,11 @@ class ObjectPageController extends PageController {
|
|
|
705
714
|
if (iSelectedSectionIndex <= iSectionIndexMax - 1) {
|
|
706
715
|
newSection = aSections[++iSelectedSectionIndex];
|
|
707
716
|
}
|
|
708
|
-
} else {
|
|
717
|
+
} else if (iSelectedSectionIndex !== 0) {
|
|
709
718
|
// PreviousTab
|
|
710
|
-
|
|
711
|
-
newSection = aSections[--iSelectedSectionIndex];
|
|
712
|
-
}
|
|
719
|
+
newSection = aSections[--iSelectedSectionIndex];
|
|
713
720
|
}
|
|
721
|
+
|
|
714
722
|
if (newSection) {
|
|
715
723
|
oObjectPage.setSelectedSection(newSection);
|
|
716
724
|
newSection.focus();
|
|
@@ -766,7 +774,7 @@ class ObjectPageController extends PageController {
|
|
|
766
774
|
});
|
|
767
775
|
}
|
|
768
776
|
|
|
769
|
-
_saveDocument(oContext: any) {
|
|
777
|
+
async _saveDocument(oContext: any) {
|
|
770
778
|
const oModel = this.getView().getModel("ui"),
|
|
771
779
|
aWaitCreateDocuments: any[] = [];
|
|
772
780
|
// indicates if we are creating a new row in the OP
|
|
@@ -795,22 +803,33 @@ class ObjectPageController extends PageController {
|
|
|
795
803
|
);
|
|
796
804
|
}
|
|
797
805
|
});
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
806
|
+
|
|
807
|
+
try {
|
|
808
|
+
const aBindings = await Promise.all(aWaitCreateDocuments);
|
|
809
|
+
const mParameters = {
|
|
810
|
+
bExecuteSideEffectsOnError: bExecuteSideEffectsOnError,
|
|
811
|
+
bindings: aBindings
|
|
812
|
+
};
|
|
813
|
+
// We need to either reject or resolve a promise here and return it since this save
|
|
814
|
+
// function is not only called when pressing the save button in the footer, but also
|
|
815
|
+
// when the user selects create or save in a dataloss popup.
|
|
816
|
+
// The logic of the dataloss popup needs to detect if the save had errors or not in order
|
|
817
|
+
// to decide if the subsequent action - like a back navigation - has to be executed or not.
|
|
818
|
+
try {
|
|
819
|
+
await this.editFlow.saveDocument(oContext, mParameters);
|
|
820
|
+
} catch (error: any) {
|
|
821
|
+
// If the saveDocument in editFlow returns errors we need
|
|
822
|
+
// to show the message popover here and ensure that the
|
|
823
|
+
// dataloss logic does not perform the follow up function
|
|
824
|
+
// like e.g. a back navigation hence we return a promise and reject it
|
|
825
|
+
this._showMessagePopover(error);
|
|
826
|
+
throw error;
|
|
827
|
+
}
|
|
828
|
+
} finally {
|
|
829
|
+
if (BusyLocker.isLocked(oModel)) {
|
|
830
|
+
BusyLocker.unlock(oModel);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
814
833
|
}
|
|
815
834
|
|
|
816
835
|
_manageCollaboration() {
|
|
@@ -830,73 +849,6 @@ class ObjectPageController extends PageController {
|
|
|
830
849
|
return this.editFlow.applyDocument(oContext).catch(() => this._showMessagePopover());
|
|
831
850
|
}
|
|
832
851
|
|
|
833
|
-
_showSwitchDraftAndActivePopover(event: Event) {
|
|
834
|
-
const view = this.getView(),
|
|
835
|
-
source = event.getSource(),
|
|
836
|
-
fragmentName = "sap.fe.templates.ObjectPage.view.fragments.SwitchDraftAndActiveObjectPopOver";
|
|
837
|
-
|
|
838
|
-
if (this.switchDraftAndActivePopOver) {
|
|
839
|
-
this.switchDraftAndActivePopOver.openBy(source, false);
|
|
840
|
-
} else {
|
|
841
|
-
const localThisModel = new JSONModel({}),
|
|
842
|
-
preprocessorSettings = {
|
|
843
|
-
bindingContexts: {
|
|
844
|
-
"this": localThisModel.createBindingContext("/")
|
|
845
|
-
},
|
|
846
|
-
models: {
|
|
847
|
-
"this": localThisModel
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
const popoverFragment = XMLTemplateProcessor.loadTemplate(fragmentName, "fragment");
|
|
851
|
-
Promise.resolve(XMLPreprocessor.process(popoverFragment, { name: fragmentName }, preprocessorSettings))
|
|
852
|
-
.then((fragment) => {
|
|
853
|
-
return Fragment.load({ definition: fragment, controller: this });
|
|
854
|
-
})
|
|
855
|
-
.then((popover: any) => {
|
|
856
|
-
view.addDependent(popover);
|
|
857
|
-
popover.setModel(view.getModel("sap.fe.i18n"), "i18n");
|
|
858
|
-
popover.setPlacement("Bottom");
|
|
859
|
-
this.switchDraftAndActivePopOver = popover;
|
|
860
|
-
popover.attachAfterOpen(() => {
|
|
861
|
-
// While the list entry corresponding to the currently displayed document version is emphasized with a blue
|
|
862
|
-
// background, we need to pre-focus the other entry
|
|
863
|
-
const context: any = this.getView().getBindingContext(),
|
|
864
|
-
isActiveEntity = context.getObject().IsActiveEntity;
|
|
865
|
-
const switchDraftAndActiveOptionsList: SelectList = (popover.getContent() as unknown as Control[]).find(
|
|
866
|
-
(element) => element.data("listIdentifier") === "switchDraftAndActivePopoverList"
|
|
867
|
-
) as SelectList;
|
|
868
|
-
const listItemToFocus: Item = isActiveEntity
|
|
869
|
-
? (switchDraftAndActiveOptionsList.getItems().find((element) => element.getKey() === "switchToDraft") as Item)
|
|
870
|
-
: (switchDraftAndActiveOptionsList.getItems().find((element) => element.getKey() === "switchToActive") as Item);
|
|
871
|
-
listItemToFocus.focus();
|
|
872
|
-
});
|
|
873
|
-
popover.openBy(source);
|
|
874
|
-
// ensure to remove the reference to the draft popover as it would be destroyed on exit
|
|
875
|
-
view.attachEventOnce("beforeExit", () => {
|
|
876
|
-
delete this.switchDraftAndActivePopOver;
|
|
877
|
-
});
|
|
878
|
-
})
|
|
879
|
-
.catch(function (Error) {
|
|
880
|
-
Log.error("Error while opening the draft switch popup", Error);
|
|
881
|
-
});
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
_switchDraftAndActivePopoverListSelect(event: Event) {
|
|
886
|
-
const context: any = this.getView().getBindingContext(),
|
|
887
|
-
selectedItemKey = event.getParameter("item").getProperty("key"),
|
|
888
|
-
isActiveEntity = context.getObject().IsActiveEntity;
|
|
889
|
-
// It was decided that we should NOT set the entry in the list corresponding to the currently displayed document version to
|
|
890
|
-
// disabled, hence the user can click entries which to not cause an action (clicking "Draft" when you already display the
|
|
891
|
-
// draft version of the document)
|
|
892
|
-
// Hence we check here which entry in the list was clicked and which document version we currently display and only do
|
|
893
|
-
// the switch between draft / active version if it makes sense.
|
|
894
|
-
if ((isActiveEntity && selectedItemKey === "switchToDraft") || (!isActiveEntity && selectedItemKey === "switchToActive")) {
|
|
895
|
-
this.editFlow.toggleDraftActive(context);
|
|
896
|
-
}
|
|
897
|
-
((event.getSource() as Control).getParent() as Popover).close();
|
|
898
|
-
}
|
|
899
|
-
|
|
900
852
|
_updateRelatedApps() {
|
|
901
853
|
const oObjectPage = this._getObjectPageLayoutControl();
|
|
902
854
|
if (CommonUtils.resolveStringtoBoolean(oObjectPage.data("showRelatedApps"))) {
|
|
@@ -936,15 +888,13 @@ class ObjectPageController extends PageController {
|
|
|
936
888
|
) {
|
|
937
889
|
//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
|
|
938
890
|
aSubsection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
|
|
939
|
-
} else {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
});
|
|
947
|
-
}
|
|
891
|
+
} else if (aSubSectionTables && !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")) {
|
|
892
|
+
aSubSectionTables.forEach(function (oTable: { table: any; gridTable: any }) {
|
|
893
|
+
if (oTable.gridTable) {
|
|
894
|
+
//Resetting the row count to default value in case we have a combination of forms and tables or multiple tables in a subsection
|
|
895
|
+
oTable.table.getType().setRowCount(null);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
948
898
|
}
|
|
949
899
|
}
|
|
950
900
|
|
|
@@ -989,9 +939,9 @@ class ObjectPageController extends PageController {
|
|
|
989
939
|
/**
|
|
990
940
|
* Chart Context is resolved for 1:n microcharts.
|
|
991
941
|
*
|
|
992
|
-
* @param
|
|
993
|
-
* @param
|
|
994
|
-
* @returns
|
|
942
|
+
* @param oChartContext The Context of the MicroChart
|
|
943
|
+
* @param sChartPath The collectionPath of the the chart
|
|
944
|
+
* @returns Array of Attributes of the chart Context
|
|
995
945
|
*/
|
|
996
946
|
_getChartContextData(oChartContext: any, sChartPath: string) {
|
|
997
947
|
const oContextData = oChartContext.getObject();
|
|
@@ -1012,7 +962,6 @@ class ObjectPageController extends PageController {
|
|
|
1012
962
|
* @function
|
|
1013
963
|
* @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTablesToRow
|
|
1014
964
|
* @param {string} sRowPath 'sPath of the table row'
|
|
1015
|
-
*
|
|
1016
965
|
*/
|
|
1017
966
|
|
|
1018
967
|
_scrollTablesToRow(sRowPath: string) {
|
|
@@ -1029,10 +978,10 @@ class ObjectPageController extends PageController {
|
|
|
1029
978
|
*
|
|
1030
979
|
* @function
|
|
1031
980
|
* @name _mergeMultipleContexts
|
|
1032
|
-
* @param
|
|
1033
|
-
* @param
|
|
1034
|
-
* @param
|
|
1035
|
-
* @returns
|
|
981
|
+
* @param oPageContext Page context
|
|
982
|
+
* @param aLineContext Selected Contexts
|
|
983
|
+
* @param sChartPath Collection name of the chart
|
|
984
|
+
* @returns Selection Variant Object
|
|
1036
985
|
*/
|
|
1037
986
|
_mergeMultipleContexts(oPageContext: Context, aLineContext: any[], sChartPath: string) {
|
|
1038
987
|
let aAttributes: any[] = [],
|
|
@@ -1051,14 +1000,14 @@ class ObjectPageController extends PageController {
|
|
|
1051
1000
|
sPathLine = oContext.getPath();
|
|
1052
1001
|
sMetaPathLine = oMetaModel && oMetaModel.getMetaPath(sPathLine).replace(/^\/*/, "");
|
|
1053
1002
|
|
|
1054
|
-
aLineContext.
|
|
1003
|
+
aLineContext.forEach((oSingleContext: any) => {
|
|
1055
1004
|
if (sChartPath) {
|
|
1056
1005
|
const oChartContextData = this._getChartContextData(oSingleContext, sChartPath);
|
|
1057
1006
|
if (oChartContextData) {
|
|
1058
|
-
aAttributes = oChartContextData.map(function (
|
|
1007
|
+
aAttributes = oChartContextData.map(function (oSubChartContextData: any) {
|
|
1059
1008
|
return {
|
|
1060
|
-
contextData:
|
|
1061
|
-
entitySet: sMetaPathPage
|
|
1009
|
+
contextData: oSubChartContextData,
|
|
1010
|
+
entitySet: `${sMetaPathPage}/${sChartPath}`
|
|
1062
1011
|
};
|
|
1063
1012
|
});
|
|
1064
1013
|
}
|
|
@@ -1106,54 +1055,55 @@ class ObjectPageController extends PageController {
|
|
|
1106
1055
|
*
|
|
1107
1056
|
* @function
|
|
1108
1057
|
* @param {sap.m.Breadcrumbs} [oSource] parent control
|
|
1109
|
-
* @description Used when context of the
|
|
1058
|
+
* @description Used when context of the object page changes.
|
|
1110
1059
|
* This event callback is attached to modelContextChange
|
|
1111
1060
|
* event of the Breadcrumb control to catch context change.
|
|
1112
|
-
* Then element binding and hrefs are updated for each
|
|
1061
|
+
* Then element binding and hrefs are updated for each link.
|
|
1113
1062
|
*
|
|
1114
1063
|
* @ui5-restricted
|
|
1115
1064
|
* @experimental
|
|
1116
1065
|
*/
|
|
1117
|
-
_setBreadcrumbLinks(oSource:
|
|
1118
|
-
const oContext = oSource.getBindingContext()
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1066
|
+
async _setBreadcrumbLinks(oSource: BreadCrumbs) {
|
|
1067
|
+
const oContext = oSource.getBindingContext(),
|
|
1068
|
+
oAppComponent = this.getAppComponent(),
|
|
1069
|
+
aPromises: Promise<void>[] = [],
|
|
1070
|
+
aSkipParameterized: any[] = [],
|
|
1071
|
+
sNewPath = oContext?.getPath(),
|
|
1072
|
+
aPathParts = sNewPath?.split("/") ?? [],
|
|
1073
|
+
oMetaModel = oAppComponent && oAppComponent.getMetaModel();
|
|
1074
|
+
let sPath = "";
|
|
1075
|
+
try {
|
|
1127
1076
|
aPathParts.shift();
|
|
1128
1077
|
aPathParts.splice(-1, 1);
|
|
1129
|
-
aPathParts.forEach(function (sPathPart: any
|
|
1130
|
-
sPath +=
|
|
1078
|
+
aPathParts.forEach(function (sPathPart: any) {
|
|
1079
|
+
sPath += `/${sPathPart}`;
|
|
1131
1080
|
const oRootViewController = oAppComponent.getRootViewController() as RootContainerBaseController;
|
|
1132
1081
|
const sParameterPath = oMetaModel.getMetaPath(sPath);
|
|
1133
|
-
const bResultContext = oMetaModel.getObject(sParameterPath
|
|
1082
|
+
const bResultContext = oMetaModel.getObject(`${sParameterPath}/@com.sap.vocabularies.Common.v1.ResultContext`);
|
|
1134
1083
|
if (bResultContext) {
|
|
1135
1084
|
// We dont need to create a breadcrumb for Parameter path
|
|
1136
|
-
|
|
1085
|
+
aSkipParameterized.push(1);
|
|
1137
1086
|
return;
|
|
1087
|
+
} else {
|
|
1088
|
+
aSkipParameterized.push(0);
|
|
1138
1089
|
}
|
|
1139
|
-
|
|
1140
|
-
const pWaitForTitleHiearchyInfo = oRootViewController.getTitleInfoFromPath(sPath);
|
|
1141
|
-
|
|
1142
|
-
pWaitForTitleHiearchyInfo
|
|
1143
|
-
.then(function (oTitleHiearchyInfo: any) {
|
|
1144
|
-
const idx = i - iSkipParameterized,
|
|
1145
|
-
oLink = oSource.getLinks()[idx] ? oSource.getLinks()[idx] : new Link();
|
|
1146
|
-
// sCurrentEntity is a fallback value in case of empty title
|
|
1147
|
-
oLink.setText(oTitleHiearchyInfo.subtitle || oTitleHiearchyInfo.title);
|
|
1148
|
-
oLink.setHref(oTitleHiearchyInfo.intent);
|
|
1149
|
-
if (!oSource.getLinks()[idx]) {
|
|
1150
|
-
oSource.addLink(oLink);
|
|
1151
|
-
}
|
|
1152
|
-
})
|
|
1153
|
-
.catch(function (oError: any) {
|
|
1154
|
-
Log.error("Error while computing the title hierarchy", oError);
|
|
1155
|
-
});
|
|
1090
|
+
aPromises.push(oRootViewController.getTitleInfoFromPath(sPath));
|
|
1156
1091
|
});
|
|
1092
|
+
const titleHierarchyInfos: any[] = await Promise.all(aPromises);
|
|
1093
|
+
let idx, hierarchyPosition, oLink;
|
|
1094
|
+
for (const titleHierarchyInfo of titleHierarchyInfos) {
|
|
1095
|
+
hierarchyPosition = titleHierarchyInfos.indexOf(titleHierarchyInfo);
|
|
1096
|
+
idx = hierarchyPosition - aSkipParameterized[hierarchyPosition];
|
|
1097
|
+
oLink = oSource.getLinks()[idx] ? oSource.getLinks()[idx] : new Link();
|
|
1098
|
+
//sCurrentEntity is a fallback value in case of empty title
|
|
1099
|
+
oLink.setText(titleHierarchyInfo.subtitle || titleHierarchyInfo.title);
|
|
1100
|
+
oLink.setHref(titleHierarchyInfo.intent);
|
|
1101
|
+
if (!oSource.getLinks()[idx]) {
|
|
1102
|
+
oSource.addLink(oLink);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
} catch (error: any) {
|
|
1106
|
+
Log.error("Error while setting the breadcrumb links:" + error);
|
|
1157
1107
|
}
|
|
1158
1108
|
}
|
|
1159
1109
|
|
|
@@ -1189,17 +1139,17 @@ class ObjectPageController extends PageController {
|
|
|
1189
1139
|
const sLinkId = id;
|
|
1190
1140
|
// process viable links from getLinks for all datapoints having outbound
|
|
1191
1141
|
if (aSupportedLinks && aSupportedLinks.length === 1 && aSupportedLinks[0].supported) {
|
|
1192
|
-
oInternalModelContext.setProperty(
|
|
1142
|
+
oInternalModelContext.setProperty(`isHeaderDPLinkVisible/${sLinkId}`, true);
|
|
1193
1143
|
}
|
|
1194
1144
|
}
|
|
1195
1145
|
|
|
1196
1146
|
/**
|
|
1197
|
-
* @param
|
|
1147
|
+
* @param oSubDataPoints
|
|
1198
1148
|
* @param oPageData
|
|
1199
1149
|
*/
|
|
1200
|
-
function fnGetLinks(
|
|
1201
|
-
for (const sId in
|
|
1202
|
-
const oDataPoint =
|
|
1150
|
+
function fnGetLinks(oSubDataPoints: any, oPageData: any) {
|
|
1151
|
+
for (const sId in oSubDataPoints) {
|
|
1152
|
+
const oDataPoint = oSubDataPoints[sId];
|
|
1203
1153
|
const oParams: any = {};
|
|
1204
1154
|
const oLink = oView.byId(sId);
|
|
1205
1155
|
if (!oLink) {
|
|
@@ -1312,7 +1262,7 @@ class ObjectPageController extends PageController {
|
|
|
1312
1262
|
}
|
|
1313
1263
|
})
|
|
1314
1264
|
.catch(function (err: any) {
|
|
1315
|
-
Log.error(
|
|
1265
|
+
Log.error(`An error occurs while scrolling to the newly created Item: ${err}`);
|
|
1316
1266
|
});
|
|
1317
1267
|
}
|
|
1318
1268
|
// fire ModelContextChange on the message button whenever the table context changes
|
|
@@ -1324,21 +1274,20 @@ class ObjectPageController extends PageController {
|
|
|
1324
1274
|
* Invokes an action - bound/unbound and sets the page dirty.
|
|
1325
1275
|
*
|
|
1326
1276
|
* @param oView
|
|
1327
|
-
* @param
|
|
1328
|
-
* @param
|
|
1329
|
-
* @param
|
|
1330
|
-
* @param
|
|
1331
|
-
* @returns
|
|
1277
|
+
* @param sActionName The name of the action to be called
|
|
1278
|
+
* @param [mParameters] Contains the following attributes:
|
|
1279
|
+
* @param [mParameters.contexts] Mandatory for a bound action, either one context or an array with contexts for which the action shall be called
|
|
1280
|
+
* @param [mParameters.model] Mandatory for an unbound action; an instance of an OData V4 model
|
|
1281
|
+
* @returns The action promise
|
|
1332
1282
|
* @ui5-restricted
|
|
1333
1283
|
* @final
|
|
1334
1284
|
*/
|
|
1335
1285
|
onCallAction(oView: any, sActionName: string, mParameters: any) {
|
|
1336
1286
|
const oController = oView.getController();
|
|
1337
|
-
const that = oController;
|
|
1338
1287
|
return oController.editFlow
|
|
1339
1288
|
.invokeAction(sActionName, mParameters)
|
|
1340
|
-
.then(
|
|
1341
|
-
.catch(
|
|
1289
|
+
.then(oController._showMessagePopover.bind(oController, undefined))
|
|
1290
|
+
.catch(oController._showMessagePopover.bind(oController));
|
|
1342
1291
|
},
|
|
1343
1292
|
onDataPointTitlePressed(oController: any, oSource: any, oManifestOutbound: any, sControlConfig: any, sCollectionPath: any) {
|
|
1344
1293
|
oManifestOutbound = typeof oManifestOutbound === "string" ? JSON.parse(oManifestOutbound) : oManifestOutbound;
|
|
@@ -1355,7 +1304,7 @@ class ObjectPageController extends PageController {
|
|
|
1355
1304
|
aNavigationData = aNavigationData.map(function (oNavigationData: any) {
|
|
1356
1305
|
return {
|
|
1357
1306
|
data: oNavigationData,
|
|
1358
|
-
metaPath: sMetaPath + (sCollectionPath ?
|
|
1307
|
+
metaPath: sMetaPath + (sCollectionPath ? `/${sCollectionPath}` : "")
|
|
1359
1308
|
};
|
|
1360
1309
|
});
|
|
1361
1310
|
if (oTargetInfo && oTargetInfo.parameters) {
|
|
@@ -1375,11 +1324,11 @@ class ObjectPageController extends PageController {
|
|
|
1375
1324
|
/**
|
|
1376
1325
|
* Triggers an outbound navigation when a user chooses the chevron.
|
|
1377
1326
|
*
|
|
1378
|
-
* @param
|
|
1379
|
-
* @param
|
|
1380
|
-
* @param
|
|
1381
|
-
* @param
|
|
1382
|
-
* @returns
|
|
1327
|
+
* @param oController
|
|
1328
|
+
* @param sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
|
|
1329
|
+
* @param oContext The context that contains the data for the target app
|
|
1330
|
+
* @param sCreatePath Create path when the chevron is created.
|
|
1331
|
+
* @returns Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
|
|
1383
1332
|
* @ui5-restricted
|
|
1384
1333
|
* @final
|
|
1385
1334
|
*/
|