@sap-ux/preview-middleware 0.23.47 → 0.23.49
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/command-executor.js +99 -66
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
- package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
- package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
- package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
- package/dist/client/adp/extension-point.js +81 -60
- package/dist/client/adp/init.js +100 -99
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
- package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
- package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
- package/dist/client/adp/sync-views-utils.js +119 -83
- package/dist/client/cpe/changes/flex-change.js +64 -48
- package/dist/client/cpe/changes/service.js +492 -367
- package/dist/client/cpe/communication-service.js +41 -29
- package/dist/client/cpe/connector-service.js +87 -64
- package/dist/client/cpe/context-menu-service.js +87 -74
- package/dist/client/cpe/control-data.js +353 -263
- package/dist/client/cpe/documentation.js +183 -126
- package/dist/client/cpe/init.js +69 -75
- package/dist/client/cpe/outline/service.js +60 -45
- package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
- package/dist/client/cpe/rta-service.js +91 -69
- package/dist/client/cpe/selection.js +239 -187
- package/dist/client/cpe/types.js +0 -4
- package/dist/client/flp/init.js +403 -296
- package/dist/client/manifest.json +7 -4
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
- package/dist/client/utils/info-center-message.js +59 -31
- package/dist/client/utils/version.js +128 -72
- package/package.json +3 -3
|
@@ -1,138 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/model/json/JSONModel", "../../i18n", "../command-executor", "./BaseDialog.controller", "sap/ui/rta/command/CommandFactory", "../../cpe/communication-service", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../quick-actions/fe-v4/utils"], function (JSONModel, ____i18n, __CommandExecutor, __BaseDialog, CommandFactory, ____cpe_communication_service, ___sap_ux_private_control_property_editor_common, ___quick_actions_fe_v4_utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
+
}
|
|
9
|
+
const getResourceModel = ____i18n["getResourceModel"];
|
|
10
|
+
const CommandExecutor = _interopRequireDefault(__CommandExecutor);
|
|
11
|
+
const BaseDialog = _interopRequireDefault(__BaseDialog);
|
|
12
|
+
const CommunicationService = ____cpe_communication_service["CommunicationService"];
|
|
13
|
+
const setApplicationRequiresReload = ___sap_ux_private_control_property_editor_common["setApplicationRequiresReload"];
|
|
14
|
+
const generateRoutePattern = ___quick_actions_fe_v4_utils["generateRoutePattern"];
|
|
15
|
+
/**
|
|
16
|
+
* @namespace open.ux.preview.client.adp.controllers
|
|
17
|
+
*/
|
|
18
|
+
const AddSubpage = BaseDialog.extend("open.ux.preview.client.adp.controllers.AddSubpage", {
|
|
19
|
+
constructor: function _constructor(name, overlays, rta, options, telemetryData) {
|
|
20
|
+
BaseDialog.prototype.constructor.call(this, name, telemetryData);
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.rta = rta;
|
|
23
|
+
this.overlays = overlays;
|
|
24
|
+
this.model = new JSONModel({
|
|
25
|
+
title: options.title,
|
|
26
|
+
navigationData: options.navProperties
|
|
27
|
+
});
|
|
28
|
+
this.commandExecutor = new CommandExecutor(this.rta);
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Setups the Dialog and the JSON Model
|
|
32
|
+
*
|
|
33
|
+
* @param {Dialog} dialog - Dialog instance
|
|
34
|
+
*/
|
|
35
|
+
setup: async function _setup(dialog) {
|
|
36
|
+
this.dialog = dialog;
|
|
37
|
+
this.setEscapeHandler();
|
|
38
|
+
await this.buildDialogData();
|
|
39
|
+
const resourceModel = await getResourceModel('open.ux.preview.client');
|
|
40
|
+
this.dialog.setModel(resourceModel, 'i18n');
|
|
41
|
+
this.dialog.setModel(this.model);
|
|
42
|
+
this.dialog.open();
|
|
43
|
+
},
|
|
44
|
+
onPageTypeChange: function _onPageTypeChange() {
|
|
45
|
+
// TODO: to be supported in future releases
|
|
46
|
+
},
|
|
47
|
+
onNavigationChange: function _onNavigationChange(event) {
|
|
48
|
+
const source = event.getSource();
|
|
49
|
+
const selectedKey = source.getSelectedKey();
|
|
50
|
+
this.model.setProperty('/selectedNavigation/key', selectedKey);
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Handles create button press
|
|
54
|
+
*
|
|
55
|
+
* @param event Event
|
|
56
|
+
*/
|
|
57
|
+
onCreateBtnPress: async function _onCreateBtnPress(event) {
|
|
58
|
+
const source = event.getSource();
|
|
59
|
+
source.setEnabled(false);
|
|
60
|
+
await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
|
|
61
|
+
const flexSettings = this.rta.getFlexSettings();
|
|
62
|
+
const navProperty = this.model.getProperty('/selectedNavigation/key');
|
|
63
|
+
const navigation = this.model.getProperty('/navigationData').find(item => item.navProperty = navProperty);
|
|
64
|
+
const targetEntitySet = navigation?.entitySet ?? '';
|
|
65
|
+
const pageDescriptor = this.options.pageDescriptor;
|
|
66
|
+
let modifiedValue;
|
|
67
|
+
if (pageDescriptor.appType === 'fe-v2') {
|
|
68
|
+
modifiedValue = {
|
|
69
|
+
appComponent: pageDescriptor.appComponent,
|
|
70
|
+
changeType: 'appdescr_ui_generic_app_addNewObjectPage',
|
|
71
|
+
reference: this.options.appReference,
|
|
72
|
+
parameters: {
|
|
73
|
+
parentPage: {
|
|
74
|
+
component: pageDescriptor.pageType,
|
|
75
|
+
entitySet: pageDescriptor.entitySet
|
|
76
|
+
},
|
|
77
|
+
childPage: {
|
|
78
|
+
id: `ObjectPage|${navProperty}`,
|
|
79
|
+
definition: {
|
|
80
|
+
entitySet: targetEntitySet,
|
|
81
|
+
navigationProperty: navProperty
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
} else {
|
|
87
|
+
const routePattern = generateRoutePattern(pageDescriptor.routePattern, navProperty, targetEntitySet);
|
|
88
|
+
modifiedValue = {
|
|
89
|
+
appComponent: pageDescriptor.appComponent,
|
|
90
|
+
changeType: 'appdescr_fe_addNewPage',
|
|
91
|
+
reference: this.options.appReference,
|
|
92
|
+
parameters: {
|
|
93
|
+
sourcePage: {
|
|
94
|
+
id: pageDescriptor.pageId,
|
|
95
|
+
navigationSource: navProperty
|
|
96
|
+
},
|
|
97
|
+
targetPage: {
|
|
98
|
+
type: 'Component',
|
|
99
|
+
id: `${targetEntitySet}ObjectPage`,
|
|
100
|
+
name: 'sap.fe.templates.ObjectPage',
|
|
101
|
+
routePattern,
|
|
102
|
+
settings: {
|
|
103
|
+
contextPath: `/${targetEntitySet}`,
|
|
104
|
+
editableHeaderContent: false,
|
|
105
|
+
entitySet: targetEntitySet,
|
|
106
|
+
pageLayout: '',
|
|
107
|
+
controlConfiguration: {}
|
|
108
|
+
}
|
|
105
109
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const command = await CommandFactory.getCommandFor(this.getRuntimeControl(), 'appDescriptor', modifiedValue, null, flexSettings);
|
|
114
|
+
await this.commandExecutor.pushAndExecuteCommand(command);
|
|
115
|
+
CommunicationService.sendAction(setApplicationRequiresReload(true));
|
|
116
|
+
this.handleDialogClose();
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* Builds data that is used in the dialog
|
|
120
|
+
*/
|
|
121
|
+
buildDialogData: async function _buildDialogData() {
|
|
122
|
+
this.getControlMetadata(); // is called to fill this.runtimeControl
|
|
123
|
+
|
|
124
|
+
const pageTypeOptions = [{
|
|
125
|
+
key: 'ObjectPage',
|
|
126
|
+
value: 'Object Page'
|
|
127
|
+
}, {
|
|
128
|
+
key: 'CustomPage',
|
|
129
|
+
value: 'Custom Page'
|
|
130
|
+
}];
|
|
131
|
+
this.model.setProperty('/pageTypeOptions', pageTypeOptions);
|
|
132
|
+
this.model.setProperty('/selectedPageType', pageTypeOptions[0]);
|
|
133
|
+
const navigationOptions = this.model.getProperty('/navigationData').map(item => {
|
|
134
|
+
const value = item.entitySet === item.navProperty ? item.entitySet : `${item.entitySet} (${item.navProperty})`;
|
|
135
|
+
return {
|
|
136
|
+
key: item.navProperty,
|
|
137
|
+
value
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
this.model.setProperty('/navigationOptions', navigationOptions);
|
|
141
|
+
this.model.setProperty('/selectedNavigation', navigationOptions[0]);
|
|
142
|
+
return Promise.resolve();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return AddSubpage;
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=AddSubpage.controller.js.map
|