@sap-ux/preview-middleware 0.16.64 → 0.16.66

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 (25) 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/cpe/changes/service.js +4 -1
  21. package/dist/client/cpe/changes/service.ts +4 -1
  22. package/dist/client/messagebundle.properties +1 -0
  23. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +5 -1
  24. package/package.json +7 -7
  25. package/dist/client/tsconfig.tsbuildinfo +0 -1
@@ -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
+ }
@@ -104,7 +104,7 @@ sap.ui.define([
104
104
  }
105
105
  return {
106
106
  type: 'saved',
107
- kind: 'valid',
107
+ kind: 'property',
108
108
  fileName: change.fileName,
109
109
  controlId: change.selector.id,
110
110
  propertyName: change.content.property,
@@ -118,6 +118,7 @@ sap.ui.define([
118
118
  const unknownChange = {
119
119
  type: 'saved',
120
120
  kind: 'unknown',
121
+ changeType: change.changeType,
121
122
  fileName: change.fileName,
122
123
  controlId: change.selector?.id
123
124
  };
@@ -197,6 +198,7 @@ sap.ui.define([
197
198
  if (changeType === 'propertyChange' || changeType === 'propertyBindingChange') {
198
199
  result = {
199
200
  type: 'pending',
201
+ kind: 'property',
200
202
  changeType,
201
203
  controlId: selectorId,
202
204
  propertyName: command.getProperty('propertyName'),
@@ -208,6 +210,7 @@ sap.ui.define([
208
210
  } else {
209
211
  result = {
210
212
  type: 'pending',
213
+ kind: 'unknown',
211
214
  controlId: selectorId,
212
215
  changeType,
213
216
  isActive: index >= inactiveCommandCount,
@@ -187,7 +187,7 @@ export class ChangeService {
187
187
  }
188
188
  return {
189
189
  type: 'saved',
190
- kind: 'valid',
190
+ kind: 'property',
191
191
  fileName: change.fileName,
192
192
  controlId: change.selector.id,
193
193
  propertyName: change.content.property,
@@ -202,6 +202,7 @@ export class ChangeService {
202
202
  const unknownChange: UnknownSavedChange = {
203
203
  type: 'saved',
204
204
  kind: 'unknown',
205
+ changeType: change.changeType,
205
206
  fileName: change.fileName,
206
207
  controlId: change.selector?.id // some changes may not have selector
207
208
  };
@@ -319,6 +320,7 @@ export class ChangeService {
319
320
  if (changeType === 'propertyChange' || changeType === 'propertyBindingChange') {
320
321
  result = {
321
322
  type: 'pending',
323
+ kind: 'property',
322
324
  changeType,
323
325
  controlId: selectorId,
324
326
  propertyName: command.getProperty('propertyName') as string,
@@ -330,6 +332,7 @@ export class ChangeService {
330
332
  } else {
331
333
  result = {
332
334
  type: 'pending',
335
+ kind: 'unknown',
333
336
  controlId: selectorId,
334
337
  changeType,
335
338
  isActive: index >= inactiveCommandCount,
@@ -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
 
@@ -8,7 +8,7 @@ sap.ui.define((function () { 'use strict';
8
8
 
9
9
  (function (exports) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
11
+ exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.showMessage = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.UNKNOWN_CHANGE_KIND = exports.PROPERTY_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
12
12
  exports.BOOLEAN_VALUE_TYPE = 'boolean';
13
13
  exports.INTEGER_VALUE_TYPE = 'integer';
14
14
  exports.FLOAT_VALUE_TYPE = 'float';
@@ -23,6 +23,10 @@ sap.ui.define((function () { 'use strict';
23
23
  FioriElementsFromScratch: 'FE_FROM_SCRATCH',
24
24
  UiAdaptation: 'UI_ADAPTATION'
25
25
  };
26
+ exports.PENDING_CHANGE_TYPE = 'pending';
27
+ exports.SAVED_CHANGE_TYPE = 'saved';
28
+ exports.PROPERTY_CHANGE_KIND = 'property';
29
+ exports.UNKNOWN_CHANGE_KIND = 'unknown';
26
30
  exports.SIMPLE_QUICK_ACTION_KIND = 'simple';
27
31
  exports.NESTED_QUICK_ACTION_KIND = 'nested';
28
32
  /**
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.16.64",
12
+ "version": "0.16.66",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,11 +25,11 @@
25
25
  "ejs": "3.1.10",
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
- "@sap-ux/logger": "0.6.0",
29
28
  "@sap-ux/btp-utils": "0.15.2",
30
- "@sap-ux/adp-tooling": "0.12.47",
31
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.2",
32
- "@sap-ux/project-access": "1.27.2"
29
+ "@sap-ux/logger": "0.6.0",
30
+ "@sap-ux/adp-tooling": "0.12.49",
31
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.5",
32
+ "@sap-ux/project-access": "1.27.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/ejs": "3.1.2",
@@ -39,13 +39,13 @@
39
39
  "copyfiles": "2.4.1",
40
40
  "@types/mem-fs": "1.1.2",
41
41
  "@types/mem-fs-editor": "7.0.1",
42
- "express": "4.19.2",
42
+ "express": "4.21.0",
43
43
  "npm-run-all2": "6.2.0",
44
44
  "nock": "13.4.0",
45
45
  "supertest": "6.3.3",
46
46
  "@sap-ux-private/playwright": "0.1.0",
47
47
  "dotenv": "16.3.1",
48
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.3",
48
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.4",
49
49
  "@sap-ux/axios-extension": "1.16.6",
50
50
  "@sap-ux/store": "0.9.1",
51
51
  "@sap-ux/ui5-info": "0.8.1",