@sap-ux/preview-middleware 0.18.20 → 0.18.23
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/dist/client/adp/api-handler.js +153 -153
- package/dist/client/adp/api-handler.ts +2 -2
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
- package/dist/client/adp/controllers/ControllerExtension.controller.js +209 -209
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
- package/dist/client/adp/dialog-factory.js +133 -133
- package/dist/client/adp/init-dialogs.js +107 -107
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +24 -7
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +25 -7
- package/dist/client/adp/quick-actions/common/add-new-subpage.js +134 -138
- package/dist/client/adp/quick-actions/common/add-new-subpage.ts +0 -5
- package/dist/client/adp/quick-actions/common/create-page-action.js +51 -51
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +61 -61
- package/dist/client/adp/quick-actions/common/utils.js +18 -18
- package/dist/client/adp/quick-actions/control-types.js +21 -21
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
- package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +104 -104
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
- package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
- package/dist/client/adp/quick-actions/fe-v2/registry.js +76 -76
- package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +50 -50
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
- package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
- package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
- package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +39 -39
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +222 -222
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/registry.js +143 -143
- package/dist/client/cpe/quick-actions/utils.js +92 -92
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +33 -33
- package/dist/client/cpe/utils.js +138 -138
- package/dist/client/flp/WorkspaceConnector.js +86 -86
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +83 -83
- package/dist/client/flp/initConnectors.js +28 -28
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +68 -68
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v2.js +56 -56
- package/dist/client/utils/fe-v4.js +141 -141
- package/dist/client/utils/version.js +104 -104
- package/package.json +6 -6
|
@@ -7,8 +7,11 @@ sap.ui.define([
|
|
|
7
7
|
'../quick-action-base',
|
|
8
8
|
'../dialog-enablement-validator',
|
|
9
9
|
'sap/ui/rta/command/CommandFactory',
|
|
10
|
-
'../../../utils/version'
|
|
11
|
-
|
|
10
|
+
'../../../utils/version',
|
|
11
|
+
'../fe-v2/utils',
|
|
12
|
+
'../../../utils/fe-v4',
|
|
13
|
+
'../../../utils/application'
|
|
14
|
+
], function (____api_handler, ___sap_ux_private_control_property_editor_common, ____dialog_factory, OverlayRegistry, ___quick_action_base, ___dialog_enablement_validator, CommandFactory, _____utils_version, ___fe_v2_utils, _____utils_fe_v4, _____utils_application) {
|
|
12
15
|
'use strict';
|
|
13
16
|
const getDataSourceAnnotationFileMap = ____api_handler['getDataSourceAnnotationFileMap'];
|
|
14
17
|
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
|
|
@@ -18,6 +21,9 @@ sap.ui.define([
|
|
|
18
21
|
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator['DIALOG_ENABLEMENT_VALIDATOR'];
|
|
19
22
|
const getUi5Version = _____utils_version['getUi5Version'];
|
|
20
23
|
const isLowerThanMinimalUi5Version = _____utils_version['isLowerThanMinimalUi5Version'];
|
|
24
|
+
const getV2AppComponent = ___fe_v2_utils['getV2AppComponent'];
|
|
25
|
+
const getV4AppComponent = _____utils_fe_v4['getV4AppComponent'];
|
|
26
|
+
const getApplicationType = _____utils_application['getApplicationType'];
|
|
21
27
|
const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
|
|
22
28
|
const ADD_NEW_ANNOTATION_FILE_TITLE = 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE';
|
|
23
29
|
class AddNewAnnotationFile extends QuickActionDefinitionBase {
|
|
@@ -52,11 +58,20 @@ sap.ui.define([
|
|
|
52
58
|
if (Object.prototype.hasOwnProperty.call(annotationDataSourceMap, key)) {
|
|
53
59
|
const source = annotationDataSourceMap[key];
|
|
54
60
|
const {annotationExistsInWS} = source.annotationDetails;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
if (source.metadataReadErrorMsg) {
|
|
62
|
+
this.children.push({
|
|
63
|
+
enabled: false,
|
|
64
|
+
tooltip: source.metadataReadErrorMsg,
|
|
65
|
+
label: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
66
|
+
children: []
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
this.children.push({
|
|
70
|
+
enabled: true,
|
|
71
|
+
label: annotationExistsInWS ? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key]) : this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
72
|
+
children: []
|
|
73
|
+
});
|
|
74
|
+
}
|
|
60
75
|
}
|
|
61
76
|
}
|
|
62
77
|
}
|
|
@@ -73,6 +88,7 @@ sap.ui.define([
|
|
|
73
88
|
}
|
|
74
89
|
async execute(path) {
|
|
75
90
|
const {annotationDataSourceMap, isRunningInBAS} = this.annotationDataSourceData;
|
|
91
|
+
const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
76
92
|
const index = Number(path);
|
|
77
93
|
if (index >= 0) {
|
|
78
94
|
const dataSourceId = Object.keys(annotationDataSourceMap)[index];
|
|
@@ -103,6 +119,7 @@ sap.ui.define([
|
|
|
103
119
|
};
|
|
104
120
|
const modifiedValue = {
|
|
105
121
|
changeType: 'appdescr_app_addAnnotationsToOData',
|
|
122
|
+
appComponent: appType === 'fe-v4' ? getV4AppComponent(this.context.view) : getV2AppComponent(this.context.view),
|
|
106
123
|
generator: this.context.flexSettings.generator,
|
|
107
124
|
reference: this.context.flexSettings.projectId,
|
|
108
125
|
parameters,
|
|
@@ -14,6 +14,9 @@ import { QuickActionDefinitionBase } from '../quick-action-base';
|
|
|
14
14
|
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
15
15
|
import CommandFactory from 'sap/ui/rta/command/CommandFactory';
|
|
16
16
|
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
17
|
+
import { getV2AppComponent } from '../fe-v2/utils';
|
|
18
|
+
import { getV4AppComponent } from '../../../utils/fe-v4';
|
|
19
|
+
import { getApplicationType } from '../../../utils/application';
|
|
17
20
|
|
|
18
21
|
export const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
|
|
19
22
|
const ADD_NEW_ANNOTATION_FILE_TITLE = 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE';
|
|
@@ -49,17 +52,27 @@ export class AddNewAnnotationFile
|
|
|
49
52
|
if (!Object.keys(this.annotationDataSourceData.annotationDataSourceMap).length) {
|
|
50
53
|
throw new Error('No data sources found in the manifest');
|
|
51
54
|
}
|
|
55
|
+
|
|
52
56
|
for (const key in annotationDataSourceMap) {
|
|
53
57
|
if (Object.prototype.hasOwnProperty.call(annotationDataSourceMap, key)) {
|
|
54
58
|
const source = annotationDataSourceMap[key];
|
|
55
59
|
const { annotationExistsInWS } = source.annotationDetails;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if (source.metadataReadErrorMsg) {
|
|
61
|
+
this.children.push({
|
|
62
|
+
enabled: false,
|
|
63
|
+
tooltip: source.metadataReadErrorMsg,
|
|
64
|
+
label: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
65
|
+
children: []
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
this.children.push({
|
|
69
|
+
enabled: true,
|
|
70
|
+
label: annotationExistsInWS
|
|
71
|
+
? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key])
|
|
72
|
+
: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
73
|
+
children: []
|
|
74
|
+
});
|
|
75
|
+
}
|
|
63
76
|
}
|
|
64
77
|
}
|
|
65
78
|
}
|
|
@@ -76,6 +89,7 @@ export class AddNewAnnotationFile
|
|
|
76
89
|
}
|
|
77
90
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
78
91
|
const { annotationDataSourceMap, isRunningInBAS } = this.annotationDataSourceData;
|
|
92
|
+
const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
79
93
|
const index = Number(path);
|
|
80
94
|
if (index >= 0) {
|
|
81
95
|
const dataSourceId = Object.keys(annotationDataSourceMap)[index];
|
|
@@ -117,6 +131,10 @@ export class AddNewAnnotationFile
|
|
|
117
131
|
};
|
|
118
132
|
const modifiedValue = {
|
|
119
133
|
changeType: 'appdescr_app_addAnnotationsToOData',
|
|
134
|
+
appComponent:
|
|
135
|
+
appType === 'fe-v4'
|
|
136
|
+
? getV4AppComponent(this.context.view)
|
|
137
|
+
: getV2AppComponent(this.context.view),
|
|
120
138
|
generator: this.context.flexSettings.generator,
|
|
121
139
|
reference: this.context.flexSettings.projectId,
|
|
122
140
|
parameters,
|
|
@@ -1,140 +1,136 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../../cpe/quick-actions/utils", "../../../utils/core", "../../../utils/application", "../../dialog-factory", "../fe-v2/utils", "../../../utils/fe-v2", "../../../utils/fe-v4", "../../../i18n", "../simple-quick-action-base"
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
-
const getControlById = _____utils_core["getControlById"];
|
|
8
|
-
const isA = _____utils_core["isA"];
|
|
9
|
-
const getApplicationType = _____utils_application["getApplicationType"];
|
|
10
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
11
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
12
|
-
const areManifestChangesSupported = ___fe_v2_utils["areManifestChangesSupported"];
|
|
13
|
-
const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
|
|
14
|
-
const getV4ApplicationPages = _____utils_fe_v4["getV4ApplicationPages"];
|
|
15
|
-
const getTextBundle = _____i18n["getTextBundle"];
|
|
16
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
return Promise.resolve();
|
|
101
|
-
}
|
|
102
|
-
const
|
|
103
|
-
if (!
|
|
104
|
-
return Promise.
|
|
105
|
-
}
|
|
106
|
-
const
|
|
107
|
-
if (!
|
|
108
|
-
return Promise.
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.control
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
__exports.ADD_NEW_OBJECT_PAGE_ACTION = ADD_NEW_OBJECT_PAGE_ACTION;
|
|
137
|
-
__exports.AddNewSubpage = AddNewSubpage;
|
|
138
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../../cpe/quick-actions/utils", "../../../utils/core", "../../../utils/application", "../../dialog-factory", "../fe-v2/utils", "../../../utils/fe-v2", "../../../utils/fe-v4", "../../../i18n", "../simple-quick-action-base"], function (Component, OverlayRegistry, _____cpe_quick_actions_utils, _____utils_core, _____utils_application, ____dialog_factory, ___fe_v2_utils, _____utils_fe_v2, _____utils_fe_v4, _____i18n, ___simple_quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
+
const getControlById = _____utils_core["getControlById"];
|
|
8
|
+
const isA = _____utils_core["isA"];
|
|
9
|
+
const getApplicationType = _____utils_application["getApplicationType"];
|
|
10
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
11
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
12
|
+
const areManifestChangesSupported = ___fe_v2_utils["areManifestChangesSupported"];
|
|
13
|
+
const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
|
|
14
|
+
const getV4ApplicationPages = _____utils_fe_v4["getV4ApplicationPages"];
|
|
15
|
+
const getTextBundle = _____i18n["getTextBundle"];
|
|
16
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
17
|
+
const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
|
|
18
|
+
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Quick Action for adding a custom page action.
|
|
22
|
+
*/
|
|
23
|
+
class AddNewSubpage extends SimpleQuickActionDefinitionBase {
|
|
24
|
+
currentPageDescriptor = {
|
|
25
|
+
entitySet: '',
|
|
26
|
+
pageType: '',
|
|
27
|
+
navProperties: []
|
|
28
|
+
};
|
|
29
|
+
constructor(context) {
|
|
30
|
+
super(ADD_NEW_OBJECT_PAGE_ACTION, [], 'QUICK_ACTION_ADD_NEW_SUB_PAGE', context, [{
|
|
31
|
+
run: async () => {
|
|
32
|
+
const i18n = await getTextBundle();
|
|
33
|
+
if (this.currentPageDescriptor.navProperties.length === 0) {
|
|
34
|
+
return {
|
|
35
|
+
type: 'error',
|
|
36
|
+
message: i18n.getText('NO_SUB_PAGES_TO_ADD')
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
}
|
|
43
|
+
getApplicationPages() {
|
|
44
|
+
if (this.appType === 'fe-v2') {
|
|
45
|
+
return getV2ApplicationPages(this.context.manifest);
|
|
46
|
+
} else if (this.appType === 'fe-v4') {
|
|
47
|
+
return getV4ApplicationPages(this.context.manifest);
|
|
48
|
+
}
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
prepareNavigationData(entityType, metaModel) {
|
|
52
|
+
const existingPages = this.getApplicationPages();
|
|
53
|
+
if (this.currentPageDescriptor.pageType === 'sap.suite.ui.generic.template.ObjectPage') {
|
|
54
|
+
// Navigation from Object Page
|
|
55
|
+
for (const navProp of entityType?.navigationProperty || []) {
|
|
56
|
+
const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
|
|
57
|
+
if (associationEnd?.multiplicity !== '*') {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const entityContainer = metaModel.getODataEntityContainer();
|
|
61
|
+
if (!entityContainer?.entitySet?.length) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
|
|
65
|
+
const pageExists = existingPages.some(page => page.entitySet === targetEntitySet?.name);
|
|
66
|
+
if (targetEntitySet && !pageExists) {
|
|
67
|
+
this.currentPageDescriptor.navProperties.push({
|
|
68
|
+
entitySet: targetEntitySet.name,
|
|
69
|
+
navProperty: navProp.name
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// navigation from LR or ALP (only OP based on current entitySet is possible)
|
|
77
|
+
const pageExists = existingPages.some(page => page.entitySet === this.currentPageDescriptor.entitySet);
|
|
78
|
+
if (!pageExists) {
|
|
79
|
+
this.currentPageDescriptor.navProperties.push({
|
|
80
|
+
entitySet: this.currentPageDescriptor.entitySet,
|
|
81
|
+
navProperty: this.currentPageDescriptor.entitySet
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async initialize() {
|
|
86
|
+
if (!(await areManifestChangesSupported(this.context.manifest))) {
|
|
87
|
+
return Promise.resolve();
|
|
88
|
+
}
|
|
89
|
+
this.appType = getApplicationType(this.context.manifest);
|
|
90
|
+
const allControls = CONTROL_TYPES.flatMap(item => this.context.controlIndex[item] ?? []);
|
|
91
|
+
const control = allControls.find(c => pageHasControlId(this.context.view, c.controlId));
|
|
92
|
+
const pageType = this.context.view.getViewName().split('.view.')[0];
|
|
93
|
+
this.currentPageDescriptor.pageType = pageType;
|
|
94
|
+
const metaModel = this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
|
|
95
|
+
if (!metaModel || !control) {
|
|
96
|
+
return Promise.resolve();
|
|
97
|
+
}
|
|
98
|
+
const modifiedControl = getControlById(control.controlId);
|
|
99
|
+
if (!modifiedControl) {
|
|
100
|
+
return Promise.resolve();
|
|
101
|
+
}
|
|
102
|
+
const component = Component.getOwnerComponentFor(modifiedControl);
|
|
103
|
+
if (!isA('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
|
|
104
|
+
return Promise.reject(new Error('Unexpected type of page owner component'));
|
|
105
|
+
}
|
|
106
|
+
const entitySetName = component.getEntitySet();
|
|
107
|
+
if (!entitySetName) {
|
|
108
|
+
return Promise.resolve();
|
|
109
|
+
}
|
|
110
|
+
this.currentPageDescriptor.entitySet = entitySetName;
|
|
111
|
+
const entitySet = metaModel.getODataEntitySet(entitySetName);
|
|
112
|
+
const entityType = metaModel.getODataEntityType(entitySet.entityType);
|
|
113
|
+
this.prepareNavigationData(entityType, metaModel);
|
|
114
|
+
this.control = modifiedControl;
|
|
115
|
+
return Promise.resolve();
|
|
116
|
+
}
|
|
117
|
+
async execute() {
|
|
118
|
+
const overlay = OverlayRegistry.getOverlay(this.control);
|
|
119
|
+
const appReference = this.context.flexSettings.projectId;
|
|
120
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_SUBPAGE, undefined, {
|
|
121
|
+
appType: this.appType,
|
|
122
|
+
appReference,
|
|
123
|
+
title: 'ADD_SUB_PAGE_DIALOG_TITLE',
|
|
124
|
+
pageDescriptor: this.currentPageDescriptor
|
|
125
|
+
});
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var __exports = {
|
|
130
|
+
__esModule: true
|
|
131
|
+
};
|
|
132
|
+
__exports.ADD_NEW_OBJECT_PAGE_ACTION = ADD_NEW_OBJECT_PAGE_ACTION;
|
|
133
|
+
__exports.AddNewSubpage = AddNewSubpage;
|
|
134
|
+
return __exports;
|
|
139
135
|
});
|
|
140
136
|
//# sourceMappingURL=add-new-subpage.js.map
|
|
@@ -17,7 +17,6 @@ import { getV4ApplicationPages } from '../../../utils/fe-v4';
|
|
|
17
17
|
import { EnablementValidatorResult } from '../enablement-validator';
|
|
18
18
|
import { getTextBundle } from '../../../i18n';
|
|
19
19
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
20
|
-
import { FeatureService } from '../../../cpe/feature-service';
|
|
21
20
|
|
|
22
21
|
export const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
|
|
23
22
|
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
@@ -102,10 +101,6 @@ export class AddNewSubpage extends SimpleQuickActionDefinitionBase implements Si
|
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
async initialize(): Promise<void> {
|
|
105
|
-
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
106
|
-
return Promise.resolve();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
104
|
if (!(await areManifestChangesSupported(this.context.manifest))) {
|
|
110
105
|
return Promise.resolve();
|
|
111
106
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../simple-quick-action-base", "../../../utils/application", "../../../utils/version", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, ___simple_quick_action_base, _____utils_application, _____utils_version, ___dialog_enablement_validator) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
|
-
const getApplicationType = _____utils_application["getApplicationType"];
|
|
10
|
-
const getUi5Version = _____utils_version["getUi5Version"];
|
|
11
|
-
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
12
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
13
|
-
const ADD_PAGE_ACTION = 'add-page-action';
|
|
14
|
-
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Quick Action for adding a custom page action.
|
|
18
|
-
*/
|
|
19
|
-
class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
20
|
-
constructor(context) {
|
|
21
|
-
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
22
|
-
this.appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
23
|
-
}
|
|
24
|
-
async initialize() {
|
|
25
|
-
const version = await getUi5Version();
|
|
26
|
-
if (this.appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, {
|
|
27
|
-
major: 1,
|
|
28
|
-
minor: 130
|
|
29
|
-
})) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
await super.initialize();
|
|
33
|
-
}
|
|
34
|
-
async execute() {
|
|
35
|
-
if (this.control) {
|
|
36
|
-
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
37
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
38
|
-
aggregation: 'actions',
|
|
39
|
-
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION',
|
|
40
|
-
defaultAggregationArrayIndex: 1
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
var __exports = {
|
|
47
|
-
__esModule: true
|
|
48
|
-
};
|
|
49
|
-
__exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
|
|
50
|
-
__exports.AddPageActionQuickAction = AddPageActionQuickAction;
|
|
51
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../simple-quick-action-base", "../../../utils/application", "../../../utils/version", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, ___simple_quick_action_base, _____utils_application, _____utils_version, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
|
+
const getApplicationType = _____utils_application["getApplicationType"];
|
|
10
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
11
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
12
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
13
|
+
const ADD_PAGE_ACTION = 'add-page-action';
|
|
14
|
+
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Quick Action for adding a custom page action.
|
|
18
|
+
*/
|
|
19
|
+
class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
20
|
+
constructor(context) {
|
|
21
|
+
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
22
|
+
this.appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
23
|
+
}
|
|
24
|
+
async initialize() {
|
|
25
|
+
const version = await getUi5Version();
|
|
26
|
+
if (this.appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, {
|
|
27
|
+
major: 1,
|
|
28
|
+
minor: 130
|
|
29
|
+
})) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
await super.initialize();
|
|
33
|
+
}
|
|
34
|
+
async execute() {
|
|
35
|
+
if (this.control) {
|
|
36
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
37
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
38
|
+
aggregation: 'actions',
|
|
39
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION',
|
|
40
|
+
defaultAggregationArrayIndex: 1
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
var __exports = {
|
|
47
|
+
__esModule: true
|
|
48
|
+
};
|
|
49
|
+
__exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
|
|
50
|
+
__exports.AddPageActionQuickAction = AddPageActionQuickAction;
|
|
51
|
+
return __exports;
|
|
52
52
|
});
|
|
53
53
|
//# sourceMappingURL=create-page-action.js.map
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
-
const OP_ADD_CUSTOM_SECTION = 'op-add-custom-section';
|
|
12
|
-
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Quick Action for adding a Header Field to an Object Page.
|
|
16
|
-
*/
|
|
17
|
-
class AddCustomSectionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
18
|
-
constructor(context) {
|
|
19
|
-
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
|
-
}
|
|
21
|
-
async execute() {
|
|
22
|
-
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
23
|
-
const overlay = OverlayRegistry.getOverlay(objectPageLayout) || [];
|
|
24
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
25
|
-
aggregation: 'sections',
|
|
26
|
-
title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION'
|
|
27
|
-
});
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
var __exports = {
|
|
32
|
-
__esModule: true
|
|
33
|
-
};
|
|
34
|
-
__exports.OP_ADD_CUSTOM_SECTION = OP_ADD_CUSTOM_SECTION;
|
|
35
|
-
__exports.AddCustomSectionQuickAction = AddCustomSectionQuickAction;
|
|
36
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
+
const OP_ADD_CUSTOM_SECTION = 'op-add-custom-section';
|
|
12
|
+
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Quick Action for adding a Header Field to an Object Page.
|
|
16
|
+
*/
|
|
17
|
+
class AddCustomSectionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
18
|
+
constructor(context) {
|
|
19
|
+
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
|
+
}
|
|
21
|
+
async execute() {
|
|
22
|
+
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
23
|
+
const overlay = OverlayRegistry.getOverlay(objectPageLayout) || [];
|
|
24
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
25
|
+
aggregation: 'sections',
|
|
26
|
+
title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION'
|
|
27
|
+
});
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var __exports = {
|
|
32
|
+
__esModule: true
|
|
33
|
+
};
|
|
34
|
+
__exports.OP_ADD_CUSTOM_SECTION = OP_ADD_CUSTOM_SECTION;
|
|
35
|
+
__exports.AddCustomSectionQuickAction = AddCustomSectionQuickAction;
|
|
36
|
+
return __exports;
|
|
37
37
|
});
|
|
38
38
|
//# sourceMappingURL=op-add-custom-section.js.map
|