@sap-ux/preview-middleware 0.16.154 → 0.16.156
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.
- package/dist/client/adp/controllers/AddFragment.controller.js +5 -5
- package/dist/client/adp/controllers/AddFragment.controller.ts +1 -1
- package/dist/client/adp/quick-actions/common/utils.js +20 -0
- package/dist/client/adp/quick-actions/common/utils.ts +7 -0
- package/dist/client/adp/quick-actions/control-types.js +23 -0
- package/dist/client/adp/quick-actions/control-types.ts +6 -0
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +6 -6
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +2 -8
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +5 -5
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +1 -1
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
- package/dist/client/adp/quick-actions/fe-v2/registry.js +3 -2
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v2/utils.js +12 -3
- package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +3 -2
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +2 -1
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +3 -2
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +2 -1
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +5 -5
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +3 -7
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +5 -5
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
- package/dist/client/adp/quick-actions/fe-v4/registry.js +3 -2
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +3 -3
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +7 -4
- package/dist/client/adp/quick-actions/table-quick-action-base.js +18 -21
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +29 -14
- package/dist/client/messagebundle.properties +4 -3
- package/dist/client/utils/fe-v4.js +13 -9
- package/dist/client/utils/fe-v4.ts +19 -11
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
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) {
|
|
3
|
+
sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils", "../../../utils/fe-v4", "../../../utils/version", "../control-types"], function (___table_quick_action_base, _____cpe_quick_actions_utils, _____utils_fe_v4, _____utils_version, ___control_types) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
@@ -8,14 +8,14 @@ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils",
|
|
|
8
8
|
const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
|
|
9
9
|
const getUi5Version = _____utils_version["getUi5Version"];
|
|
10
10
|
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
11
|
+
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
11
12
|
const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
|
|
12
|
-
const CONTROL_TYPE = 'sap.ui.mdc.Table';
|
|
13
13
|
/**
|
|
14
14
|
* Quick Action for enabling table filtering using table personalization settings.
|
|
15
15
|
*/
|
|
16
16
|
class EnableTableFilteringQuickAction extends TableQuickActionDefinitionBase {
|
|
17
17
|
constructor(context) {
|
|
18
|
-
super(ENABLE_TABLE_FILTERING, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
18
|
+
super(ENABLE_TABLE_FILTERING, [MDC_TABLE_TYPE], 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
19
19
|
}
|
|
20
20
|
forceRefreshAfterExecution = true;
|
|
21
21
|
async initialize() {
|
|
@@ -29,7 +29,7 @@ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils",
|
|
|
29
29
|
}
|
|
30
30
|
const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
|
|
31
31
|
let index = 0;
|
|
32
|
-
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
32
|
+
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE])) {
|
|
33
33
|
const personalizationData = smartTable.getP13nMode();
|
|
34
34
|
const value = this.context.changeService.getConfigurationPropertyValue(smartTable.getId(), 'personalization');
|
|
35
35
|
const isFilterEnabled = value?.filter === undefined ? personalizationData.includes('Filter') : value.filter;
|
|
@@ -52,7 +52,7 @@ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils",
|
|
|
52
52
|
flexSettings
|
|
53
53
|
} = this.context;
|
|
54
54
|
const index = this.tableMap[path];
|
|
55
|
-
const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
55
|
+
const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE]);
|
|
56
56
|
const modifiedControl = smartTables[index];
|
|
57
57
|
if (!modifiedControl) {
|
|
58
58
|
return [];
|
|
@@ -6,9 +6,9 @@ import { TableQuickActionDefinitionBase } from './table-quick-action-base';
|
|
|
6
6
|
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
7
7
|
import { createManifestPropertyChange } from '../../../utils/fe-v4';
|
|
8
8
|
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
9
|
+
import { MDC_TABLE_TYPE } from '../control-types';
|
|
9
10
|
|
|
10
11
|
export const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
|
|
11
|
-
const CONTROL_TYPE = 'sap.ui.mdc.Table';
|
|
12
12
|
|
|
13
13
|
type Personalization = {
|
|
14
14
|
sort: boolean;
|
|
@@ -26,7 +26,7 @@ export class EnableTableFilteringQuickAction
|
|
|
26
26
|
implements NestedQuickActionDefinition
|
|
27
27
|
{
|
|
28
28
|
constructor(context: QuickActionContext) {
|
|
29
|
-
super(ENABLE_TABLE_FILTERING, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
29
|
+
super(ENABLE_TABLE_FILTERING, [MDC_TABLE_TYPE], 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
30
30
|
}
|
|
31
31
|
readonly forceRefreshAfterExecution = true;
|
|
32
32
|
|
|
@@ -40,7 +40,7 @@ export class EnableTableFilteringQuickAction
|
|
|
40
40
|
const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
|
|
41
41
|
let index = 0;
|
|
42
42
|
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
43
|
-
|
|
43
|
+
MDC_TABLE_TYPE
|
|
44
44
|
])) {
|
|
45
45
|
const personalizationData = (smartTable as Table).getP13nMode();
|
|
46
46
|
const value = this.context.changeService.getConfigurationPropertyValue(
|
|
@@ -70,7 +70,7 @@ export class EnableTableFilteringQuickAction
|
|
|
70
70
|
const index = this.tableMap[path];
|
|
71
71
|
|
|
72
72
|
const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
73
|
-
|
|
73
|
+
MDC_TABLE_TYPE
|
|
74
74
|
]);
|
|
75
75
|
|
|
76
76
|
const modifiedControl = smartTables[index];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../utils/fe-v4", "../../../utils/version", "../control-types", "../table-quick-action-base", "../../../utils/core", "../common/utils", "../fe-v2/create-table-custom-column"], function (_____utils_fe_v4, _____utils_version, ___control_types, ___table_quick_action_base, _____utils_core, ___common_utils, ___fe_v2_create_table_custom_column) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const createManifestPropertyChange = _____utils_fe_v4["createManifestPropertyChange"];
|
|
7
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
8
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
9
|
+
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
10
|
+
const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
|
|
11
|
+
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
12
|
+
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
13
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
14
|
+
const isA = _____utils_core["isA"];
|
|
15
|
+
const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
|
|
16
|
+
const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
|
|
17
|
+
const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
|
|
18
|
+
const CONTROL_TYPES = [MDC_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
|
|
19
|
+
const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
|
|
20
|
+
const INLINE_CREATION_ROWS_MODE = 'InlineCreationRows';
|
|
21
|
+
/**
|
|
22
|
+
* Quick Action for enabling table filtering using table personalization settings.
|
|
23
|
+
*/
|
|
24
|
+
class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
|
|
25
|
+
constructor(context) {
|
|
26
|
+
super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
|
|
27
|
+
}
|
|
28
|
+
forceRefreshAfterExecution = true;
|
|
29
|
+
async initialize() {
|
|
30
|
+
const version = await getUi5Version();
|
|
31
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
32
|
+
major: 1,
|
|
33
|
+
minor: 131
|
|
34
|
+
})) {
|
|
35
|
+
this.isApplicable = false;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const {
|
|
39
|
+
alreadyEnabledTooltip,
|
|
40
|
+
unsupportedCreationRowsTooltip
|
|
41
|
+
} = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
|
|
42
|
+
const processChild = (child, mapKey) => {
|
|
43
|
+
const table = this.tableMap[mapKey]?.table;
|
|
44
|
+
if (table) {
|
|
45
|
+
if (UNSUPPORTED_TABLES.some(t => isA(t, table))) {
|
|
46
|
+
child.enabled = false;
|
|
47
|
+
child.tooltip = unsupportedCreationRowsTooltip;
|
|
48
|
+
} else if (table.data('creationMode') === INLINE_CREATION_ROWS_MODE) {
|
|
49
|
+
child.enabled = false;
|
|
50
|
+
child.tooltip = alreadyEnabledTooltip;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
|
|
54
|
+
};
|
|
55
|
+
await super.initialize();
|
|
56
|
+
|
|
57
|
+
// disable nested actions based on conditions
|
|
58
|
+
this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
|
|
59
|
+
}
|
|
60
|
+
async execute(path) {
|
|
61
|
+
const {
|
|
62
|
+
flexSettings
|
|
63
|
+
} = this.context;
|
|
64
|
+
const {
|
|
65
|
+
table,
|
|
66
|
+
sectionInfo,
|
|
67
|
+
iconTabBarFilterKey
|
|
68
|
+
} = this.tableMap[path];
|
|
69
|
+
if (!table) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
73
|
+
this.selectOverlay(table);
|
|
74
|
+
const command = await createManifestPropertyChange(table, flexSettings, {
|
|
75
|
+
name: INLINE_CREATION_ROWS_MODE
|
|
76
|
+
}, ['creationMode']);
|
|
77
|
+
if (command) {
|
|
78
|
+
return [command];
|
|
79
|
+
} else {
|
|
80
|
+
return [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
var __exports = {
|
|
85
|
+
__esModule: true
|
|
86
|
+
};
|
|
87
|
+
__exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
|
|
88
|
+
__exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
|
|
89
|
+
return __exports;
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=op-enable-empty-row-mode.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
+
|
|
3
|
+
import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
|
|
4
|
+
import { createManifestPropertyChange } from '../../../utils/fe-v4';
|
|
5
|
+
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
6
|
+
import { ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
|
|
7
|
+
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
8
|
+
import { isA } from '../../../utils/core';
|
|
9
|
+
import { getTooltipsForTableEmptyRowModeAction } from '../common/utils';
|
|
10
|
+
import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common';
|
|
11
|
+
import { preprocessActionExecution } from '../fe-v2/create-table-custom-column';
|
|
12
|
+
|
|
13
|
+
export const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
|
|
14
|
+
const CONTROL_TYPES = [MDC_TABLE_TYPE, GRID_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
|
|
15
|
+
const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
|
|
16
|
+
|
|
17
|
+
const INLINE_CREATION_ROWS_MODE = 'InlineCreationRows';
|
|
18
|
+
/**
|
|
19
|
+
* Quick Action for enabling table filtering using table personalization settings.
|
|
20
|
+
*/
|
|
21
|
+
export class EnableTableEmptyRowModeQuickAction
|
|
22
|
+
extends TableQuickActionDefinitionBase
|
|
23
|
+
implements NestedQuickActionDefinition
|
|
24
|
+
{
|
|
25
|
+
constructor(context: QuickActionContext) {
|
|
26
|
+
super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
|
|
27
|
+
}
|
|
28
|
+
readonly forceRefreshAfterExecution = true;
|
|
29
|
+
|
|
30
|
+
async initialize(): Promise<void> {
|
|
31
|
+
const version = await getUi5Version();
|
|
32
|
+
if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 131 })) {
|
|
33
|
+
this.isApplicable = false;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const { alreadyEnabledTooltip, unsupportedCreationRowsTooltip } = getTooltipsForTableEmptyRowModeAction(
|
|
38
|
+
this.context.resourceBundle
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const processChild = (child: NestedQuickActionChild, mapKey: string) => {
|
|
42
|
+
const table = this.tableMap[mapKey]?.table;
|
|
43
|
+
if (table) {
|
|
44
|
+
if (UNSUPPORTED_TABLES.some((t) => isA(t, table))) {
|
|
45
|
+
child.enabled = false;
|
|
46
|
+
child.tooltip = unsupportedCreationRowsTooltip;
|
|
47
|
+
} else if (table.data('creationMode') === INLINE_CREATION_ROWS_MODE) {
|
|
48
|
+
child.enabled = false;
|
|
49
|
+
child.tooltip = alreadyEnabledTooltip;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
await super.initialize();
|
|
56
|
+
|
|
57
|
+
// disable nested actions based on conditions
|
|
58
|
+
this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async execute(path: string): Promise<FlexCommand[]> {
|
|
62
|
+
const { flexSettings } = this.context;
|
|
63
|
+
const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path];
|
|
64
|
+
if (!table) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
69
|
+
this.selectOverlay(table);
|
|
70
|
+
|
|
71
|
+
const command = await createManifestPropertyChange(
|
|
72
|
+
table,
|
|
73
|
+
flexSettings,
|
|
74
|
+
{
|
|
75
|
+
name: INLINE_CREATION_ROWS_MODE
|
|
76
|
+
},
|
|
77
|
+
['creationMode']
|
|
78
|
+
);
|
|
79
|
+
if (command) {
|
|
80
|
+
return [command];
|
|
81
|
+
} else {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -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", "../common/op-add-custom-section", "./create-table-custom-column", "../common/create-page-action", "./create-table-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar"], 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, ___create_table_custom_column, ___common_create_page_action, ___create_table_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar) {
|
|
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", "./create-table-custom-column", "../common/create-page-action", "./create-table-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode"], 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, ___create_table_custom_column, ___common_create_page_action, ___create_table_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
@@ -14,6 +14,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
|
|
|
14
14
|
const AddTableActionQuickAction = ___create_table_action["AddTableActionQuickAction"];
|
|
15
15
|
const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
|
|
16
16
|
const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
|
|
17
|
+
const EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
|
|
17
18
|
const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
|
|
18
19
|
const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
|
|
19
20
|
|
|
@@ -43,7 +44,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
|
|
|
43
44
|
} else if (name === 'objectPage') {
|
|
44
45
|
definitionGroups.push({
|
|
45
46
|
title: 'OBJECT PAGE',
|
|
46
|
-
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
|
|
47
|
+
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction],
|
|
47
48
|
view,
|
|
48
49
|
key: name + index
|
|
49
50
|
});
|
|
@@ -14,6 +14,7 @@ import { AddPageActionQuickAction } from '../common/create-page-action';
|
|
|
14
14
|
import { AddTableActionQuickAction } from './create-table-action';
|
|
15
15
|
import { EnableTableFilteringQuickAction } from './lr-enable-table-filtering';
|
|
16
16
|
import { ToggleSemanticDateRangeFilterBar } from './lr-enable-semantic-date-range-filter-bar';
|
|
17
|
+
import { EnableTableEmptyRowModeQuickAction } from './op-enable-empty-row-mode';
|
|
17
18
|
|
|
18
19
|
type PageName = 'listReport' | 'objectPage';
|
|
19
20
|
|
|
@@ -60,7 +61,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
60
61
|
AddCustomSectionQuickAction,
|
|
61
62
|
ChangeTableColumnsQuickAction,
|
|
62
63
|
AddTableActionQuickAction,
|
|
63
|
-
AddTableCustomColumnQuickAction
|
|
64
|
+
AddTableCustomColumnQuickAction,
|
|
65
|
+
EnableTableEmptyRowModeQuickAction
|
|
64
66
|
],
|
|
65
67
|
view,
|
|
66
68
|
key: name + index
|
|
@@ -8,7 +8,6 @@ sap.ui.define([
|
|
|
8
8
|
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
|
|
9
9
|
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils['getRelevantControlFromActivePage'];
|
|
10
10
|
const ACTION_ID = 'CTX_SETTINGS0';
|
|
11
|
-
const CONTROL_TYPE = 'sap.ui.mdc.Table';
|
|
12
11
|
class TableQuickActionDefinitionBase {
|
|
13
12
|
kind = NESTED_QUICK_ACTION_KIND;
|
|
14
13
|
get id() {
|
|
@@ -25,15 +24,16 @@ sap.ui.define([
|
|
|
25
24
|
isClearButtonEnabled = false;
|
|
26
25
|
children = [];
|
|
27
26
|
tableMap = {};
|
|
28
|
-
constructor(type, defaultTextKey, context, isSkipVariantManagementCheck) {
|
|
27
|
+
constructor(type, controlTypes, defaultTextKey, context, isSkipVariantManagementCheck) {
|
|
29
28
|
this.type = type;
|
|
29
|
+
this.controlTypes = controlTypes;
|
|
30
30
|
this.defaultTextKey = defaultTextKey;
|
|
31
31
|
this.context = context;
|
|
32
32
|
this.isSkipVariantManagementCheck = isSkipVariantManagementCheck;
|
|
33
33
|
}
|
|
34
34
|
async initialize() {
|
|
35
35
|
let index = 0;
|
|
36
|
-
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view,
|
|
36
|
+
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
|
|
37
37
|
if (!this.isSkipVariantManagementCheck) {
|
|
38
38
|
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
|
|
39
39
|
if (!hasVariantManagement) {
|
|
@@ -8,7 +8,7 @@ import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-defi
|
|
|
8
8
|
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
9
9
|
|
|
10
10
|
const ACTION_ID = 'CTX_SETTINGS0';
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
export abstract class TableQuickActionDefinitionBase {
|
|
13
13
|
readonly kind = NESTED_QUICK_ACTION_KIND;
|
|
14
14
|
public get id(): string {
|
|
@@ -28,6 +28,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
28
28
|
tableMap: Record<string, number> = {};
|
|
29
29
|
constructor(
|
|
30
30
|
public readonly type: string,
|
|
31
|
+
protected readonly controlTypes: string[],
|
|
31
32
|
protected readonly defaultTextKey: string,
|
|
32
33
|
protected readonly context: QuickActionContext,
|
|
33
34
|
protected readonly isSkipVariantManagementCheck?: boolean
|
|
@@ -35,9 +36,11 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
35
36
|
|
|
36
37
|
async initialize(): Promise<void> {
|
|
37
38
|
let index = 0;
|
|
38
|
-
for (const smartTable of getRelevantControlFromActivePage(
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
for (const smartTable of getRelevantControlFromActivePage(
|
|
40
|
+
this.context.controlIndex,
|
|
41
|
+
this.context.view,
|
|
42
|
+
this.controlTypes
|
|
43
|
+
)) {
|
|
41
44
|
if (!this.isSkipVariantManagementCheck) {
|
|
42
45
|
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
|
|
43
46
|
if (!hasVariantManagement) {
|
|
@@ -4,8 +4,9 @@ sap.ui.define([
|
|
|
4
4
|
'sap/ui/dt/OverlayUtil',
|
|
5
5
|
'../../cpe/quick-actions/utils',
|
|
6
6
|
'../../utils/core',
|
|
7
|
-
'../../utils/version'
|
|
8
|
-
|
|
7
|
+
'../../utils/version',
|
|
8
|
+
'./control-types'
|
|
9
|
+
], function (___sap_ux_private_control_property_editor_common, OverlayUtil, ____cpe_quick_actions_utils, ____utils_core, ____utils_version, ___control_types) {
|
|
9
10
|
'use strict';
|
|
10
11
|
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
|
|
11
12
|
const getParentContainer = ____cpe_quick_actions_utils['getParentContainer'];
|
|
@@ -15,16 +16,16 @@ sap.ui.define([
|
|
|
15
16
|
const isManagedObject = ____utils_core['isManagedObject'];
|
|
16
17
|
const getUi5Version = ____utils_version['getUi5Version'];
|
|
17
18
|
const isLowerThanMinimalUi5Version = ____utils_version['isLowerThanMinimalUi5Version'];
|
|
19
|
+
const ANALYTICAL_TABLE_TYPE = ___control_types['ANALYTICAL_TABLE_TYPE'];
|
|
20
|
+
const GRID_TABLE_TYPE = ___control_types['GRID_TABLE_TYPE'];
|
|
21
|
+
const M_TABLE_TYPE = ___control_types['M_TABLE_TYPE'];
|
|
22
|
+
const MDC_TABLE_TYPE = ___control_types['MDC_TABLE_TYPE'];
|
|
23
|
+
const SMART_TABLE_TYPE = ___control_types['SMART_TABLE_TYPE'];
|
|
24
|
+
const TREE_TABLE_TYPE = ___control_types['TREE_TABLE_TYPE'];
|
|
18
25
|
const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
|
|
19
26
|
const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
|
|
20
27
|
const SETTINGS_ID = 'CTX_SETTINGS';
|
|
21
28
|
const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
|
|
22
|
-
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
23
|
-
const M_TABLE_TYPE = 'sap.m.Table';
|
|
24
|
-
const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
|
|
25
|
-
const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
|
|
26
|
-
const GRID_TABLE_TYPE = 'sap.ui.table.Table';
|
|
27
|
-
const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
|
|
28
29
|
async function getActionId(table) {
|
|
29
30
|
const {major, minor} = await getUi5Version();
|
|
30
31
|
if (isA(SMART_TABLE_TYPE, table)) {
|
|
@@ -160,20 +161,20 @@ sap.ui.define([
|
|
|
160
161
|
layout
|
|
161
162
|
});
|
|
162
163
|
} else if (subSections.length > 1) {
|
|
163
|
-
const
|
|
164
|
-
let tableMapIndex
|
|
164
|
+
const existingChildIdx = this.children.findIndex(val => val.label === `'${ section.getTitle() }' section`);
|
|
165
|
+
let tableMapIndex;
|
|
165
166
|
const label = this.getTableLabel(table);
|
|
166
167
|
const child = this.createChild(label, table);
|
|
167
|
-
if (
|
|
168
|
-
tableMapIndex = `${ tableMapIndex }/0`;
|
|
168
|
+
if (existingChildIdx < 0) {
|
|
169
169
|
this.children.push({
|
|
170
170
|
label: `'${ section?.getTitle() }' section`,
|
|
171
171
|
enabled: true,
|
|
172
172
|
children: [child]
|
|
173
173
|
});
|
|
174
|
+
tableMapIndex = `${ this.children.length - 1 }/0`;
|
|
174
175
|
} else {
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
this.children[existingChildIdx].children.push(child);
|
|
177
|
+
tableMapIndex = `${ existingChildIdx.toFixed(0) }/${ this.children[existingChildIdx].children.length - 1 }`;
|
|
177
178
|
}
|
|
178
179
|
this.tableMap[tableMapIndex] = {
|
|
179
180
|
table,
|
|
@@ -192,7 +193,9 @@ sap.ui.define([
|
|
|
192
193
|
SMART_TABLE_TYPE,
|
|
193
194
|
M_TABLE_TYPE,
|
|
194
195
|
MDC_TABLE_TYPE,
|
|
195
|
-
TREE_TABLE_TYPE
|
|
196
|
+
TREE_TABLE_TYPE,
|
|
197
|
+
GRID_TABLE_TYPE,
|
|
198
|
+
ANALYTICAL_TABLE_TYPE
|
|
196
199
|
].some(type => isA(type, table))) {
|
|
197
200
|
const label = this.getTableLabel(table);
|
|
198
201
|
const child = this.createChild(label, table);
|
|
@@ -239,12 +242,6 @@ sap.ui.define([
|
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
var __exports = { __esModule: true };
|
|
242
|
-
__exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
|
|
243
|
-
__exports.M_TABLE_TYPE = M_TABLE_TYPE;
|
|
244
|
-
__exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
|
|
245
|
-
__exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
|
|
246
|
-
__exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
|
|
247
|
-
__exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
|
|
248
245
|
__exports.TableQuickActionDefinitionBase = TableQuickActionDefinitionBase;
|
|
249
246
|
return __exports;
|
|
250
247
|
});
|
|
@@ -15,17 +15,19 @@ import ObjectPageSection from 'sap/uxap/ObjectPageSection';
|
|
|
15
15
|
import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
|
|
16
16
|
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
17
17
|
import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
18
|
+
import {
|
|
19
|
+
ANALYTICAL_TABLE_TYPE,
|
|
20
|
+
GRID_TABLE_TYPE,
|
|
21
|
+
M_TABLE_TYPE,
|
|
22
|
+
MDC_TABLE_TYPE,
|
|
23
|
+
SMART_TABLE_TYPE,
|
|
24
|
+
TREE_TABLE_TYPE
|
|
25
|
+
} from './control-types';
|
|
18
26
|
|
|
19
27
|
const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
|
|
20
28
|
const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
|
|
21
29
|
const SETTINGS_ID = 'CTX_SETTINGS';
|
|
22
30
|
const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
|
|
23
|
-
export const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
24
|
-
export const M_TABLE_TYPE = 'sap.m.Table';
|
|
25
|
-
export const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
|
|
26
|
-
export const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
|
|
27
|
-
export const GRID_TABLE_TYPE = 'sap.ui.table.Table';
|
|
28
|
-
export const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
|
|
29
31
|
|
|
30
32
|
async function getActionId(table: UI5Element): Promise<string[]> {
|
|
31
33
|
const { major, minor } = await getUi5Version();
|
|
@@ -229,21 +231,25 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
229
231
|
if (subSections?.length === 1) {
|
|
230
232
|
this.processTable(table, { section, subSection: subSections[0], layout });
|
|
231
233
|
} else if (subSections.length > 1) {
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
+
const existingChildIdx = this.children.findIndex(
|
|
235
|
+
(val) => val.label === `'${section.getTitle()}' section`
|
|
236
|
+
);
|
|
237
|
+
let tableMapIndex;
|
|
234
238
|
const label = this.getTableLabel(table);
|
|
235
239
|
const child = this.createChild(label, table);
|
|
236
|
-
if (
|
|
237
|
-
tableMapIndex = `${tableMapIndex}/0`;
|
|
238
|
-
|
|
240
|
+
if (existingChildIdx < 0) {
|
|
239
241
|
this.children.push({
|
|
240
242
|
label: `'${section?.getTitle()}' section`,
|
|
241
243
|
enabled: true,
|
|
242
244
|
children: [child]
|
|
243
245
|
});
|
|
246
|
+
|
|
247
|
+
tableMapIndex = `${this.children.length - 1}/0`;
|
|
244
248
|
} else {
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
this.children[existingChildIdx].children.push(child);
|
|
250
|
+
tableMapIndex = `${existingChildIdx.toFixed(0)}/${
|
|
251
|
+
this.children[existingChildIdx].children.length - 1
|
|
252
|
+
}`;
|
|
247
253
|
}
|
|
248
254
|
|
|
249
255
|
this.tableMap[tableMapIndex] = {
|
|
@@ -264,7 +270,16 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
264
270
|
table: UI5Element,
|
|
265
271
|
sectionInfo?: { section: ObjectPageSection; subSection: ObjectPageSubSection; layout?: ObjectPageLayout }
|
|
266
272
|
): void {
|
|
267
|
-
if (
|
|
273
|
+
if (
|
|
274
|
+
[
|
|
275
|
+
SMART_TABLE_TYPE,
|
|
276
|
+
M_TABLE_TYPE,
|
|
277
|
+
MDC_TABLE_TYPE,
|
|
278
|
+
TREE_TABLE_TYPE,
|
|
279
|
+
GRID_TABLE_TYPE,
|
|
280
|
+
ANALYTICAL_TABLE_TYPE
|
|
281
|
+
].some((type) => isA(type, table))
|
|
282
|
+
) {
|
|
268
283
|
const label = this.getTableLabel(table);
|
|
269
284
|
const child = this.createChild(label, table);
|
|
270
285
|
this.children.push(child);
|
|
@@ -6,9 +6,9 @@ QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION=Add Custom Page Action
|
|
|
6
6
|
QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION=Add Custom Table Action
|
|
7
7
|
QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN=Add Custom Table Column
|
|
8
8
|
QUICK_ACTION_ENABLE_TABLE_FILTERING=Enable Table Filtering for Page Variants
|
|
9
|
+
QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE=Enable Empty Row Mode for Tables
|
|
9
10
|
|
|
10
11
|
V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
|
|
11
|
-
|
|
12
12
|
V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
|
|
13
13
|
V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
|
|
14
14
|
|
|
@@ -16,7 +16,6 @@ QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR=Enable Semantic Date Range
|
|
|
16
16
|
QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR=Disable Semantic Date Range in Filter Bar
|
|
17
17
|
|
|
18
18
|
V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
|
|
19
|
-
|
|
20
19
|
V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
|
|
21
20
|
V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
|
|
22
21
|
|
|
@@ -31,7 +30,7 @@ ADP_ADD_FRAGMENT_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be cr
|
|
|
31
30
|
ADP_ADD_FRAGMENT_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be created once you save the changes.
|
|
32
31
|
ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" and "{1}.fragment.xml" fragments will be created once you save the changes.
|
|
33
32
|
ADP_SYNC_VIEWS_MESSAGE = Synchronous views are detected for this application. Controller extensions are not supported for such views and will be disabled.
|
|
34
|
-
ADP_REUSE_COMPONENTS_MESSAGE = Reuse components are detected for some views in this application. Controller extensions
|
|
33
|
+
ADP_REUSE_COMPONENTS_MESSAGE = Reuse components are detected for some views in this application. Controller extensions, adding fragments and manifest changes are not supported for such views and will be disabled.
|
|
35
34
|
|
|
36
35
|
CPE_CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_MESSAGE = Note: The change will be visible after save and reload.
|
|
37
36
|
|
|
@@ -41,3 +40,5 @@ HIGHER_LAYER_CHANGES_INFO_MESSAGE=The preview of the project was reloaded due to
|
|
|
41
40
|
|
|
42
41
|
TABLE_CUSTOM_COLUMN_ACTION_NOT_AVAILABLE=This action has been disabled because the table rows are not available. Please load the table data and try again
|
|
43
42
|
TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE=This option is disabled because table filtering for page variants is already enabled
|
|
43
|
+
EMPTY_ROW_MODE_IS_ALREADY_ENABLED=This option has been disabled because empty row mode is already enabled for this table
|
|
44
|
+
EMPTY_ROW_MODE_IS_NOT_SUPPORTED=This action is disabled because empty row mode is not supported for analytical and tree tables
|
|
@@ -77,20 +77,24 @@ sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFac
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
* Get the modified value for a control.
|
|
81
|
+
* @param modifiedControl - The modified control.
|
|
82
|
+
* @param flexSettings - Flex Settings of the control.
|
|
83
|
+
* @param propertyChanges - The change object
|
|
84
|
+
* @param propertyPathExtraSegments - optional path segments which are added to the default modified control manifest path
|
|
85
|
+
*
|
|
86
|
+
* @returns A Promise resolving to an array of FlexCommand objects.
|
|
87
|
+
*/
|
|
88
|
+
async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges, propertyPathExtraSegments) {
|
|
88
89
|
const overlay = getOverlay(modifiedControl);
|
|
89
90
|
if (!overlay) {
|
|
90
91
|
return undefined;
|
|
91
92
|
}
|
|
92
93
|
const overlayData = overlay?.getDesignTimeMetadata().getData();
|
|
93
|
-
|
|
94
|
+
let manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
|
|
95
|
+
if (propertyPathExtraSegments) {
|
|
96
|
+
manifestPropertyPath += '/' + propertyPathExtraSegments.join('/');
|
|
97
|
+
}
|
|
94
98
|
const [manifestPropertyChange] = overlayData.manifestPropertyChange(propertyChanges, manifestPropertyPath, modifiedControl);
|
|
95
99
|
const modifiedValue = {
|
|
96
100
|
reference: getReference(modifiedControl),
|
|
@@ -10,7 +10,6 @@ import { getOverlay } from '../cpe/utils';
|
|
|
10
10
|
import UI5Element from 'sap/ui/core/Element';
|
|
11
11
|
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
/**
|
|
15
14
|
* Gets app component of a v4 project.
|
|
16
15
|
*
|
|
@@ -85,20 +84,29 @@ export function getConfigMapControlIdMap(page: string | undefined, propertyPathS
|
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
|
-
* Get the modified value for a control.
|
|
89
|
-
* @param modifiedControl - The modified control.
|
|
90
|
-
* @param flexSettings - Flex Settings of the control.
|
|
91
|
-
* @param propertyChanges - The change object
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
* Get the modified value for a control.
|
|
88
|
+
* @param modifiedControl - The modified control.
|
|
89
|
+
* @param flexSettings - Flex Settings of the control.
|
|
90
|
+
* @param propertyChanges - The change object
|
|
91
|
+
* @param propertyPathExtraSegments - optional path segments which are added to the default modified control manifest path
|
|
92
|
+
*
|
|
93
|
+
* @returns A Promise resolving to an array of FlexCommand objects.
|
|
94
|
+
*/
|
|
95
|
+
export async function createManifestPropertyChange(
|
|
96
|
+
modifiedControl: UI5Element,
|
|
97
|
+
flexSettings: FlexSettings,
|
|
98
|
+
propertyChanges: Record<string, string | string[] | boolean | number | object | undefined>,
|
|
99
|
+
propertyPathExtraSegments?: string[]
|
|
100
|
+
): Promise<FlexCommand | undefined> {
|
|
96
101
|
const overlay = getOverlay(modifiedControl);
|
|
97
102
|
if (!overlay) {
|
|
98
103
|
return undefined;
|
|
99
104
|
}
|
|
100
105
|
const overlayData = overlay?.getDesignTimeMetadata().getData();
|
|
101
|
-
|
|
106
|
+
let manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
|
|
107
|
+
if (propertyPathExtraSegments) {
|
|
108
|
+
manifestPropertyPath += '/' + propertyPathExtraSegments.join('/');
|
|
109
|
+
}
|
|
102
110
|
const [manifestPropertyChange] = overlayData.manifestPropertyChange(
|
|
103
111
|
propertyChanges,
|
|
104
112
|
manifestPropertyPath,
|
|
@@ -122,4 +130,4 @@ export async function createManifestPropertyChange(modifiedControl: UI5Element,
|
|
|
122
130
|
);
|
|
123
131
|
|
|
124
132
|
return command;
|
|
125
|
-
}
|
|
133
|
+
}
|