@sap-ux/preview-middleware 0.17.11 → 0.17.12
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 +1 -1
- package/dist/client/adp/controllers/AddFragment.controller.ts +1 -1
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +43 -19
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +46 -20
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +20 -18
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +18 -28
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +10 -10
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +9 -14
- package/package.json +7 -7
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +0 -67
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +0 -75
|
@@ -168,7 +168,7 @@ sap.ui.define([
|
|
|
168
168
|
ANALYTICAL_TABLE_TYPE
|
|
169
169
|
].includes(currentControlName) && targetAggregation === 'columns') {
|
|
170
170
|
return 'ANALYTICAL_TABLE_COLUMN';
|
|
171
|
-
} else if (currentControlName === 'sap.ui.mdc.
|
|
171
|
+
} else if (currentControlName === 'sap.ui.mdc.Table' && targetAggregation === 'actions') {
|
|
172
172
|
return 'TABLE_ACTION';
|
|
173
173
|
}
|
|
174
174
|
return '';
|
|
@@ -264,7 +264,7 @@ export default class AddFragment extends BaseDialog<AddFragmentModel> {
|
|
|
264
264
|
targetAggregation === 'columns'
|
|
265
265
|
) {
|
|
266
266
|
return 'ANALYTICAL_TABLE_COLUMN';
|
|
267
|
-
} else if (currentControlName === 'sap.ui.mdc.
|
|
267
|
+
} else if (currentControlName === 'sap.ui.mdc.Table' && targetAggregation === 'actions') {
|
|
268
268
|
return 'TABLE_ACTION';
|
|
269
269
|
}
|
|
270
270
|
return '';
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI", "../../../
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI", "../../../utils/core", "../table-quick-action-base", "../control-types", "../dialog-enablement-validator", "../../../cpe/quick-actions/utils"], function (OverlayUtil, FlexRuntimeInfoAPI, _____utils_core, ___table_quick_action_base, ___control_types, ___dialog_enablement_validator, _____cpe_quick_actions_utils) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
7
6
|
const getControlById = _____utils_core["getControlById"];
|
|
8
7
|
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
9
8
|
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
10
9
|
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
10
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
11
11
|
const CHANGE_TABLE_COLUMNS = 'change-table-columns';
|
|
12
12
|
const ACTION_ID = 'CTX_SETTINGS0';
|
|
13
|
-
const CONTROL_TYPE = 'sap.ui.mdc.Table';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Quick Action for changing table columns.
|
|
@@ -19,25 +18,50 @@ sap.ui.define(["sap/ui/dt/OverlayUtil", "sap/ui/fl/apply/api/FlexRuntimeInfoAPI"
|
|
|
19
18
|
constructor(context) {
|
|
20
19
|
super(CHANGE_TABLE_COLUMNS, [MDC_TABLE_TYPE], 'V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
21
20
|
}
|
|
22
|
-
async
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
async initialize() {
|
|
22
|
+
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
|
|
23
|
+
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
|
|
24
|
+
element: smartTable
|
|
25
|
+
});
|
|
26
|
+
if (!hasVariantManagement) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const actions = await this.context.actionService.get(smartTable.getId());
|
|
30
|
+
const changeColumnAction = actions.find(action => action.id === ACTION_ID);
|
|
31
|
+
if (changeColumnAction) {
|
|
32
|
+
this.children.push({
|
|
33
|
+
label: `'${smartTable.getHeader()}' table`,
|
|
34
|
+
enabled: true,
|
|
35
|
+
children: []
|
|
34
36
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
this.tableMap[`${this.children.length - 1}`] = {
|
|
38
|
+
table: smartTable,
|
|
39
|
+
tableUpdateEventAttachedOnce: false
|
|
40
|
+
};
|
|
39
41
|
}
|
|
40
42
|
}
|
|
43
|
+
if (this.children.length > 0) {
|
|
44
|
+
this.isApplicable = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async execute(path) {
|
|
48
|
+
const {
|
|
49
|
+
table
|
|
50
|
+
} = this.tableMap[path];
|
|
51
|
+
if (!table) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const tableControl = getControlById(table.getId());
|
|
55
|
+
const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
|
|
56
|
+
if (controlOverlay) {
|
|
57
|
+
controlOverlay.setSelected(true);
|
|
58
|
+
}
|
|
59
|
+
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({
|
|
60
|
+
element: table
|
|
61
|
+
});
|
|
62
|
+
if (hasVariantManagement) {
|
|
63
|
+
await this.context.actionService.execute(table.getId(), ACTION_ID);
|
|
64
|
+
}
|
|
41
65
|
return [];
|
|
42
66
|
}
|
|
43
67
|
}
|
|
@@ -2,15 +2,15 @@ import OverlayUtil from 'sap/ui/dt/OverlayUtil';
|
|
|
2
2
|
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
3
|
import FlexRuntimeInfoAPI from 'sap/ui/fl/apply/api/FlexRuntimeInfoAPI';
|
|
4
4
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
5
|
-
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
6
5
|
import { getControlById } from '../../../utils/core';
|
|
7
|
-
import { TableQuickActionDefinitionBase } from '
|
|
6
|
+
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
8
7
|
import { MDC_TABLE_TYPE } from '../control-types';
|
|
9
8
|
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
|
+
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
10
|
+
import Table from 'sap/ui/mdc/Table';
|
|
10
11
|
|
|
11
12
|
export const CHANGE_TABLE_COLUMNS = 'change-table-columns';
|
|
12
13
|
const ACTION_ID = 'CTX_SETTINGS0';
|
|
13
|
-
const CONTROL_TYPE = 'sap.ui.mdc.Table';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Quick Action for changing table columns.
|
|
@@ -25,24 +25,50 @@ export class ChangeTableColumnsQuickAction
|
|
|
25
25
|
]);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
async
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (controlOverlay) {
|
|
38
|
-
controlOverlay.setSelected(true);
|
|
39
|
-
}
|
|
40
|
-
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTables[i] });
|
|
41
|
-
if (!hasVariantManagement) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
await this.context.actionService.execute(smartTables[i].getId(), ACTION_ID);
|
|
28
|
+
async initialize(): Promise<void> {
|
|
29
|
+
for (const smartTable of getRelevantControlFromActivePage(
|
|
30
|
+
this.context.controlIndex,
|
|
31
|
+
this.context.view,
|
|
32
|
+
this.controlTypes
|
|
33
|
+
)) {
|
|
34
|
+
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
|
|
35
|
+
if (!hasVariantManagement) {
|
|
36
|
+
continue;
|
|
45
37
|
}
|
|
38
|
+
|
|
39
|
+
const actions = await this.context.actionService.get(smartTable.getId());
|
|
40
|
+
const changeColumnAction = actions.find((action) => action.id === ACTION_ID);
|
|
41
|
+
if (changeColumnAction) {
|
|
42
|
+
this.children.push({
|
|
43
|
+
label: `'${(smartTable as Table).getHeader()}' table`,
|
|
44
|
+
enabled: true,
|
|
45
|
+
children: []
|
|
46
|
+
});
|
|
47
|
+
this.tableMap[`${this.children.length - 1}`] = {
|
|
48
|
+
table: smartTable,
|
|
49
|
+
tableUpdateEventAttachedOnce: false
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (this.children.length > 0) {
|
|
55
|
+
this.isApplicable = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async execute(path: string): Promise<FlexCommand[]> {
|
|
60
|
+
const { table } = this.tableMap[path];
|
|
61
|
+
if (!table) {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const tableControl = getControlById(table.getId());
|
|
65
|
+
const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
|
|
66
|
+
if (controlOverlay) {
|
|
67
|
+
controlOverlay.setSelected(true);
|
|
68
|
+
}
|
|
69
|
+
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: table });
|
|
70
|
+
if (hasVariantManagement) {
|
|
71
|
+
await this.context.actionService.execute(table.getId(), ACTION_ID);
|
|
46
72
|
}
|
|
47
73
|
|
|
48
74
|
return [];
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayUtil", "../../../
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayUtil", "../../../utils/core", "../../dialog-factory", "../dialog-enablement-validator", "../table-quick-action-base", "../control-types", "../fe-v2/create-table-custom-column"], function (OverlayUtil, _____utils_core, ____dialog_factory, ___dialog_enablement_validator, ___table_quick_action_base, ___control_types, ___fe_v2_create_table_custom_column) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
7
6
|
const getControlById = _____utils_core["getControlById"];
|
|
8
7
|
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
9
8
|
const DialogNames = ____dialog_factory["DialogNames"];
|
|
10
9
|
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
10
|
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
12
11
|
const MDC_TABLE_TYPE = ___control_types["MDC_TABLE_TYPE"];
|
|
12
|
+
const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
|
|
13
13
|
const CREATE_TABLE_ACTION = 'create_table_action';
|
|
14
|
-
const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Quick Action for creating table action.
|
|
18
17
|
*/
|
|
19
18
|
class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
|
|
20
19
|
constructor(context) {
|
|
21
|
-
super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context,
|
|
20
|
+
super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
22
21
|
}
|
|
23
22
|
async execute(path) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
const {
|
|
24
|
+
table,
|
|
25
|
+
sectionInfo,
|
|
26
|
+
iconTabBarFilterKey
|
|
27
|
+
} = this.tableMap[path];
|
|
28
|
+
if (!table) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
32
|
+
const tableControl = getControlById(table.getId());
|
|
33
|
+
const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
|
|
34
|
+
if (controlOverlay) {
|
|
35
|
+
controlOverlay.setSelected(true);
|
|
36
|
+
await DialogFactory.createDialog(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
37
|
+
aggregation: 'actions',
|
|
38
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
39
|
+
});
|
|
38
40
|
}
|
|
39
41
|
return [];
|
|
40
42
|
}
|
|
@@ -2,51 +2,41 @@ import OverlayUtil from 'sap/ui/dt/OverlayUtil';
|
|
|
2
2
|
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
3
|
|
|
4
4
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
5
|
-
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
6
5
|
import { getControlById } from '../../../utils/core';
|
|
7
6
|
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
8
7
|
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
|
-
import { TableQuickActionDefinitionBase } from '
|
|
8
|
+
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
10
9
|
import { MDC_TABLE_TYPE } from '../control-types';
|
|
10
|
+
import { preprocessActionExecution } from '../fe-v2/create-table-custom-column';
|
|
11
11
|
|
|
12
12
|
export const CREATE_TABLE_ACTION = 'create_table_action';
|
|
13
|
-
const TOOLBAR_ACTION = 'sap.ui.mdc.ActionToolbar';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Quick Action for creating table action.
|
|
17
16
|
*/
|
|
18
17
|
export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
|
|
19
18
|
constructor(context: QuickActionContext) {
|
|
20
|
-
super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context,
|
|
19
|
+
super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
|
|
21
20
|
DIALOG_ENABLEMENT_VALIDATOR
|
|
22
21
|
]);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
DialogNames.ADD_FRAGMENT,
|
|
42
|
-
undefined,
|
|
43
|
-
{
|
|
44
|
-
aggregation: 'actions',
|
|
45
|
-
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
25
|
+
const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path];
|
|
26
|
+
if (!table) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
31
|
+
const tableControl = getControlById(table.getId());
|
|
32
|
+
const controlOverlay = OverlayUtil.getClosestOverlayFor(tableControl);
|
|
33
|
+
if (controlOverlay) {
|
|
34
|
+
controlOverlay.setSelected(true);
|
|
35
|
+
|
|
36
|
+
await DialogFactory.createDialog(controlOverlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
37
|
+
aggregation: 'actions',
|
|
38
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
39
|
+
});
|
|
50
40
|
}
|
|
51
41
|
|
|
52
42
|
return [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["
|
|
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"];
|
|
@@ -28,7 +28,6 @@ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils",
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
|
|
31
|
-
let index = 0;
|
|
32
31
|
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [MDC_TABLE_TYPE])) {
|
|
33
32
|
const personalizationData = smartTable.getP13nMode();
|
|
34
33
|
const value = this.context.changeService.getConfigurationPropertyValue(smartTable.getId(), 'personalization');
|
|
@@ -39,22 +38,23 @@ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils",
|
|
|
39
38
|
tooltip: isFilterEnabled ? tooltipText : undefined,
|
|
40
39
|
children: []
|
|
41
40
|
});
|
|
42
|
-
this.tableMap[`${this.children.length - 1}`] =
|
|
43
|
-
|
|
41
|
+
this.tableMap[`${this.children.length - 1}`] = {
|
|
42
|
+
table: smartTable,
|
|
43
|
+
tableUpdateEventAttachedOnce: false
|
|
44
|
+
};
|
|
44
45
|
}
|
|
45
46
|
if (this.children.length > 0) {
|
|
46
47
|
this.isApplicable = true;
|
|
47
48
|
}
|
|
48
|
-
return Promise.resolve();
|
|
49
49
|
}
|
|
50
50
|
async execute(path) {
|
|
51
51
|
const {
|
|
52
52
|
flexSettings
|
|
53
53
|
} = this.context;
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (!
|
|
54
|
+
const {
|
|
55
|
+
table
|
|
56
|
+
} = this.tableMap[path];
|
|
57
|
+
if (!table) {
|
|
58
58
|
return [];
|
|
59
59
|
}
|
|
60
60
|
const propertyChange = {
|
|
@@ -66,7 +66,7 @@ sap.ui.define(["./table-quick-action-base", "../../../cpe/quick-actions/utils",
|
|
|
66
66
|
aggregate: true
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
const command = await createManifestPropertyChange(
|
|
69
|
+
const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
|
|
70
70
|
if (command) {
|
|
71
71
|
return [command];
|
|
72
72
|
} else {
|
|
@@ -2,7 +2,7 @@ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
|
2
2
|
|
|
3
3
|
import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
|
|
4
4
|
import Table from 'sap/ui/mdc/Table';
|
|
5
|
-
import { TableQuickActionDefinitionBase } from '
|
|
5
|
+
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';
|
|
@@ -38,7 +38,7 @@ export class EnableTableFilteringQuickAction
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const tooltipText = this.context.resourceBundle.getText('TABLE_FILTERING_CHANGE_HAS_ALREADY_BEEN_MADE');
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
43
43
|
MDC_TABLE_TYPE
|
|
44
44
|
])) {
|
|
@@ -54,27 +54,22 @@ export class EnableTableFilteringQuickAction
|
|
|
54
54
|
tooltip: isFilterEnabled ? tooltipText : undefined,
|
|
55
55
|
children: []
|
|
56
56
|
});
|
|
57
|
-
this.tableMap[`${this.children.length - 1}`] =
|
|
58
|
-
|
|
57
|
+
this.tableMap[`${this.children.length - 1}`] = {
|
|
58
|
+
table: smartTable,
|
|
59
|
+
tableUpdateEventAttachedOnce: false
|
|
60
|
+
};
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
if (this.children.length > 0) {
|
|
62
64
|
this.isApplicable = true;
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
return Promise.resolve();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
69
69
|
const { flexSettings } = this.context;
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
const smartTables = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, [
|
|
73
|
-
MDC_TABLE_TYPE
|
|
74
|
-
]);
|
|
70
|
+
const { table } = this.tableMap[path];
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
if (!modifiedControl) {
|
|
72
|
+
if (!table) {
|
|
78
73
|
return [];
|
|
79
74
|
}
|
|
80
75
|
const propertyChange = {
|
|
@@ -86,7 +81,7 @@ export class EnableTableFilteringQuickAction
|
|
|
86
81
|
aggregate: true
|
|
87
82
|
}
|
|
88
83
|
};
|
|
89
|
-
const command = await createManifestPropertyChange(
|
|
84
|
+
const command = await createManifestPropertyChange(table, flexSettings, propertyChange);
|
|
90
85
|
if (command) {
|
|
91
86
|
return [command];
|
|
92
87
|
} else {
|
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.17.
|
|
12
|
+
"version": "0.17.12",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"ejs": "3.1.10",
|
|
26
26
|
"mem-fs": "2.1.0",
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
|
-
"@sap-ux/btp-utils": "0.18.0",
|
|
29
|
-
"@sap-ux/feature-toggle": "0.2.3",
|
|
30
28
|
"@sap-ux/logger": "0.6.0",
|
|
31
|
-
"@sap-ux/
|
|
29
|
+
"@sap-ux/feature-toggle": "0.2.3",
|
|
30
|
+
"@sap-ux/btp-utils": "0.18.0",
|
|
32
31
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.33",
|
|
33
|
-
"@sap-ux/adp-tooling": "0.12.119"
|
|
32
|
+
"@sap-ux/adp-tooling": "0.12.119",
|
|
33
|
+
"@sap-ux/project-access": "1.29.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/ejs": "3.1.2",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"supertest": "6.3.3",
|
|
47
47
|
"@sap-ux-private/playwright": "0.1.0",
|
|
48
48
|
"dotenv": "16.3.1",
|
|
49
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.
|
|
50
|
-
"@sap-ux/axios-extension": "1.18.3",
|
|
49
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.56",
|
|
51
50
|
"@sap-ux/store": "1.0.0",
|
|
52
51
|
"@sap-ux/ui5-info": "0.8.3",
|
|
52
|
+
"@sap-ux/axios-extension": "1.18.3",
|
|
53
53
|
"@sap-ux/i18n": "0.2.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
sap.ui.define([
|
|
3
|
-
'sap/ui/fl/apply/api/FlexRuntimeInfoAPI',
|
|
4
|
-
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
5
|
-
'../../../cpe/quick-actions/utils',
|
|
6
|
-
'../quick-action-base'
|
|
7
|
-
], function (FlexRuntimeInfoAPI, ___sap_ux_private_control_property_editor_common, _____cpe_quick_actions_utils, ___quick_action_base) {
|
|
8
|
-
'use strict';
|
|
9
|
-
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
|
|
10
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils['getRelevantControlFromActivePage'];
|
|
11
|
-
const QuickActionDefinitionBase = ___quick_action_base['QuickActionDefinitionBase'];
|
|
12
|
-
const ACTION_ID = 'CTX_SETTINGS0';
|
|
13
|
-
class TableQuickActionDefinitionBase extends QuickActionDefinitionBase {
|
|
14
|
-
isApplicable = false;
|
|
15
|
-
isClearButtonEnabled = false;
|
|
16
|
-
children = [];
|
|
17
|
-
tableMap = {};
|
|
18
|
-
constructor(type, controlTypes, defaultTextKey, context, isSkipVariantManagementCheck) {
|
|
19
|
-
let enablementValidators = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
|
|
20
|
-
super(type, NESTED_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
|
|
21
|
-
this.type = type;
|
|
22
|
-
this.controlTypes = controlTypes;
|
|
23
|
-
this.defaultTextKey = defaultTextKey;
|
|
24
|
-
this.context = context;
|
|
25
|
-
this.isSkipVariantManagementCheck = isSkipVariantManagementCheck;
|
|
26
|
-
this.enablementValidators = enablementValidators;
|
|
27
|
-
}
|
|
28
|
-
async initialize() {
|
|
29
|
-
let index = 0;
|
|
30
|
-
for (const smartTable of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)) {
|
|
31
|
-
if (!this.isSkipVariantManagementCheck) {
|
|
32
|
-
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
|
|
33
|
-
if (!hasVariantManagement) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const actions = await this.context.actionService.get(smartTable.getId());
|
|
38
|
-
const changeColumnAction = actions.find(action => action.id === ACTION_ID);
|
|
39
|
-
if (changeColumnAction) {
|
|
40
|
-
this.children.push({
|
|
41
|
-
label: `'${ smartTable.getHeader() }' table`,
|
|
42
|
-
enabled: true,
|
|
43
|
-
children: []
|
|
44
|
-
});
|
|
45
|
-
this.tableMap[`${ this.children.length - 1 }`] = index;
|
|
46
|
-
index++;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (this.children.length > 0) {
|
|
50
|
-
this.isApplicable = true;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
getActionObject() {
|
|
54
|
-
return {
|
|
55
|
-
kind: NESTED_QUICK_ACTION_KIND,
|
|
56
|
-
id: this.id,
|
|
57
|
-
enabled: !this.isDisabled,
|
|
58
|
-
tooltip: this.tooltip,
|
|
59
|
-
title: this.context.resourceBundle.getText(this.textKey),
|
|
60
|
-
children: this.children
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
var __exports = { __esModule: true };
|
|
65
|
-
__exports.TableQuickActionDefinitionBase = TableQuickActionDefinitionBase;
|
|
66
|
-
return __exports;
|
|
67
|
-
});
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import Table from 'sap/ui/mdc/Table';
|
|
2
|
-
import FlexRuntimeInfoAPI from 'sap/ui/fl/apply/api/FlexRuntimeInfoAPI';
|
|
3
|
-
|
|
4
|
-
import type { NestedQuickActionChild, NestedQuickAction } from '@sap-ux-private/control-property-editor-common';
|
|
5
|
-
import { NESTED_QUICK_ACTION_KIND } from '@sap-ux-private/control-property-editor-common';
|
|
6
|
-
|
|
7
|
-
import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
|
|
8
|
-
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
9
|
-
import { EnablementValidator } from '../enablement-validator';
|
|
10
|
-
import { QuickActionDefinitionBase } from '../quick-action-base';
|
|
11
|
-
|
|
12
|
-
const ACTION_ID = 'CTX_SETTINGS0';
|
|
13
|
-
|
|
14
|
-
export abstract class TableQuickActionDefinitionBase extends QuickActionDefinitionBase<
|
|
15
|
-
typeof NESTED_QUICK_ACTION_KIND
|
|
16
|
-
> {
|
|
17
|
-
isApplicable = false;
|
|
18
|
-
|
|
19
|
-
isClearButtonEnabled = false;
|
|
20
|
-
children: NestedQuickActionChild[] = [];
|
|
21
|
-
tableMap: Record<string, number> = {};
|
|
22
|
-
constructor(
|
|
23
|
-
public readonly type: string,
|
|
24
|
-
protected readonly controlTypes: string[],
|
|
25
|
-
protected readonly defaultTextKey: string,
|
|
26
|
-
protected readonly context: QuickActionContext,
|
|
27
|
-
protected readonly isSkipVariantManagementCheck?: boolean,
|
|
28
|
-
protected readonly enablementValidators: EnablementValidator[] = []
|
|
29
|
-
) {
|
|
30
|
-
super(type, NESTED_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async initialize(): Promise<void> {
|
|
34
|
-
let index = 0;
|
|
35
|
-
for (const smartTable of getRelevantControlFromActivePage(
|
|
36
|
-
this.context.controlIndex,
|
|
37
|
-
this.context.view,
|
|
38
|
-
this.controlTypes
|
|
39
|
-
)) {
|
|
40
|
-
if (!this.isSkipVariantManagementCheck) {
|
|
41
|
-
const hasVariantManagement = FlexRuntimeInfoAPI.hasVariantManagement({ element: smartTable });
|
|
42
|
-
if (!hasVariantManagement) {
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const actions = await this.context.actionService.get(smartTable.getId());
|
|
48
|
-
const changeColumnAction = actions.find((action) => action.id === ACTION_ID);
|
|
49
|
-
if (changeColumnAction) {
|
|
50
|
-
this.children.push({
|
|
51
|
-
label: `'${(smartTable as Table).getHeader()}' table`,
|
|
52
|
-
enabled: true,
|
|
53
|
-
children: []
|
|
54
|
-
});
|
|
55
|
-
this.tableMap[`${this.children.length - 1}`] = index;
|
|
56
|
-
index++;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (this.children.length > 0) {
|
|
61
|
-
this.isApplicable = true;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
getActionObject(): NestedQuickAction {
|
|
66
|
-
return {
|
|
67
|
-
kind: NESTED_QUICK_ACTION_KIND,
|
|
68
|
-
id: this.id,
|
|
69
|
-
enabled: !this.isDisabled,
|
|
70
|
-
tooltip: this.tooltip,
|
|
71
|
-
title: this.context.resourceBundle.getText(this.textKey),
|
|
72
|
-
children: this.children
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|