@sap-ux/preview-middleware 0.19.18 → 0.19.19

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 (73) 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/ControllerExtension.controller.js +210 -210
  5. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  6. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  7. package/dist/client/adp/dialog-factory.js +135 -135
  8. package/dist/client/adp/init-dialogs.js +138 -138
  9. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +23 -23
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
  19. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
  20. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  21. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  26. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  27. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  28. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  29. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
  30. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  31. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
  33. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  36. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  37. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  39. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  40. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  41. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
  42. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  43. package/dist/client/adp/quick-actions/load.js +44 -44
  44. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  45. package/dist/client/adp/utils.js +218 -218
  46. package/dist/client/cpe/changes/index.js +10 -10
  47. package/dist/client/cpe/changes/validator.js +39 -39
  48. package/dist/client/cpe/documentation.js +164 -164
  49. package/dist/client/cpe/feature-service.js +36 -36
  50. package/dist/client/cpe/logger.js +30 -30
  51. package/dist/client/cpe/outline/editable.js +37 -37
  52. package/dist/client/cpe/outline/nodes.js +203 -203
  53. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  54. package/dist/client/cpe/quick-actions/registry.js +143 -143
  55. package/dist/client/cpe/quick-actions/utils.js +92 -92
  56. package/dist/client/cpe/types.js +4 -4
  57. package/dist/client/cpe/ui5-utils.js +33 -33
  58. package/dist/client/cpe/utils.js +111 -111
  59. package/dist/client/flp/WorkspaceConnector.js +86 -86
  60. package/dist/client/flp/common.js +28 -28
  61. package/dist/client/flp/enableFakeConnector.js +83 -83
  62. package/dist/client/flp/homepage/Component.js +14 -14
  63. package/dist/client/flp/initCdm.js +117 -117
  64. package/dist/client/flp/initConnectors.js +28 -28
  65. package/dist/client/flp/initRta.js +178 -178
  66. package/dist/client/i18n.js +56 -56
  67. package/dist/client/utils/application.js +32 -32
  68. package/dist/client/utils/core.js +84 -84
  69. package/dist/client/utils/error.js +19 -19
  70. package/dist/client/utils/fe-v2.js +56 -56
  71. package/dist/client/utils/fe-v4.js +140 -140
  72. package/dist/client/utils/version.js +104 -104
  73. package/package.json +5 -5
@@ -1,80 +1,80 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils", "../../../utils/version"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils, _____utils_version) {
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 SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
- const prepareManifestChange = ___utils["prepareManifestChange"];
12
- const getUi5Version = _____utils_version["getUi5Version"];
13
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
14
- const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
15
- const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
16
- const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
17
- const COMPONENT_LR = 'sap.suite.ui.generic.template.ListReport';
18
- const COMPONENT_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage';
19
-
20
- /**
21
- * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
22
- */
23
- class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
24
- constructor(context) {
25
- super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
26
- }
27
- forceRefreshAfterExecution = true;
28
- isUseDateRangeTypeEnabled = false;
29
- async initialize() {
30
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
31
- if (!manifestChangesSupported) {
32
- return;
33
- }
34
- const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
35
- for (const control of controls) {
36
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
37
- const modifiedControl = getControlById(control.controlId);
38
- if (isActionApplicable && modifiedControl) {
39
- this.control = modifiedControl;
40
- const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
41
- if (typeof id !== 'string') {
42
- throw new Error('Could not retrieve configuration property because control id is not valid!');
43
- }
44
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
45
- this.isUseDateRangeTypeEnabled = value === undefined ? this.control.getUseDateRangeType() : value;
46
- }
47
- }
48
- }
49
- get textKey() {
50
- return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
51
- }
52
- async execute() {
53
- const version = await getUi5Version();
54
- const isLowerMinimalVersion = isLowerThanMinimalUi5Version(version, {
55
- major: 1,
56
- minor: 126
57
- });
58
- let entitySet;
59
- if (isLowerMinimalVersion && isA(CONTROL_TYPE_LR, this.control)) {
60
- // In older versions of UI5, the getEntitySet method is unavailable, so this workaround has been introduced.
61
- const regex = /::([^:]+)--/;
62
- entitySet = regex.exec(this.control?.getId() ?? '')?.[1];
63
- } else {
64
- entitySet = isA(CONTROL_TYPE_LR, this.control) || isA(CONTROL_TYPE_ALP, this.control) ? this.control.getEntitySet() : undefined;
65
- }
66
- const viewName = this.context.view.getViewName();
67
- const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, viewName.includes('AnalyticalListPage') ? COMPONENT_ALP : COMPONENT_LR, entitySet, {
68
- useDateRange: !this.isUseDateRangeTypeEnabled
69
- });
70
- return command;
71
- }
72
- }
73
- var __exports = {
74
- __esModule: true
75
- };
76
- __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
77
- __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
78
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils", "../../../utils/version"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils, _____utils_version) {
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 SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
+ const prepareManifestChange = ___utils["prepareManifestChange"];
12
+ const getUi5Version = _____utils_version["getUi5Version"];
13
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
14
+ const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
15
+ const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
16
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
17
+ const COMPONENT_LR = 'sap.suite.ui.generic.template.ListReport';
18
+ const COMPONENT_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage';
19
+
20
+ /**
21
+ * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
22
+ */
23
+ class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase {
24
+ constructor(context) {
25
+ super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context);
26
+ }
27
+ forceRefreshAfterExecution = true;
28
+ isUseDateRangeTypeEnabled = false;
29
+ async initialize() {
30
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
31
+ if (!manifestChangesSupported) {
32
+ return;
33
+ }
34
+ const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
35
+ for (const control of controls) {
36
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
37
+ const modifiedControl = getControlById(control.controlId);
38
+ if (isActionApplicable && modifiedControl) {
39
+ this.control = modifiedControl;
40
+ const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
41
+ if (typeof id !== 'string') {
42
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
43
+ }
44
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
45
+ this.isUseDateRangeTypeEnabled = value === undefined ? this.control.getUseDateRangeType() : value;
46
+ }
47
+ }
48
+ }
49
+ get textKey() {
50
+ return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
51
+ }
52
+ async execute() {
53
+ const version = await getUi5Version();
54
+ const isLowerMinimalVersion = isLowerThanMinimalUi5Version(version, {
55
+ major: 1,
56
+ minor: 126
57
+ });
58
+ let entitySet;
59
+ if (isLowerMinimalVersion && isA(CONTROL_TYPE_LR, this.control)) {
60
+ // In older versions of UI5, the getEntitySet method is unavailable, so this workaround has been introduced.
61
+ const regex = /::([^:]+)--/;
62
+ entitySet = regex.exec(this.control?.getId() ?? '')?.[1];
63
+ } else {
64
+ entitySet = isA(CONTROL_TYPE_LR, this.control) || isA(CONTROL_TYPE_ALP, this.control) ? this.control.getEntitySet() : undefined;
65
+ }
66
+ const viewName = this.context.view.getViewName();
67
+ const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, viewName.includes('AnalyticalListPage') ? COMPONENT_ALP : COMPONENT_LR, entitySet, {
68
+ useDateRange: !this.isUseDateRangeTypeEnabled
69
+ });
70
+ return command;
71
+ }
72
+ }
73
+ var __exports = {
74
+ __esModule: true
75
+ };
76
+ __exports.ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR;
77
+ __exports.ToggleSemanticDateRangeFilterBar = ToggleSemanticDateRangeFilterBar;
78
+ return __exports;
79
79
  });
80
80
  //# sourceMappingURL=lr-enable-semantic-date-range-filter-bar.js.map
@@ -1,79 +1,79 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../../cpe/quick-actions/utils", "../control-types", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___control_types, ___utils, ___simple_quick_action_base, _____utils_core) {
4
- "use strict";
5
-
6
- const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
- const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
- const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
9
- const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
10
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
11
- const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
12
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
13
- const prepareManifestChange = ___utils["prepareManifestChange"];
14
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
15
- const isA = _____utils_core["isA"];
16
- const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
17
- const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
18
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
19
-
20
- /**
21
- * Quick Action for enabling table filtering using table personalization settings.
22
- */
23
- class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
24
- constructor(context) {
25
- super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context, [{
26
- run: () => {
27
- if (this.control) {
28
- const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
29
- if (typeof id !== 'string') {
30
- throw new Error('Could not retrieve configuration property because control id is not valid!');
31
- }
32
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'enableTableFilterInPageVariant');
33
- const isFilterEnabled = value === undefined ? this.control.data('p13nDialogSettings')?.filter?.visible : value;
34
- if (isFilterEnabled) {
35
- return {
36
- type: 'error',
37
- message: this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE')
38
- };
39
- }
40
- }
41
- return undefined;
42
- }
43
- }]);
44
- }
45
- forceRefreshAfterExecution = true;
46
- async initialize() {
47
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
48
- if (!manifestChangesSupported) {
49
- return;
50
- }
51
- for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
52
- if (table) {
53
- const isActionApplicable = pageHasControlId(this.context.view, table.getId());
54
- if (isActionApplicable) {
55
- this.control = table;
56
- break;
57
- }
58
- }
59
- }
60
- }
61
- async execute() {
62
- if (!this.control) {
63
- return [];
64
- }
65
- const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
66
- const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
67
- enableTableFilterInPageVariant: !this.isDisabled
68
- });
69
- return command;
70
- }
71
- }
72
- var __exports = {
73
- __esModule: true
74
- };
75
- __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
76
- __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
77
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../control-types", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___control_types, ___utils, ___simple_quick_action_base, _____utils_core) {
4
+ "use strict";
5
+
6
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
7
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
+ const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
9
+ const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
10
+ const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
11
+ const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
12
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
13
+ const prepareManifestChange = ___utils["prepareManifestChange"];
14
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
15
+ const isA = _____utils_core["isA"];
16
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
17
+ const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
18
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
19
+
20
+ /**
21
+ * Quick Action for enabling table filtering using table personalization settings.
22
+ */
23
+ class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
24
+ constructor(context) {
25
+ super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context, [{
26
+ run: () => {
27
+ if (this.control) {
28
+ const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
29
+ if (typeof id !== 'string') {
30
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
31
+ }
32
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'enableTableFilterInPageVariant');
33
+ const isFilterEnabled = value === undefined ? this.control.data('p13nDialogSettings')?.filter?.visible : value;
34
+ if (isFilterEnabled) {
35
+ return {
36
+ type: 'error',
37
+ message: this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE')
38
+ };
39
+ }
40
+ }
41
+ return undefined;
42
+ }
43
+ }]);
44
+ }
45
+ forceRefreshAfterExecution = true;
46
+ async initialize() {
47
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
48
+ if (!manifestChangesSupported) {
49
+ return;
50
+ }
51
+ for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
52
+ if (table) {
53
+ const isActionApplicable = pageHasControlId(this.context.view, table.getId());
54
+ if (isActionApplicable) {
55
+ this.control = table;
56
+ break;
57
+ }
58
+ }
59
+ }
60
+ }
61
+ async execute() {
62
+ if (!this.control) {
63
+ return [];
64
+ }
65
+ const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
66
+ const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
67
+ enableTableFilterInPageVariant: !this.isDisabled
68
+ });
69
+ return command;
70
+ }
71
+ }
72
+ var __exports = {
73
+ __esModule: true
74
+ };
75
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
76
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
77
+ return __exports;
78
78
  });
79
79
  //# sourceMappingURL=lr-enable-table-filtering.js.map
@@ -1,71 +1,71 @@
1
- "use strict";
2
-
3
- sap.ui.define(["./utils", "../simple-quick-action-base", "sap/ui/core/Component"], function (___utils, ___simple_quick_action_base, Component) {
4
- "use strict";
5
-
6
- const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
7
- const prepareManifestChange = ___utils["prepareManifestChange"];
8
- const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
- const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
10
- const CONTROL_TYPES = ['sap.f.DynamicPage'];
11
-
12
- /**
13
- * Quick Action for enabling table filtering using table personalization settings.
14
- */
15
- class EnableListReportVariantManagementQuickAction extends SimpleQuickActionDefinitionBase {
16
- isPageSmartVariantManagementEnabled = false;
17
- forceRefreshAfterExecution = true;
18
- constructor(context) {
19
- super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT', context, [{
20
- run: () => {
21
- if (this.ownerComponent) {
22
- if (!this.isPageSmartVariantManagementEnabled) {
23
- return {
24
- type: 'error',
25
- message: this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED')
26
- };
27
- }
28
- }
29
- return undefined;
30
- }
31
- }]);
32
- }
33
- async initialize() {
34
- const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
35
- if (!manifestChangesSupported) {
36
- return;
37
- }
38
- await super.initialize();
39
- if (this.control) {
40
- this.ownerComponent = Component.getOwnerComponentFor(this.control);
41
- if (!this.ownerComponent?.isA('sap.suite.ui.generic.template.ListReport.Component') && !this.ownerComponent?.isA('sap.suite.ui.generic.template.AnalyticalListPage.Component')) {
42
- this.control = undefined;
43
- } else {
44
- const id = this.control.getId();
45
- if (typeof id !== 'string') {
46
- throw new Error('Could not retrieve configuration property because control id is not valid!');
47
- }
48
- const value = this.context.changeService.getConfigurationPropertyValue(id, 'smartVariantManagement');
49
- this.isPageSmartVariantManagementEnabled = value === undefined ? this.ownerComponent.getSmartVariantManagement() : value;
50
- }
51
- }
52
- }
53
- async execute() {
54
- if (!this.control) {
55
- return [];
56
- }
57
- const entitySet = this.ownerComponent.getEntitySet();
58
- const command = await prepareManifestChange(this.context, 'component/settings', this.control, this.ownerComponent.getMetadata().getComponentName(), entitySet, {
59
- smartVariantManagement: !this.isPageSmartVariantManagementEnabled
60
- });
61
- return command;
62
- }
63
- }
64
- var __exports = {
65
- __esModule: true
66
- };
67
- __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
68
- __exports.EnableListReportVariantManagementQuickAction = EnableListReportVariantManagementQuickAction;
69
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["./utils", "../simple-quick-action-base", "sap/ui/core/Component"], function (___utils, ___simple_quick_action_base, Component) {
4
+ "use strict";
5
+
6
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
7
+ const prepareManifestChange = ___utils["prepareManifestChange"];
8
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
9
+ const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts';
10
+ const CONTROL_TYPES = ['sap.f.DynamicPage'];
11
+
12
+ /**
13
+ * Quick Action for enabling table filtering using table personalization settings.
14
+ */
15
+ class EnableListReportVariantManagementQuickAction extends SimpleQuickActionDefinitionBase {
16
+ isPageSmartVariantManagementEnabled = false;
17
+ forceRefreshAfterExecution = true;
18
+ constructor(context) {
19
+ super(ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT', context, [{
20
+ run: () => {
21
+ if (this.ownerComponent) {
22
+ if (!this.isPageSmartVariantManagementEnabled) {
23
+ return {
24
+ type: 'error',
25
+ message: this.context.resourceBundle.getText('VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED')
26
+ };
27
+ }
28
+ }
29
+ return undefined;
30
+ }
31
+ }]);
32
+ }
33
+ async initialize() {
34
+ const manifestChangesSupported = await areManifestChangesSupported(this.context.manifest);
35
+ if (!manifestChangesSupported) {
36
+ return;
37
+ }
38
+ await super.initialize();
39
+ if (this.control) {
40
+ this.ownerComponent = Component.getOwnerComponentFor(this.control);
41
+ if (!this.ownerComponent?.isA('sap.suite.ui.generic.template.ListReport.Component') && !this.ownerComponent?.isA('sap.suite.ui.generic.template.AnalyticalListPage.Component')) {
42
+ this.control = undefined;
43
+ } else {
44
+ const id = this.control.getId();
45
+ if (typeof id !== 'string') {
46
+ throw new Error('Could not retrieve configuration property because control id is not valid!');
47
+ }
48
+ const value = this.context.changeService.getConfigurationPropertyValue(id, 'smartVariantManagement');
49
+ this.isPageSmartVariantManagementEnabled = value === undefined ? this.ownerComponent.getSmartVariantManagement() : value;
50
+ }
51
+ }
52
+ }
53
+ async execute() {
54
+ if (!this.control) {
55
+ return [];
56
+ }
57
+ const entitySet = this.ownerComponent.getEntitySet();
58
+ const command = await prepareManifestChange(this.context, 'component/settings', this.control, this.ownerComponent.getMetadata().getComponentName(), entitySet, {
59
+ smartVariantManagement: !this.isPageSmartVariantManagementEnabled
60
+ });
61
+ return command;
62
+ }
63
+ }
64
+ var __exports = {
65
+ __esModule: true
66
+ };
67
+ __exports.ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS;
68
+ __exports.EnableListReportVariantManagementQuickAction = EnableListReportVariantManagementQuickAction;
69
+ return __exports;
70
70
  });
71
71
  //# sourceMappingURL=lr-enable-variant-management.js.map
@@ -1,61 +1,61 @@
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_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
- const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
13
-
14
- /**
15
- * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
16
- */
17
- class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
18
- constructor(context) {
19
- super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
20
- }
21
- isClearButtonEnabled = false;
22
- initialize() {
23
- const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
24
- for (const control of controls) {
25
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
26
- const modifiedControl = getControlById(control.controlId);
27
- if (isActionApplicable && modifiedControl) {
28
- this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
29
- this.control = modifiedControl;
30
- }
31
- }
32
- return Promise.resolve();
33
- }
34
- get textKey() {
35
- return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
36
- }
37
- async execute() {
38
- if (this.control) {
39
- const {
40
- flexSettings
41
- } = this.context;
42
- const modifiedValue = {
43
- generator: flexSettings.generator,
44
- propertyName: PROPERTY_NAME,
45
- newValue: !this.isClearButtonEnabled
46
- };
47
- const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
48
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
49
- return [command];
50
- }
51
- return [];
52
- }
53
- }
54
- var __exports = {
55
- __esModule: true
56
- };
57
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
58
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
59
- 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_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
12
+ const CONTROL_TYPE_ALP = 'sap.suite.ui.generic.template.AnalyticalListPage.control.SmartFilterBarExt';
13
+
14
+ /**
15
+ * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
16
+ */
17
+ class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
18
+ constructor(context) {
19
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
20
+ }
21
+ isClearButtonEnabled = false;
22
+ initialize() {
23
+ const controls = [...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), ...(this.context.controlIndex[CONTROL_TYPE_ALP] ?? [])];
24
+ for (const control of controls) {
25
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
26
+ const modifiedControl = getControlById(control.controlId);
27
+ if (isActionApplicable && modifiedControl) {
28
+ this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
29
+ this.control = modifiedControl;
30
+ }
31
+ }
32
+ return Promise.resolve();
33
+ }
34
+ get textKey() {
35
+ return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
36
+ }
37
+ async execute() {
38
+ if (this.control) {
39
+ const {
40
+ flexSettings
41
+ } = this.context;
42
+ const modifiedValue = {
43
+ generator: flexSettings.generator,
44
+ propertyName: PROPERTY_NAME,
45
+ newValue: !this.isClearButtonEnabled
46
+ };
47
+ const command = await CommandFactory.getCommandFor(this.control, 'Property', modifiedValue, null, flexSettings);
48
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
49
+ return [command];
50
+ }
51
+ return [];
52
+ }
53
+ }
54
+ var __exports = {
55
+ __esModule: true
56
+ };
57
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
58
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
59
+ return __exports;
60
60
  });
61
61
  //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map