@sap-ux/preview-middleware 0.16.161 → 0.16.164

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 (77) hide show
  1. package/dist/base/flex.js +28 -7
  2. package/dist/client/adp/api-handler.js +164 -142
  3. package/dist/client/adp/api-handler.ts +31 -0
  4. package/dist/client/adp/command-executor.js +75 -75
  5. package/dist/client/adp/control-utils.js +44 -44
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  7. package/dist/client/adp/controllers/BaseDialog.controller.ts +1 -2
  8. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  9. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  10. package/dist/client/adp/controllers/FileExistsDialog.controller.js +71 -0
  11. package/dist/client/adp/controllers/FileExistsDialog.controller.ts +92 -0
  12. package/dist/client/adp/dialog-factory.js +122 -113
  13. package/dist/client/adp/dialog-factory.ts +15 -7
  14. package/dist/client/adp/init-dialogs.js +100 -100
  15. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  16. package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +118 -0
  17. package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +141 -0
  18. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  19. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  20. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  21. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  22. package/dist/client/adp/quick-actions/control-types.js +21 -21
  23. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  24. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  25. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  26. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  27. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  28. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -60
  29. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  30. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  31. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  32. package/dist/client/adp/quick-actions/fe-v2/registry.js +73 -72
  33. package/dist/client/adp/quick-actions/fe-v2/registry.ts +5 -2
  34. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
  35. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -49
  36. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -47
  37. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  39. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  40. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  41. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  42. package/dist/client/adp/quick-actions/fe-v4/registry.js +57 -56
  43. package/dist/client/adp/quick-actions/fe-v4/registry.ts +5 -2
  44. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  45. package/dist/client/adp/quick-actions/load.js +44 -44
  46. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  47. package/dist/client/adp/ui/FileExistsDialog.fragment.xml +33 -0
  48. package/dist/client/adp/utils.js +160 -160
  49. package/dist/client/cpe/changes/index.js +10 -10
  50. package/dist/client/cpe/changes/service.js +8 -3
  51. package/dist/client/cpe/changes/service.ts +14 -3
  52. package/dist/client/cpe/changes/validator.js +34 -34
  53. package/dist/client/cpe/documentation.js +164 -164
  54. package/dist/client/cpe/feature-service.js +36 -36
  55. package/dist/client/cpe/logger.js +30 -30
  56. package/dist/client/cpe/outline/editable.js +37 -37
  57. package/dist/client/cpe/outline/nodes.js +222 -217
  58. package/dist/client/cpe/outline/nodes.ts +64 -58
  59. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  60. package/dist/client/cpe/quick-actions/registry.js +143 -143
  61. package/dist/client/cpe/quick-actions/utils.js +92 -92
  62. package/dist/client/cpe/types.js +4 -4
  63. package/dist/client/cpe/ui5-utils.js +33 -33
  64. package/dist/client/cpe/utils.js +138 -138
  65. package/dist/client/flp/WorkspaceConnector.js +86 -86
  66. package/dist/client/flp/common.js +28 -28
  67. package/dist/client/flp/enableFakeConnector.js +83 -83
  68. package/dist/client/flp/initConnectors.js +30 -30
  69. package/dist/client/flp/initRta.js +178 -178
  70. package/dist/client/i18n.js +56 -56
  71. package/dist/client/messagebundle.properties +9 -0
  72. package/dist/client/utils/application.js +32 -32
  73. package/dist/client/utils/core.js +68 -68
  74. package/dist/client/utils/error.js +19 -19
  75. package/dist/client/utils/fe-v4.js +118 -118
  76. package/dist/client/utils/version.js +102 -102
  77. package/package.json +4 -4
@@ -1,140 +1,140 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/model/json/JSONModel", "../api-handler", "./BaseDialog.controller", "../utils"], function (JSONModel, ___api_handler, __BaseDialog, ___utils) {
4
- "use strict";
5
-
6
- function _interopRequireDefault(obj) {
7
- return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
- }
9
- const getFragments = ___api_handler["getFragments"];
10
- const BaseDialog = _interopRequireDefault(__BaseDialog);
11
- const notifyUser = ___utils["notifyUser"];
12
- /**
13
- * @namespace open.ux.preview.client.adp.controllers
14
- */
15
- const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
16
- constructor: function _constructor(name, _overlays, rta, data) {
17
- BaseDialog.prototype.constructor.call(this, name);
18
- this.model = new JSONModel();
19
- this.data = data;
20
- this.rta = rta;
21
- },
22
- /**
23
- * Setups the Dialog and the JSON Model
24
- *
25
- * @param {Dialog} dialog - Dialog instance
26
- */
27
- setup: async function _setup(dialog) {
28
- this.dialog = dialog;
29
- this.setEscapeHandler();
30
- await this.buildDialogData();
31
- this.dialog.setModel(this.model);
32
- this.dialog.open();
33
- },
34
- /**
35
- * Handles create button press
36
- *
37
- * @param event Event
38
- */
39
- onCreateBtnPress: function _onCreateBtnPress(event) {
40
- const source = event.getSource();
41
- source.setEnabled(false);
42
- const fragmentName = this.model.getProperty('/newFragmentName');
43
- this.createExtensionPointFragmentChange(fragmentName);
44
- notifyUser(`Note: The '${fragmentName}.fragment.xml' fragment will be created once you save the change.`, 8000);
45
- this.handleDialogClose();
46
- },
47
- /**
48
- * Handler for extension point select control
49
- *
50
- * @param event Select control change event
51
- */
52
- onExtensionPointHandler: function _onExtensionPointHandler(event) {
53
- const source = event.getSource();
54
- const selectedItem = source.getSelectedItem();
55
- let extensionPointName = '';
56
- if (selectedItem) {
57
- extensionPointName = selectedItem.getText();
58
- }
59
- this.model.setProperty('/extensionPointName', extensionPointName);
60
- const hasDefaultContent = this.hasDefaultContentForName(extensionPointName);
61
- this.model.setProperty('/hasDefaultContent', hasDefaultContent);
62
- },
63
- /**
64
- * Determines whether there is default content associated with the given name.
65
- *
66
- * @param {string} name - The name to check for associated default content.
67
- * @returns {boolean} - True if there is non-empty default content associated with the name, false otherwise.
68
- */
69
- hasDefaultContentForName: function _hasDefaultContentForName(name) {
70
- const defaultContent = this.data?.info.find(v => v.name === name)?.defaultContent;
71
- return defaultContent ? defaultContent.length > 0 : false;
72
- },
73
- /**
74
- * Builds data that is used in the dialog
75
- */
76
- buildDialogData: async function _buildDialogData() {
77
- const name = this.data?.name;
78
- if (name) {
79
- const hasDefaultContent = this.hasDefaultContentForName(name);
80
- const extensionPointList = [{
81
- key: 0,
82
- value: name
83
- }];
84
- this.updateModel(name, 0, extensionPointList, false, hasDefaultContent);
85
- } else {
86
- // In this case we are selecting from the application. There can be many extension points under one control.
87
- const extensionPointList = this.data.info.map((v, idx) => {
88
- return {
89
- key: idx,
90
- value: v.name
91
- };
92
- });
93
- const firstElName = extensionPointList[0].value;
94
- const enabled = extensionPointList.length > 1;
95
- const hasDefaultContent = this.hasDefaultContentForName(firstElName);
96
- this.updateModel(firstElName, 0, extensionPointList, enabled, hasDefaultContent);
97
- }
98
- try {
99
- const {
100
- fragments
101
- } = await getFragments();
102
- this.model.setProperty('/fragmentList', fragments);
103
- } catch (e) {
104
- this.handleError(e);
105
- }
106
- },
107
- /**
108
- * Updates the Select control according to provided values
109
- *
110
- * @param name Extension point name
111
- * @param key Selected extension point key
112
- * @param list All of the extension points that are under a view
113
- * @param enabled Enables the select control
114
- * @param hasDefaultContent Whether there is default content associated with the extension name
115
- */
116
- updateModel: function _updateModel(name, key, list, enabled, hasDefaultContent) {
117
- this.model.setProperty('/extensionPointName', name);
118
- this.model.setProperty('/extensionPointKey', key);
119
- this.model.setProperty('/extensionPointList', list);
120
- this.model.setProperty('/extensionListEnabled', enabled);
121
- this.model.setProperty('/hasDefaultContent', hasDefaultContent);
122
- },
123
- /**
124
- * Creates add xml at extension point changes
125
- *
126
- * @param fragmentName Fragment name
127
- */
128
- createExtensionPointFragmentChange: function _createExtensionPointFragmentChange(fragmentName) {
129
- const extensionPointName = this.model.getProperty('/extensionPointName');
130
- const modifiedValue = {
131
- fragment: `<core:FragmentDefinition xmlns:core='sap.ui.core'></core:FragmentDefinition>`,
132
- fragmentPath: `fragments/${fragmentName}.fragment.xml`,
133
- extensionPointName
134
- };
135
- this.data.deferred.resolve(modifiedValue);
136
- }
137
- });
138
- return ExtensionPoint;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/model/json/JSONModel", "../api-handler", "./BaseDialog.controller", "../utils"], function (JSONModel, ___api_handler, __BaseDialog, ___utils) {
4
+ "use strict";
5
+
6
+ function _interopRequireDefault(obj) {
7
+ return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
+ }
9
+ const getFragments = ___api_handler["getFragments"];
10
+ const BaseDialog = _interopRequireDefault(__BaseDialog);
11
+ const notifyUser = ___utils["notifyUser"];
12
+ /**
13
+ * @namespace open.ux.preview.client.adp.controllers
14
+ */
15
+ const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
16
+ constructor: function _constructor(name, _overlays, rta, data) {
17
+ BaseDialog.prototype.constructor.call(this, name);
18
+ this.model = new JSONModel();
19
+ this.data = data;
20
+ this.rta = rta;
21
+ },
22
+ /**
23
+ * Setups the Dialog and the JSON Model
24
+ *
25
+ * @param {Dialog} dialog - Dialog instance
26
+ */
27
+ setup: async function _setup(dialog) {
28
+ this.dialog = dialog;
29
+ this.setEscapeHandler();
30
+ await this.buildDialogData();
31
+ this.dialog.setModel(this.model);
32
+ this.dialog.open();
33
+ },
34
+ /**
35
+ * Handles create button press
36
+ *
37
+ * @param event Event
38
+ */
39
+ onCreateBtnPress: function _onCreateBtnPress(event) {
40
+ const source = event.getSource();
41
+ source.setEnabled(false);
42
+ const fragmentName = this.model.getProperty('/newFragmentName');
43
+ this.createExtensionPointFragmentChange(fragmentName);
44
+ notifyUser(`Note: The '${fragmentName}.fragment.xml' fragment will be created once you save the change.`, 8000);
45
+ this.handleDialogClose();
46
+ },
47
+ /**
48
+ * Handler for extension point select control
49
+ *
50
+ * @param event Select control change event
51
+ */
52
+ onExtensionPointHandler: function _onExtensionPointHandler(event) {
53
+ const source = event.getSource();
54
+ const selectedItem = source.getSelectedItem();
55
+ let extensionPointName = '';
56
+ if (selectedItem) {
57
+ extensionPointName = selectedItem.getText();
58
+ }
59
+ this.model.setProperty('/extensionPointName', extensionPointName);
60
+ const hasDefaultContent = this.hasDefaultContentForName(extensionPointName);
61
+ this.model.setProperty('/hasDefaultContent', hasDefaultContent);
62
+ },
63
+ /**
64
+ * Determines whether there is default content associated with the given name.
65
+ *
66
+ * @param {string} name - The name to check for associated default content.
67
+ * @returns {boolean} - True if there is non-empty default content associated with the name, false otherwise.
68
+ */
69
+ hasDefaultContentForName: function _hasDefaultContentForName(name) {
70
+ const defaultContent = this.data?.info.find(v => v.name === name)?.defaultContent;
71
+ return defaultContent ? defaultContent.length > 0 : false;
72
+ },
73
+ /**
74
+ * Builds data that is used in the dialog
75
+ */
76
+ buildDialogData: async function _buildDialogData() {
77
+ const name = this.data?.name;
78
+ if (name) {
79
+ const hasDefaultContent = this.hasDefaultContentForName(name);
80
+ const extensionPointList = [{
81
+ key: 0,
82
+ value: name
83
+ }];
84
+ this.updateModel(name, 0, extensionPointList, false, hasDefaultContent);
85
+ } else {
86
+ // In this case we are selecting from the application. There can be many extension points under one control.
87
+ const extensionPointList = this.data.info.map((v, idx) => {
88
+ return {
89
+ key: idx,
90
+ value: v.name
91
+ };
92
+ });
93
+ const firstElName = extensionPointList[0].value;
94
+ const enabled = extensionPointList.length > 1;
95
+ const hasDefaultContent = this.hasDefaultContentForName(firstElName);
96
+ this.updateModel(firstElName, 0, extensionPointList, enabled, hasDefaultContent);
97
+ }
98
+ try {
99
+ const {
100
+ fragments
101
+ } = await getFragments();
102
+ this.model.setProperty('/fragmentList', fragments);
103
+ } catch (e) {
104
+ this.handleError(e);
105
+ }
106
+ },
107
+ /**
108
+ * Updates the Select control according to provided values
109
+ *
110
+ * @param name Extension point name
111
+ * @param key Selected extension point key
112
+ * @param list All of the extension points that are under a view
113
+ * @param enabled Enables the select control
114
+ * @param hasDefaultContent Whether there is default content associated with the extension name
115
+ */
116
+ updateModel: function _updateModel(name, key, list, enabled, hasDefaultContent) {
117
+ this.model.setProperty('/extensionPointName', name);
118
+ this.model.setProperty('/extensionPointKey', key);
119
+ this.model.setProperty('/extensionPointList', list);
120
+ this.model.setProperty('/extensionListEnabled', enabled);
121
+ this.model.setProperty('/hasDefaultContent', hasDefaultContent);
122
+ },
123
+ /**
124
+ * Creates add xml at extension point changes
125
+ *
126
+ * @param fragmentName Fragment name
127
+ */
128
+ createExtensionPointFragmentChange: function _createExtensionPointFragmentChange(fragmentName) {
129
+ const extensionPointName = this.model.getProperty('/extensionPointName');
130
+ const modifiedValue = {
131
+ fragment: `<core:FragmentDefinition xmlns:core='sap.ui.core'></core:FragmentDefinition>`,
132
+ fragmentPath: `fragments/${fragmentName}.fragment.xml`,
133
+ extensionPointName
134
+ };
135
+ this.data.deferred.resolve(modifiedValue);
136
+ }
137
+ });
138
+ return ExtensionPoint;
139
139
  });
140
140
  //# sourceMappingURL=ExtensionPoint.controller.js.map
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/model/json/JSONModel", "./BaseDialog.controller", "../../i18n"], function (JSONModel, __BaseDialog, ____i18n) {
4
+ "use strict";
5
+
6
+ function _interopRequireDefault(obj) {
7
+ return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
8
+ }
9
+ const BaseDialog = _interopRequireDefault(__BaseDialog);
10
+ const getResourceModel = ____i18n["getResourceModel"];
11
+ /**
12
+ * @namespace open.ux.preview.client.adp.controllers
13
+ */
14
+ const FileExistsDialog = BaseDialog.extend("open.ux.preview.client.adp.controllers.FileExistsDialog", {
15
+ constructor: function _constructor(name, options) {
16
+ BaseDialog.prototype.constructor.call(this, name);
17
+ this.model = new JSONModel();
18
+ this.options = options;
19
+ },
20
+ /**
21
+ * Setups the Dialog and the JSON Model
22
+ *
23
+ * @param {Dialog} dialog - Dialog instance
24
+ */
25
+ setup: async function _setup(dialog) {
26
+ this.dialog = dialog;
27
+ this.model.setProperty('/filePath', this.options.filePath);
28
+ this.model.setProperty('/filePathFromRoot', this.options.fileName);
29
+ this.model.setProperty('/isRunningInBAS', this.options.isRunningInBAS);
30
+ this.buildDialogData();
31
+ const resourceModel = await getResourceModel();
32
+ this.dialog.setModel(this.model);
33
+ this.dialog.setModel(resourceModel, 'i18n');
34
+ this.dialog.open();
35
+ },
36
+ /**
37
+ * Handles create button press
38
+ *
39
+ * @param _event Event
40
+ */
41
+ onShowFileInVscodeBtn: function _onShowFileInVscodeBtn(_event) {
42
+ const annotationPath = this.model.getProperty('/filePath');
43
+ window.open(`vscode://file${annotationPath}`);
44
+ this.handleDialogClose();
45
+ },
46
+ handleDialogClose: function _handleDialogClose() {
47
+ this.dialog.close();
48
+ this.dialog.destroy();
49
+ },
50
+ /**
51
+ * Builds data that is used in the dialog.
52
+ */
53
+ buildDialogData: function _buildDialogData() {
54
+ const content = this.dialog.getContent();
55
+ const messageForm = content[0];
56
+ messageForm.setVisible(true);
57
+ const isRunningInBAS = this.model.getProperty('/isRunningInBAS');
58
+ if (isRunningInBAS) {
59
+ this.dialog.getBeginButton().setVisible(false);
60
+ }
61
+ },
62
+ /**
63
+ * Handles create button press
64
+ *
65
+ * @param _event Event
66
+ */
67
+ onCreateBtnPress: function _onCreateBtnPress(_event) {}
68
+ });
69
+ return FileExistsDialog;
70
+ });
71
+ //# sourceMappingURL=FileExistsDialog.controller.js.map
@@ -0,0 +1,92 @@
1
+ import JSONModel from 'sap/ui/model/json/JSONModel';
2
+ import type Dialog from 'sap/m/Dialog';
3
+
4
+ import type Event from 'sap/ui/base/Event';
5
+
6
+ import type SimpleForm from 'sap/ui/layout/form/SimpleForm';
7
+ import BaseDialog from './BaseDialog.controller';
8
+ import { getResourceModel } from '../../i18n';
9
+
10
+ export interface FileExistsDialogOptions {
11
+ title: string;
12
+ fileName: string;
13
+ filePath: string;
14
+ isRunningInBAS: boolean;
15
+ }
16
+
17
+ type FileExistModel = JSONModel & {
18
+ getProperty(sPath: '/filePath'): string;
19
+ getProperty(sPath: '/filePathFromRoot'): string;
20
+ getProperty(sPath: '/isRunningInBAS'): boolean;
21
+ };
22
+
23
+ /**
24
+ * @namespace open.ux.preview.client.adp.controllers
25
+ */
26
+ export default class FileExistsDialog extends BaseDialog<FileExistModel> {
27
+ private options: FileExistsDialogOptions;
28
+ public model: JSONModel;
29
+ private readonly _name: string;
30
+ constructor(name: string, options: FileExistsDialogOptions) {
31
+ super(name);
32
+ this.model = new JSONModel();
33
+ this.options = options;
34
+ }
35
+
36
+ /**
37
+ * Setups the Dialog and the JSON Model
38
+ *
39
+ * @param {Dialog} dialog - Dialog instance
40
+ */
41
+ async setup(dialog: Dialog): Promise<void> {
42
+ this.dialog = dialog;
43
+
44
+ this.model.setProperty('/filePath', this.options.filePath);
45
+ this.model.setProperty('/filePathFromRoot', this.options.fileName);
46
+ this.model.setProperty('/isRunningInBAS', this.options.isRunningInBAS);
47
+ this.buildDialogData();
48
+ const resourceModel = await getResourceModel();
49
+ this.dialog.setModel(this.model);
50
+ this.dialog.setModel(resourceModel, 'i18n');
51
+ this.dialog.open();
52
+ }
53
+
54
+ /**
55
+ * Handles create button press
56
+ *
57
+ * @param _event Event
58
+ */
59
+ onShowFileInVscodeBtn(_event: Event) {
60
+ const annotationPath = this.model.getProperty('/filePath');
61
+ window.open(`vscode://file${annotationPath}`);
62
+
63
+ this.handleDialogClose();
64
+ }
65
+
66
+ handleDialogClose() {
67
+ this.dialog.close();
68
+ this.dialog.destroy();
69
+ }
70
+
71
+ /**
72
+ * Builds data that is used in the dialog.
73
+ */
74
+ buildDialogData(): void {
75
+ const content = this.dialog.getContent();
76
+
77
+ const messageForm = content[0] as SimpleForm;
78
+ messageForm.setVisible(true);
79
+
80
+ const isRunningInBAS = this.model.getProperty('/isRunningInBAS');
81
+ if (isRunningInBAS) {
82
+ this.dialog.getBeginButton().setVisible(false);
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Handles create button press
88
+ *
89
+ * @param _event Event
90
+ */
91
+ onCreateBtnPress(_event: Event): Promise<void> | void {}
92
+ }