@sap-ux/preview-middleware 0.16.131 → 0.16.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +11 -48
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +16 -44
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +69 -0
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +79 -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 +77 -0
- package/dist/client/adp/quick-actions/fe-v2/utils.ts +72 -0
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +1 -5
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +0 -4
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -0
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +96 -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 +9 -3
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +10 -3
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +6 -2
- package/dist/client/adp/quick-actions/simple-quick-action-base.ts +9 -2
- package/dist/client/adp/quick-actions/table-quick-action-base.js +13 -4
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +17 -5
- package/dist/client/cpe/changes/flex-change.js +7 -19
- package/dist/client/cpe/changes/flex-change.ts +5 -29
- package/dist/client/cpe/quick-actions/quick-action-definition.ts +1 -6
- package/dist/client/cpe/quick-actions/quick-action-service.js +1 -1
- package/dist/client/cpe/quick-actions/quick-action-service.ts +1 -1
- package/dist/client/messagebundle.properties +2 -1
- package/dist/client/utils/fe-v4.js +30 -1
- package/dist/client/utils/fe-v4.ts +45 -1
- package/package.json +3 -3
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
+
|
|
3
|
+
import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
|
|
4
|
+
import Table from 'sap/ui/mdc/Table';
|
|
5
|
+
import { TableQuickActionDefinitionBase } from './table-quick-action-base';
|
|
6
|
+
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
7
|
+
import { createManifestPropertyChange } from '../../../utils/fe-v4';
|
|
8
|
+
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
9
|
+
|
|
10
|
+
export const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
|
|
11
|
+
const CONTROL_TYPE = 'sap.ui.mdc.Table';
|
|
12
|
+
|
|
13
|
+
type Personalization = {
|
|
14
|
+
sort: boolean;
|
|
15
|
+
column: boolean;
|
|
16
|
+
filter: boolean;
|
|
17
|
+
group: boolean;
|
|
18
|
+
aggregate: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Quick Action for enabling table filtering using table personalization settings.
|
|
23
|
+
*/
|
|
24
|
+
export class EnableTableFilteringQuickAction
|
|
25
|
+
extends TableQuickActionDefinitionBase
|
|
26
|
+
implements NestedQuickActionDefinition
|
|
27
|
+
{
|
|
28
|
+
constructor(context: QuickActionContext) {
|
|
29
|
+
super(ENABLE_TABLE_FILTERING, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
30
|
+
}
|
|
31
|
+
readonly forceRefreshAfterExecution = true;
|
|
32
|
+
|
|
33
|
+
async initialize(): Promise<void> {
|
|
34
|
+
const version = await getUi5Version();
|
|
35
|
+
if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 131 })) {
|
|
36
|
+
this.isApplicable = false;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const tooltipText = this.context.resourceBundle.getText('THE_CHANGE_HAS_ALREADY_BEEN_MADE');
|
|
41
|
+
let index = 0;
|
|
42
|
+
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
43
|
+
CONTROL_TYPE
|
|
44
|
+
])) {
|
|
45
|
+
const personalizationData = (smartTable as Table).getP13nMode();
|
|
46
|
+
const value = this.context.changeService.getConfigurationPropertyValue(
|
|
47
|
+
smartTable.getId(),
|
|
48
|
+
'personalization'
|
|
49
|
+
) as Personalization;
|
|
50
|
+
const isFilterEnabled = value?.filter === undefined ? personalizationData.includes('Filter') : value.filter;
|
|
51
|
+
this.children.push({
|
|
52
|
+
label: `'${(smartTable as Table).getHeader()}' table`,
|
|
53
|
+
enabled: !isFilterEnabled,
|
|
54
|
+
tooltip: isFilterEnabled ? tooltipText : undefined,
|
|
55
|
+
children: []
|
|
56
|
+
});
|
|
57
|
+
this.tableMap[`${this.children.length - 1}`] = index;
|
|
58
|
+
index++;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (this.children.length > 0) {
|
|
62
|
+
this.isApplicable = true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return Promise.resolve();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async execute(path: string): Promise<FlexCommand[]> {
|
|
69
|
+
const { flexSettings } = this.context;
|
|
70
|
+
const index = this.tableMap[path];
|
|
71
|
+
|
|
72
|
+
const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
73
|
+
CONTROL_TYPE
|
|
74
|
+
]);
|
|
75
|
+
|
|
76
|
+
const modifiedControl = smartTables[index];
|
|
77
|
+
if (!modifiedControl) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const propertyChange = {
|
|
81
|
+
personalization: {
|
|
82
|
+
sort: true,
|
|
83
|
+
column: true,
|
|
84
|
+
filter: true,
|
|
85
|
+
group: true,
|
|
86
|
+
aggregate: true
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const command = await createManifestPropertyChange(modifiedControl, flexSettings, propertyChange);
|
|
90
|
+
if (command) {
|
|
91
|
+
return [command];
|
|
92
|
+
} else {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -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-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_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"], 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) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
@@ -12,6 +12,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
|
|
|
12
12
|
const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
|
|
13
13
|
const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
|
|
14
14
|
const AddTableActionQuickAction = ___create_table_action["AddTableActionQuickAction"];
|
|
15
|
+
const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
|
|
15
16
|
const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
|
|
16
17
|
const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
|
|
17
18
|
const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
|
|
@@ -35,7 +36,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
|
|
|
35
36
|
if (name === 'listReport') {
|
|
36
37
|
definitionGroups.push({
|
|
37
38
|
title: 'LIST REPORT',
|
|
38
|
-
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
|
|
39
|
+
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
|
|
39
40
|
view,
|
|
40
41
|
key: name + index
|
|
41
42
|
});
|
|
@@ -12,6 +12,7 @@ import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
|
|
|
12
12
|
import { AddTableCustomColumnQuickAction } from './create-table-custom-column';
|
|
13
13
|
import { AddPageActionQuickAction } from '../common/create-page-action';
|
|
14
14
|
import { AddTableActionQuickAction } from './create-table-action';
|
|
15
|
+
import { EnableTableFilteringQuickAction } from './lr-enable-table-filtering';
|
|
15
16
|
import { ToggleSemanticDateRangeFilterBar } from './lr-enable-semantic-date-range-filter-bar';
|
|
16
17
|
|
|
17
18
|
type PageName = 'listReport' | 'objectPage';
|
|
@@ -43,7 +44,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
43
44
|
ToggleSemanticDateRangeFilterBar,
|
|
44
45
|
ChangeTableColumnsQuickAction,
|
|
45
46
|
AddTableActionQuickAction,
|
|
46
|
-
AddTableCustomColumnQuickAction
|
|
47
|
+
AddTableCustomColumnQuickAction,
|
|
48
|
+
EnableTableFilteringQuickAction
|
|
47
49
|
],
|
|
48
50
|
view,
|
|
49
51
|
key: name + index
|
|
@@ -17,7 +17,11 @@ sap.ui.define([
|
|
|
17
17
|
get textKey() {
|
|
18
18
|
return this.defaultTextKey;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
isApplicable = false;
|
|
21
|
+
isDisabled = false;
|
|
22
|
+
get tooltip() {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
21
25
|
isClearButtonEnabled = false;
|
|
22
26
|
children = [];
|
|
23
27
|
tableMap = {};
|
|
@@ -41,6 +45,7 @@ sap.ui.define([
|
|
|
41
45
|
if (changeColumnAction) {
|
|
42
46
|
this.children.push({
|
|
43
47
|
label: `'${ smartTable.getHeader() }' table`,
|
|
48
|
+
enabled: true,
|
|
44
49
|
children: []
|
|
45
50
|
});
|
|
46
51
|
this.tableMap[`${ this.children.length - 1 }`] = index;
|
|
@@ -48,14 +53,15 @@ sap.ui.define([
|
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
if (this.children.length > 0) {
|
|
51
|
-
this.
|
|
56
|
+
this.isApplicable = true;
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
getActionObject() {
|
|
55
60
|
return {
|
|
56
61
|
kind: NESTED_QUICK_ACTION_KIND,
|
|
57
62
|
id: this.id,
|
|
58
|
-
enabled: this.
|
|
63
|
+
enabled: !this.isDisabled,
|
|
64
|
+
tooltip: this.tooltip,
|
|
59
65
|
title: this.context.resourceBundle.getText(this.textKey),
|
|
60
66
|
children: this.children
|
|
61
67
|
};
|
|
@@ -17,7 +17,12 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
17
17
|
protected get textKey(): string {
|
|
18
18
|
return this.defaultTextKey;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
isApplicable = false;
|
|
21
|
+
protected isDisabled = false;
|
|
22
|
+
public get tooltip(): string | undefined {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
isClearButtonEnabled = false;
|
|
22
27
|
children: NestedQuickActionChild[] = [];
|
|
23
28
|
tableMap: Record<string, number> = {};
|
|
@@ -45,6 +50,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
45
50
|
if (changeColumnAction) {
|
|
46
51
|
this.children.push({
|
|
47
52
|
label: `'${(smartTable as Table).getHeader()}' table`,
|
|
53
|
+
enabled: true,
|
|
48
54
|
children: []
|
|
49
55
|
});
|
|
50
56
|
this.tableMap[`${this.children.length - 1}`] = index;
|
|
@@ -53,7 +59,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
if (this.children.length > 0) {
|
|
56
|
-
this.
|
|
62
|
+
this.isApplicable = true;
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
|
|
@@ -61,7 +67,8 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
61
67
|
return {
|
|
62
68
|
kind: NESTED_QUICK_ACTION_KIND,
|
|
63
69
|
id: this.id,
|
|
64
|
-
enabled: this.
|
|
70
|
+
enabled: !this.isDisabled,
|
|
71
|
+
tooltip: this.tooltip,
|
|
65
72
|
title: this.context.resourceBundle.getText(this.textKey),
|
|
66
73
|
children: this.children
|
|
67
74
|
};
|
|
@@ -11,9 +11,12 @@ sap.ui.define([
|
|
|
11
11
|
get id() {
|
|
12
12
|
return `${ this.context.key }-${ this.type }`;
|
|
13
13
|
}
|
|
14
|
-
get
|
|
14
|
+
get isApplicable() {
|
|
15
15
|
return this.control !== undefined;
|
|
16
16
|
}
|
|
17
|
+
get tooltip() {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
17
20
|
get textKey() {
|
|
18
21
|
return this.defaultTextKey;
|
|
19
22
|
}
|
|
@@ -33,7 +36,8 @@ sap.ui.define([
|
|
|
33
36
|
return {
|
|
34
37
|
kind: SIMPLE_QUICK_ACTION_KIND,
|
|
35
38
|
id: this.id,
|
|
36
|
-
enabled: this.
|
|
39
|
+
enabled: !this.isDisabled,
|
|
40
|
+
tooltip: this.tooltip,
|
|
37
41
|
title: this.context.resourceBundle.getText(this.textKey)
|
|
38
42
|
};
|
|
39
43
|
}
|
|
@@ -14,10 +14,16 @@ export abstract class SimpleQuickActionDefinitionBase {
|
|
|
14
14
|
return `${this.context.key}-${this.type}`;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
public get
|
|
17
|
+
public get isApplicable(): boolean {
|
|
18
18
|
return this.control !== undefined;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
protected isDisabled: boolean | undefined;
|
|
22
|
+
|
|
23
|
+
public get tooltip(): string | undefined {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
protected get textKey(): string {
|
|
22
28
|
return this.defaultTextKey;
|
|
23
29
|
}
|
|
@@ -46,7 +52,8 @@ export abstract class SimpleQuickActionDefinitionBase {
|
|
|
46
52
|
return {
|
|
47
53
|
kind: SIMPLE_QUICK_ACTION_KIND,
|
|
48
54
|
id: this.id,
|
|
49
|
-
enabled: this.
|
|
55
|
+
enabled: !this.isDisabled,
|
|
56
|
+
tooltip: this.tooltip,
|
|
50
57
|
title: this.context.resourceBundle.getText(this.textKey)
|
|
51
58
|
};
|
|
52
59
|
}
|
|
@@ -44,7 +44,10 @@ sap.ui.define([
|
|
|
44
44
|
get id() {
|
|
45
45
|
return `${ this.context.key }-${ this.type }`;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
isApplicable = false;
|
|
48
|
+
get tooltip() {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
48
51
|
children = [];
|
|
49
52
|
tableMap = {};
|
|
50
53
|
get textKey() {
|
|
@@ -63,7 +66,7 @@ sap.ui.define([
|
|
|
63
66
|
major: 1,
|
|
64
67
|
minor: 96
|
|
65
68
|
})) {
|
|
66
|
-
this.
|
|
69
|
+
this.isApplicable = false;
|
|
67
70
|
return;
|
|
68
71
|
}
|
|
69
72
|
const iconTabBarfilterMap = this.buildIconTabBarFilterMap();
|
|
@@ -75,6 +78,7 @@ sap.ui.define([
|
|
|
75
78
|
} else if (this.iconTabBar && tabKey) {
|
|
76
79
|
this.children.push({
|
|
77
80
|
label: `'${ iconTabBarfilterMap[tabKey] }' table`,
|
|
81
|
+
enabled: true,
|
|
78
82
|
children: []
|
|
79
83
|
});
|
|
80
84
|
this.tableMap[`${ this.children.length - 1 }`] = {
|
|
@@ -95,7 +99,7 @@ sap.ui.define([
|
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
if (this.children.length > 0) {
|
|
98
|
-
this.
|
|
102
|
+
this.isApplicable = true;
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
getTableLabel(table) {
|
|
@@ -146,8 +150,10 @@ sap.ui.define([
|
|
|
146
150
|
tableMapIndex = `${ tableMapIndex }/0`;
|
|
147
151
|
this.children.push({
|
|
148
152
|
label: `'${ section?.getTitle() }' section`,
|
|
153
|
+
enabled: true,
|
|
149
154
|
children: [{
|
|
150
155
|
label: this.getTableLabel(table),
|
|
156
|
+
enabled: true,
|
|
151
157
|
children: []
|
|
152
158
|
}]
|
|
153
159
|
});
|
|
@@ -155,6 +161,7 @@ sap.ui.define([
|
|
|
155
161
|
tableMapIndex = `${ tableMapIndex }/${ sectionChild.children.length - 1 }`;
|
|
156
162
|
sectionChild.children.push({
|
|
157
163
|
label: this.getTableLabel(table),
|
|
164
|
+
enabled: true,
|
|
158
165
|
children: []
|
|
159
166
|
});
|
|
160
167
|
}
|
|
@@ -179,6 +186,7 @@ sap.ui.define([
|
|
|
179
186
|
].some(type => isA(type, table))) {
|
|
180
187
|
this.children.push({
|
|
181
188
|
label: this.getTableLabel(table),
|
|
189
|
+
enabled: true,
|
|
182
190
|
children: []
|
|
183
191
|
});
|
|
184
192
|
}
|
|
@@ -198,7 +206,8 @@ sap.ui.define([
|
|
|
198
206
|
return {
|
|
199
207
|
kind: NESTED_QUICK_ACTION_KIND,
|
|
200
208
|
id: this.id,
|
|
201
|
-
enabled: this.
|
|
209
|
+
enabled: !this.isDisabled,
|
|
210
|
+
tooltip: this.tooltip,
|
|
202
211
|
title: this.context.resourceBundle.getText(this.textKey),
|
|
203
212
|
children: this.children
|
|
204
213
|
};
|
|
@@ -49,7 +49,13 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
49
49
|
return `${this.context.key}-${this.type}`;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
public
|
|
52
|
+
public isApplicable = false;
|
|
53
|
+
|
|
54
|
+
protected isDisabled: boolean | undefined;
|
|
55
|
+
|
|
56
|
+
public get tooltip(): string | undefined {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
53
59
|
|
|
54
60
|
public children: NestedQuickActionChild[] = [];
|
|
55
61
|
public tableMap: Record<
|
|
@@ -89,7 +95,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
89
95
|
// No action found in control design time for version < 1.96
|
|
90
96
|
const version = await getUi5Version();
|
|
91
97
|
if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 96 })) {
|
|
92
|
-
this.
|
|
98
|
+
this.isApplicable = false;
|
|
93
99
|
return;
|
|
94
100
|
}
|
|
95
101
|
const iconTabBarfilterMap = this.buildIconTabBarFilterMap();
|
|
@@ -105,6 +111,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
105
111
|
} else if (this.iconTabBar && tabKey) {
|
|
106
112
|
this.children.push({
|
|
107
113
|
label: `'${iconTabBarfilterMap[tabKey]}' table`,
|
|
114
|
+
enabled: true,
|
|
108
115
|
children: []
|
|
109
116
|
});
|
|
110
117
|
this.tableMap[`${this.children.length - 1}`] = {
|
|
@@ -131,7 +138,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
131
138
|
}
|
|
132
139
|
}
|
|
133
140
|
if (this.children.length > 0) {
|
|
134
|
-
this.
|
|
141
|
+
this.isApplicable = true;
|
|
135
142
|
}
|
|
136
143
|
}
|
|
137
144
|
|
|
@@ -160,7 +167,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
160
167
|
* Builds a map kay/tab_name for ICON_TAB_BAR control of the active page, if such exists
|
|
161
168
|
* @returns built map
|
|
162
169
|
*/
|
|
163
|
-
|
|
170
|
+
protected buildIconTabBarFilterMap(): { [key: string]: string } {
|
|
164
171
|
const iconTabBarFilterMap: { [key: string]: string } = {};
|
|
165
172
|
|
|
166
173
|
// Assumption only a tab bar control per page.
|
|
@@ -201,9 +208,11 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
201
208
|
tableMapIndex = `${tableMapIndex}/0`;
|
|
202
209
|
this.children.push({
|
|
203
210
|
label: `'${section?.getTitle()}' section`,
|
|
211
|
+
enabled: true,
|
|
204
212
|
children: [
|
|
205
213
|
{
|
|
206
214
|
label: this.getTableLabel(table),
|
|
215
|
+
enabled: true,
|
|
207
216
|
children: []
|
|
208
217
|
}
|
|
209
218
|
]
|
|
@@ -212,6 +221,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
212
221
|
tableMapIndex = `${tableMapIndex}/${sectionChild.children.length - 1}`;
|
|
213
222
|
sectionChild.children.push({
|
|
214
223
|
label: this.getTableLabel(table),
|
|
224
|
+
enabled: true,
|
|
215
225
|
children: []
|
|
216
226
|
});
|
|
217
227
|
}
|
|
@@ -237,6 +247,7 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
237
247
|
if ([SMART_TABLE_TYPE, M_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE].some((type) => isA(type, table))) {
|
|
238
248
|
this.children.push({
|
|
239
249
|
label: this.getTableLabel(table),
|
|
250
|
+
enabled: true,
|
|
240
251
|
children: []
|
|
241
252
|
});
|
|
242
253
|
}
|
|
@@ -267,7 +278,8 @@ export abstract class TableQuickActionDefinitionBase {
|
|
|
267
278
|
return {
|
|
268
279
|
kind: NESTED_QUICK_ACTION_KIND,
|
|
269
280
|
id: this.id,
|
|
270
|
-
enabled: this.
|
|
281
|
+
enabled: !this.isDisabled,
|
|
282
|
+
tooltip: this.tooltip,
|
|
271
283
|
title: this.context.resourceBundle.getText(this.textKey),
|
|
272
284
|
children: this.children
|
|
273
285
|
};
|
|
@@ -3,14 +3,12 @@ sap.ui.define([
|
|
|
3
3
|
'sap/ui/rta/command/CommandFactory',
|
|
4
4
|
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
5
5
|
'./validator',
|
|
6
|
-
'../../utils/fe-v4'
|
|
7
|
-
|
|
8
|
-
], function (CommandFactory, ___sap_ux_private_control_property_editor_common, ___validator, ____utils_fe_v4, ___utils) {
|
|
6
|
+
'../../utils/fe-v4'
|
|
7
|
+
], function (CommandFactory, ___sap_ux_private_control_property_editor_common, ___validator, ____utils_fe_v4) {
|
|
9
8
|
'use strict';
|
|
10
9
|
const PropertyType = ___sap_ux_private_control_property_editor_common['PropertyType'];
|
|
11
10
|
const validateBindingModel = ___validator['validateBindingModel'];
|
|
12
|
-
const
|
|
13
|
-
const getOverlay = ___utils['getOverlay'];
|
|
11
|
+
const createManifestPropertyChange = ____utils_fe_v4['createManifestPropertyChange'];
|
|
14
12
|
function isBindingExpression(value) {
|
|
15
13
|
return value.includes('{') && value.includes('}') && value.indexOf('{') < value.indexOf('}');
|
|
16
14
|
}
|
|
@@ -38,22 +36,12 @@ sap.ui.define([
|
|
|
38
36
|
const command = await CommandFactory.getCommandFor(modifiedControl, changeType, modifiedValue, null, flexSettings);
|
|
39
37
|
await rta.getCommandStack().pushAndExecute(command);
|
|
40
38
|
} else if (change.propertyType === PropertyType.Configuration) {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
39
|
+
const command = await createManifestPropertyChange(modifiedControl, flexSettings, { [change.propertyName]: change.value });
|
|
40
|
+
if (command) {
|
|
41
|
+
await rta.getCommandStack().pushAndExecute(command);
|
|
42
|
+
} else {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
const overlayData = overlay?.getDesignTimeMetadata().getData();
|
|
46
|
-
const manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
|
|
47
|
-
const [manifestPropertyChange] = overlayData.manifestPropertyChange({ [change.propertyName]: change.value }, manifestPropertyPath, modifiedControl);
|
|
48
|
-
const modifiedValue = {
|
|
49
|
-
reference: getReference(modifiedControl),
|
|
50
|
-
appComponent: manifestPropertyChange.appComponent,
|
|
51
|
-
changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
|
|
52
|
-
parameters: manifestPropertyChange.changeSpecificData.content.parameters,
|
|
53
|
-
selector: manifestPropertyChange.selector
|
|
54
|
-
};
|
|
55
|
-
const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
56
|
-
await rta.getCommandStack().pushAndExecute(command);
|
|
57
45
|
}
|
|
58
46
|
}
|
|
59
47
|
var __exports = { __esModule: true };
|
|
@@ -3,9 +3,7 @@ import CommandFactory from 'sap/ui/rta/command/CommandFactory';
|
|
|
3
3
|
import { PropertyType, type PropertyChange } from '@sap-ux-private/control-property-editor-common';
|
|
4
4
|
import type { UI5AdaptationOptions } from '../types';
|
|
5
5
|
import { validateBindingModel } from './validator';
|
|
6
|
-
import {
|
|
7
|
-
import { getOverlay } from '../utils';
|
|
8
|
-
|
|
6
|
+
import { createManifestPropertyChange } from '../../utils/fe-v4';
|
|
9
7
|
/**
|
|
10
8
|
* Function to check a give value is a binding expression.
|
|
11
9
|
*
|
|
@@ -56,33 +54,11 @@ export async function applyChange(options: UI5AdaptationOptions, change: Propert
|
|
|
56
54
|
);
|
|
57
55
|
await rta.getCommandStack().pushAndExecute(command);
|
|
58
56
|
} else if (change.propertyType === PropertyType.Configuration) {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
57
|
+
const command = await createManifestPropertyChange(modifiedControl, flexSettings, { [change.propertyName]: change.value });
|
|
58
|
+
if (command) {
|
|
59
|
+
await rta.getCommandStack().pushAndExecute(command);
|
|
60
|
+
} else {
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
const overlayData = overlay?.getDesignTimeMetadata().getData();
|
|
64
|
-
const manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
|
|
65
|
-
const [manifestPropertyChange] = overlayData.manifestPropertyChange(
|
|
66
|
-
{ [change.propertyName]: change.value },
|
|
67
|
-
manifestPropertyPath,
|
|
68
|
-
modifiedControl
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const modifiedValue = {
|
|
72
|
-
reference: getReference(modifiedControl),
|
|
73
|
-
appComponent: manifestPropertyChange.appComponent,
|
|
74
|
-
changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
|
|
75
|
-
parameters: manifestPropertyChange.changeSpecificData.content.parameters,
|
|
76
|
-
selector: manifestPropertyChange.selector
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const command = await CommandFactory.getCommandFor(
|
|
80
|
-
modifiedControl,
|
|
81
|
-
'appDescriptor',
|
|
82
|
-
modifiedValue,
|
|
83
|
-
null,
|
|
84
|
-
flexSettings
|
|
85
|
-
);
|
|
86
|
-
await rta.getCommandStack().pushAndExecute(command);
|
|
87
63
|
}
|
|
88
64
|
}
|
|
@@ -42,11 +42,6 @@ export interface QuickActionContext {
|
|
|
42
42
|
changeService: ChangeService;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export type QuickActionActivationData = {
|
|
46
|
-
isActive: boolean;
|
|
47
|
-
title: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
45
|
interface QuickActionDefinitionBase {
|
|
51
46
|
/**
|
|
52
47
|
* Used to identify between different Quick Action definitions.
|
|
@@ -65,7 +60,7 @@ interface QuickActionDefinitionBase {
|
|
|
65
60
|
/**
|
|
66
61
|
* Indicates that the Quick Action is applicable to the given context and should be displayed.
|
|
67
62
|
*/
|
|
68
|
-
|
|
63
|
+
isApplicable: boolean;
|
|
69
64
|
/**
|
|
70
65
|
* Initializes the action and checks if it should be enabled in current context.
|
|
71
66
|
*/
|
|
@@ -85,7 +85,7 @@ sap.ui.define([
|
|
|
85
85
|
this.sendAction(quickActionListChanged(groups));
|
|
86
86
|
}
|
|
87
87
|
addAction(group, instance) {
|
|
88
|
-
if (instance.
|
|
88
|
+
if (instance.isApplicable) {
|
|
89
89
|
const quickAction = instance.getActionObject();
|
|
90
90
|
group.actions.push(quickAction);
|
|
91
91
|
this.actions.push(instance);
|
|
@@ -132,7 +132,7 @@ export class QuickActionService implements Service {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
private addAction(group: QuickActionGroup, instance: QuickActionDefinition): void {
|
|
135
|
-
if (instance.
|
|
135
|
+
if (instance.isApplicable) {
|
|
136
136
|
const quickAction = instance.getActionObject();
|
|
137
137
|
group.actions.push(quickAction);
|
|
138
138
|
this.actions.push(instance);
|
|
@@ -5,6 +5,7 @@ QUICK_ACTION_OP_ADD_CUSTOM_SECTION=Add Custom Section
|
|
|
5
5
|
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
|
+
QUICK_ACTION_ENABLE_TABLE_FILTERING=Enable Table Filtering for Page Variants
|
|
8
9
|
|
|
9
10
|
V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
|
|
10
11
|
|
|
@@ -14,7 +15,6 @@ V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
|
|
|
14
15
|
QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR=Enable Semantic Date Range in Filter Bar
|
|
15
16
|
QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR=Disable Semantic Date Range in Filter Bar
|
|
16
17
|
|
|
17
|
-
|
|
18
18
|
V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
|
|
19
19
|
|
|
20
20
|
V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
|
|
@@ -38,3 +38,4 @@ CPE_CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_MESSAGE = Note: The change will be vis
|
|
|
38
38
|
TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN=At least one table row is required to create new custom column. Make sure the table data is loaded and try again.
|
|
39
39
|
|
|
40
40
|
HIGHER_LAYER_CHANGES_INFO_MESSAGE=The preview of the project was reloaded due to detected changes in higher layer than the one used in your project.
|
|
41
|
+
THE_CHANGE_HAS_ALREADY_BEEN_MADE=This option has been disabled because the change has already been made
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/core/Component", "./core"], function (Component, ___core) {
|
|
3
|
+
sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFactory", "../cpe/utils"], function (Component, ___core, CommandFactory, ___cpe_utils) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const isA = ___core["isA"];
|
|
7
|
+
const getOverlay = ___cpe_utils["getOverlay"];
|
|
7
8
|
/**
|
|
8
9
|
* Gets app component of a v4 project.
|
|
9
10
|
*
|
|
@@ -74,6 +75,33 @@ sap.ui.define(["sap/ui/core/Component", "./core"], function (Component, ___core)
|
|
|
74
75
|
}
|
|
75
76
|
return propertyPathSegments.join('/');
|
|
76
77
|
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
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
|
+
*
|
|
85
|
+
* @returns A Promise resolving to an array of FlexCommand objects.
|
|
86
|
+
*/
|
|
87
|
+
async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges) {
|
|
88
|
+
const overlay = getOverlay(modifiedControl);
|
|
89
|
+
if (!overlay) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
const overlayData = overlay?.getDesignTimeMetadata().getData();
|
|
93
|
+
const manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
|
|
94
|
+
const [manifestPropertyChange] = overlayData.manifestPropertyChange(propertyChanges, manifestPropertyPath, modifiedControl);
|
|
95
|
+
const modifiedValue = {
|
|
96
|
+
reference: getReference(modifiedControl),
|
|
97
|
+
appComponent: manifestPropertyChange.appComponent,
|
|
98
|
+
changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
|
|
99
|
+
parameters: manifestPropertyChange.changeSpecificData.content.parameters,
|
|
100
|
+
selector: manifestPropertyChange.selector
|
|
101
|
+
};
|
|
102
|
+
const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
103
|
+
return command;
|
|
104
|
+
}
|
|
77
105
|
var __exports = {
|
|
78
106
|
__esModule: true
|
|
79
107
|
};
|
|
@@ -82,6 +110,7 @@ sap.ui.define(["sap/ui/core/Component", "./core"], function (Component, ___core)
|
|
|
82
110
|
__exports.getV4PageType = getV4PageType;
|
|
83
111
|
__exports.getPageName = getPageName;
|
|
84
112
|
__exports.getConfigMapControlIdMap = getConfigMapControlIdMap;
|
|
113
|
+
__exports.createManifestPropertyChange = createManifestPropertyChange;
|
|
85
114
|
return __exports;
|
|
86
115
|
});
|
|
87
116
|
//# sourceMappingURL=fe-v4.js.map
|