@sap-ux/preview-middleware 0.16.155 → 0.16.157
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 +142 -142
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +5 -6
- package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
- package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
- package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/dialog-factory.js +115 -0
- package/dist/client/adp/dialog-factory.ts +134 -0
- package/dist/client/adp/extension-point.js +6 -6
- package/dist/client/adp/extension-point.ts +2 -2
- package/dist/client/adp/init-dialogs.js +100 -157
- package/dist/client/adp/init-dialogs.ts +5 -77
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
- package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
- package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
- package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
- package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
- package/dist/client/adp/quick-actions/common/utils.js +20 -0
- package/dist/client/adp/quick-actions/common/utils.ts +7 -0
- package/dist/client/adp/quick-actions/control-types.js +23 -0
- package/dist/client/adp/quick-actions/control-types.ts +6 -0
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
- package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
- package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
- package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
- package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
- package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
- package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
- 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 +55 -0
- package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
- package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
- package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/service.js +30 -0
- package/dist/client/cpe/changes/service.ts +46 -0
- package/dist/client/cpe/changes/validator.js +34 -34
- 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 +217 -217
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
- package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
- package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
- 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 +30 -30
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/messagebundle.properties +5 -3
- 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-v4.js +118 -114
- package/dist/client/utils/fe-v4.ts +19 -11
- package/dist/client/utils/version.js +102 -102
- package/package.json +4 -4
|
@@ -1,159 +1,102 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @param
|
|
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
|
-
return
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @param
|
|
72
|
-
* @
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
case DialogNames.ADD_TABLE_COLUMN_FRAGMENTS:
|
|
102
|
-
controller = new AddTableColumnFragments(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta, {
|
|
103
|
-
aggregation: options.aggregation,
|
|
104
|
-
title: resources.getText(options.title ?? 'ADP_ADD_FRAGMENT_DIALOG_TITLE')
|
|
105
|
-
});
|
|
106
|
-
break;
|
|
107
|
-
case DialogNames.CONTROLLER_EXTENSION:
|
|
108
|
-
controller = new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta);
|
|
109
|
-
break;
|
|
110
|
-
case DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT:
|
|
111
|
-
controller = new ExtensionPoint(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta, extensionPointData);
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
const id = dialogName === DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT ? `dialog--${dialogName}` : undefined;
|
|
115
|
-
const dialog = await Fragment.load({
|
|
116
|
-
name: `open.ux.preview.client.adp.ui.${dialogName}`,
|
|
117
|
-
controller,
|
|
118
|
-
id
|
|
119
|
-
});
|
|
120
|
-
await controller.setup(dialog);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Adds a new item to the context menu
|
|
125
|
-
*
|
|
126
|
-
* @param rta Runtime Authoring
|
|
127
|
-
* @param syncViewsIds Ids of all application sync views
|
|
128
|
-
* @param ui5VersionInfo UI5 version information
|
|
129
|
-
*/
|
|
130
|
-
const initDialogs = (rta, syncViewsIds, ui5VersionInfo) => {
|
|
131
|
-
const contextMenu = rta.getDefaultPlugins().contextMenu;
|
|
132
|
-
contextMenu.addMenuItem({
|
|
133
|
-
id: 'ADD_FRAGMENT',
|
|
134
|
-
text: getAddFragmentItemText,
|
|
135
|
-
handler: async overlays => await handler(overlays[0], rta, DialogNames.ADD_FRAGMENT),
|
|
136
|
-
icon: 'sap-icon://attachment-html',
|
|
137
|
-
enabled: overlays => isFragmentCommandEnabled(overlays, ui5VersionInfo)
|
|
138
|
-
});
|
|
139
|
-
contextMenu.addMenuItem({
|
|
140
|
-
id: 'EXTEND_CONTROLLER',
|
|
141
|
-
text: 'Extend With Controller',
|
|
142
|
-
handler: async overlays => await handler(overlays[0], rta, DialogNames.CONTROLLER_EXTENSION),
|
|
143
|
-
icon: 'sap-icon://create-form',
|
|
144
|
-
enabled: overlays => isControllerExtensionEnabled(overlays, syncViewsIds, ui5VersionInfo)
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
var __exports = {
|
|
148
|
-
__esModule: true
|
|
149
|
-
};
|
|
150
|
-
__exports.DialogNames = DialogNames;
|
|
151
|
-
__exports.isControllerExtensionEnabledForControl = isControllerExtensionEnabledForControl;
|
|
152
|
-
__exports.isControllerExtensionEnabled = isControllerExtensionEnabled;
|
|
153
|
-
__exports.isFragmentCommandEnabled = isFragmentCommandEnabled;
|
|
154
|
-
__exports.getAddFragmentItemText = getAddFragmentItemText;
|
|
155
|
-
__exports.handler = handler;
|
|
156
|
-
__exports.initDialogs = initDialogs;
|
|
157
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/rta/util/hasStableId", "sap/ui/fl/Utils", "../cpe/utils", "./dialog-factory"], function (hasStableId, FlUtils, ___cpe_utils, ___dialog_factory) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const isReuseComponent = ___cpe_utils["isReuseComponent"];
|
|
7
|
+
const DialogFactory = ___dialog_factory["DialogFactory"];
|
|
8
|
+
const DialogNames = ___dialog_factory["DialogNames"];
|
|
9
|
+
/**
|
|
10
|
+
* Handler for enablement of Extend With Controller context menu entry
|
|
11
|
+
*
|
|
12
|
+
* @param control UI5 control.
|
|
13
|
+
* @param syncViewsIds Runtime Authoring
|
|
14
|
+
* @param ui5VersionInfo UI5 version information
|
|
15
|
+
*
|
|
16
|
+
* @returns boolean whether menu item is enabled or not
|
|
17
|
+
*/
|
|
18
|
+
function isControllerExtensionEnabledForControl(control, syncViewsIds, ui5VersionInfo) {
|
|
19
|
+
const clickedControlId = FlUtils.getViewForControl(control).getId();
|
|
20
|
+
const isClickedControlReuseComponent = isReuseComponent(clickedControlId, ui5VersionInfo);
|
|
21
|
+
return !syncViewsIds.includes(clickedControlId) && !isClickedControlReuseComponent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Handler for enablement of Extend With Controller context menu entry
|
|
26
|
+
*
|
|
27
|
+
* @param overlays Control overlays
|
|
28
|
+
* @param syncViewsIds Runtime Authoring
|
|
29
|
+
* @param ui5VersionInfo UI5 version information
|
|
30
|
+
*
|
|
31
|
+
* @returns boolean whether menu item is enabled or not
|
|
32
|
+
*/
|
|
33
|
+
const isControllerExtensionEnabled = (overlays, syncViewsIds, ui5VersionInfo) => {
|
|
34
|
+
if (overlays.length === 0 || overlays.length > 1) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return isControllerExtensionEnabledForControl(overlays[0].getElement(), syncViewsIds, ui5VersionInfo);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Determines whether the fragment command should be enabled based on the provided overlays.
|
|
42
|
+
*
|
|
43
|
+
* @param {ElementOverlay[]} overlays - An array of ElementOverlay objects representing the UI overlays.
|
|
44
|
+
* @param ui5VersionInfo UI5 version information
|
|
45
|
+
* @returns {boolean} True if the fragment command is enabled, false otherwise.
|
|
46
|
+
*/
|
|
47
|
+
const isFragmentCommandEnabled = (overlays, ui5VersionInfo) => {
|
|
48
|
+
if (overlays.length === 0 || overlays.length > 1) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const control = overlays[0].getElement();
|
|
52
|
+
return hasStableId(overlays[0]) && !isReuseComponent(control.getId(), ui5VersionInfo);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Determines the text that should be displayed for the Add Fragment context menu item.
|
|
57
|
+
*
|
|
58
|
+
* @param {ElementOverlay} overlay - An ElementOverlay object representing the UI overlay.
|
|
59
|
+
* @returns {string} The text of the Add Fragment context menu item.
|
|
60
|
+
*/
|
|
61
|
+
const getAddFragmentItemText = overlay => {
|
|
62
|
+
if (!hasStableId(overlay)) {
|
|
63
|
+
return 'Add: Fragment (Unavailable due to unstable ID of the control or its parent control)';
|
|
64
|
+
}
|
|
65
|
+
return 'Add: Fragment';
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Adds a new item to the context menu
|
|
70
|
+
*
|
|
71
|
+
* @param rta Runtime Authoring
|
|
72
|
+
* @param syncViewsIds Ids of all application sync views
|
|
73
|
+
* @param ui5VersionInfo UI5 version information
|
|
74
|
+
*/
|
|
75
|
+
const initDialogs = (rta, syncViewsIds, ui5VersionInfo) => {
|
|
76
|
+
const contextMenu = rta.getDefaultPlugins().contextMenu;
|
|
77
|
+
contextMenu.addMenuItem({
|
|
78
|
+
id: 'ADD_FRAGMENT',
|
|
79
|
+
text: getAddFragmentItemText,
|
|
80
|
+
handler: async overlays => await DialogFactory.createDialog(overlays[0], rta, DialogNames.ADD_FRAGMENT),
|
|
81
|
+
icon: 'sap-icon://attachment-html',
|
|
82
|
+
enabled: overlays => isFragmentCommandEnabled(overlays, ui5VersionInfo)
|
|
83
|
+
});
|
|
84
|
+
contextMenu.addMenuItem({
|
|
85
|
+
id: 'EXTEND_CONTROLLER',
|
|
86
|
+
text: 'Extend With Controller',
|
|
87
|
+
handler: async overlays => await DialogFactory.createDialog(overlays[0], rta, DialogNames.CONTROLLER_EXTENSION),
|
|
88
|
+
icon: 'sap-icon://create-form',
|
|
89
|
+
enabled: overlays => isControllerExtensionEnabled(overlays, syncViewsIds, ui5VersionInfo)
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
var __exports = {
|
|
93
|
+
__esModule: true
|
|
94
|
+
};
|
|
95
|
+
__exports.isControllerExtensionEnabledForControl = isControllerExtensionEnabledForControl;
|
|
96
|
+
__exports.isControllerExtensionEnabled = isControllerExtensionEnabled;
|
|
97
|
+
__exports.isFragmentCommandEnabled = isFragmentCommandEnabled;
|
|
98
|
+
__exports.getAddFragmentItemText = getAddFragmentItemText;
|
|
99
|
+
__exports.initDialogs = initDialogs;
|
|
100
|
+
return __exports;
|
|
158
101
|
});
|
|
159
102
|
//# sourceMappingURL=init-dialogs.js.map
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/** sap.m */
|
|
2
|
-
import type Dialog from 'sap/m/Dialog';
|
|
3
|
-
|
|
4
1
|
/** sap.ui.core */
|
|
5
|
-
import Fragment from 'sap/ui/core/Fragment';
|
|
6
2
|
import UI5Element from 'sap/ui/core/Element';
|
|
7
3
|
|
|
8
4
|
/** sap.ui.rta */
|
|
@@ -15,24 +11,10 @@ import FlUtils from 'sap/ui/fl/Utils';
|
|
|
15
11
|
/** sap.ui.dt */
|
|
16
12
|
import type ElementOverlay from 'sap/ui/dt/ElementOverlay';
|
|
17
13
|
|
|
18
|
-
import AddFragment, { AddFragmentOptions } from './controllers/AddFragment.controller';
|
|
19
|
-
import ControllerExtension from './controllers/ControllerExtension.controller';
|
|
20
|
-
import { ExtensionPointData } from './extension-point';
|
|
21
|
-
import ExtensionPoint from './controllers/ExtensionPoint.controller';
|
|
22
14
|
import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
23
15
|
import { isReuseComponent } from '../cpe/utils';
|
|
24
16
|
import { Ui5VersionInfo } from '../utils/version';
|
|
25
|
-
import {
|
|
26
|
-
import AddTableColumnFragments from './controllers/AddTableColumnFragments.controller';
|
|
27
|
-
|
|
28
|
-
export const enum DialogNames {
|
|
29
|
-
ADD_FRAGMENT = 'AddFragment',
|
|
30
|
-
ADD_TABLE_COLUMN_FRAGMENTS = 'AddTableColumnFragments',
|
|
31
|
-
CONTROLLER_EXTENSION = 'ControllerExtension',
|
|
32
|
-
ADD_FRAGMENT_AT_EXTENSION_POINT = 'ExtensionPoint'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type Controller = AddFragment | AddTableColumnFragments | ControllerExtension | ExtensionPoint;
|
|
17
|
+
import { DialogFactory, DialogNames } from './dialog-factory';
|
|
36
18
|
|
|
37
19
|
/**
|
|
38
20
|
* Handler for enablement of Extend With Controller context menu entry
|
|
@@ -105,62 +87,6 @@ export const getAddFragmentItemText = (overlay: ElementOverlay) => {
|
|
|
105
87
|
return 'Add: Fragment';
|
|
106
88
|
};
|
|
107
89
|
|
|
108
|
-
/**
|
|
109
|
-
* Handler for new context menu entry
|
|
110
|
-
*
|
|
111
|
-
* @param overlay Control overlays
|
|
112
|
-
* @param rta Runtime Authoring
|
|
113
|
-
* @param dialogName Dialog name
|
|
114
|
-
* @param extensionPointData Control ID
|
|
115
|
-
* @param options Dialog options
|
|
116
|
-
*/
|
|
117
|
-
export async function handler(
|
|
118
|
-
overlay: UI5Element,
|
|
119
|
-
rta: RuntimeAuthoring,
|
|
120
|
-
dialogName: DialogNames,
|
|
121
|
-
extensionPointData?: ExtensionPointData,
|
|
122
|
-
options: Partial<AddFragmentOptions> = {}
|
|
123
|
-
): Promise<void> {
|
|
124
|
-
let controller: Controller;
|
|
125
|
-
const resources = await getTextBundle();
|
|
126
|
-
|
|
127
|
-
switch (dialogName) {
|
|
128
|
-
case DialogNames.ADD_FRAGMENT:
|
|
129
|
-
controller = new AddFragment(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta, {
|
|
130
|
-
aggregation: options.aggregation,
|
|
131
|
-
title: resources.getText(options.title ?? 'ADP_ADD_FRAGMENT_DIALOG_TITLE')
|
|
132
|
-
});
|
|
133
|
-
break;
|
|
134
|
-
case DialogNames.ADD_TABLE_COLUMN_FRAGMENTS:
|
|
135
|
-
controller = new AddTableColumnFragments(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta, {
|
|
136
|
-
aggregation: options.aggregation,
|
|
137
|
-
title: resources.getText(options.title ?? 'ADP_ADD_FRAGMENT_DIALOG_TITLE')
|
|
138
|
-
});
|
|
139
|
-
break;
|
|
140
|
-
case DialogNames.CONTROLLER_EXTENSION:
|
|
141
|
-
controller = new ControllerExtension(`open.ux.preview.client.adp.controllers.${dialogName}`, overlay, rta);
|
|
142
|
-
break;
|
|
143
|
-
case DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT:
|
|
144
|
-
controller = new ExtensionPoint(
|
|
145
|
-
`open.ux.preview.client.adp.controllers.${dialogName}`,
|
|
146
|
-
overlay,
|
|
147
|
-
rta,
|
|
148
|
-
extensionPointData!
|
|
149
|
-
);
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const id = dialogName === DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT ? `dialog--${dialogName}` : undefined;
|
|
154
|
-
|
|
155
|
-
const dialog = await Fragment.load({
|
|
156
|
-
name: `open.ux.preview.client.adp.ui.${dialogName}`,
|
|
157
|
-
controller,
|
|
158
|
-
id
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
await controller.setup(dialog as Dialog);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
90
|
/**
|
|
165
91
|
* Adds a new item to the context menu
|
|
166
92
|
*
|
|
@@ -174,7 +100,8 @@ export const initDialogs = (rta: RuntimeAuthoring, syncViewsIds: string[], ui5Ve
|
|
|
174
100
|
contextMenu.addMenuItem({
|
|
175
101
|
id: 'ADD_FRAGMENT',
|
|
176
102
|
text: getAddFragmentItemText,
|
|
177
|
-
handler: async (overlays: UI5Element[]) =>
|
|
103
|
+
handler: async (overlays: UI5Element[]) =>
|
|
104
|
+
await DialogFactory.createDialog(overlays[0], rta, DialogNames.ADD_FRAGMENT),
|
|
178
105
|
icon: 'sap-icon://attachment-html',
|
|
179
106
|
enabled: (overlays: ElementOverlay[]) => isFragmentCommandEnabled(overlays, ui5VersionInfo)
|
|
180
107
|
});
|
|
@@ -182,7 +109,8 @@ export const initDialogs = (rta: RuntimeAuthoring, syncViewsIds: string[], ui5Ve
|
|
|
182
109
|
contextMenu.addMenuItem({
|
|
183
110
|
id: 'EXTEND_CONTROLLER',
|
|
184
111
|
text: 'Extend With Controller',
|
|
185
|
-
handler: async (overlays: UI5Element[]) =>
|
|
112
|
+
handler: async (overlays: UI5Element[]) =>
|
|
113
|
+
await DialogFactory.createDialog(overlays[0], rta, DialogNames.CONTROLLER_EXTENSION),
|
|
186
114
|
icon: 'sap-icon://create-form',
|
|
187
115
|
enabled: (overlays: ElementOverlay[]) => isControllerExtensionEnabled(overlays, syncViewsIds, ui5VersionInfo)
|
|
188
116
|
});
|
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/version", "../../utils", "../../../cpe/quick-actions/utils", "../../init-dialogs", "../../api-handler", "../simple-quick-action-base"], function (OverlayRegistry, _____utils_version, ____utils, _____cpe_quick_actions_utils, ____init_dialogs, ____api_handler, ___simple_quick_action_base) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getUi5Version = _____utils_version["getUi5Version"];
|
|
7
|
-
const getAllSyncViewsIds = ____utils["getAllSyncViewsIds"];
|
|
8
|
-
const getControllerInfoForControl = ____utils["getControllerInfoForControl"];
|
|
9
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const isControllerExtensionEnabledForControl = ____init_dialogs["isControllerExtensionEnabledForControl"];
|
|
13
|
-
const getExistingController = ____api_handler["getExistingController"];
|
|
14
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
__exports.
|
|
54
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/version", "../../utils", "../../../cpe/quick-actions/utils", "../../dialog-factory", "../../init-dialogs", "../../api-handler", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_version, ____utils, _____cpe_quick_actions_utils, ____dialog_factory, ____init_dialogs, ____api_handler, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
7
|
+
const getAllSyncViewsIds = ____utils["getAllSyncViewsIds"];
|
|
8
|
+
const getControllerInfoForControl = ____utils["getControllerInfoForControl"];
|
|
9
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
10
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
11
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
12
|
+
const isControllerExtensionEnabledForControl = ____init_dialogs["isControllerExtensionEnabledForControl"];
|
|
13
|
+
const getExistingController = ____api_handler["getExistingController"];
|
|
14
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
15
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
16
|
+
const ADD_CONTROLLER_TO_PAGE_TYPE = 'add-controller-to-page';
|
|
17
|
+
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Quick Action for adding controller to a page.
|
|
21
|
+
*/
|
|
22
|
+
class AddControllerToPageQuickAction extends SimpleQuickActionDefinitionBase {
|
|
23
|
+
constructor(context) {
|
|
24
|
+
super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
25
|
+
}
|
|
26
|
+
controllerExists = false;
|
|
27
|
+
async initialize() {
|
|
28
|
+
for (const control of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
|
|
29
|
+
const version = await getUi5Version();
|
|
30
|
+
const syncViewsIds = await getAllSyncViewsIds(version);
|
|
31
|
+
const controlInfo = getControllerInfoForControl(control);
|
|
32
|
+
const data = await getExistingController(controlInfo.controllerName);
|
|
33
|
+
this.controllerExists = data?.controllerExists;
|
|
34
|
+
const isActiveAction = isControllerExtensionEnabledForControl(control, syncViewsIds, version);
|
|
35
|
+
this.control = isActiveAction ? control : undefined;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
get textKey() {
|
|
40
|
+
return this.controllerExists ? 'QUICK_ACTION_SHOW_PAGE_CONTROLLER' : 'QUICK_ACTION_ADD_PAGE_CONTROLLER';
|
|
41
|
+
}
|
|
42
|
+
async execute() {
|
|
43
|
+
if (this.control) {
|
|
44
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
45
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.CONTROLLER_EXTENSION);
|
|
46
|
+
}
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var __exports = {
|
|
51
|
+
__esModule: true
|
|
52
|
+
};
|
|
53
|
+
__exports.ADD_CONTROLLER_TO_PAGE_TYPE = ADD_CONTROLLER_TO_PAGE_TYPE;
|
|
54
|
+
__exports.AddControllerToPageQuickAction = AddControllerToPageQuickAction;
|
|
55
|
+
return __exports;
|
|
55
56
|
});
|
|
56
57
|
//# sourceMappingURL=add-controller-to-page.js.map
|
|
@@ -8,9 +8,11 @@ import type {
|
|
|
8
8
|
QuickActionContext,
|
|
9
9
|
SimpleQuickActionDefinition
|
|
10
10
|
} from '../../../cpe/quick-actions/quick-action-definition';
|
|
11
|
-
import {
|
|
11
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
12
|
+
import { isControllerExtensionEnabledForControl } from '../../init-dialogs';
|
|
12
13
|
import { getExistingController } from '../../api-handler';
|
|
13
14
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
15
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
14
16
|
|
|
15
17
|
export const ADD_CONTROLLER_TO_PAGE_TYPE = 'add-controller-to-page';
|
|
16
18
|
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
@@ -23,7 +25,7 @@ export class AddControllerToPageQuickAction
|
|
|
23
25
|
implements SimpleQuickActionDefinition
|
|
24
26
|
{
|
|
25
27
|
constructor(context: QuickActionContext) {
|
|
26
|
-
super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context);
|
|
28
|
+
super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
private controllerExists = false;
|
|
@@ -52,7 +54,7 @@ export class AddControllerToPageQuickAction
|
|
|
52
54
|
async execute(): Promise<FlexCommand[]> {
|
|
53
55
|
if (this.control) {
|
|
54
56
|
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
55
|
-
await
|
|
57
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.CONTROLLER_EXTENSION);
|
|
56
58
|
}
|
|
57
59
|
return [];
|
|
58
60
|
}
|
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
__exports.
|
|
49
|
-
|
|
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
|
+
}
|
|
23
|
+
async initialize() {
|
|
24
|
+
const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
25
|
+
const version = await getUi5Version();
|
|
26
|
+
if (appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, {
|
|
27
|
+
major: 1,
|
|
28
|
+
minor: 130
|
|
29
|
+
})) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
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
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
var __exports = {
|
|
46
|
+
__esModule: true
|
|
47
|
+
};
|
|
48
|
+
__exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
|
|
49
|
+
__exports.AddPageActionQuickAction = AddPageActionQuickAction;
|
|
50
|
+
return __exports;
|
|
50
51
|
});
|
|
51
52
|
//# sourceMappingURL=create-page-action.js.map
|