@sap-ux/preview-middleware 0.16.150 → 0.16.152

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 (54) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  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/BaseDialog.controller.js +187 -187
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  7. package/dist/client/adp/init-dialogs.js +157 -157
  8. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +54 -54
  9. package/dist/client/adp/quick-actions/common/create-page-action.js +49 -49
  10. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +35 -35
  11. package/dist/client/adp/quick-actions/common/op-add-header-field.js +47 -47
  12. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +100 -100
  13. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +69 -69
  14. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +95 -95
  15. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +56 -56
  16. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +67 -67
  17. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  18. package/dist/client/adp/quick-actions/fe-v2/registry.js +71 -71
  19. package/dist/client/adp/quick-actions/fe-v2/utils.js +86 -86
  20. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +47 -47
  21. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +45 -45
  22. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +45 -45
  23. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  24. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  25. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  26. package/dist/client/adp/quick-actions/fe-v4/registry.js +55 -55
  27. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  28. package/dist/client/adp/quick-actions/load.js +44 -44
  29. package/dist/client/adp/utils.js +160 -160
  30. package/dist/client/cpe/changes/index.js +10 -10
  31. package/dist/client/cpe/changes/validator.js +34 -34
  32. package/dist/client/cpe/documentation.js +164 -164
  33. package/dist/client/cpe/feature-service.js +36 -36
  34. package/dist/client/cpe/logger.js +30 -30
  35. package/dist/client/cpe/outline/editable.js +37 -37
  36. package/dist/client/cpe/outline/nodes.js +217 -217
  37. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  38. package/dist/client/cpe/quick-actions/registry.js +143 -143
  39. package/dist/client/cpe/quick-actions/utils.js +92 -92
  40. package/dist/client/cpe/types.js +4 -4
  41. package/dist/client/cpe/ui5-utils.js +33 -33
  42. package/dist/client/cpe/utils.js +138 -138
  43. package/dist/client/flp/WorkspaceConnector.js +86 -86
  44. package/dist/client/flp/common.js +28 -28
  45. package/dist/client/flp/enableFakeConnector.js +83 -83
  46. package/dist/client/flp/initConnectors.js +30 -30
  47. package/dist/client/flp/initRta.js +178 -178
  48. package/dist/client/i18n.js +56 -56
  49. package/dist/client/utils/application.js +32 -32
  50. package/dist/client/utils/core.js +68 -68
  51. package/dist/client/utils/error.js +19 -19
  52. package/dist/client/utils/fe-v4.js +114 -114
  53. package/dist/client/utils/version.js +102 -102
  54. package/package.json +6 -6
@@ -1,59 +1,59 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base) {
4
- "use strict";
5
-
6
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
- const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
10
- const PROPERTY_NAME = 'showClearOnFB';
11
- const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
-
13
- /**
14
- * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
15
- */
16
- class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
17
- constructor(context) {
18
- super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
19
- }
20
- isClearButtonEnabled = false;
21
- initialize() {
22
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
23
- for (const control of controls) {
24
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
25
- const modifiedControl = getControlById(control.controlId);
26
- if (isActionApplicable && modifiedControl) {
27
- this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
28
- this.control = modifiedControl;
29
- }
30
- }
31
- }
32
- get textKey() {
33
- return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
34
- }
35
- async execute() {
36
- if (this.control) {
37
- const {
38
- flexSettings
39
- } = this.context;
40
- const modifiedValue = {
41
- generator: flexSettings.generator,
42
- propertyName: PROPERTY_NAME,
43
- newValue: !this.isClearButtonEnabled
44
- };
45
- const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
46
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
47
- return [command];
48
- }
49
- return [];
50
- }
51
- }
52
- var __exports = {
53
- __esModule: true
54
- };
55
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
56
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
57
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
+ const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
10
+ const PROPERTY_NAME = 'showClearOnFB';
11
+ const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
+
13
+ /**
14
+ * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
15
+ */
16
+ class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
17
+ constructor(context) {
18
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
19
+ }
20
+ isClearButtonEnabled = false;
21
+ initialize() {
22
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
23
+ for (const control of controls) {
24
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
25
+ const modifiedControl = getControlById(control.controlId);
26
+ if (isActionApplicable && modifiedControl) {
27
+ this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
28
+ this.control = modifiedControl;
29
+ }
30
+ }
31
+ }
32
+ get textKey() {
33
+ return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
34
+ }
35
+ async execute() {
36
+ if (this.control) {
37
+ const {
38
+ flexSettings
39
+ } = this.context;
40
+ const modifiedValue = {
41
+ generator: flexSettings.generator,
42
+ propertyName: PROPERTY_NAME,
43
+ newValue: !this.isClearButtonEnabled
44
+ };
45
+ const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
46
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
47
+ return [command];
48
+ }
49
+ return [];
50
+ }
51
+ }
52
+ var __exports = {
53
+ __esModule: true
54
+ };
55
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
56
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
57
+ return __exports;
58
58
  });
59
59
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
@@ -1,73 +1,73 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "./create-table-custom-column", "../common/create-page-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___create_table_custom_column, ___common_create_page_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar) {
4
- "use strict";
5
-
6
- const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
7
- const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
8
- const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
9
- const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
10
- const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
11
- const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
12
- const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
13
- const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
14
- const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
15
- const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
16
- const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
17
- const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
18
- const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
19
- const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
20
- /**
21
- * Quick Action provider for SAP Fiori Elements V2 applications.
22
- */
23
- class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
24
- PAGE_NAME_MAP = {
25
- [LIST_REPORT_TYPE]: 'listReport',
26
- [OBJECT_PAGE_TYPE]: 'objectPage',
27
- [ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
28
- };
29
- getDefinitions(context) {
30
- const activePages = this.getActivePageContent(context.controlIndex);
31
- const definitionGroups = [];
32
- for (let index = 0; index < activePages.length; index++) {
33
- const {
34
- name,
35
- view
36
- } = activePages[index];
37
- if (name === 'listReport') {
38
- definitionGroups.push({
39
- title: 'LIST REPORT',
40
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
41
- view,
42
- key: name + index
43
- });
44
- } else if (name === 'objectPage') {
45
- definitionGroups.push({
46
- title: 'OBJECT PAGE',
47
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
48
- view,
49
- key: name + index
50
- });
51
- } else if (name === 'analyticalListPage') {
52
- definitionGroups.push({
53
- title: 'ANALYTICAL LIST PAGE',
54
- definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableCustomColumnQuickAction],
55
- view,
56
- key: name + index
57
- });
58
- }
59
- }
60
- return definitionGroups;
61
- }
62
- getComponentContainerFromPage(page) {
63
- // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
64
- const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
65
- if (componentContainer instanceof ComponentContainer) {
66
- return componentContainer;
67
- }
68
- return undefined;
69
- }
70
- }
71
- return FEV2QuickActionRegistry;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "./create-table-custom-column", "../common/create-page-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___create_table_custom_column, ___common_create_page_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar) {
4
+ "use strict";
5
+
6
+ const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
7
+ const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
8
+ const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
9
+ const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
10
+ const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
11
+ const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
12
+ const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
13
+ const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
14
+ const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
15
+ const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
16
+ const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
17
+ const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
18
+ const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
19
+ const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
20
+ /**
21
+ * Quick Action provider for SAP Fiori Elements V2 applications.
22
+ */
23
+ class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
24
+ PAGE_NAME_MAP = {
25
+ [LIST_REPORT_TYPE]: 'listReport',
26
+ [OBJECT_PAGE_TYPE]: 'objectPage',
27
+ [ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
28
+ };
29
+ getDefinitions(context) {
30
+ const activePages = this.getActivePageContent(context.controlIndex);
31
+ const definitionGroups = [];
32
+ for (let index = 0; index < activePages.length; index++) {
33
+ const {
34
+ name,
35
+ view
36
+ } = activePages[index];
37
+ if (name === 'listReport') {
38
+ definitionGroups.push({
39
+ title: 'LIST REPORT',
40
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
41
+ view,
42
+ key: name + index
43
+ });
44
+ } else if (name === 'objectPage') {
45
+ definitionGroups.push({
46
+ title: 'OBJECT PAGE',
47
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
48
+ view,
49
+ key: name + index
50
+ });
51
+ } else if (name === 'analyticalListPage') {
52
+ definitionGroups.push({
53
+ title: 'ANALYTICAL LIST PAGE',
54
+ definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableCustomColumnQuickAction],
55
+ view,
56
+ key: name + index
57
+ });
58
+ }
59
+ }
60
+ return definitionGroups;
61
+ }
62
+ getComponentContainerFromPage(page) {
63
+ // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
64
+ const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
65
+ if (componentContainer instanceof ComponentContainer) {
66
+ return componentContainer;
67
+ }
68
+ return undefined;
69
+ }
70
+ }
71
+ return FEV2QuickActionRegistry;
72
72
  });
73
73
  //# sourceMappingURL=registry.js.map
@@ -1,88 +1,88 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version"], function (CommandFactory, _____utils_version) {
4
- "use strict";
5
-
6
- const getUi5Version = _____utils_version["getUi5Version"];
7
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
8
- const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
9
- /**
10
- * Prepares the change for the manifest setting.
11
- *
12
- * @param context - The context object containing flexSettings.
13
- * @param propertyPath - The path of the property in the manifest.
14
- * @param control - The UI5 element representing the control.
15
- * @param component - component name e.g list report or object page.
16
- * @param entitySet - Entity Set name.
17
- * @param propertyValue - The value to be set for the property.
18
- *
19
- * @returns A Promise resolving to an array of FlexCommand objects.
20
- */
21
- async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
22
- const {
23
- flexSettings
24
- } = context;
25
- const modifiedValue = {
26
- changeType: 'appdescr_ui_generic_app_changePageConfiguration',
27
- reference: flexSettings.projectId,
28
- parameters: {
29
- parentPage: {
30
- component,
31
- entitySet
32
- },
33
- entityPropertyChange: {
34
- propertyPath: propertyPath,
35
- operation: 'UPSERT',
36
- propertyValue: propertyValue
37
- }
38
- }
39
- };
40
- const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
41
- return [command];
42
- }
43
-
44
- /**
45
- * Checks if the current UI5 version and manifest structure is supported in v2 applications.
46
- *
47
- * @param manifest - manifest changes of the current application.
48
- *
49
- * Returns `false`
50
- *
51
- * - If the manifest is structured is an array
52
- * - If the UI5 version is not supported
53
- * Otherwise, returns `true`.
54
- *
55
- */
56
- async function areManifestChangesSupported(manifest) {
57
- const pagesStructureInManifest = manifest['sap.ui.generic.app'].pages;
58
- if (Array.isArray(pagesStructureInManifest)) {
59
- return false;
60
- }
61
- const version = await getUi5Version();
62
- const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
63
- major: 1,
64
- minor: 128
65
- });
66
- const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
67
- major: 1,
68
- minor: 96,
69
- patch: 37
70
- }) || isVersionEqualOrHasNewerPatch(version, {
71
- major: 1,
72
- minor: 108,
73
- patch: 38
74
- }) || isVersionEqualOrHasNewerPatch(version, {
75
- major: 1,
76
- minor: 120,
77
- patch: 23
78
- });
79
- return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
80
- }
81
- var __exports = {
82
- __esModule: true
83
- };
84
- __exports.prepareManifestChange = prepareManifestChange;
85
- __exports.areManifestChangesSupported = areManifestChangesSupported;
86
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version"], function (CommandFactory, _____utils_version) {
4
+ "use strict";
5
+
6
+ const getUi5Version = _____utils_version["getUi5Version"];
7
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
8
+ const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
9
+ /**
10
+ * Prepares the change for the manifest setting.
11
+ *
12
+ * @param context - The context object containing flexSettings.
13
+ * @param propertyPath - The path of the property in the manifest.
14
+ * @param control - The UI5 element representing the control.
15
+ * @param component - component name e.g list report or object page.
16
+ * @param entitySet - Entity Set name.
17
+ * @param propertyValue - The value to be set for the property.
18
+ *
19
+ * @returns A Promise resolving to an array of FlexCommand objects.
20
+ */
21
+ async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
22
+ const {
23
+ flexSettings
24
+ } = context;
25
+ const modifiedValue = {
26
+ changeType: 'appdescr_ui_generic_app_changePageConfiguration',
27
+ reference: flexSettings.projectId,
28
+ parameters: {
29
+ parentPage: {
30
+ component,
31
+ entitySet
32
+ },
33
+ entityPropertyChange: {
34
+ propertyPath: propertyPath,
35
+ operation: 'UPSERT',
36
+ propertyValue: propertyValue
37
+ }
38
+ }
39
+ };
40
+ const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
41
+ return [command];
42
+ }
43
+
44
+ /**
45
+ * Checks if the current UI5 version and manifest structure is supported in v2 applications.
46
+ *
47
+ * @param manifest - manifest changes of the current application.
48
+ *
49
+ * Returns `false`
50
+ *
51
+ * - If the manifest is structured is an array
52
+ * - If the UI5 version is not supported
53
+ * Otherwise, returns `true`.
54
+ *
55
+ */
56
+ async function areManifestChangesSupported(manifest) {
57
+ const pagesStructureInManifest = manifest['sap.ui.generic.app'].pages;
58
+ if (Array.isArray(pagesStructureInManifest)) {
59
+ return false;
60
+ }
61
+ const version = await getUi5Version();
62
+ const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
63
+ major: 1,
64
+ minor: 128
65
+ });
66
+ const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
67
+ major: 1,
68
+ minor: 96,
69
+ patch: 37
70
+ }) || isVersionEqualOrHasNewerPatch(version, {
71
+ major: 1,
72
+ minor: 108,
73
+ patch: 38
74
+ }) || isVersionEqualOrHasNewerPatch(version, {
75
+ major: 1,
76
+ minor: 120,
77
+ patch: 23
78
+ });
79
+ return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
80
+ }
81
+ var __exports = {
82
+ __esModule: true
83
+ };
84
+ __exports.prepareManifestChange = prepareManifestChange;
85
+ __exports.areManifestChangesSupported = areManifestChangesSupported;
86
+ return __exports;
87
87
  });
88
88
  //# sourceMappingURL=utils.js.map
@@ -1,49 +1,49 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI", "../../../cpe/quick-actions/utils", "../../../utils/core", "./table-quick-action-base"], function (OverlayUtil, FlexRuntimeInfoAPI, _____cpe_quick_actions_utils, _____utils_core, ___table_quick_action_base) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
9
- const CHANGE_TABLE_COLUMNS = 'change-table-columns';
10
- const ACTION_ID = 'CTX_SETTINGS0';
11
- const CONTROL_TYPE = 'sap.ui.mdc.Table';
12
-
13
- /**
14
- * Quick Action for changing table columns.
15
- */
16
- class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
17
- constructor(context) {
18
- super(CHANGE_TABLE_COLUMNS, 'V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context);
19
- }
20
- async execute(path) {
21
- const index = this.tableMap[path];
22
- const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE]);
23
- for (let i = 0; i < smartTables.length; i++) {
24
- if (i === index) {
25
- const section = getControlById(smartTables[i].getId());
26
- const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
27
- if (controlOverlay) {
28
- controlOverlay.setSelected(true);
29
- }
30
- const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
31
- element: smartTables[i]
32
- });
33
- if (!hasVariantManagement) {
34
- continue;
35
- }
36
- await this.context.actionService.execute(smartTables[i].getId(), ACTION_ID);
37
- }
38
- }
39
- return [];
40
- }
41
- }
42
- var __exports = {
43
- __esModule: true
44
- };
45
- __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
46
- __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
47
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI", "../../../cpe/quick-actions/utils", "../../../utils/core", "./table-quick-action-base"], function (OverlayUtil, FlexRuntimeInfoAPI, _____cpe_quick_actions_utils, _____utils_core, ___table_quick_action_base) {
4
+ "use strict";
5
+
6
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
9
+ const CHANGE_TABLE_COLUMNS = 'change-table-columns';
10
+ const ACTION_ID = 'CTX_SETTINGS0';
11
+ const CONTROL_TYPE = 'sap.ui.mdc.Table';
12
+
13
+ /**
14
+ * Quick Action for changing table columns.
15
+ */
16
+ class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
17
+ constructor(context) {
18
+ super(CHANGE_TABLE_COLUMNS, 'V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context);
19
+ }
20
+ async execute(path) {
21
+ const index = this.tableMap[path];
22
+ const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE]);
23
+ for (let i = 0; i < smartTables.length; i++) {
24
+ if (i === index) {
25
+ const section = getControlById(smartTables[i].getId());
26
+ const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
27
+ if (controlOverlay) {
28
+ controlOverlay.setSelected(true);
29
+ }
30
+ const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
31
+ element: smartTables[i]
32
+ });
33
+ if (!hasVariantManagement) {
34
+ continue;
35
+ }
36
+ await this.context.actionService.execute(smartTables[i].getId(), ACTION_ID);
37
+ }
38
+ }
39
+ return [];
40
+ }
41
+ }
42
+ var __exports = {
43
+ __esModule: true
44
+ };
45
+ __exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
46
+ __exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
47
+ return __exports;
48
48
  });
49
49
  //# sourceMappingURL=change-table-columns.js.map
@@ -1,47 +1,47 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayUtil", "../../../cpe/quick-actions/utils", "../../../utils/core", "../../init-dialogs", "./table-quick-action-base"], function (OverlayUtil, _____cpe_quick_actions_utils, _____utils_core, ____init_dialogs, ___table_quick_action_base) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const getControlById = _____utils_core["getControlById"];
8
- const DialogNames = ____init_dialogs["DialogNames"];
9
- const handler = ____init_dialogs["handler"];
10
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
- const CREATE_TABLE_ACTION = 'create_table_action';
12
- const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
13
-
14
- /**
15
- * Quick Action for creating table action.
16
- */
17
- class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
18
- constructor(context) {
19
- super(CREATE_TABLE_ACTION, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, true);
20
- }
21
- async execute(path) {
22
- const index = this.tableMap[path];
23
- const smartTablesToolbarAction = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [TOOLBAR_ACTION]);
24
- for (let i = 0; i < smartTablesToolbarAction.length; i++) {
25
- if (i === index) {
26
- const section = getControlById(smartTablesToolbarAction[i].getId());
27
- const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
28
- if (controlOverlay) {
29
- controlOverlay.setSelected(true);
30
- await handler(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
31
- aggregation: 'actions',
32
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
33
- });
34
- }
35
- }
36
- }
37
- return [];
38
- }
39
- }
40
- var __exports = {
41
- __esModule: true
42
- };
43
- __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
44
- __exports.AddTableActionQuickAction = AddTableActionQuickAction;
45
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/dt/OverlayUtil", "../../../cpe/quick-actions/utils", "../../../utils/core", "../../init-dialogs", "./table-quick-action-base"], function (OverlayUtil, _____cpe_quick_actions_utils, _____utils_core, ____init_dialogs, ___table_quick_action_base) {
4
+ "use strict";
5
+
6
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const DialogNames = ____init_dialogs["DialogNames"];
9
+ const handler = ____init_dialogs["handler"];
10
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
11
+ const CREATE_TABLE_ACTION = 'create_table_action';
12
+ const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
13
+
14
+ /**
15
+ * Quick Action for creating table action.
16
+ */
17
+ class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
18
+ constructor(context) {
19
+ super(CREATE_TABLE_ACTION, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, true);
20
+ }
21
+ async execute(path) {
22
+ const index = this.tableMap[path];
23
+ const smartTablesToolbarAction = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [TOOLBAR_ACTION]);
24
+ for (let i = 0; i < smartTablesToolbarAction.length; i++) {
25
+ if (i === index) {
26
+ const section = getControlById(smartTablesToolbarAction[i].getId());
27
+ const controlOverlay = OverlayUtil.getClosestOverlayFor(section);
28
+ if (controlOverlay) {
29
+ controlOverlay.setSelected(true);
30
+ await handler(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
31
+ aggregation: 'actions',
32
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
33
+ });
34
+ }
35
+ }
36
+ }
37
+ return [];
38
+ }
39
+ }
40
+ var __exports = {
41
+ __esModule: true
42
+ };
43
+ __exports.CREATE_TABLE_ACTION = CREATE_TABLE_ACTION;
44
+ __exports.AddTableActionQuickAction = AddTableActionQuickAction;
45
+ return __exports;
46
46
  });
47
47
  //# sourceMappingURL=create-table-action.js.map