@sap-ux/preview-middleware 0.16.64 → 0.16.65

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 (22) hide show
  1. package/dist/client/adp/command-executor.ts +2 -2
  2. package/dist/client/adp/controllers/AddFragment.controller.js +13 -0
  3. package/dist/client/adp/controllers/AddFragment.controller.ts +17 -1
  4. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -69
  5. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +11 -23
  6. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +34 -0
  7. package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +35 -0
  8. package/dist/client/adp/quick-actions/common/op-add-header-field.js +42 -58
  9. package/dist/client/adp/quick-actions/common/op-add-header-field.ts +5 -34
  10. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -65
  11. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +12 -27
  12. package/dist/client/adp/quick-actions/fe-v2/registry.js +3 -2
  13. package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
  14. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +76 -83
  15. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +11 -19
  16. package/dist/client/adp/quick-actions/fe-v4/registry.js +3 -2
  17. package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
  18. package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -0
  19. package/dist/client/adp/quick-actions/simple-quick-action-base.ts +53 -0
  20. package/dist/client/messagebundle.properties +1 -0
  21. package/dist/client/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +6 -6
@@ -2,36 +2,27 @@ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
2
  import CommandFactory from 'sap/ui/rta/command/CommandFactory';
3
3
  import type FilterBar from 'sap/ui/comp/filterbar/FilterBar';
4
4
 
5
- import { SIMPLE_QUICK_ACTION_KIND, SimpleQuickAction } from '@sap-ux-private/control-property-editor-common';
6
-
7
5
  import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
8
-
9
6
  import { pageHasControlId } from '../../../cpe/quick-actions/utils';
10
7
  import { getControlById } from '../../../utils/core';
8
+ import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
11
9
 
12
10
  export const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
13
11
  const PROPERTY_NAME = 'showClearOnFB';
14
-
15
12
  const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
16
13
 
17
14
  /**
18
15
  * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
19
16
  */
20
- export class ToggleClearFilterBarQuickAction implements SimpleQuickActionDefinition {
21
- readonly kind = SIMPLE_QUICK_ACTION_KIND;
22
- readonly type = ENABLE_CLEAR_FILTER_BAR_TYPE;
23
-
24
- public get id(): string {
25
- return `${this.context.key}-${this.type}`;
26
- }
27
-
28
- public get isActive(): boolean {
29
- return !!this.filterBar;
17
+ export class ToggleClearFilterBarQuickAction
18
+ extends SimpleQuickActionDefinitionBase
19
+ implements SimpleQuickActionDefinition
20
+ {
21
+ constructor(context: QuickActionContext) {
22
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
30
23
  }
31
24
 
32
25
  private isClearButtonEnabled = false;
33
- private filterBar: FilterBar | undefined;
34
- constructor(private context: QuickActionContext) {}
35
26
 
36
27
  initialize(): void {
37
28
  const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
@@ -40,25 +31,19 @@ export class ToggleClearFilterBarQuickAction implements SimpleQuickActionDefinit
40
31
  const modifiedControl = getControlById<FilterBar>(control.controlId);
41
32
  if (isActionApplicable && modifiedControl) {
42
33
  this.isClearButtonEnabled = modifiedControl.getShowClearOnFB();
43
- this.filterBar = modifiedControl;
34
+ this.control = modifiedControl;
44
35
  }
45
36
  }
46
37
  }
47
38
 
48
- getActionObject(): SimpleQuickAction {
49
- const key = this.isClearButtonEnabled
39
+ protected get textKey() {
40
+ return this.isClearButtonEnabled
50
41
  ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR'
51
42
  : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
52
- return {
53
- kind: SIMPLE_QUICK_ACTION_KIND,
54
- id: this.id,
55
- enabled: this.isActive,
56
- title: this.context.resourceBundle.getText(key)
57
- };
58
43
  }
59
44
 
60
45
  async execute(): Promise<FlexCommand[]> {
61
- if (this.filterBar) {
46
+ if (this.control) {
62
47
  const { flexSettings } = this.context;
63
48
 
64
49
  const modifiedValue = {
@@ -68,7 +53,7 @@ export class ToggleClearFilterBarQuickAction implements SimpleQuickActionDefinit
68
53
  };
69
54
 
70
55
  const command = await CommandFactory.getCommandFor<FlexCommand>(
71
- this.filterBar,
56
+ this.control,
72
57
  'Property',
73
58
  modifiedValue,
74
59
  null,
@@ -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"], 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) {
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"], 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) {
4
4
  "use strict";
5
5
 
6
6
  const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
@@ -8,6 +8,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
8
8
  const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
9
9
  const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
10
10
  const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
11
+ const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
11
12
  const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
12
13
  const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
13
14
 
@@ -37,7 +38,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
37
38
  } else if (name === 'objectPage') {
38
39
  definitionGroups.push({
39
40
  title: 'OBJECT PAGE',
40
- definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction],
41
+ definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction],
41
42
  view,
42
43
  key: name + index
43
44
  });
@@ -13,6 +13,7 @@ import { AddControllerToPageQuickAction } from '../common/add-controller-to-page
13
13
  import { ToggleClearFilterBarQuickAction } from './lr-toggle-clear-filter-bar';
14
14
  import { ChangeTableColumnsQuickAction } from './change-table-columns';
15
15
  import { AddHeaderFieldQuickAction } from '../common/op-add-header-field';
16
+ import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
16
17
 
17
18
  type PageName = 'listReport' | 'objectPage';
18
19
 
@@ -50,7 +51,8 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
50
51
  definitions: [
51
52
  AddControllerToPageQuickAction,
52
53
  ChangeTableColumnsQuickAction,
53
- AddHeaderFieldQuickAction
54
+ AddHeaderFieldQuickAction,
55
+ AddCustomSectionQuickAction
54
56
  ],
55
57
  view,
56
58
  key: name + index
@@ -1,88 +1,81 @@
1
- 'use strict';
2
- sap.ui.define([
3
- 'sap/ui/rta/command/CommandFactory',
4
- 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
5
- '../../../cpe/quick-actions/utils',
6
- '../../../utils/core',
7
- './utils'
8
- ], function (CommandFactory, ___sap_ux_private_control_property_editor_common, _____cpe_quick_actions_utils, _____utils_core, ___utils) {
9
- 'use strict';
10
- const SIMPLE_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['SIMPLE_QUICK_ACTION_KIND'];
11
- const pageHasControlId = _____cpe_quick_actions_utils['pageHasControlId'];
12
- const getControlById = _____utils_core['getControlById'];
13
- const getAppComponent = ___utils['getAppComponent'];
14
- const getPageName = ___utils['getPageName'];
15
- const getReference = ___utils['getReference'];
16
- const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
17
- const PROPERTY_PATH = 'controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/showClearButton';
18
- const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
19
- class ToggleClearFilterBarQuickAction {
20
- kind = SIMPLE_QUICK_ACTION_KIND;
21
- type = ENABLE_CLEAR_FILTER_BAR_TYPE;
22
- forceRefreshAfterExecution = true;
23
- get id() {
24
- return `${ this.context.key }-${ this.type }`;
25
- }
26
- isActive = false;
27
- isClearButtonEnabled = false;
28
- constructor(context) {
29
- this.context = context;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (CommandFactory, _____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
4
+ "use strict";
5
+
6
+ const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
7
+ const getControlById = _____utils_core["getControlById"];
8
+ const getAppComponent = ___utils["getAppComponent"];
9
+ const getPageName = ___utils["getPageName"];
10
+ const getReference = ___utils["getReference"];
11
+ const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
12
+ const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
13
+ const PROPERTY_PATH = 'controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/showClearButton';
14
+ const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
15
+
16
+ /**
17
+ * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
18
+ */
19
+ class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase {
20
+ constructor(context) {
21
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
22
+ }
23
+ forceRefreshAfterExecution = true;
24
+ isClearButtonEnabled = false;
25
+ initialize() {
26
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
27
+ for (const control of controls) {
28
+ const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
29
+ const filterBar = getControlById(control.controlId);
30
+ if (isActionApplicable && filterBar) {
31
+ this.control = filterBar;
32
+ this.isClearButtonEnabled = filterBar.getShowClearButton();
30
33
  }
31
- initialize() {
32
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
33
- for (const control of controls) {
34
- const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
35
- const filterBar = getControlById(control.controlId);
36
- if (isActionApplicable && filterBar) {
37
- this.isActive = true;
38
- this.isClearButtonEnabled = filterBar.getShowClearButton();
39
- }
40
- }
34
+ }
35
+ }
36
+ get textKey() {
37
+ return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
38
+ }
39
+ async execute() {
40
+ const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
41
+ const control = controls[0];
42
+ if (control) {
43
+ const modifiedControl = getControlById(control.controlId);
44
+ if (!modifiedControl) {
45
+ return [];
41
46
  }
42
- getActionObject() {
43
- const key = this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
44
- return {
45
- kind: SIMPLE_QUICK_ACTION_KIND,
46
- id: this.id,
47
- enabled: this.isActive,
48
- title: this.context.resourceBundle.getText(key)
49
- };
47
+ const {
48
+ flexSettings
49
+ } = this.context;
50
+ const parent = modifiedControl.getParent();
51
+ if (!parent) {
52
+ return [];
50
53
  }
51
- async execute() {
52
- const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
53
- const control = controls[0];
54
- if (control) {
55
- const modifiedControl = getControlById(control.controlId);
56
- if (!modifiedControl) {
57
- return [];
58
- }
59
- const {flexSettings} = this.context;
60
- const parent = modifiedControl.getParent();
61
- if (!parent) {
62
- return [];
63
- }
64
- const modifiedValue = {
65
- reference: getReference(modifiedControl),
66
- appComponent: getAppComponent(modifiedControl),
67
- changeType: 'appdescr_fe_changePageConfiguration',
68
- parameters: {
69
- page: getPageName(parent),
70
- entityPropertyChange: {
71
- propertyPath: PROPERTY_PATH,
72
- propertyValue: !this.isClearButtonEnabled,
73
- operation: 'UPSERT'
74
- }
75
- }
76
- };
77
- const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
78
- this.isClearButtonEnabled = !this.isClearButtonEnabled;
79
- return [command];
54
+ const modifiedValue = {
55
+ reference: getReference(modifiedControl),
56
+ appComponent: getAppComponent(modifiedControl),
57
+ changeType: 'appdescr_fe_changePageConfiguration',
58
+ parameters: {
59
+ page: getPageName(parent),
60
+ entityPropertyChange: {
61
+ propertyPath: PROPERTY_PATH,
62
+ propertyValue: !this.isClearButtonEnabled,
63
+ operation: 'UPSERT'
80
64
  }
81
- return [];
82
- }
65
+ }
66
+ };
67
+ const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
68
+ this.isClearButtonEnabled = !this.isClearButtonEnabled;
69
+ return [command];
70
+ }
71
+ return [];
83
72
  }
84
- var __exports = { __esModule: true };
85
- __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
86
- __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
87
- return __exports;
88
- });
73
+ }
74
+ var __exports = {
75
+ __esModule: true
76
+ };
77
+ __exports.ENABLE_CLEAR_FILTER_BAR_TYPE = ENABLE_CLEAR_FILTER_BAR_TYPE;
78
+ __exports.ToggleClearFilterBarQuickAction = ToggleClearFilterBarQuickAction;
79
+ return __exports;
80
+ });
81
+ //# sourceMappingURL=lr-toggle-clear-filter-bar.js.map
@@ -2,12 +2,11 @@ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
2
  import CommandFactory from 'sap/ui/rta/command/CommandFactory';
3
3
  import FilterBar from 'sap/ui/mdc/FilterBar';
4
4
 
5
- import { SIMPLE_QUICK_ACTION_KIND, SimpleQuickAction } from '@sap-ux-private/control-property-editor-common';
6
-
7
5
  import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
8
6
  import { pageHasControlId } from '../../../cpe/quick-actions/utils';
9
7
  import { getControlById } from '../../../utils/core';
10
8
  import { getAppComponent, getPageName, getReference } from './utils';
9
+ import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
11
10
 
12
11
  export const ENABLE_CLEAR_FILTER_BAR_TYPE = 'enable-clear-filter-bar';
13
12
  const PROPERTY_PATH = 'controlConfiguration/@com.sap.vocabularies.UI.v1.SelectionFields/showClearButton';
@@ -16,16 +15,15 @@ const CONTROL_TYPE = 'sap.fe.macros.controls.FilterBar';
16
15
  /**
17
16
  * Quick Action for toggling the visibility of "clear filter bar" button in List Report page.
18
17
  */
19
- export class ToggleClearFilterBarQuickAction implements SimpleQuickActionDefinition {
20
- readonly kind = SIMPLE_QUICK_ACTION_KIND;
21
- readonly type = ENABLE_CLEAR_FILTER_BAR_TYPE;
22
- readonly forceRefreshAfterExecution = true;
23
- public get id(): string {
24
- return `${this.context.key}-${this.type}`;
18
+ export class ToggleClearFilterBarQuickAction
19
+ extends SimpleQuickActionDefinitionBase
20
+ implements SimpleQuickActionDefinition
21
+ {
22
+ constructor(context: QuickActionContext) {
23
+ super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context);
25
24
  }
26
- isActive = false;
25
+ readonly forceRefreshAfterExecution = true;
27
26
  private isClearButtonEnabled = false;
28
- constructor(private context: QuickActionContext) {}
29
27
 
30
28
  initialize(): void {
31
29
  const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
@@ -33,22 +31,16 @@ export class ToggleClearFilterBarQuickAction implements SimpleQuickActionDefinit
33
31
  const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
34
32
  const filterBar = getControlById<FilterBar>(control.controlId);
35
33
  if (isActionApplicable && filterBar) {
36
- this.isActive = true;
34
+ this.control = filterBar;
37
35
  this.isClearButtonEnabled = filterBar.getShowClearButton();
38
36
  }
39
37
  }
40
38
  }
41
39
 
42
- getActionObject(): SimpleQuickAction {
43
- const key = this.isClearButtonEnabled
40
+ protected get textKey() {
41
+ return this.isClearButtonEnabled
44
42
  ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR'
45
43
  : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR';
46
- return {
47
- kind: SIMPLE_QUICK_ACTION_KIND,
48
- id: this.id,
49
- enabled: this.isActive,
50
- title: this.context.resourceBundle.getText(key)
51
- };
52
44
  }
53
45
 
54
46
  async execute(): Promise<FlexCommand[]> {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field"], function (_____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field) {
3
+ sap.ui.define(["../../../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"], function (_____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) {
4
4
  "use strict";
5
5
 
6
6
  const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
@@ -8,6 +8,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
8
8
  const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
9
9
  const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
10
10
  const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
11
+ const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
11
12
  const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
12
13
  const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
13
14
 
@@ -37,7 +38,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
37
38
  } else if (name === 'objectPage') {
38
39
  definitionGroups.push({
39
40
  title: 'OBJECT PAGE',
40
- definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction],
41
+ definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction],
41
42
  view,
42
43
  key: name + index
43
44
  });
@@ -8,6 +8,7 @@ import { AddControllerToPageQuickAction } from '../common/add-controller-to-page
8
8
  import { ToggleClearFilterBarQuickAction } from './lr-toggle-clear-filter-bar';
9
9
  import { ChangeTableColumnsQuickAction } from './change-table-columns';
10
10
  import { AddHeaderFieldQuickAction } from '../common/op-add-header-field';
11
+ import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
11
12
 
12
13
  type PageName = 'listReport' | 'objectPage';
13
14
 
@@ -46,7 +47,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
46
47
  definitions: [
47
48
  AddControllerToPageQuickAction,
48
49
  ChangeTableColumnsQuickAction,
49
- AddHeaderFieldQuickAction
50
+ AddHeaderFieldQuickAction,
51
+ AddCustomSectionQuickAction
50
52
  ],
51
53
  view,
52
54
  key: name + index
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+ sap.ui.define([
3
+ 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
4
+ '../../cpe/quick-actions/utils'
5
+ ], function (___sap_ux_private_control_property_editor_common, ____cpe_quick_actions_utils) {
6
+ 'use strict';
7
+ const SIMPLE_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['SIMPLE_QUICK_ACTION_KIND'];
8
+ const getRelevantControlFromActivePage = ____cpe_quick_actions_utils['getRelevantControlFromActivePage'];
9
+ class SimpleQuickActionDefinitionBase {
10
+ kind = SIMPLE_QUICK_ACTION_KIND;
11
+ get id() {
12
+ return `${ this.context.key }-${ this.type }`;
13
+ }
14
+ get isActive() {
15
+ return this.control !== undefined;
16
+ }
17
+ get textKey() {
18
+ return this.defaultTextKey;
19
+ }
20
+ constructor(type, controlTypes, defaultTextKey, context) {
21
+ this.type = type;
22
+ this.controlTypes = controlTypes;
23
+ this.defaultTextKey = defaultTextKey;
24
+ this.context = context;
25
+ }
26
+ initialize() {
27
+ for (const control of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
28
+ this.control = control;
29
+ break;
30
+ }
31
+ }
32
+ getActionObject() {
33
+ return {
34
+ kind: SIMPLE_QUICK_ACTION_KIND,
35
+ id: this.id,
36
+ enabled: this.isActive,
37
+ title: this.context.resourceBundle.getText(this.textKey)
38
+ };
39
+ }
40
+ }
41
+ var __exports = { __esModule: true };
42
+ __exports.SimpleQuickActionDefinitionBase = SimpleQuickActionDefinitionBase;
43
+ return __exports;
44
+ });
@@ -0,0 +1,53 @@
1
+ import UI5Element from 'sap/ui/core/Element';
2
+
3
+ import { SIMPLE_QUICK_ACTION_KIND, SimpleQuickAction } from '@sap-ux-private/control-property-editor-common';
4
+
5
+ import { getRelevantControlFromActivePage } from '../../cpe/quick-actions/utils';
6
+ import { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition';
7
+
8
+ /**
9
+ * Base class for all simple quick actions.
10
+ */
11
+ export abstract class SimpleQuickActionDefinitionBase {
12
+ readonly kind = SIMPLE_QUICK_ACTION_KIND;
13
+ public get id(): string {
14
+ return `${this.context.key}-${this.type}`;
15
+ }
16
+
17
+ public get isActive(): boolean {
18
+ return this.control !== undefined;
19
+ }
20
+
21
+ protected get textKey(): string {
22
+ return this.defaultTextKey;
23
+ }
24
+
25
+ protected control: UI5Element | undefined;
26
+
27
+ constructor(
28
+ public readonly type: string,
29
+ protected readonly controlTypes: string[],
30
+ protected readonly defaultTextKey: string,
31
+ protected readonly context: QuickActionContext
32
+ ) {}
33
+
34
+ initialize(): void {
35
+ for (const control of getRelevantControlFromActivePage(
36
+ this.context.controlIndex,
37
+ this.context.view,
38
+ this.controlTypes
39
+ )) {
40
+ this.control = control;
41
+ break;
42
+ }
43
+ }
44
+
45
+ getActionObject(): SimpleQuickAction {
46
+ return {
47
+ kind: SIMPLE_QUICK_ACTION_KIND,
48
+ id: this.id,
49
+ enabled: this.isActive,
50
+ title: this.context.resourceBundle.getText(this.textKey)
51
+ };
52
+ }
53
+ }
@@ -1,6 +1,7 @@
1
1
  QUICK_ACTION_ADD_PAGE_CONTROLLER=Add Controller to Page
2
2
  QUICK_ACTION_SHOW_PAGE_CONTROLLER=Show Page Controller
3
3
  QUICK_ACTION_OP_ADD_HEADER_FIELD=Add Header Field
4
+ QUICK_ACTION_OP_ADD_CUSTOM_SECTION=Add Custom Section
4
5
 
5
6
  V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
6
7