@sap-ux/preview-middleware 0.18.15 → 0.18.16

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 (70) hide show
  1. package/dist/base/config.js +1 -1
  2. package/dist/base/flp.d.ts +7 -0
  3. package/dist/base/flp.js +13 -0
  4. package/dist/client/adp/api-handler.js +153 -153
  5. package/dist/client/adp/command-executor.js +75 -75
  6. package/dist/client/adp/control-utils.js +44 -44
  7. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  8. package/dist/client/adp/controllers/ControllerExtension.controller.js +209 -209
  9. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  10. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  11. package/dist/client/adp/dialog-factory.js +125 -125
  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/create-page-action.js +51 -51
  15. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  16. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  17. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  18. package/dist/client/adp/quick-actions/control-types.js +21 -21
  19. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  20. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  21. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +104 -104
  23. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  26. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  27. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  28. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  29. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  30. package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
  31. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  33. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +50 -50
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  35. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  36. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  37. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  38. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  39. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  40. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  41. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  42. package/dist/client/adp/quick-actions/load.js +44 -44
  43. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  44. package/dist/client/adp/utils.js +160 -160
  45. package/dist/client/cpe/changes/index.js +10 -10
  46. package/dist/client/cpe/changes/validator.js +39 -39
  47. package/dist/client/cpe/documentation.js +164 -164
  48. package/dist/client/cpe/feature-service.js +36 -36
  49. package/dist/client/cpe/logger.js +30 -30
  50. package/dist/client/cpe/outline/editable.js +37 -37
  51. package/dist/client/cpe/outline/nodes.js +222 -222
  52. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  53. package/dist/client/cpe/quick-actions/registry.js +143 -143
  54. package/dist/client/cpe/quick-actions/utils.js +92 -92
  55. package/dist/client/cpe/types.js +4 -4
  56. package/dist/client/cpe/ui5-utils.js +33 -33
  57. package/dist/client/cpe/utils.js +138 -138
  58. package/dist/client/flp/WorkspaceConnector.js +86 -86
  59. package/dist/client/flp/common.js +28 -28
  60. package/dist/client/flp/enableFakeConnector.js +83 -83
  61. package/dist/client/flp/initConnectors.js +28 -30
  62. package/dist/client/flp/initConnectors.ts +0 -7
  63. package/dist/client/flp/initRta.js +178 -178
  64. package/dist/client/i18n.js +56 -56
  65. package/dist/client/utils/application.js +32 -32
  66. package/dist/client/utils/core.js +68 -68
  67. package/dist/client/utils/error.js +19 -19
  68. package/dist/client/utils/fe-v4.js +118 -118
  69. package/dist/client/utils/version.js +104 -104
  70. package/package.json +5 -5
@@ -1,86 +1,86 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, ___create_table_custom_column) {
4
- "use strict";
5
-
6
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
8
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
9
- const prepareManifestChange = ___utils["prepareManifestChange"];
10
- const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
11
- const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
12
- const CONTROL_TYPES = [SMART_TABLE_TYPE];
13
- const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
14
- class EnableObjectPageVariantManagementQuickAction extends TableQuickActionDefinitionBase {
15
- forceRefreshAfterExecution = true;
16
- constructor(context) {
17
- super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_VARIANT_MANAGEMENT', context);
18
- }
19
- async initialize() {
20
- if (!(await areManifestChangesSupported(this.context.manifest))) {
21
- this.isApplicable = false;
22
- return;
23
- }
24
- await super.initialize();
25
- const processChild = (child, mapKey) => {
26
- const alreadyEnabledTooltip = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_TABLE_CONTROLS_IS_ALREADY_ENABLED', [child.label]);
27
- const vmSetupNotSupported = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_CUSTOM_TABLES_NOT_SUPPORTED', [child.label]);
28
- const table = this.tableMap[mapKey]?.table;
29
- if (table) {
30
- const id = table.getId();
31
- if (typeof id !== 'string') {
32
- throw new Error('Could not retrieve configuration property because control id is not valid!');
33
- }
34
- let value = this.context.changeService.getConfigurationPropertyValue(id, 'variantManagement');
35
- if (value === undefined) {
36
- value = !!table.getVariantManagement();
37
- }
38
- const sectionId = table.data('sectionId');
39
- let tooltip;
40
- if (!sectionId) {
41
- tooltip = vmSetupNotSupported;
42
- } else if (value) {
43
- tooltip = alreadyEnabledTooltip;
44
- }
45
- if (value || !sectionId) {
46
- child.enabled = false;
47
- child.tooltip = tooltip;
48
- }
49
- }
50
- child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
51
- };
52
- this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
53
- }
54
- async execute(path) {
55
- const {
56
- table,
57
- sectionInfo,
58
- iconTabBarFilterKey
59
- } = this.tableMap[path];
60
- if (!table) {
61
- throw Error('Internal error. Table element not found');
62
- }
63
- const entitySet = this.context.view.getParent()?.getProperty('entitySet');
64
- if (!entitySet) {
65
- throw Error('Internal error. Object Page entity set not found');
66
- }
67
- const sectionId = table.data('sectionId');
68
- if (!sectionId) {
69
- throw Error('Internal error. Table sectionId property not found');
70
- }
71
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
72
- this.selectOverlay(table);
73
- const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/tableSettings`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, {
74
- 'variantManagement': true
75
- });
76
- return commands ?? [];
77
- }
78
- }
79
- var __exports = {
80
- __esModule: true
81
- };
82
- __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
83
- __exports.EnableObjectPageVariantManagementQuickAction = EnableObjectPageVariantManagementQuickAction;
84
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, ___create_table_custom_column) {
4
+ "use strict";
5
+
6
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
8
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
9
+ const prepareManifestChange = ___utils["prepareManifestChange"];
10
+ const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
11
+ const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
12
+ const CONTROL_TYPES = [SMART_TABLE_TYPE];
13
+ const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
14
+ class EnableObjectPageVariantManagementQuickAction extends TableQuickActionDefinitionBase {
15
+ forceRefreshAfterExecution = true;
16
+ constructor(context) {
17
+ super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_VARIANT_MANAGEMENT', context);
18
+ }
19
+ async initialize() {
20
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
21
+ this.isApplicable = false;
22
+ return;
23
+ }
24
+ await super.initialize();
25
+ const processChild = (child, mapKey) => {
26
+ const alreadyEnabledTooltip = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_TABLE_CONTROLS_IS_ALREADY_ENABLED', [child.label]);
27
+ const vmSetupNotSupported = this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_CUSTOM_TABLES_NOT_SUPPORTED', [child.label]);
28
+ const table = this.tableMap[mapKey]?.table;
29
+ if (table) {
30
+ const id = table.getId();
31
+ if (typeof id !== 'string') {
32
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
33
+ }
34
+ let value = this.context.changeService.getConfigurationPropertyValue(id, 'variantManagement');
35
+ if (value === undefined) {
36
+ value = !!table.getVariantManagement();
37
+ }
38
+ const sectionId = table.data('sectionId');
39
+ let tooltip;
40
+ if (!sectionId) {
41
+ tooltip = vmSetupNotSupported;
42
+ } else if (value) {
43
+ tooltip = alreadyEnabledTooltip;
44
+ }
45
+ if (value || !sectionId) {
46
+ child.enabled = false;
47
+ child.tooltip = tooltip;
48
+ }
49
+ }
50
+ child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
51
+ };
52
+ this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
53
+ }
54
+ async execute(path) {
55
+ const {
56
+ table,
57
+ sectionInfo,
58
+ iconTabBarFilterKey
59
+ } = this.tableMap[path];
60
+ if (!table) {
61
+ throw Error('Internal error. Table element not found');
62
+ }
63
+ const entitySet = this.context.view.getParent()?.getProperty('entitySet');
64
+ if (!entitySet) {
65
+ throw Error('Internal error. Object Page entity set not found');
66
+ }
67
+ const sectionId = table.data('sectionId');
68
+ if (!sectionId) {
69
+ throw Error('Internal error. Table sectionId property not found');
70
+ }
71
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
72
+ this.selectOverlay(table);
73
+ const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/tableSettings`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, {
74
+ 'variantManagement': true
75
+ });
76
+ return commands ?? [];
77
+ }
78
+ }
79
+ var __exports = {
80
+ __esModule: true
81
+ };
82
+ __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
83
+ __exports.EnableObjectPageVariantManagementQuickAction = EnableObjectPageVariantManagementQuickAction;
84
+ return __exports;
85
85
  });
86
86
  //# sourceMappingURL=op-enable-variant-management.js.map
@@ -1,77 +1,77 @@
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", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./op-enable-variant-management", "./lr-enable-variant-management"], 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, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___op_enable_variant_management, ___lr_enable_variant_management) {
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 EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
18
- const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
19
- const EnableObjectPageVariantManagementQuickAction = ___op_enable_variant_management["EnableObjectPageVariantManagementQuickAction"];
20
- const EnableListReportVariantManagementQuickAction = ___lr_enable_variant_management["EnableListReportVariantManagementQuickAction"];
21
- const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
22
- const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
23
- const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
24
- /**
25
- * Quick Action provider for SAP Fiori Elements V2 applications.
26
- */
27
- class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
28
- PAGE_NAME_MAP = {
29
- [LIST_REPORT_TYPE]: 'listReport',
30
- [OBJECT_PAGE_TYPE]: 'objectPage',
31
- [ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
32
- };
33
- getDefinitions(context) {
34
- const activePages = this.getActivePageContent(context.controlIndex);
35
- const definitionGroups = [];
36
- for (let index = 0; index < activePages.length; index++) {
37
- const {
38
- name,
39
- view
40
- } = activePages[index];
41
- if (name === 'listReport') {
42
- definitionGroups.push({
43
- title: 'LIST REPORT',
44
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableListReportVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
45
- view,
46
- key: name + index
47
- });
48
- } else if (name === 'objectPage') {
49
- definitionGroups.push({
50
- title: 'OBJECT PAGE',
51
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, EnableObjectPageVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile],
52
- view,
53
- key: name + index
54
- });
55
- } else if (name === 'analyticalListPage') {
56
- definitionGroups.push({
57
- title: 'ANALYTICAL LIST PAGE',
58
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableListReportVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
59
- view,
60
- key: name + index
61
- });
62
- }
63
- }
64
- return definitionGroups;
65
- }
66
- getComponentContainerFromPage(page) {
67
- // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
68
- const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
69
- if (componentContainer instanceof ComponentContainer) {
70
- return componentContainer;
71
- }
72
- return undefined;
73
- }
74
- }
75
- 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", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./op-enable-variant-management", "./lr-enable-variant-management"], 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, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___op_enable_variant_management, ___lr_enable_variant_management) {
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 EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
18
+ const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
19
+ const EnableObjectPageVariantManagementQuickAction = ___op_enable_variant_management["EnableObjectPageVariantManagementQuickAction"];
20
+ const EnableListReportVariantManagementQuickAction = ___lr_enable_variant_management["EnableListReportVariantManagementQuickAction"];
21
+ const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
22
+ const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
23
+ const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
24
+ /**
25
+ * Quick Action provider for SAP Fiori Elements V2 applications.
26
+ */
27
+ class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
28
+ PAGE_NAME_MAP = {
29
+ [LIST_REPORT_TYPE]: 'listReport',
30
+ [OBJECT_PAGE_TYPE]: 'objectPage',
31
+ [ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
32
+ };
33
+ getDefinitions(context) {
34
+ const activePages = this.getActivePageContent(context.controlIndex);
35
+ const definitionGroups = [];
36
+ for (let index = 0; index < activePages.length; index++) {
37
+ const {
38
+ name,
39
+ view
40
+ } = activePages[index];
41
+ if (name === 'listReport') {
42
+ definitionGroups.push({
43
+ title: 'LIST REPORT',
44
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableListReportVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
45
+ view,
46
+ key: name + index
47
+ });
48
+ } else if (name === 'objectPage') {
49
+ definitionGroups.push({
50
+ title: 'OBJECT PAGE',
51
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, EnableObjectPageVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile],
52
+ view,
53
+ key: name + index
54
+ });
55
+ } else if (name === 'analyticalListPage') {
56
+ definitionGroups.push({
57
+ title: 'ANALYTICAL LIST PAGE',
58
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableListReportVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
59
+ view,
60
+ key: name + index
61
+ });
62
+ }
63
+ }
64
+ return definitionGroups;
65
+ }
66
+ getComponentContainerFromPage(page) {
67
+ // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
68
+ const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
69
+ if (componentContainer instanceof ComponentContainer) {
70
+ return componentContainer;
71
+ }
72
+ return undefined;
73
+ }
74
+ }
75
+ return FEV2QuickActionRegistry;
76
76
  });
77
77
  //# sourceMappingURL=registry.js.map
@@ -1,118 +1,118 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version", "sap/ui/core/Component"], function (CommandFactory, _____utils_version, Component) {
4
- "use strict";
5
-
6
- const getUi5Version = _____utils_version["getUi5Version"];
7
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
8
- const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
9
- /**
10
- * Gets app component of a v2 project.
11
- *
12
- * @param control - ManagedObject.
13
- * @returns AppComponent.
14
- */
15
- function getV2AppComponent(control) {
16
- const ownerComponent = Component.getOwnerComponentFor(control);
17
- let result;
18
- if (ownerComponent?.isA('sap.suite.ui.generic.template.lib.TemplateComponent')) {
19
- result = ownerComponent.getAppComponent();
20
- }
21
- return result;
22
- }
23
-
24
- /**
25
- * Prepares the change for the manifest setting.
26
- *
27
- * @param context - The context object containing flexSettings.
28
- * @param propertyPath - The path of the property in the manifest.
29
- * @param control - The UI5 element representing the control.
30
- * @param component - component name e.g list report or object page.
31
- * @param entitySet - Entity Set name.
32
- * @param propertyValue - The value to be set for the property.
33
- *
34
- * @returns A Promise resolving to an array of FlexCommand objects.
35
- */
36
- async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
37
- const {
38
- flexSettings
39
- } = context;
40
- const appComponent = getV2AppComponent(control);
41
- const modifiedValue = {
42
- changeType: 'appdescr_ui_generic_app_changePageConfiguration',
43
- reference: flexSettings.projectId,
44
- appComponent,
45
- parameters: {
46
- parentPage: {
47
- component,
48
- entitySet
49
- },
50
- entityPropertyChange: {
51
- propertyPath: propertyPath,
52
- operation: 'UPSERT',
53
- propertyValue: propertyValue
54
- }
55
- }
56
- };
57
- const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
58
- return [command];
59
- }
60
-
61
- /**
62
- * Checks whether the manifest has array structured page definitions
63
- * @param manifest - manifest object
64
- * @returns true if pages are defined as array, false if defined as object
65
- */
66
- function isManifestArrayStructured(manifest) {
67
- return Array.isArray(manifest['sap.ui.generic.app']?.pages);
68
- }
69
-
70
- /**
71
- * Checks if the current UI5 version and manifest structure is supported in v2 applications.
72
- *
73
- * @param manifest - manifest changes of the current application.
74
- *
75
- * Returns `false`
76
- *
77
- * - If the manifest is structured is an array and is below version 1.134
78
- * - If the UI5 version is not supported
79
- * Otherwise, returns `true`.
80
- *
81
- */
82
- async function areManifestChangesSupported(manifest) {
83
- const version = await getUi5Version();
84
- if (isLowerThanMinimalUi5Version(version, {
85
- major: 1,
86
- minor: 134
87
- }) && isManifestArrayStructured(manifest)) {
88
- return false;
89
- }
90
- const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
91
- major: 1,
92
- minor: 128
93
- });
94
- const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
95
- major: 1,
96
- minor: 96,
97
- patch: 35
98
- }) || isVersionEqualOrHasNewerPatch(version, {
99
- major: 1,
100
- minor: 108,
101
- patch: 38
102
- }) || isVersionEqualOrHasNewerPatch(version, {
103
- major: 1,
104
- minor: 120,
105
- patch: 23
106
- });
107
- return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
108
- }
109
- var __exports = {
110
- __esModule: true
111
- };
112
- __exports.getV2AppComponent = getV2AppComponent;
113
- __exports.prepareManifestChange = prepareManifestChange;
114
- __exports.isManifestArrayStructured = isManifestArrayStructured;
115
- __exports.areManifestChangesSupported = areManifestChangesSupported;
116
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version", "sap/ui/core/Component"], function (CommandFactory, _____utils_version, Component) {
4
+ "use strict";
5
+
6
+ const getUi5Version = _____utils_version["getUi5Version"];
7
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
8
+ const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
9
+ /**
10
+ * Gets app component of a v2 project.
11
+ *
12
+ * @param control - ManagedObject.
13
+ * @returns AppComponent.
14
+ */
15
+ function getV2AppComponent(control) {
16
+ const ownerComponent = Component.getOwnerComponentFor(control);
17
+ let result;
18
+ if (ownerComponent?.isA('sap.suite.ui.generic.template.lib.TemplateComponent')) {
19
+ result = ownerComponent.getAppComponent();
20
+ }
21
+ return result;
22
+ }
23
+
24
+ /**
25
+ * Prepares the change for the manifest setting.
26
+ *
27
+ * @param context - The context object containing flexSettings.
28
+ * @param propertyPath - The path of the property in the manifest.
29
+ * @param control - The UI5 element representing the control.
30
+ * @param component - component name e.g list report or object page.
31
+ * @param entitySet - Entity Set name.
32
+ * @param propertyValue - The value to be set for the property.
33
+ *
34
+ * @returns A Promise resolving to an array of FlexCommand objects.
35
+ */
36
+ async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
37
+ const {
38
+ flexSettings
39
+ } = context;
40
+ const appComponent = getV2AppComponent(control);
41
+ const modifiedValue = {
42
+ changeType: 'appdescr_ui_generic_app_changePageConfiguration',
43
+ reference: flexSettings.projectId,
44
+ appComponent,
45
+ parameters: {
46
+ parentPage: {
47
+ component,
48
+ entitySet
49
+ },
50
+ entityPropertyChange: {
51
+ propertyPath: propertyPath,
52
+ operation: 'UPSERT',
53
+ propertyValue: propertyValue
54
+ }
55
+ }
56
+ };
57
+ const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
58
+ return [command];
59
+ }
60
+
61
+ /**
62
+ * Checks whether the manifest has array structured page definitions
63
+ * @param manifest - manifest object
64
+ * @returns true if pages are defined as array, false if defined as object
65
+ */
66
+ function isManifestArrayStructured(manifest) {
67
+ return Array.isArray(manifest['sap.ui.generic.app']?.pages);
68
+ }
69
+
70
+ /**
71
+ * Checks if the current UI5 version and manifest structure is supported in v2 applications.
72
+ *
73
+ * @param manifest - manifest changes of the current application.
74
+ *
75
+ * Returns `false`
76
+ *
77
+ * - If the manifest is structured is an array and is below version 1.134
78
+ * - If the UI5 version is not supported
79
+ * Otherwise, returns `true`.
80
+ *
81
+ */
82
+ async function areManifestChangesSupported(manifest) {
83
+ const version = await getUi5Version();
84
+ if (isLowerThanMinimalUi5Version(version, {
85
+ major: 1,
86
+ minor: 134
87
+ }) && isManifestArrayStructured(manifest)) {
88
+ return false;
89
+ }
90
+ const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
91
+ major: 1,
92
+ minor: 128
93
+ });
94
+ const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
95
+ major: 1,
96
+ minor: 96,
97
+ patch: 35
98
+ }) || isVersionEqualOrHasNewerPatch(version, {
99
+ major: 1,
100
+ minor: 108,
101
+ patch: 38
102
+ }) || isVersionEqualOrHasNewerPatch(version, {
103
+ major: 1,
104
+ minor: 120,
105
+ patch: 23
106
+ });
107
+ return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
108
+ }
109
+ var __exports = {
110
+ __esModule: true
111
+ };
112
+ __exports.getV2AppComponent = getV2AppComponent;
113
+ __exports.prepareManifestChange = prepareManifestChange;
114
+ __exports.isManifestArrayStructured = isManifestArrayStructured;
115
+ __exports.areManifestChangesSupported = areManifestChangesSupported;
116
+ return __exports;
117
117
  });
118
118
  //# sourceMappingURL=utils.js.map