@sap-ux/preview-middleware 0.16.161 → 0.16.163

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 (78) 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/tsconfig.tsbuildinfo +1 -0
  73. package/dist/client/utils/application.js +32 -32
  74. package/dist/client/utils/core.js +68 -68
  75. package/dist/client/utils/error.js +19 -19
  76. package/dist/client/utils/fe-v4.js +118 -118
  77. package/dist/client/utils/version.js +102 -102
  78. package/package.json +4 -4
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+ sap.ui.define([
3
+ '../../api-handler',
4
+ 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
5
+ '../../dialog-factory',
6
+ 'sap/ui/dt/OverlayRegistry',
7
+ '../quick-action-base',
8
+ '../dialog-enablement-validator',
9
+ 'sap/ui/rta/command/CommandFactory',
10
+ '../../../utils/version'
11
+ ], function (____api_handler, ___sap_ux_private_control_property_editor_common, ____dialog_factory, OverlayRegistry, ___quick_action_base, ___dialog_enablement_validator, CommandFactory, _____utils_version) {
12
+ 'use strict';
13
+ const getDataSourceAnnotationFileMap = ____api_handler['getDataSourceAnnotationFileMap'];
14
+ const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
15
+ const DialogFactory = ____dialog_factory['DialogFactory'];
16
+ const DialogNames = ____dialog_factory['DialogNames'];
17
+ const QuickActionDefinitionBase = ___quick_action_base['QuickActionDefinitionBase'];
18
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator['DIALOG_ENABLEMENT_VALIDATOR'];
19
+ const getUi5Version = _____utils_version['getUi5Version'];
20
+ const isLowerThanMinimalUi5Version = _____utils_version['isLowerThanMinimalUi5Version'];
21
+ const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
22
+ class AddNewAnnotationFile extends QuickActionDefinitionBase {
23
+ children = [];
24
+ kind = NESTED_QUICK_ACTION_KIND;
25
+ type = ADD_NEW_ANNOTATION_FILE;
26
+ forceRefreshAfterExecution = true;
27
+ isApplicable = true;
28
+ get id() {
29
+ return `${ this.context.key }-${ this.type }`;
30
+ }
31
+ constructor(context) {
32
+ super(ADD_NEW_ANNOTATION_FILE, NESTED_QUICK_ACTION_KIND, 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE', context, [DIALOG_ENABLEMENT_VALIDATOR]);
33
+ this.context = context;
34
+ }
35
+ async initialize() {
36
+ const version = await getUi5Version();
37
+ if (isLowerThanMinimalUi5Version(version, {
38
+ major: 1,
39
+ minor: 132,
40
+ patch: 0
41
+ })) {
42
+ this.isApplicable = false;
43
+ return;
44
+ }
45
+ const dataSourceAnnotationFileMap = await getDataSourceAnnotationFileMap();
46
+ if (!dataSourceAnnotationFileMap) {
47
+ throw new Error('No data sources found in the manifest');
48
+ }
49
+ for (const key in dataSourceAnnotationFileMap) {
50
+ if (Object.prototype.hasOwnProperty.call(dataSourceAnnotationFileMap, key)) {
51
+ const source = dataSourceAnnotationFileMap[key];
52
+ this.children.push({
53
+ enabled: true,
54
+ label: source.annotationDetails.annotationExistsInWS ? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key]) : this.context.resourceBundle.getText('ODATA_SOURCE', [key]),
55
+ children: []
56
+ });
57
+ }
58
+ }
59
+ }
60
+ async execute(path) {
61
+ const index = Number(path);
62
+ if (index >= 0) {
63
+ const dataSourceAnnotationFileMap = await getDataSourceAnnotationFileMap();
64
+ const dataSourceId = Object.keys(dataSourceAnnotationFileMap)[index];
65
+ const dataSource = dataSourceAnnotationFileMap?.[dataSourceId];
66
+ if (dataSource?.annotationDetails.annotationExistsInWS) {
67
+ const annotationFileDetails = dataSource.annotationDetails;
68
+ const {annotationPath, annotationPathFromRoot} = annotationFileDetails;
69
+ await DialogFactory.createDialog(OverlayRegistry.getOverlay(this.context.view), this.context.rta, DialogNames.FILE_EXISTS, undefined, {
70
+ fileName: annotationPathFromRoot,
71
+ filePath: annotationPath,
72
+ isRunningInBAS: dataSource.isRunningInBAS
73
+ });
74
+ } else if (dataSource) {
75
+ const timestamp = Date.now();
76
+ const annotationFileNameWithoutExtension = `annotation_${ timestamp }`;
77
+ const annotationFileName = `${ annotationFileNameWithoutExtension }.xml`;
78
+ const annotationNameSpace = this.context.flexSettings.layer === 'CUSTOMER_BASE' ? `customer.annotation.${ annotationFileNameWithoutExtension }` : `annotation.${ annotationFileNameWithoutExtension }`;
79
+ const content = {
80
+ dataSourceId: dataSourceId,
81
+ annotations: [annotationNameSpace],
82
+ annotationsInsertPosition: 'END',
83
+ dataSource: {
84
+ [annotationNameSpace]: {
85
+ uri: `../annotations/${ annotationFileName }`,
86
+ type: 'ODataAnnotation'
87
+ }
88
+ }
89
+ };
90
+ const modifiedValue = {
91
+ changeType: 'appdescr_app_addAnnotationsToOData',
92
+ generator: this.context.flexSettings.generator,
93
+ reference: this.context.flexSettings.projectId,
94
+ fileName: `id_${ timestamp }_addAnnotationsToOData`,
95
+ content: content,
96
+ serviceUrl: dataSource.serviceUrl
97
+ };
98
+ const command = await CommandFactory.getCommandFor(this.context.view, 'annotation', modifiedValue, null, this.context.flexSettings);
99
+ return [command];
100
+ }
101
+ }
102
+ return [];
103
+ }
104
+ getActionObject() {
105
+ return {
106
+ kind: NESTED_QUICK_ACTION_KIND,
107
+ id: this.id,
108
+ enabled: this.isApplicable,
109
+ title: this.context.resourceBundle.getText('QUICK_ACTION_ADD_NEW_ANNOTATION_FILE'),
110
+ children: this.children
111
+ };
112
+ }
113
+ }
114
+ var __exports = { __esModule: true };
115
+ __exports.ADD_NEW_ANNOTATION_FILE = ADD_NEW_ANNOTATION_FILE;
116
+ __exports.AddNewAnnotationFile = AddNewAnnotationFile;
117
+ return __exports;
118
+ });
@@ -0,0 +1,141 @@
1
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+
3
+ import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
4
+ import { getDataSourceAnnotationFileMap } from '../../api-handler';
5
+ import {
6
+ NESTED_QUICK_ACTION_KIND,
7
+ NestedQuickAction,
8
+ NestedQuickActionChild
9
+ } from '@sap-ux-private/control-property-editor-common';
10
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
11
+ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
12
+ import { QuickActionDefinitionBase } from '../quick-action-base';
13
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
14
+ import CommandFactory from 'sap/ui/rta/command/CommandFactory';
15
+ import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
16
+
17
+ export const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
18
+
19
+ /**
20
+ * Add New Annotation File.
21
+ */
22
+ export class AddNewAnnotationFile
23
+ extends QuickActionDefinitionBase<typeof NESTED_QUICK_ACTION_KIND>
24
+ implements NestedQuickActionDefinition
25
+ {
26
+ public children: NestedQuickActionChild[] = [];
27
+ readonly kind = NESTED_QUICK_ACTION_KIND;
28
+ readonly type = ADD_NEW_ANNOTATION_FILE;
29
+ readonly forceRefreshAfterExecution = true;
30
+ public isApplicable = true;
31
+ public get id(): string {
32
+ return `${this.context.key}-${this.type}`;
33
+ }
34
+ constructor(protected readonly context: QuickActionContext) {
35
+ super(ADD_NEW_ANNOTATION_FILE, NESTED_QUICK_ACTION_KIND, 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE', context, [
36
+ DIALOG_ENABLEMENT_VALIDATOR
37
+ ]);
38
+ }
39
+
40
+ async initialize(): Promise<void> {
41
+ const version = await getUi5Version();
42
+ if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 132, patch: 0 })) {
43
+ this.isApplicable = false;
44
+ return;
45
+ }
46
+ const dataSourceAnnotationFileMap = await getDataSourceAnnotationFileMap();
47
+ if (!dataSourceAnnotationFileMap) {
48
+ throw new Error('No data sources found in the manifest');
49
+ }
50
+ for (const key in dataSourceAnnotationFileMap) {
51
+ if (Object.prototype.hasOwnProperty.call(dataSourceAnnotationFileMap, key)) {
52
+ const source = dataSourceAnnotationFileMap[key];
53
+ this.children.push({
54
+ enabled: true,
55
+ label: source.annotationDetails.annotationExistsInWS
56
+ ? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key])
57
+ : this.context.resourceBundle.getText('ODATA_SOURCE', [key]),
58
+ children: []
59
+ });
60
+ }
61
+ }
62
+ }
63
+ async execute(path: string): Promise<FlexCommand[]> {
64
+ const index = Number(path);
65
+ if (index >= 0) {
66
+ // Do not cache the result of getDataSourceAnnotationFileMap api,
67
+ // as annotation file or datasource can be added outside using create command.
68
+ // So refresh would be required for the cache to be updated.
69
+ const dataSourceAnnotationFileMap = await getDataSourceAnnotationFileMap();
70
+ const dataSourceId = Object.keys(dataSourceAnnotationFileMap)[index];
71
+ const dataSource = dataSourceAnnotationFileMap?.[dataSourceId];
72
+ if (dataSource?.annotationDetails.annotationExistsInWS) {
73
+ const annotationFileDetails = dataSource.annotationDetails;
74
+ const { annotationPath, annotationPathFromRoot } = annotationFileDetails;
75
+ await DialogFactory.createDialog(
76
+ OverlayRegistry.getOverlay(this.context.view), // this passed only because, for method param is required.
77
+ this.context.rta, // same as above
78
+ DialogNames.FILE_EXISTS,
79
+ undefined,
80
+ {
81
+ fileName: annotationPathFromRoot,
82
+ filePath: annotationPath,
83
+ isRunningInBAS: dataSource.isRunningInBAS
84
+ }
85
+ );
86
+ }
87
+ // Create annotation file only, if no file exists already for datasource id or if the change file exist and but no annotation file exists in file system.
88
+ else if (dataSource) {
89
+ const timestamp = Date.now();
90
+ const annotationFileNameWithoutExtension = `annotation_${timestamp}`;
91
+ const annotationFileName = `${annotationFileNameWithoutExtension}.xml`;
92
+ const annotationNameSpace =
93
+ this.context.flexSettings.layer === 'CUSTOMER_BASE'
94
+ ? `customer.annotation.${annotationFileNameWithoutExtension}`
95
+ : `annotation.${annotationFileNameWithoutExtension}`;
96
+ const content = {
97
+ dataSourceId: dataSourceId,
98
+ annotations: [annotationNameSpace],
99
+ annotationsInsertPosition: 'END',
100
+ dataSource: {
101
+ [annotationNameSpace]: {
102
+ uri: `../annotations/${annotationFileName}`,
103
+ type: 'ODataAnnotation'
104
+ }
105
+ }
106
+ };
107
+ const modifiedValue = {
108
+ changeType: 'appdescr_app_addAnnotationsToOData',
109
+ generator: this.context.flexSettings.generator,
110
+ reference: this.context.flexSettings.projectId,
111
+ fileName: `id_${timestamp}_addAnnotationsToOData`,
112
+ content: content,
113
+ serviceUrl: dataSource.serviceUrl
114
+ };
115
+ const command = await CommandFactory.getCommandFor<FlexCommand>(
116
+ this.context.view,
117
+ 'annotation',
118
+ modifiedValue,
119
+ null,
120
+ this.context.flexSettings
121
+ );
122
+ return [command];
123
+ }
124
+ }
125
+ return [];
126
+ }
127
+
128
+ /**
129
+ * Prepares nested quick action object
130
+ * @returns action instance
131
+ */
132
+ getActionObject(): NestedQuickAction {
133
+ return {
134
+ kind: NESTED_QUICK_ACTION_KIND,
135
+ id: this.id,
136
+ enabled: this.isApplicable,
137
+ title: this.context.resourceBundle.getText('QUICK_ACTION_ADD_NEW_ANNOTATION_FILE'),
138
+ children: this.children
139
+ };
140
+ }
141
+ }
@@ -1,52 +1,52 @@
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;
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;
51
51
  });
52
52
  //# 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
@@ -1,50 +1,50 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, _____utils_core, ___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 isA = _____utils_core["isA"];
10
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
11
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
12
- const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
13
- const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
14
-
15
- /**
16
- * Quick Action for adding a Header Field to an Object Page.
17
- */
18
- class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
19
- constructor(context) {
20
- super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR]);
21
- }
22
- async execute() {
23
- const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
24
- const headerContent = objectPageLayout.getHeaderContent();
25
-
26
- // check if only flex box exist in the headerContent.
27
- if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
28
- const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
29
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
30
- aggregation: 'items',
31
- title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
32
- });
33
- } else if (this.control) {
34
- const overlay = OverlayRegistry.getOverlay(this.control) || [];
35
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
36
- aggregation: 'headerContent',
37
- title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
38
- });
39
- }
40
- return [];
41
- }
42
- }
43
- var __exports = {
44
- __esModule: true
45
- };
46
- __exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
47
- __exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
48
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, _____utils_core, ___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 isA = _____utils_core["isA"];
10
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
11
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
12
+ const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
13
+ const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
14
+
15
+ /**
16
+ * Quick Action for adding a Header Field to an Object Page.
17
+ */
18
+ class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
19
+ constructor(context) {
20
+ super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR]);
21
+ }
22
+ async execute() {
23
+ const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
24
+ const headerContent = objectPageLayout.getHeaderContent();
25
+
26
+ // check if only flex box exist in the headerContent.
27
+ if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
28
+ const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
29
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
30
+ aggregation: 'items',
31
+ title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
32
+ });
33
+ } else if (this.control) {
34
+ const overlay = OverlayRegistry.getOverlay(this.control) || [];
35
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
36
+ aggregation: 'headerContent',
37
+ title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
38
+ });
39
+ }
40
+ return [];
41
+ }
42
+ }
43
+ var __exports = {
44
+ __esModule: true
45
+ };
46
+ __exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
47
+ __exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
48
+ return __exports;
49
49
  });
50
50
  //# sourceMappingURL=op-add-header-field.js.map
@@ -1,20 +1,20 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- function getTooltipsForTableEmptyRowModeAction(resourceBundle) {
7
- const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED');
8
- const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED');
9
- return {
10
- alreadyEnabledTooltip,
11
- unsupportedCreationRowsTooltip
12
- };
13
- }
14
- var __exports = {
15
- __esModule: true
16
- };
17
- __exports.getTooltipsForTableEmptyRowModeAction = getTooltipsForTableEmptyRowModeAction;
18
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ function getTooltipsForTableEmptyRowModeAction(resourceBundle) {
7
+ const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED');
8
+ const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED');
9
+ return {
10
+ alreadyEnabledTooltip,
11
+ unsupportedCreationRowsTooltip
12
+ };
13
+ }
14
+ var __exports = {
15
+ __esModule: true
16
+ };
17
+ __exports.getTooltipsForTableEmptyRowModeAction = getTooltipsForTableEmptyRowModeAction;
18
+ return __exports;
19
19
  });
20
20
  //# sourceMappingURL=utils.js.map
@@ -1,23 +1,23 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
7
- const M_TABLE_TYPE = 'sap.m.Table';
8
- const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
9
- const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
10
- const GRID_TABLE_TYPE = 'sap.ui.table.Table';
11
- const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
12
- var __exports = {
13
- __esModule: true
14
- };
15
- __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
16
- __exports.M_TABLE_TYPE = M_TABLE_TYPE;
17
- __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
18
- __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
19
- __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
20
- __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
21
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
7
+ const M_TABLE_TYPE = 'sap.m.Table';
8
+ const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
9
+ const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
10
+ const GRID_TABLE_TYPE = 'sap.ui.table.Table';
11
+ const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
12
+ var __exports = {
13
+ __esModule: true
14
+ };
15
+ __exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
16
+ __exports.M_TABLE_TYPE = M_TABLE_TYPE;
17
+ __exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
18
+ __exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
19
+ __exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
20
+ __exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
21
+ return __exports;
22
22
  });
23
23
  //# sourceMappingURL=control-types.js.map