@sap-ux/preview-middleware 0.18.18 → 0.18.20

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/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/AddSubpage.controller.js +128 -0
  5. package/dist/client/adp/controllers/AddSubpage.controller.ts +195 -0
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +209 -209
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  9. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  10. package/dist/client/adp/dialog-factory.js +133 -125
  11. package/dist/client/adp/dialog-factory.ts +17 -3
  12. package/dist/client/adp/init-dialogs.js +107 -107
  13. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  14. package/dist/client/adp/quick-actions/common/add-new-subpage.js +140 -0
  15. package/dist/client/adp/quick-actions/common/add-new-subpage.ts +164 -0
  16. package/dist/client/adp/quick-actions/common/create-page-action.js +51 -51
  17. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  18. package/dist/client/adp/quick-actions/common/op-add-header-field.js +61 -61
  19. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  20. package/dist/client/adp/quick-actions/control-types.js +21 -21
  21. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  22. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  23. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  24. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +104 -104
  25. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  26. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  27. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  28. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  29. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  30. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  31. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  32. package/dist/client/adp/quick-actions/fe-v2/registry.js +76 -75
  33. package/dist/client/adp/quick-actions/fe-v2/registry.ts +7 -3
  34. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  35. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  36. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +50 -50
  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/enable-variant-management.js +81 -81
  39. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  40. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  41. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  42. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  43. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  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/AddSubpage.fragment.xml +73 -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/validator.js +39 -39
  51. package/dist/client/cpe/documentation.js +164 -164
  52. package/dist/client/cpe/feature-service.js +36 -36
  53. package/dist/client/cpe/logger.js +30 -30
  54. package/dist/client/cpe/outline/editable.js +37 -37
  55. package/dist/client/cpe/outline/nodes.js +222 -222
  56. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  57. package/dist/client/cpe/quick-actions/registry.js +143 -143
  58. package/dist/client/cpe/quick-actions/utils.js +92 -92
  59. package/dist/client/cpe/types.js +4 -4
  60. package/dist/client/cpe/ui5-utils.js +33 -33
  61. package/dist/client/cpe/utils.js +138 -138
  62. package/dist/client/flp/WorkspaceConnector.js +86 -86
  63. package/dist/client/flp/common.js +28 -28
  64. package/dist/client/flp/enableFakeConnector.js +83 -83
  65. package/dist/client/flp/initConnectors.js +28 -28
  66. package/dist/client/flp/initRta.js +178 -178
  67. package/dist/client/i18n.js +56 -56
  68. package/dist/client/messagebundle.properties +6 -0
  69. package/dist/client/utils/application.js +32 -32
  70. package/dist/client/utils/core.js +68 -68
  71. package/dist/client/utils/error.js +19 -19
  72. package/dist/client/utils/fe-v2.js +58 -0
  73. package/dist/client/utils/fe-v2.ts +63 -0
  74. package/dist/client/utils/fe-v4.js +141 -118
  75. package/dist/client/utils/fe-v4.ts +19 -0
  76. package/dist/client/utils/version.js +104 -104
  77. package/package.json +8 -8
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../../cpe/quick-actions/utils", "../../../utils/core", "../../../utils/application", "../../dialog-factory", "../fe-v2/utils", "../../../utils/fe-v2", "../../../utils/fe-v4", "../../../i18n", "../simple-quick-action-base", "../../../cpe/feature-service"], function (Component, OverlayRegistry, _____cpe_quick_actions_utils, _____utils_core, _____utils_application, ____dialog_factory, ___fe_v2_utils, _____utils_fe_v2, _____utils_fe_v4, _____i18n, ___simple_quick_action_base, _____cpe_feature_service) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const isA = _____utils_core["isA"];
9
+ const getApplicationType = _____utils_application["getApplicationType"];
10
+ const DialogFactory = ____dialog_factory["DialogFactory"];
11
+ const DialogNames = ____dialog_factory["DialogNames"];
12
+ const areManifestChangesSupported = ___fe_v2_utils["areManifestChangesSupported"];
13
+ const getV2ApplicationPages = _____utils_fe_v2["getV2ApplicationPages"];
14
+ const getV4ApplicationPages = _____utils_fe_v4["getV4ApplicationPages"];
15
+ const getTextBundle = _____i18n["getTextBundle"];
16
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
17
+ const FeatureService = _____cpe_feature_service["FeatureService"];
18
+ const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
19
+ const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
20
+
21
+ /**
22
+ * Quick Action for adding a custom page action.
23
+ */
24
+ class AddNewSubpage extends SimpleQuickActionDefinitionBase {
25
+ currentPageDescriptor = {
26
+ entitySet: '',
27
+ pageType: '',
28
+ navProperties: []
29
+ };
30
+ constructor(context) {
31
+ super(ADD_NEW_OBJECT_PAGE_ACTION, [], 'QUICK_ACTION_ADD_NEW_SUB_PAGE', context, [{
32
+ run: async () => {
33
+ const i18n = await getTextBundle();
34
+ if (this.currentPageDescriptor.navProperties.length === 0) {
35
+ return {
36
+ type: 'error',
37
+ message: i18n.getText('NO_SUB_PAGES_TO_ADD')
38
+ };
39
+ }
40
+ return undefined;
41
+ }
42
+ }]);
43
+ }
44
+ getApplicationPages() {
45
+ if (this.appType === 'fe-v2') {
46
+ return getV2ApplicationPages(this.context.manifest);
47
+ } else if (this.appType === 'fe-v4') {
48
+ return getV4ApplicationPages(this.context.manifest);
49
+ }
50
+ return [];
51
+ }
52
+ prepareNavigationData(entityType, metaModel) {
53
+ const existingPages = this.getApplicationPages();
54
+ if (this.currentPageDescriptor.pageType === 'sap.suite.ui.generic.template.ObjectPage') {
55
+ // Navigation from Object Page
56
+ for (const navProp of entityType?.navigationProperty || []) {
57
+ const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
58
+ if (associationEnd?.multiplicity !== '*') {
59
+ continue;
60
+ }
61
+ const entityContainer = metaModel.getODataEntityContainer();
62
+ if (!entityContainer?.entitySet?.length) {
63
+ continue;
64
+ }
65
+ const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
66
+ const pageExists = existingPages.some(page => page.entitySet === targetEntitySet?.name);
67
+ if (targetEntitySet && !pageExists) {
68
+ this.currentPageDescriptor.navProperties.push({
69
+ entitySet: targetEntitySet.name,
70
+ navProperty: navProp.name
71
+ });
72
+ }
73
+ }
74
+ return;
75
+ }
76
+
77
+ // navigation from LR or ALP (only OP based on current entitySet is possible)
78
+ const pageExists = existingPages.some(page => page.entitySet === this.currentPageDescriptor.entitySet);
79
+ if (!pageExists) {
80
+ this.currentPageDescriptor.navProperties.push({
81
+ entitySet: this.currentPageDescriptor.entitySet,
82
+ navProperty: this.currentPageDescriptor.entitySet
83
+ });
84
+ }
85
+ }
86
+ async initialize() {
87
+ if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
88
+ return Promise.resolve();
89
+ }
90
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
91
+ return Promise.resolve();
92
+ }
93
+ this.appType = getApplicationType(this.context.manifest);
94
+ const allControls = CONTROL_TYPES.flatMap(item => this.context.controlIndex[item] ?? []);
95
+ const control = allControls.find(c => pageHasControlId(this.context.view, c.controlId));
96
+ const pageType = this.context.view.getViewName().split('.view.')[0];
97
+ this.currentPageDescriptor.pageType = pageType;
98
+ const metaModel = this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
99
+ if (!metaModel || !control) {
100
+ return Promise.resolve();
101
+ }
102
+ const modifiedControl = getControlById(control.controlId);
103
+ if (!modifiedControl) {
104
+ return Promise.resolve();
105
+ }
106
+ const component = Component.getOwnerComponentFor(modifiedControl);
107
+ if (!isA('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
108
+ return Promise.reject(new Error('Unexpected type of page owner component'));
109
+ }
110
+ const entitySetName = component.getEntitySet();
111
+ if (!entitySetName) {
112
+ return Promise.resolve();
113
+ }
114
+ this.currentPageDescriptor.entitySet = entitySetName;
115
+ const entitySet = metaModel.getODataEntitySet(entitySetName);
116
+ const entityType = metaModel.getODataEntityType(entitySet.entityType);
117
+ this.prepareNavigationData(entityType, metaModel);
118
+ this.control = modifiedControl;
119
+ return Promise.resolve();
120
+ }
121
+ async execute() {
122
+ const overlay = OverlayRegistry.getOverlay(this.control);
123
+ const appReference = this.context.flexSettings.projectId;
124
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_SUBPAGE, undefined, {
125
+ appType: this.appType,
126
+ appReference,
127
+ title: 'ADD_SUB_PAGE_DIALOG_TITLE',
128
+ pageDescriptor: this.currentPageDescriptor
129
+ });
130
+ return [];
131
+ }
132
+ }
133
+ var __exports = {
134
+ __esModule: true
135
+ };
136
+ __exports.ADD_NEW_OBJECT_PAGE_ACTION = ADD_NEW_OBJECT_PAGE_ACTION;
137
+ __exports.AddNewSubpage = AddNewSubpage;
138
+ return __exports;
139
+ });
140
+ //# sourceMappingURL=add-new-subpage.js.map
@@ -0,0 +1,164 @@
1
+ import Component from 'sap/ui/core/Component';
2
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
3
+ import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
4
+ import ODataModel from 'sap/ui/model/odata/v2/ODataModel';
5
+ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
6
+ import TemplateComponent from 'sap/suite/ui/generic/template/lib/TemplateComponent';
7
+
8
+ import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
9
+ import { pageHasControlId } from '../../../cpe/quick-actions/utils';
10
+ import { getControlById, isA } from '../../../utils/core';
11
+ import ODataMetaModel, { EntityContainer, EntitySet, EntityType } from 'sap/ui/model/odata/ODataMetaModel';
12
+ import { ApplicationType, getApplicationType } from '../../../utils/application';
13
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
14
+ import { areManifestChangesSupported } from '../fe-v2/utils';
15
+ import { getV2ApplicationPages } from '../../../utils/fe-v2';
16
+ import { getV4ApplicationPages } from '../../../utils/fe-v4';
17
+ import { EnablementValidatorResult } from '../enablement-validator';
18
+ import { getTextBundle } from '../../../i18n';
19
+ import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
20
+ import { FeatureService } from '../../../cpe/feature-service';
21
+
22
+ export const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
23
+ const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
24
+
25
+ /**
26
+ * Quick Action for adding a custom page action.
27
+ */
28
+ export class AddNewSubpage extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition {
29
+ private readonly currentPageDescriptor: {
30
+ pageType: string;
31
+ entitySet: string;
32
+ navProperties: { navProperty: string; entitySet: string }[]; // only navProperty with 1:n relationship and the entitySet
33
+ } = {
34
+ entitySet: '',
35
+ pageType: '',
36
+ navProperties: []
37
+ };
38
+
39
+ private appType: ApplicationType;
40
+
41
+ constructor(context: QuickActionContext) {
42
+ super(ADD_NEW_OBJECT_PAGE_ACTION, [], 'QUICK_ACTION_ADD_NEW_SUB_PAGE', context, [
43
+ {
44
+ run: async (): Promise<EnablementValidatorResult> => {
45
+ const i18n = await getTextBundle();
46
+ if (this.currentPageDescriptor.navProperties.length === 0) {
47
+ return {
48
+ type: 'error',
49
+ message: i18n.getText('NO_SUB_PAGES_TO_ADD')
50
+ };
51
+ }
52
+ return undefined;
53
+ }
54
+ }
55
+ ]);
56
+ }
57
+
58
+ private getApplicationPages() {
59
+ if (this.appType === 'fe-v2') {
60
+ return getV2ApplicationPages(this.context.manifest);
61
+ } else if (this.appType === 'fe-v4') {
62
+ return getV4ApplicationPages(this.context.manifest);
63
+ }
64
+ return [];
65
+ }
66
+
67
+ private prepareNavigationData(entityType: EntityType, metaModel: ODataMetaModel): void {
68
+ const existingPages = this.getApplicationPages();
69
+ if (this.currentPageDescriptor.pageType === 'sap.suite.ui.generic.template.ObjectPage') {
70
+ // Navigation from Object Page
71
+ for (const navProp of entityType?.navigationProperty || []) {
72
+ const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
73
+ if (associationEnd?.multiplicity !== '*') {
74
+ continue;
75
+ }
76
+ const entityContainer = metaModel.getODataEntityContainer() as EntityContainer;
77
+ if (!entityContainer?.entitySet?.length) {
78
+ continue;
79
+ }
80
+ const targetEntitySet = entityContainer.entitySet.find(
81
+ (item) => item.entityType === associationEnd.type
82
+ );
83
+ const pageExists = existingPages.some((page) => page.entitySet === targetEntitySet?.name);
84
+ if (targetEntitySet && !pageExists) {
85
+ this.currentPageDescriptor.navProperties.push({
86
+ entitySet: targetEntitySet.name,
87
+ navProperty: navProp.name
88
+ });
89
+ }
90
+ }
91
+ return;
92
+ }
93
+
94
+ // navigation from LR or ALP (only OP based on current entitySet is possible)
95
+ const pageExists = existingPages.some((page) => page.entitySet === this.currentPageDescriptor.entitySet);
96
+ if (!pageExists) {
97
+ this.currentPageDescriptor.navProperties.push({
98
+ entitySet: this.currentPageDescriptor.entitySet,
99
+ navProperty: this.currentPageDescriptor.entitySet
100
+ });
101
+ }
102
+ }
103
+
104
+ async initialize(): Promise<void> {
105
+ if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
106
+ return Promise.resolve();
107
+ }
108
+
109
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
110
+ return Promise.resolve();
111
+ }
112
+
113
+ this.appType = getApplicationType(this.context.manifest);
114
+
115
+ const allControls = CONTROL_TYPES.flatMap((item) => this.context.controlIndex[item] ?? []);
116
+ const control = allControls.find((c) => pageHasControlId(this.context.view, c.controlId));
117
+
118
+ const pageType = this.context.view.getViewName().split('.view.')[0];
119
+ this.currentPageDescriptor.pageType = pageType;
120
+
121
+ const metaModel = (this.context.rta.getRootControlInstance().getModel() as ODataModel)?.getMetaModel();
122
+ if (!metaModel || !control) {
123
+ return Promise.resolve();
124
+ }
125
+
126
+ const modifiedControl = getControlById<ObjectPageLayout>(control.controlId);
127
+ if (!modifiedControl) {
128
+ return Promise.resolve();
129
+ }
130
+
131
+ const component = Component.getOwnerComponentFor(modifiedControl);
132
+ if (!isA<TemplateComponent>('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
133
+ return Promise.reject(new Error('Unexpected type of page owner component'));
134
+ }
135
+
136
+ const entitySetName = component.getEntitySet();
137
+ if (!entitySetName) {
138
+ return Promise.resolve();
139
+ }
140
+
141
+ this.currentPageDescriptor.entitySet = entitySetName;
142
+
143
+ const entitySet = metaModel.getODataEntitySet(entitySetName) as EntitySet;
144
+ const entityType = metaModel.getODataEntityType(entitySet.entityType) as EntityType;
145
+
146
+ this.prepareNavigationData(entityType, metaModel);
147
+
148
+ this.control = modifiedControl;
149
+
150
+ return Promise.resolve();
151
+ }
152
+
153
+ async execute(): Promise<FlexCommand[]> {
154
+ const overlay = OverlayRegistry.getOverlay(this.control!);
155
+ const appReference = this.context.flexSettings.projectId;
156
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_SUBPAGE, undefined, {
157
+ appType: this.appType,
158
+ appReference,
159
+ title: 'ADD_SUB_PAGE_DIALOG_TITLE',
160
+ pageDescriptor: this.currentPageDescriptor
161
+ });
162
+ return [];
163
+ }
164
+ }
@@ -1,53 +1,53 @@
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
- this.appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
23
- }
24
- async initialize() {
25
- const version = await getUi5Version();
26
- if (this.appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, {
27
- major: 1,
28
- minor: 130
29
- })) {
30
- return;
31
- }
32
- await 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
- defaultAggregationArrayIndex: 1
41
- });
42
- }
43
- return [];
44
- }
45
- }
46
- var __exports = {
47
- __esModule: true
48
- };
49
- __exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
50
- __exports.AddPageActionQuickAction = AddPageActionQuickAction;
51
- 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
+ this.appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
23
+ }
24
+ async initialize() {
25
+ const version = await getUi5Version();
26
+ if (this.appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, {
27
+ major: 1,
28
+ minor: 130
29
+ })) {
30
+ return;
31
+ }
32
+ await 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
+ defaultAggregationArrayIndex: 1
41
+ });
42
+ }
43
+ return [];
44
+ }
45
+ }
46
+ var __exports = {
47
+ __esModule: true
48
+ };
49
+ __exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
50
+ __exports.AddPageActionQuickAction = AddPageActionQuickAction;
51
+ return __exports;
52
52
  });
53
53
  //# 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,63 +1,63 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator", "../../../i18n"], function (OverlayRegistry, ____dialog_factory, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator, _____i18n) {
4
- "use strict";
5
-
6
- const DialogFactory = ____dialog_factory["DialogFactory"];
7
- const DialogNames = ____dialog_factory["DialogNames"];
8
- const isA = _____utils_core["isA"];
9
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
11
- const getTextBundle = _____i18n["getTextBundle"];
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
- run: async () => {
22
- const i18n = await getTextBundle();
23
- if (!this.control?.getShowHeaderContent()) {
24
- return {
25
- type: 'error',
26
- message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
27
- };
28
- }
29
- return undefined;
30
- }
31
- }]);
32
- }
33
- async execute() {
34
- if (!this.control) {
35
- return [];
36
- }
37
- const headerContent = this.control.getHeaderContent();
38
-
39
- // check if only flex box exist in the headerContent.
40
- if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
41
- const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
42
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
43
- aggregation: 'items',
44
- title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
45
- });
46
- } else if (this.control) {
47
- const overlay = OverlayRegistry.getOverlay(this.control) || [];
48
- await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
49
- aggregation: 'headerContent',
50
- title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
51
- });
52
- }
53
- return [];
54
- }
55
- }
56
- var __exports = {
57
- __esModule: true
58
- };
59
- __exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
60
- __exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
61
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator", "../../../i18n"], function (OverlayRegistry, ____dialog_factory, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator, _____i18n) {
4
+ "use strict";
5
+
6
+ const DialogFactory = ____dialog_factory["DialogFactory"];
7
+ const DialogNames = ____dialog_factory["DialogNames"];
8
+ const isA = _____utils_core["isA"];
9
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
11
+ const getTextBundle = _____i18n["getTextBundle"];
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
+ run: async () => {
22
+ const i18n = await getTextBundle();
23
+ if (!this.control?.getShowHeaderContent()) {
24
+ return {
25
+ type: 'error',
26
+ message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
27
+ };
28
+ }
29
+ return undefined;
30
+ }
31
+ }]);
32
+ }
33
+ async execute() {
34
+ if (!this.control) {
35
+ return [];
36
+ }
37
+ const headerContent = this.control.getHeaderContent();
38
+
39
+ // check if only flex box exist in the headerContent.
40
+ if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
41
+ const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
42
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
43
+ aggregation: 'items',
44
+ title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
45
+ });
46
+ } else if (this.control) {
47
+ const overlay = OverlayRegistry.getOverlay(this.control) || [];
48
+ await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
49
+ aggregation: 'headerContent',
50
+ title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
51
+ });
52
+ }
53
+ return [];
54
+ }
55
+ }
56
+ var __exports = {
57
+ __esModule: true
58
+ };
59
+ __exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
60
+ __exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
61
+ return __exports;
62
62
  });
63
63
  //# 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