@sap-ux/preview-middleware 0.16.131 → 0.16.133
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/change-table-columns.js +3 -1
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +3 -1
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +3 -1
- 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 +57 -23
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +73 -25
- 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 +4 -1
- package/dist/client/utils/fe-v4.js +30 -1
- package/dist/client/utils/fe-v4.ts +45 -1
- package/package.json +4 -4
|
@@ -13,7 +13,9 @@ sap.ui.define(["../../../utils/core", "../table-quick-action-base"], function (_
|
|
|
13
13
|
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
|
|
14
14
|
class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
|
|
15
15
|
constructor(context) {
|
|
16
|
-
super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context,
|
|
16
|
+
super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
|
|
17
|
+
includeServiceAction: true
|
|
18
|
+
});
|
|
17
19
|
}
|
|
18
20
|
async execute(path) {
|
|
19
21
|
const {
|
|
@@ -18,7 +18,9 @@ export class ChangeTableColumnsQuickAction
|
|
|
18
18
|
implements NestedQuickActionDefinition
|
|
19
19
|
{
|
|
20
20
|
constructor(context: QuickActionContext) {
|
|
21
|
-
super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context,
|
|
21
|
+
super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
|
|
22
|
+
includeServiceAction: true
|
|
23
|
+
});
|
|
22
24
|
}
|
|
23
25
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
24
26
|
const { table, iconTabBarFilterKey, changeColumnActionId, sectionInfo } = this.tableMap[path];
|
|
@@ -44,7 +44,9 @@ sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-d
|
|
|
44
44
|
}
|
|
45
45
|
class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
|
|
46
46
|
constructor(context) {
|
|
47
|
-
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context
|
|
47
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
|
|
48
|
+
areTableRowsRequired: true
|
|
49
|
+
});
|
|
48
50
|
}
|
|
49
51
|
async execute(path) {
|
|
50
52
|
const {
|
|
@@ -64,7 +64,9 @@ export class AddTableCustomColumnQuickAction
|
|
|
64
64
|
implements NestedQuickActionDefinition
|
|
65
65
|
{
|
|
66
66
|
constructor(context: QuickActionContext) {
|
|
67
|
-
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context
|
|
67
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
|
|
68
|
+
areTableRowsRequired: true
|
|
69
|
+
});
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["
|
|
3
|
+
sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "./utils"], function (_____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___utils) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const FeatureService = _____cpe_feature_service["FeatureService"];
|
|
7
6
|
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
8
7
|
const getControlById = _____utils_core["getControlById"];
|
|
8
|
+
const isA = _____utils_core["isA"];
|
|
9
9
|
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
10
|
+
const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
|
|
11
|
+
const prepareManifestChange = ___utils["prepareManifestChange"];
|
|
13
12
|
const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
|
|
14
13
|
const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
|
|
15
|
-
|
|
14
|
+
const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
|
|
16
15
|
/**
|
|
17
16
|
* Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
|
|
18
17
|
*/
|
|
@@ -23,29 +22,10 @@ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/feature-servic
|
|
|
23
22
|
forceRefreshAfterExecution = true;
|
|
24
23
|
isUseDateRangeTypeEnabled = false;
|
|
25
24
|
async initialize() {
|
|
26
|
-
const
|
|
27
|
-
const isUI5VersionNotSupported = isLowerThanMinimalUi5Version(version, {
|
|
28
|
-
major: 1,
|
|
29
|
-
minor: 128
|
|
30
|
-
}) && !(isVersionEqualOrHasNewerPatch(version, {
|
|
31
|
-
major: 1,
|
|
32
|
-
minor: 96,
|
|
33
|
-
patch: 37
|
|
34
|
-
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
35
|
-
major: 1,
|
|
36
|
-
minor: 108,
|
|
37
|
-
patch: 38
|
|
38
|
-
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
39
|
-
major: 1,
|
|
40
|
-
minor: 120,
|
|
41
|
-
patch: 23
|
|
42
|
-
}));
|
|
25
|
+
const isUI5VersionNotSupported = await areManifestChangesSupported();
|
|
43
26
|
if (isUI5VersionNotSupported) {
|
|
44
27
|
return;
|
|
45
28
|
}
|
|
46
|
-
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
29
|
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
50
30
|
for (const control of controls) {
|
|
51
31
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
@@ -60,29 +40,12 @@ sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../cpe/feature-servic
|
|
|
60
40
|
return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR';
|
|
61
41
|
}
|
|
62
42
|
async execute() {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
changeType: 'appdescr_ui_generic_app_changePageConfiguration',
|
|
68
|
-
reference: flexSettings.projectId,
|
|
69
|
-
parameters: {
|
|
70
|
-
parentPage: {
|
|
71
|
-
component: 'sap.suite.ui.generic.template.ListReport',
|
|
72
|
-
entitySet: this.control.getEntitySet()
|
|
73
|
-
},
|
|
74
|
-
entityPropertyChange: {
|
|
75
|
-
propertyPath: 'component/settings/filterSettings/dateSettings',
|
|
76
|
-
operation: 'UPSERT',
|
|
77
|
-
propertyValue: {
|
|
78
|
-
useDateRange: !this.isUseDateRangeTypeEnabled
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const command = await CommandFactory.getCommandFor(this.control, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
43
|
+
const entitySet = isA(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
|
|
44
|
+
const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
|
|
45
|
+
useDateRange: !this.isUseDateRangeTypeEnabled
|
|
46
|
+
});
|
|
84
47
|
this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
|
|
85
|
-
return
|
|
48
|
+
return command;
|
|
86
49
|
}
|
|
87
50
|
}
|
|
88
51
|
var __exports = {
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
-
import CommandFactory from 'sap/ui/rta/command/CommandFactory';
|
|
3
2
|
import type FilterBar from 'sap/ui/comp/filterbar/FilterBar';
|
|
4
|
-
import SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar';
|
|
5
|
-
|
|
6
|
-
import { FeatureService } from '../../../cpe/feature-service';
|
|
7
3
|
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
8
4
|
import { pageHasControlId } from '../../../cpe/quick-actions/utils';
|
|
9
|
-
import { getControlById } from '../../../utils/core';
|
|
5
|
+
import { getControlById, isA } from '../../../utils/core';
|
|
10
6
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
11
|
-
import {
|
|
7
|
+
import { areManifestChangesSupported, prepareManifestChange } from './utils';
|
|
8
|
+
import SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar';
|
|
12
9
|
|
|
13
10
|
export const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar';
|
|
14
11
|
const CONTROL_TYPE = 'sap.ui.comp.smartfilterbar.SmartFilterBar';
|
|
15
|
-
|
|
12
|
+
const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
|
|
16
13
|
/**
|
|
17
14
|
* Quick Action for toggling the visibility of "semantic date range" for filterbar fields.
|
|
18
15
|
*/
|
|
@@ -27,21 +24,10 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
27
24
|
private isUseDateRangeTypeEnabled = false;
|
|
28
25
|
|
|
29
26
|
async initialize(): Promise<void> {
|
|
30
|
-
const
|
|
31
|
-
const isUI5VersionNotSupported =
|
|
32
|
-
isLowerThanMinimalUi5Version(version, { major: 1, minor: 128 }) &&
|
|
33
|
-
!(
|
|
34
|
-
isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 96, patch: 37 }) ||
|
|
35
|
-
isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 108, patch: 38 }) ||
|
|
36
|
-
isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 120, patch: 23 })
|
|
37
|
-
);
|
|
38
|
-
|
|
27
|
+
const isUI5VersionNotSupported = await areManifestChangesSupported();
|
|
39
28
|
if (isUI5VersionNotSupported) {
|
|
40
29
|
return;
|
|
41
30
|
}
|
|
42
|
-
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
31
|
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
46
32
|
for (const control of controls) {
|
|
47
33
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
@@ -60,34 +46,20 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
60
46
|
}
|
|
61
47
|
|
|
62
48
|
async execute(): Promise<FlexCommand[]> {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
reference: flexSettings.projectId,
|
|
68
|
-
parameters: {
|
|
69
|
-
parentPage: {
|
|
70
|
-
component: 'sap.suite.ui.generic.template.ListReport',
|
|
71
|
-
entitySet: (this.control as SmartFilterBar).getEntitySet()
|
|
72
|
-
},
|
|
73
|
-
entityPropertyChange: {
|
|
74
|
-
propertyPath: 'component/settings/filterSettings/dateSettings',
|
|
75
|
-
operation: 'UPSERT',
|
|
76
|
-
propertyValue: {
|
|
77
|
-
useDateRange: !this.isUseDateRangeTypeEnabled
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const command = await CommandFactory.getCommandFor<FlexCommand>(
|
|
49
|
+
const entitySet = isA<SmartFilterBar>(CONTROL_TYPE, this.control) ? this.control.getEntitySet() : undefined;
|
|
50
|
+
const command = await prepareManifestChange(
|
|
51
|
+
this.context,
|
|
52
|
+
'component/settings/filterSettings/dateSettings',
|
|
83
53
|
this.control!,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
54
|
+
COMPONENT,
|
|
55
|
+
entitySet,
|
|
56
|
+
{
|
|
57
|
+
useDateRange: !this.isUseDateRangeTypeEnabled
|
|
58
|
+
}
|
|
88
59
|
);
|
|
89
60
|
|
|
90
61
|
this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
|
|
91
|
-
|
|
62
|
+
|
|
63
|
+
return command;
|
|
92
64
|
}
|
|
93
65
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../cpe/quick-actions/utils", "../table-quick-action-base", "./utils", "../simple-quick-action-base", "../../../utils/core"], function (_____cpe_quick_actions_utils, ___table_quick_action_base, ___utils, ___simple_quick_action_base, _____utils_core) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
7
|
+
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
8
|
+
const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
|
|
9
|
+
const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
|
|
10
|
+
const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
|
|
11
|
+
const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
|
|
12
|
+
const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
|
|
13
|
+
const prepareManifestChange = ___utils["prepareManifestChange"];
|
|
14
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
15
|
+
const isA = _____utils_core["isA"];
|
|
16
|
+
const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
|
|
17
|
+
const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
|
|
18
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Quick Action for enabling table filtering using table personalization settings.
|
|
22
|
+
*/
|
|
23
|
+
class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase {
|
|
24
|
+
constructor(context) {
|
|
25
|
+
super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
26
|
+
}
|
|
27
|
+
forceRefreshAfterExecution = true;
|
|
28
|
+
lsTableMap = {};
|
|
29
|
+
get tooltip() {
|
|
30
|
+
return this.isDisabled ? this.context.resourceBundle.getText('THE_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
|
|
31
|
+
}
|
|
32
|
+
async initialize() {
|
|
33
|
+
const isUI5VersionNotSupported = await areManifestChangesSupported();
|
|
34
|
+
if (isUI5VersionNotSupported) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
for (const table of getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)) {
|
|
38
|
+
if (table) {
|
|
39
|
+
const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
|
|
40
|
+
const isActionApplicable = pageHasControlId(this.context.view, table.getId());
|
|
41
|
+
if (isActionApplicable) {
|
|
42
|
+
this.isDisabled = isFilterEnabled;
|
|
43
|
+
this.control = table;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
}
|
|
50
|
+
async execute() {
|
|
51
|
+
if (!this.control) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const entitySet = isA(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
|
|
55
|
+
const command = await prepareManifestChange(this.context, 'component/settings', this.control, COMPONENT, entitySet, {
|
|
56
|
+
enableTableFilterInPageVariant: !this.isDisabled
|
|
57
|
+
});
|
|
58
|
+
this.isDisabled = !this.isDisabled;
|
|
59
|
+
return command;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
var __exports = {
|
|
63
|
+
__esModule: true
|
|
64
|
+
};
|
|
65
|
+
__exports.ENABLE_TABLE_FILTERING = ENABLE_TABLE_FILTERING;
|
|
66
|
+
__exports.EnableTableFilteringQuickAction = EnableTableFilteringQuickAction;
|
|
67
|
+
return __exports;
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=lr-enable-table-filtering.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
+
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
3
|
+
import { getRelevantControlFromActivePage, pageHasControlId } from '../../../cpe/quick-actions/utils';
|
|
4
|
+
import { GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../table-quick-action-base';
|
|
5
|
+
import { areManifestChangesSupported, prepareManifestChange } from './utils';
|
|
6
|
+
|
|
7
|
+
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
8
|
+
import { isA } from '../../../utils/core';
|
|
9
|
+
import SmartTable from 'sap/ui/comp/smarttable/SmartTable';
|
|
10
|
+
const COMPONENT = 'sap.suite.ui.generic.template.ListReport';
|
|
11
|
+
|
|
12
|
+
export const ENABLE_TABLE_FILTERING = 'enable-table-filtering';
|
|
13
|
+
|
|
14
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Quick Action for enabling table filtering using table personalization settings.
|
|
18
|
+
*/
|
|
19
|
+
export class EnableTableFilteringQuickAction
|
|
20
|
+
extends SimpleQuickActionDefinitionBase
|
|
21
|
+
implements SimpleQuickActionDefinition
|
|
22
|
+
{
|
|
23
|
+
constructor(context: QuickActionContext) {
|
|
24
|
+
super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context);
|
|
25
|
+
}
|
|
26
|
+
isActive: boolean;
|
|
27
|
+
readonly forceRefreshAfterExecution = true;
|
|
28
|
+
lsTableMap: Record<string, number> = {};
|
|
29
|
+
public get tooltip(): string | undefined {
|
|
30
|
+
return this.isDisabled ? this.context.resourceBundle.getText('THE_CHANGE_HAS_ALREADY_BEEN_MADE') : undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async initialize(): Promise<void> {
|
|
34
|
+
const isUI5VersionNotSupported = await areManifestChangesSupported();
|
|
35
|
+
if (isUI5VersionNotSupported) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
for (const table of getRelevantControlFromActivePage(
|
|
40
|
+
this.context.controlIndex,
|
|
41
|
+
this.context.view,
|
|
42
|
+
CONTROL_TYPES
|
|
43
|
+
)) {
|
|
44
|
+
if (table) {
|
|
45
|
+
const isFilterEnabled = table.data('p13nDialogSettings').filter.visible;
|
|
46
|
+
const isActionApplicable = pageHasControlId(this.context.view, table.getId());
|
|
47
|
+
if (isActionApplicable) {
|
|
48
|
+
this.isDisabled = isFilterEnabled;
|
|
49
|
+
this.control = table;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return Promise.resolve();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async execute(): Promise<FlexCommand[]> {
|
|
59
|
+
if (!this.control) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const entitySet = isA<SmartTable>(SMART_TABLE_TYPE, this.control) ? this.control.getEntitySet() : undefined;
|
|
64
|
+
const command = await prepareManifestChange(
|
|
65
|
+
this.context,
|
|
66
|
+
'component/settings',
|
|
67
|
+
this.control,
|
|
68
|
+
COMPONENT,
|
|
69
|
+
entitySet,
|
|
70
|
+
{
|
|
71
|
+
enableTableFilterInPageVariant: !this.isDisabled
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
this.isDisabled = !this.isDisabled;
|
|
76
|
+
|
|
77
|
+
return command;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "./create-table-custom-column", "../common/create-page-action", "./lr-enable-semantic-date-range-filter-bar"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___create_table_custom_column, ___common_create_page_action, ___lr_enable_semantic_date_range_filter_bar) {
|
|
3
|
+
sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "./create-table-custom-column", "../common/create-page-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___create_table_custom_column, ___common_create_page_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(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
|
|
|
12
12
|
const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
|
|
13
13
|
const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
|
|
14
14
|
const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
|
|
15
|
+
const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
|
|
15
16
|
const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
|
|
16
17
|
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
17
18
|
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
@@ -36,7 +37,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
|
|
|
36
37
|
if (name === 'listReport') {
|
|
37
38
|
definitionGroups.push({
|
|
38
39
|
title: 'LIST REPORT',
|
|
39
|
-
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
|
|
40
|
+
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction],
|
|
40
41
|
view,
|
|
41
42
|
key: name + index
|
|
42
43
|
});
|
|
@@ -17,6 +17,7 @@ import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
|
|
|
17
17
|
import { AddTableActionQuickAction } from '../fe-v2/create-table-action';
|
|
18
18
|
import { AddTableCustomColumnQuickAction } from './create-table-custom-column';
|
|
19
19
|
import { AddPageActionQuickAction } from '../common/create-page-action';
|
|
20
|
+
import { EnableTableFilteringQuickAction } from './lr-enable-table-filtering';
|
|
20
21
|
import { ToggleSemanticDateRangeFilterBar } from './lr-enable-semantic-date-range-filter-bar';
|
|
21
22
|
type PageName = 'listReport' | 'objectPage' | 'analyticalListPage';
|
|
22
23
|
|
|
@@ -48,7 +49,8 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
48
49
|
ToggleSemanticDateRangeFilterBar,
|
|
49
50
|
ChangeTableColumnsQuickAction,
|
|
50
51
|
AddTableActionQuickAction,
|
|
51
|
-
AddTableCustomColumnQuickAction
|
|
52
|
+
AddTableCustomColumnQuickAction,
|
|
53
|
+
EnableTableFilteringQuickAction
|
|
52
54
|
],
|
|
53
55
|
view,
|
|
54
56
|
key: name + index
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/rta/command/CommandFactory", "../../../utils/version"], function (CommandFactory, _____utils_version) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
7
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
8
|
+
const isVersionEqualOrHasNewerPatch = _____utils_version["isVersionEqualOrHasNewerPatch"];
|
|
9
|
+
/**
|
|
10
|
+
* Prepares the change for the manifest setting.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The context object containing flexSettings.
|
|
13
|
+
* @param propertyPath - The path of the property in the manifest.
|
|
14
|
+
* @param control - The UI5 element representing the control.
|
|
15
|
+
* @param component - component name e.g list report or object page.
|
|
16
|
+
* @param entitySet - Entity Set name.
|
|
17
|
+
* @param propertyValue - The value to be set for the property.
|
|
18
|
+
*
|
|
19
|
+
* @returns A Promise resolving to an array of FlexCommand objects.
|
|
20
|
+
*/
|
|
21
|
+
async function prepareManifestChange(context, propertyPath, control, component, entitySet, propertyValue) {
|
|
22
|
+
const {
|
|
23
|
+
flexSettings
|
|
24
|
+
} = context;
|
|
25
|
+
const modifiedValue = {
|
|
26
|
+
changeType: 'appdescr_ui_generic_app_changePageConfiguration',
|
|
27
|
+
reference: flexSettings.projectId,
|
|
28
|
+
parameters: {
|
|
29
|
+
parentPage: {
|
|
30
|
+
component,
|
|
31
|
+
entitySet
|
|
32
|
+
},
|
|
33
|
+
entityPropertyChange: {
|
|
34
|
+
propertyPath: propertyPath,
|
|
35
|
+
operation: 'UPSERT',
|
|
36
|
+
propertyValue: propertyValue
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const command = await CommandFactory.getCommandFor(control, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
41
|
+
return [command];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Checks if the current UI5 version supports manifest changes in v2 applications.
|
|
46
|
+
*
|
|
47
|
+
* Returns `true` if the UI5 version is supported.
|
|
48
|
+
* Otherwise, returns `false`.
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
async function areManifestChangesSupported() {
|
|
52
|
+
const version = await getUi5Version();
|
|
53
|
+
return isLowerThanMinimalUi5Version(version, {
|
|
54
|
+
major: 1,
|
|
55
|
+
minor: 128
|
|
56
|
+
}) && !(isVersionEqualOrHasNewerPatch(version, {
|
|
57
|
+
major: 1,
|
|
58
|
+
minor: 96,
|
|
59
|
+
patch: 37
|
|
60
|
+
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
61
|
+
major: 1,
|
|
62
|
+
minor: 108,
|
|
63
|
+
patch: 38
|
|
64
|
+
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
65
|
+
major: 1,
|
|
66
|
+
minor: 120,
|
|
67
|
+
patch: 23
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
var __exports = {
|
|
71
|
+
__esModule: true
|
|
72
|
+
};
|
|
73
|
+
__exports.prepareManifestChange = prepareManifestChange;
|
|
74
|
+
__exports.areManifestChangesSupported = areManifestChangesSupported;
|
|
75
|
+
return __exports;
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import UI5Element from 'sap/ui/core/Element';
|
|
2
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
|
+
import CommandFactory from 'sap/ui/rta/command/CommandFactory';
|
|
4
|
+
|
|
5
|
+
import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
|
|
6
|
+
import { getUi5Version, isLowerThanMinimalUi5Version, isVersionEqualOrHasNewerPatch } from '../../../utils/version';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Prepares the change for the manifest setting.
|
|
10
|
+
*
|
|
11
|
+
* @param context - The context object containing flexSettings.
|
|
12
|
+
* @param propertyPath - The path of the property in the manifest.
|
|
13
|
+
* @param control - The UI5 element representing the control.
|
|
14
|
+
* @param component - component name e.g list report or object page.
|
|
15
|
+
* @param entitySet - Entity Set name.
|
|
16
|
+
* @param propertyValue - The value to be set for the property.
|
|
17
|
+
*
|
|
18
|
+
* @returns A Promise resolving to an array of FlexCommand objects.
|
|
19
|
+
*/
|
|
20
|
+
export async function prepareManifestChange(
|
|
21
|
+
context: QuickActionContext,
|
|
22
|
+
propertyPath: string,
|
|
23
|
+
control: UI5Element,
|
|
24
|
+
component: string,
|
|
25
|
+
entitySet: string | undefined,
|
|
26
|
+
propertyValue: object
|
|
27
|
+
): Promise<FlexCommand[]> {
|
|
28
|
+
const { flexSettings } = context;
|
|
29
|
+
|
|
30
|
+
const modifiedValue = {
|
|
31
|
+
changeType: 'appdescr_ui_generic_app_changePageConfiguration',
|
|
32
|
+
reference: flexSettings.projectId,
|
|
33
|
+
parameters: {
|
|
34
|
+
parentPage: {
|
|
35
|
+
component,
|
|
36
|
+
entitySet
|
|
37
|
+
},
|
|
38
|
+
entityPropertyChange: {
|
|
39
|
+
propertyPath: propertyPath,
|
|
40
|
+
operation: 'UPSERT',
|
|
41
|
+
propertyValue: propertyValue
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const command = await CommandFactory.getCommandFor<FlexCommand>(
|
|
46
|
+
control,
|
|
47
|
+
'appDescriptor',
|
|
48
|
+
modifiedValue,
|
|
49
|
+
null,
|
|
50
|
+
flexSettings
|
|
51
|
+
);
|
|
52
|
+
return [command];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Checks if the current UI5 version supports manifest changes in v2 applications.
|
|
57
|
+
*
|
|
58
|
+
* Returns `true` if the UI5 version is supported.
|
|
59
|
+
* Otherwise, returns `false`.
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
62
|
+
export async function areManifestChangesSupported(): Promise<boolean> {
|
|
63
|
+
const version = await getUi5Version();
|
|
64
|
+
return (
|
|
65
|
+
isLowerThanMinimalUi5Version(version, { major: 1, minor: 128 }) &&
|
|
66
|
+
!(
|
|
67
|
+
isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 96, patch: 37 }) ||
|
|
68
|
+
isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 108, patch: 38 }) ||
|
|
69
|
+
isVersionEqualOrHasNewerPatch(version, { major: 1, minor: 120, patch: 23 })
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["../../../cpe/
|
|
3
|
+
sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "./utils", "../simple-quick-action-base"], function (_____cpe_quick_actions_utils, _____utils_core, ___utils, ___simple_quick_action_base) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const FeatureService = _____cpe_feature_service["FeatureService"];
|
|
7
6
|
const pageHasControlId = _____cpe_quick_actions_utils["pageHasControlId"];
|
|
8
7
|
const getControlById = _____utils_core["getControlById"];
|
|
9
8
|
const executeToggleAction = ___utils["executeToggleAction"];
|
|
@@ -26,9 +25,6 @@ sap.ui.define(["../../../cpe/feature-service", "../../../cpe/quick-actions/utils
|
|
|
26
25
|
forceRefreshAfterExecution = true;
|
|
27
26
|
isUseDateRangeTypeEnabled = false;
|
|
28
27
|
initialize() {
|
|
29
|
-
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
28
|
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
33
29
|
for (const control of controls) {
|
|
34
30
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
2
|
import FilterBar from 'sap/ui/mdc/FilterBar';
|
|
3
3
|
|
|
4
|
-
import { FeatureService } from '../../../cpe/feature-service';
|
|
5
4
|
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
6
5
|
import { pageHasControlId } from '../../../cpe/quick-actions/utils';
|
|
7
6
|
import { getControlById } from '../../../utils/core';
|
|
@@ -30,9 +29,6 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
30
29
|
private isUseDateRangeTypeEnabled = false;
|
|
31
30
|
|
|
32
31
|
initialize(): void {
|
|
33
|
-
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
32
|
const controls = this.context.controlIndex[CONTROL_TYPE] ?? [];
|
|
37
33
|
for (const control of controls) {
|
|
38
34
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|