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