@sap-ux/preview-middleware 0.16.130 → 0.16.132

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 (29) hide show
  1. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +11 -48
  2. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +16 -44
  3. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +69 -0
  4. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +79 -0
  5. package/dist/client/adp/quick-actions/fe-v2/registry.js +3 -2
  6. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  7. package/dist/client/adp/quick-actions/fe-v2/utils.js +77 -0
  8. package/dist/client/adp/quick-actions/fe-v2/utils.ts +72 -0
  9. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +1 -5
  10. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +0 -4
  11. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -0
  12. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +96 -0
  13. package/dist/client/adp/quick-actions/fe-v4/registry.js +3 -2
  14. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  15. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +9 -3
  16. package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +10 -3
  17. package/dist/client/adp/quick-actions/simple-quick-action-base.js +6 -2
  18. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +9 -2
  19. package/dist/client/adp/quick-actions/table-quick-action-base.js +13 -4
  20. package/dist/client/adp/quick-actions/table-quick-action-base.ts +17 -5
  21. package/dist/client/cpe/changes/flex-change.js +7 -19
  22. package/dist/client/cpe/changes/flex-change.ts +5 -29
  23. package/dist/client/cpe/quick-actions/quick-action-definition.ts +1 -6
  24. package/dist/client/cpe/quick-actions/quick-action-service.js +1 -1
  25. package/dist/client/cpe/quick-actions/quick-action-service.ts +1 -1
  26. package/dist/client/messagebundle.properties +2 -1
  27. package/dist/client/utils/fe-v4.js +30 -1
  28. package/dist/client/utils/fe-v4.ts +45 -1
  29. package/package.json +4 -4
@@ -1,18 +1,17 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/feature-service", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "../../../utils/version"], function (CommandFactory, _____cpe_feature_service, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, _____utils_version) {
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
4
4
  "use strict";
5
5
 
6
- const FeatureService = _____cpe_feature_service["FeatureService"];
7
6
  const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
7
  const getControlById = _____utils_core["getControlById"];
8
+ const isA = _____utils_core["isA"];
9
9
  const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
10
- const getUi5Version = _____utils_version["getUi5Version"];
11
- const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
12
- const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
10
+ const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
11
+ const prepareManifestChange = ___utils["prepareManifestChange"];
13
12
  const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
14
13
  const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
15
-
14
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
16
15
  /**
17
16
  * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
18
17
  */
@@ -23,29 +22,10 @@ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/feature-servic
23
22
  forceRefreshAfterExecution = true;
24
23
  isUseDateRangeTypeEnabled = false;
25
24
  async initialize() {
26
- const version = await getUi5Version();
27
- const isUI5VersionNotSupported = isLowerThanMinimalUi5Version(version, {
28
- major: 1,
29
- minor: 128
30
- }) && !(isVersionEqualOrHasNewerPatch(version, {
31
- major: 1,
32
- minor: 96,
33
- patch: 37
34
- }) || isVersionEqualOrHasNewerPatch(version, {
35
- major: 1,
36
- minor: 108,
37
- patch: 38
38
- }) || isVersionEqualOrHasNewerPatch(version, {
39
- major: 1,
40
- minor: 120,
41
- patch: 23
42
- }));
25
+ const isUI5VersionNotSupported = await areManifestChangesSupported();
43
26
  if (isUI5VersionNotSupported) {
44
27
  return;
45
28
  }
46
- if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
47
- return;
48
- }
49
29
  const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
50
30
  for (const control of controls) {
51
31
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
@@ -60,29 +40,12 @@ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/feature-servic
60
40
  return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
61
41
  }
62
42
  async execute() {
63
- const {
64
- flexSettings
65
- } = this.context;
66
- const modifiedValue = {
67
- changeType: 'appdescr_ui_generic_app_changePageConfiguration',
68
- reference: flexSettings.projectId,
69
- parameters: {
70
- parentPage: {
71
- component: 'sap.suite.ui.generic.template.ListReport',
72
- entitySet: this.control.getEntitySet()
73
- },
74
- entityPropertyChange: {
75
- propertyPath: 'component/settings/filterSettings/dateSettings',
76
- operation: 'UPSERT',
77
- propertyValue: {
78
- useDateRange: !this.isUseDateRangeTypeEnabled
79
- }
80
- }
81
- }
82
- };
83
- const command = await CommandFactory.getCommandFor(this.control, 'appDescriptor', modifiedValue, null, flexSettings);
43
+ const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
44
+ const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
45
+ useDateRange: !this.isUseDateRangeTypeEnabled
46
+ });
84
47
  this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
85
- return [command];
48
+ return command;
86
49
  }
87
50
  }
88
51
  var __exports = {
@@ -1,18 +1,15 @@
1
1
  import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
- import CommandFactory from 'sap/ui/rta/command/CommandFactory';
3
2
  import type FilterBar from 'sap/ui/comp/filterbar/FilterBar';
4
- import SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar';
5
-
6
- import { FeatureService } from '../../../cpe/feature-service';
7
3
  import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
8
4
  import { pageHasControlId } from '../../../cpe/quick-actions/utils';
9
- import { getControlById } from '../../../utils/core';
5
+ import { getControlById, isA } from '../../../utils/core';
10
6
  import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
11
- import { getUi5Version, isVersionEqualOrHasNewerPatch, isLowerThanMinimalUi5Version } from '../../../utils/version';
7
+ import { areManifestChangesSupported, prepareManifestChange } from './utils';
8
+ import SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar';
12
9
 
13
10
  export const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
14
11
  const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
15
-
12
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
16
13
  /**
17
14
  * Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
18
15
  */
@@ -27,21 +24,10 @@ export class ToggleSemanticDateRangeFilterBar
27
24
  private isUseDateRangeTypeEnabled = false;
28
25
 
29
26
  async initialize(): Promise<void> {
30
- const version = await getUi5Version();
31
- const isUI5VersionNotSupported =
32
- isLowerThanMinimalUi5Version(version, { major: 1, minor: 128 }) &&
33
- !(
34
- isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 96, patch: 37 }) ||
35
- isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 108, patch: 38 }) ||
36
- isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 120, patch: 23 })
37
- );
38
-
27
+ const isUI5VersionNotSupported = await areManifestChangesSupported();
39
28
  if (isUI5VersionNotSupported) {
40
29
  return;
41
30
  }
42
- if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
43
- return;
44
- }
45
31
  const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
46
32
  for (const control of controls) {
47
33
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
@@ -60,34 +46,20 @@ export class ToggleSemanticDateRangeFilterBar
60
46
  }
61
47
 
62
48
  async execute(): Promise<FlexCommand[]> {
63
- const { flexSettings } = this.context;
64
-
65
- const modifiedValue = {
66
- changeType: 'appdescr_ui_generic_app_changePageConfiguration',
67
- reference: flexSettings.projectId,
68
- parameters: {
69
- parentPage: {
70
- component: 'sap.suite.ui.generic.template.ListReport',
71
- entitySet: (this.control as SmartFilterBar).getEntitySet()
72
- },
73
- entityPropertyChange: {
74
- propertyPath: 'component/settings/filterSettings/dateSettings',
75
- operation: 'UPSERT',
76
- propertyValue: {
77
- useDateRange: !this.isUseDateRangeTypeEnabled
78
- }
79
- }
80
- }
81
- };
82
- const command = await CommandFactory.getCommandFor<FlexCommand>(
49
+ const entitySet = isA<SmartFilterBar>(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
50
+ const command = await prepareManifestChange(
51
+ this.context,
52
+ 'component/settings/filterSettings/dateSettings',
83
53
  this.control!,
84
- 'appDescriptor',
85
- modifiedValue,
86
- null,
87
- flexSettings
54
+ COMPONENT,
55
+ entitySet,
56
+ {
57
+ useDateRange: !this.isUseDateRangeTypeEnabled
58
+ }
88
59
  );
89
60
 
90
61
  this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
91
- return [command];
62
+
63
+ return command;
92
64
  }
93
65
  }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../table-quick-action-base", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___table_quick_action_base, ___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 = ___table_quick_action_base["GRID_TABLE_TYPE"];
9
+ const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
10
+ const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
11
+ const TREE_TABLE_TYPE = ___table_quick_action_base["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
+ }
27
+ forceRefreshAfterExecution = true;
28
+ lsTableMap = {};
29
+ get tooltip() {
30
+ return this.isDisabled ? this.context.resourceBundle.getText('THE_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
31
+ }
32
+ async initialize() {
33
+ const isUI5VersionNotSupported = await areManifestChangesSupported();
34
+ if (isUI5VersionNotSupported) {
35
+ return;
36
+ }
37
+ for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
38
+ if (table) {
39
+ const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
40
+ const isActionApplicable = pageHasControlId(this.context.view, table.getId());
41
+ if (isActionApplicable) {
42
+ this.isDisabled = isFilterEnabled;
43
+ this.control = table;
44
+ break;
45
+ }
46
+ }
47
+ }
48
+ return Promise.resolve();
49
+ }
50
+ async execute() {
51
+ if (!this.control) {
52
+ return [];
53
+ }
54
+ const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
55
+ const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
56
+ enableTableFilterInPageVariant: !this.isDisabled
57
+ });
58
+ this.isDisabled = !this.isDisabled;
59
+ return command;
60
+ }
61
+ }
62
+ var __exports = {
63
+ __esModule: true
64
+ };
65
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
66
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
67
+ return __exports;
68
+ });
69
+ //# sourceMappingURL=lr-enable-table-filtering.js.map
@@ -0,0 +1,79 @@
1
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
+ import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
3
+ import { getRelevantControlFromActivePage, pageHasControlId } from '../../../cpe/quick-actions/utils';
4
+ import { GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../table-quick-action-base';
5
+ import { areManifestChangesSupported, prepareManifestChange } from './utils';
6
+
7
+ import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
8
+ import { isA } from '../../../utils/core';
9
+ import SmartTable from 'sap/ui/comp/smarttable/SmartTable';
10
+ const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
11
+
12
+ export const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
13
+
14
+ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
15
+
16
+ /**
17
+ * Quick Action for enabling table filtering using table personalization settings.
18
+ */
19
+ export class EnableTableFilteringQuickAction
20
+ extends SimpleQuickActionDefinitionBase
21
+ implements SimpleQuickActionDefinition
22
+ {
23
+ constructor(context: QuickActionContext) {
24
+ super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
25
+ }
26
+ isActive: boolean;
27
+ readonly forceRefreshAfterExecution = true;
28
+ lsTableMap: Record<string, number> = {};
29
+ public get tooltip(): string | undefined {
30
+ return this.isDisabled ? this.context.resourceBundle.getText('THE_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
31
+ }
32
+
33
+ async initialize(): Promise<void> {
34
+ const isUI5VersionNotSupported = await areManifestChangesSupported();
35
+ if (isUI5VersionNotSupported) {
36
+ return;
37
+ }
38
+
39
+ for (const table of getRelevantControlFromActivePage(
40
+ this.context.controlIndex,
41
+ this.context.view,
42
+ CONTROL_TYPES
43
+ )) {
44
+ if (table) {
45
+ const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
46
+ const isActionApplicable = pageHasControlId(this.context.view, table.getId());
47
+ if (isActionApplicable) {
48
+ this.isDisabled = isFilterEnabled;
49
+ this.control = table;
50
+ break;
51
+ }
52
+ }
53
+ }
54
+
55
+ return Promise.resolve();
56
+ }
57
+
58
+ async execute(): Promise<FlexCommand[]> {
59
+ if (!this.control) {
60
+ return [];
61
+ }
62
+
63
+ const entitySet = isA<SmartTable>(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
64
+ const command = await prepareManifestChange(
65
+ this.context,
66
+ 'component/settings',
67
+ this.control,
68
+ COMPONENT,
69
+ entitySet,
70
+ {
71
+ enableTableFilterInPageVariant: !this.isDisabled
72
+ }
73
+ );
74
+
75
+ this.isDisabled = !this.isDisabled;
76
+
77
+ return command;
78
+ }
79
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
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-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_semantic_date_range_filter_bar) {
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
4
  "use strict";
5
5
 
6
6
  const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
@@ -12,6 +12,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
12
12
  const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
13
13
  const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
14
14
  const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
15
+ const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
15
16
  const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
16
17
  const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
17
18
  const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
@@ -36,7 +37,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
36
37
  if (name === 'listReport') {
37
38
  definitionGroups.push({
38
39
  title: 'LIST REPORT',
39
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
40
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
40
41
  view,
41
42
  key: name + index
42
43
  });
@@ -17,6 +17,7 @@ import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
17
17
  import { AddTableActionQuickAction } from '../fe-v2/create-table-action';
18
18
  import { AddTableCustomColumnQuickAction } from './create-table-custom-column';
19
19
  import { AddPageActionQuickAction } from '../common/create-page-action';
20
+ import { EnableTableFilteringQuickAction } from './lr-enable-table-filtering';
20
21
  import { ToggleSemanticDateRangeFilterBar } from './lr-enable-semantic-date-range-filter-bar';
21
22
  type PageName = 'listReport' | 'objectPage' | 'analyticalListPage';
22
23
 
@@ -48,7 +49,8 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
48
49
  ToggleSemanticDateRangeFilterBar,
49
50
  ChangeTableColumnsQuickAction,
50
51
  AddTableActionQuickAction,
51
- AddTableCustomColumnQuickAction
52
+ AddTableCustomColumnQuickAction,
53
+ EnableTableFilteringQuickAction
52
54
  ],
53
55
  view,
54
56
  key: name + index
@@ -0,0 +1,77 @@
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 supports manifest changes in v2 applications.
46
+ *
47
+ * Returns `true` if the UI5 version is supported.
48
+ * Otherwise, returns `false`.
49
+ *
50
+ */
51
+ async function areManifestChangesSupported() {
52
+ const version = await getUi5Version();
53
+ return isLowerThanMinimalUi5Version(version, {
54
+ major: 1,
55
+ minor: 128
56
+ }) && !(isVersionEqualOrHasNewerPatch(version, {
57
+ major: 1,
58
+ minor: 96,
59
+ patch: 37
60
+ }) || isVersionEqualOrHasNewerPatch(version, {
61
+ major: 1,
62
+ minor: 108,
63
+ patch: 38
64
+ }) || isVersionEqualOrHasNewerPatch(version, {
65
+ major: 1,
66
+ minor: 120,
67
+ patch: 23
68
+ }));
69
+ }
70
+ var __exports = {
71
+ __esModule: true
72
+ };
73
+ __exports.prepareManifestChange = prepareManifestChange;
74
+ __exports.areManifestChangesSupported = areManifestChangesSupported;
75
+ return __exports;
76
+ });
77
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,72 @@
1
+ import UI5Element from 'sap/ui/core/Element';
2
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
3
+ import CommandFactory from 'sap/ui/rta/command/CommandFactory';
4
+
5
+ import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
6
+ import { getUi5Version, isLowerThanMinimalUi5Version, isVersionEqualOrHasNewerPatch } from '../../../utils/version';
7
+
8
+ /**
9
+ * Prepares the change for the manifest setting.
10
+ *
11
+ * @param context - The context object containing flexSettings.
12
+ * @param propertyPath - The path of the property in the manifest.
13
+ * @param control - The UI5 element representing the control.
14
+ * @param component - component name e.g list report or object page.
15
+ * @param entitySet - Entity Set name.
16
+ * @param propertyValue - The value to be set for the property.
17
+ *
18
+ * @returns A Promise resolving to an array of FlexCommand objects.
19
+ */
20
+ export async function prepareManifestChange(
21
+ context: QuickActionContext,
22
+ propertyPath: string,
23
+ control: UI5Element,
24
+ component: string,
25
+ entitySet: string | undefined,
26
+ propertyValue: object
27
+ ): Promise<FlexCommand[]> {
28
+ const { flexSettings } = context;
29
+
30
+ const modifiedValue = {
31
+ changeType: 'appdescr_ui_generic_app_changePageConfiguration',
32
+ reference: flexSettings.projectId,
33
+ parameters: {
34
+ parentPage: {
35
+ component,
36
+ entitySet
37
+ },
38
+ entityPropertyChange: {
39
+ propertyPath: propertyPath,
40
+ operation: 'UPSERT',
41
+ propertyValue: propertyValue
42
+ }
43
+ }
44
+ };
45
+ const command = await CommandFactory.getCommandFor<FlexCommand>(
46
+ control,
47
+ 'appDescriptor',
48
+ modifiedValue,
49
+ null,
50
+ flexSettings
51
+ );
52
+ return [command];
53
+ }
54
+
55
+ /**
56
+ * Checks if the current UI5 version supports manifest changes in v2 applications.
57
+ *
58
+ * Returns `true` if the UI5 version is supported.
59
+ * Otherwise, returns `false`.
60
+ *
61
+ */
62
+ export async function areManifestChangesSupported(): Promise<boolean> {
63
+ const version = await getUi5Version();
64
+ return (
65
+ isLowerThanMinimalUi5Version(version, { major: 1, minor: 128 }) &&
66
+ !(
67
+ isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 96, patch: 37 }) ||
68
+ isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 108, patch: 38 }) ||
69
+ isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 120, patch: 23 })
70
+ )
71
+ );
72
+ }
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["../../../cpe/feature-service", "../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_feature_service, _____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
3
+ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
4
4
  "use strict";
5
5
 
6
- const FeatureService = _____cpe_feature_service["FeatureService"];
7
6
  const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
8
7
  const getControlById = _____utils_core["getControlById"];
9
8
  const executeToggleAction = ___utils["executeToggleAction"];
@@ -26,9 +25,6 @@ sap.ui.define(["../../../cpe/feature-service", "../../../cpe/quick-actions/utils
26
25
  forceRefreshAfterExecution = true;
27
26
  isUseDateRangeTypeEnabled = false;
28
27
  initialize() {
29
- if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
30
- return;
31
- }
32
28
  const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
33
29
  for (const control of controls) {
34
30
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
@@ -1,7 +1,6 @@
1
1
  import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
2
  import FilterBar from 'sap/ui/mdc/FilterBar';
3
3
 
4
- import { FeatureService } from '../../../cpe/feature-service';
5
4
  import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
6
5
  import { pageHasControlId } from '../../../cpe/quick-actions/utils';
7
6
  import { getControlById } from '../../../utils/core';
@@ -30,9 +29,6 @@ export class ToggleSemanticDateRangeFilterBar
30
29
  private isUseDateRangeTypeEnabled = false;
31
30
 
32
31
  initialize(): void {
33
- if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
34
- return;
35
- }
36
32
  const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
37
33
  for (const control of controls) {
38
34
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils", "../../../utils/fe-v4", "../../../utils/version"], function (___table_quick_action_base, _____cpe_quick_actions_utils, _____utils_fe_v4, _____utils_version) {
4
+ "use strict";
5
+
6
+ const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
7
+ const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
8
+ const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
9
+ const getUi5Version = _____utils_version["getUi5Version"];
10
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
11
+ const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
12
+ const CONTROL_TYPE = 'sap.ui.mdc.Table';
13
+ /**
14
+ * Quick Action for enabling table filtering using table personalization settings.
15
+ */
16
+ class EnableTableFilteringQuickAction extends TableQuickActionDefinitionBase {
17
+ constructor(context) {
18
+ super(ENABLE_TABLE_FILTERING, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
19
+ }
20
+ forceRefreshAfterExecution = true;
21
+ async initialize() {
22
+ const version = await getUi5Version();
23
+ if (isLowerThanMinimalUi5Version(version, {
24
+ major: 1,
25
+ minor: 131
26
+ })) {
27
+ this.isApplicable = false;
28
+ return;
29
+ }
30
+ const tooltipText = this.context.resourceBundle.getText('THE_CHANGE_HAS_ALREADY_BEEN_MADE');
31
+ let index = 0;
32
+ for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE])) {
33
+ const personalizationData = smartTable.getP13nMode();
34
+ const value = this.context.changeService.getConfigurationPropertyValue(smartTable.getId(), 'personalization');
35
+ const isFilterEnabled = value?.filter === undefined ? personalizationData.includes('Filter') : value.filter;
36
+ this.children.push({
37
+ label: `'${smartTable.getHeader()}' table`,
38
+ enabled: !isFilterEnabled,
39
+ tooltip: isFilterEnabled ? tooltipText : undefined,
40
+ children: []
41
+ });
42
+ this.tableMap[`${this.children.length - 1}`] = index;
43
+ index++;
44
+ }
45
+ if (this.children.length > 0) {
46
+ this.isApplicable = true;
47
+ }
48
+ return Promise.resolve();
49
+ }
50
+ async execute(path) {
51
+ const {
52
+ flexSettings
53
+ } = this.context;
54
+ const index = this.tableMap[path];
55
+ const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [CONTROL_TYPE]);
56
+ const modifiedControl = smartTables[index];
57
+ if (!modifiedControl) {
58
+ return [];
59
+ }
60
+ const propertyChange = {
61
+ personalization: {
62
+ sort: true,
63
+ column: true,
64
+ filter: true,
65
+ group: true,
66
+ aggregate: true
67
+ }
68
+ };
69
+ const command = await createManifestPropertyChange(modifiedControl, flexSettings, propertyChange);
70
+ if (command) {
71
+ return [command];
72
+ } else {
73
+ return [];
74
+ }
75
+ }
76
+ }
77
+ var __exports = {
78
+ __esModule: true
79
+ };
80
+ __exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
81
+ __exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
82
+ return __exports;
83
+ });
84
+ //# sourceMappingURL=lr-enable-table-filtering.js.map