@sap-ux/preview-middleware 0.16.170 → 0.16.172
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/api-handler.js +153 -153
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
- package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
- package/dist/client/adp/dialog-factory.js +122 -122
- package/dist/client/adp/init-dialogs.js +100 -100
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
- package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
- package/dist/client/adp/quick-actions/common/utils.js +18 -18
- package/dist/client/adp/quick-actions/control-types.js +21 -21
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
- package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +64 -60
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +15 -5
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +58 -57
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +6 -2
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
- package/dist/client/adp/quick-actions/fe-v2/registry.js +73 -73
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +7 -1
- package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -49
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -47
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
- package/dist/client/adp/quick-actions/fe-v4/registry.js +57 -57
- package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +34 -34
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +222 -222
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/registry.js +143 -143
- package/dist/client/cpe/quick-actions/utils.js +92 -92
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +33 -33
- package/dist/client/cpe/utils.js +138 -138
- package/dist/client/flp/WorkspaceConnector.js +86 -86
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +83 -83
- package/dist/client/flp/initConnectors.js +30 -30
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +68 -68
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v4.js +118 -118
- package/dist/client/utils/version.js +102 -102
- package/package.json +5 -5
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "../../../utils/version", "../../../utils/core", "../common/utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, _____utils_version, _____utils_core, ___common_utils, ___create_table_custom_column) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
7
|
-
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
8
|
-
const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
|
|
9
|
-
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
10
|
-
const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
|
|
11
|
-
const prepareManifestChange = ___utils["prepareManifestChange"];
|
|
12
|
-
const getUi5Version = _____utils_version["getUi5Version"];
|
|
13
|
-
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
14
|
-
const isA = _____utils_core["isA"];
|
|
15
|
-
const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
|
|
16
|
-
const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
|
|
17
|
-
const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
|
|
18
|
-
const CONTROL_TYPES = [SMART_TABLE_TYPE];
|
|
19
|
-
const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
|
|
20
|
-
const CREATION_ROWS_MODE = 'creationRows';
|
|
21
|
-
const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
|
|
22
|
-
class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
|
|
23
|
-
forceRefreshAfterExecution = true;
|
|
24
|
-
constructor(context) {
|
|
25
|
-
super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
|
|
26
|
-
}
|
|
27
|
-
async initialize() {
|
|
28
|
-
const version = await getUi5Version();
|
|
29
|
-
if (!(await areManifestChangesSupported(this.context.manifest))) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (isLowerThanMinimalUi5Version(version, {
|
|
33
|
-
major: 1,
|
|
34
|
-
minor: 120,
|
|
35
|
-
patch: 23
|
|
36
|
-
})) {
|
|
37
|
-
this.isApplicable = false;
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const {
|
|
41
|
-
alreadyEnabledTooltip,
|
|
42
|
-
unsupportedCreationRowsTooltip
|
|
43
|
-
} = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
|
|
44
|
-
const processChild = (child, mapKey) => {
|
|
45
|
-
const table = this.tableMap[mapKey]?.table;
|
|
46
|
-
if (table) {
|
|
47
|
-
const innerTable = this.getInternalTable(table);
|
|
48
|
-
if (innerTable) {
|
|
49
|
-
if (UNSUPPORTED_TABLES.some(t => isA(t, innerTable))) {
|
|
50
|
-
child.enabled = false;
|
|
51
|
-
child.tooltip = unsupportedCreationRowsTooltip;
|
|
52
|
-
} else if (table.data('creationMode') === CREATION_ROWS_MODE) {
|
|
53
|
-
child.enabled = false;
|
|
54
|
-
child.tooltip = alreadyEnabledTooltip;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
|
|
59
|
-
};
|
|
60
|
-
await super.initialize();
|
|
61
|
-
|
|
62
|
-
// disable nested actions based on conditions
|
|
63
|
-
this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
|
|
64
|
-
}
|
|
65
|
-
async execute(path) {
|
|
66
|
-
const {
|
|
67
|
-
table,
|
|
68
|
-
sectionInfo,
|
|
69
|
-
iconTabBarFilterKey
|
|
70
|
-
} = this.tableMap[path];
|
|
71
|
-
if (!table) {
|
|
72
|
-
throw Error('Internal error. Table element not found');
|
|
73
|
-
}
|
|
74
|
-
const sectionId = table.data('sectionId');
|
|
75
|
-
if (!sectionId) {
|
|
76
|
-
throw Error('Internal error. Table sectionId property not found');
|
|
77
|
-
}
|
|
78
|
-
const entitySet = this.context.view.getParent()?.getProperty('entitySet');
|
|
79
|
-
if (!entitySet) {
|
|
80
|
-
throw Error('Internal error. Object Page entity set not found');
|
|
81
|
-
}
|
|
82
|
-
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
83
|
-
this.selectOverlay(table);
|
|
84
|
-
const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/createMode`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, CREATION_ROWS_MODE);
|
|
85
|
-
return commands ?? [];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
var __exports = {
|
|
89
|
-
__esModule: true
|
|
90
|
-
};
|
|
91
|
-
__exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
|
|
92
|
-
__exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
|
|
93
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../table-quick-action-base", "../control-types", "./utils", "../../../utils/version", "../../../utils/core", "../common/utils", "./create-table-custom-column"], function (___table_quick_action_base, ___control_types, ___utils, _____utils_version, _____utils_core, ___common_utils, ___create_table_custom_column) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
7
|
+
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
8
|
+
const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
|
|
9
|
+
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
10
|
+
const areManifestChangesSupported = ___utils["areManifestChangesSupported"];
|
|
11
|
+
const prepareManifestChange = ___utils["prepareManifestChange"];
|
|
12
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
13
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
14
|
+
const isA = _____utils_core["isA"];
|
|
15
|
+
const getTooltipsForTableEmptyRowModeAction = ___common_utils["getTooltipsForTableEmptyRowModeAction"];
|
|
16
|
+
const preprocessActionExecution = ___create_table_custom_column["preprocessActionExecution"];
|
|
17
|
+
const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode';
|
|
18
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE];
|
|
19
|
+
const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE];
|
|
20
|
+
const CREATION_ROWS_MODE = 'creationRows';
|
|
21
|
+
const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
|
|
22
|
+
class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase {
|
|
23
|
+
forceRefreshAfterExecution = true;
|
|
24
|
+
constructor(context) {
|
|
25
|
+
super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context);
|
|
26
|
+
}
|
|
27
|
+
async initialize() {
|
|
28
|
+
const version = await getUi5Version();
|
|
29
|
+
if (!(await areManifestChangesSupported(this.context.manifest))) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
33
|
+
major: 1,
|
|
34
|
+
minor: 120,
|
|
35
|
+
patch: 23
|
|
36
|
+
})) {
|
|
37
|
+
this.isApplicable = false;
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const {
|
|
41
|
+
alreadyEnabledTooltip,
|
|
42
|
+
unsupportedCreationRowsTooltip
|
|
43
|
+
} = getTooltipsForTableEmptyRowModeAction(this.context.resourceBundle);
|
|
44
|
+
const processChild = (child, mapKey) => {
|
|
45
|
+
const table = this.tableMap[mapKey]?.table;
|
|
46
|
+
if (table) {
|
|
47
|
+
const innerTable = this.getInternalTable(table);
|
|
48
|
+
if (innerTable) {
|
|
49
|
+
if (UNSUPPORTED_TABLES.some(t => isA(t, innerTable))) {
|
|
50
|
+
child.enabled = false;
|
|
51
|
+
child.tooltip = unsupportedCreationRowsTooltip;
|
|
52
|
+
} else if (table.data('creationMode') === CREATION_ROWS_MODE) {
|
|
53
|
+
child.enabled = false;
|
|
54
|
+
child.tooltip = alreadyEnabledTooltip;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
child.children.forEach((nestedChild, idx) => processChild(nestedChild, `${mapKey}/${idx.toFixed(0)}`));
|
|
59
|
+
};
|
|
60
|
+
await super.initialize();
|
|
61
|
+
|
|
62
|
+
// disable nested actions based on conditions
|
|
63
|
+
this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`));
|
|
64
|
+
}
|
|
65
|
+
async execute(path) {
|
|
66
|
+
const {
|
|
67
|
+
table,
|
|
68
|
+
sectionInfo,
|
|
69
|
+
iconTabBarFilterKey
|
|
70
|
+
} = this.tableMap[path];
|
|
71
|
+
if (!table) {
|
|
72
|
+
throw Error('Internal error. Table element not found');
|
|
73
|
+
}
|
|
74
|
+
const sectionId = table.data('sectionId');
|
|
75
|
+
if (!sectionId) {
|
|
76
|
+
throw Error('Internal error. Table sectionId property not found');
|
|
77
|
+
}
|
|
78
|
+
const entitySet = this.context.view.getParent()?.getProperty('entitySet');
|
|
79
|
+
if (!entitySet) {
|
|
80
|
+
throw Error('Internal error. Object Page entity set not found');
|
|
81
|
+
}
|
|
82
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
83
|
+
this.selectOverlay(table);
|
|
84
|
+
const commands = await prepareManifestChange(this.context, `component/settings/sections/${sectionId}/createMode`, table, OBJECT_PAGE_COMPONENT_NAME, entitySet, CREATION_ROWS_MODE);
|
|
85
|
+
return commands ?? [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
var __exports = {
|
|
89
|
+
__esModule: true
|
|
90
|
+
};
|
|
91
|
+
__exports.ENABLE_TABLE_EMPTY_ROW_MODE = ENABLE_TABLE_EMPTY_ROW_MODE;
|
|
92
|
+
__exports.EnableTableEmptyRowModeQuickAction = EnableTableEmptyRowModeQuickAction;
|
|
93
|
+
return __exports;
|
|
94
94
|
});
|
|
95
95
|
//# sourceMappingURL=op-enable-empty-row-mode.js.map
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
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-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file"], 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, ___op_enable_empty_row_mode, ___common_add_new_annotation_file) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
7
|
-
const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
|
|
8
|
-
const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
|
|
9
|
-
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
|
-
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
|
-
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
-
const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
|
|
13
|
-
const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
|
|
14
|
-
const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
|
|
15
|
-
const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
|
|
16
|
-
const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
|
|
17
|
-
const EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
|
|
18
|
-
const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
|
|
19
|
-
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
20
|
-
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
21
|
-
const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
|
|
22
|
-
/**
|
|
23
|
-
* Quick Action provider for SAP Fiori Elements V2 applications.
|
|
24
|
-
*/
|
|
25
|
-
class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
26
|
-
PAGE_NAME_MAP = {
|
|
27
|
-
[LIST_REPORT_TYPE]: 'listReport',
|
|
28
|
-
[OBJECT_PAGE_TYPE]: 'objectPage',
|
|
29
|
-
[ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
|
|
30
|
-
};
|
|
31
|
-
getDefinitions(context) {
|
|
32
|
-
const activePages = this.getActivePageContent(context.controlIndex);
|
|
33
|
-
const definitionGroups = [];
|
|
34
|
-
for (let index = 0; index < activePages.length; index++) {
|
|
35
|
-
const {
|
|
36
|
-
name,
|
|
37
|
-
view
|
|
38
|
-
} = activePages[index];
|
|
39
|
-
if (name === 'listReport') {
|
|
40
|
-
definitionGroups.push({
|
|
41
|
-
title: 'LIST REPORT',
|
|
42
|
-
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
|
|
43
|
-
view,
|
|
44
|
-
key: name + index
|
|
45
|
-
});
|
|
46
|
-
} else if (name === 'objectPage') {
|
|
47
|
-
definitionGroups.push({
|
|
48
|
-
title: 'OBJECT PAGE',
|
|
49
|
-
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile],
|
|
50
|
-
view,
|
|
51
|
-
key: name + index
|
|
52
|
-
});
|
|
53
|
-
} else if (name === 'analyticalListPage') {
|
|
54
|
-
definitionGroups.push({
|
|
55
|
-
title: 'ANALYTICAL LIST PAGE',
|
|
56
|
-
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableCustomColumnQuickAction],
|
|
57
|
-
view,
|
|
58
|
-
key: name + index
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return definitionGroups;
|
|
63
|
-
}
|
|
64
|
-
getComponentContainerFromPage(page) {
|
|
65
|
-
// in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
|
|
66
|
-
const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
|
|
67
|
-
if (componentContainer instanceof ComponentContainer) {
|
|
68
|
-
return componentContainer;
|
|
69
|
-
}
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return FEV2QuickActionRegistry;
|
|
1
|
+
"use strict";
|
|
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-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file"], 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, ___op_enable_empty_row_mode, ___common_add_new_annotation_file) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
7
|
+
const AddControllerToPageQuickAction = ___common_add_controller_to_page["AddControllerToPageQuickAction"];
|
|
8
|
+
const ToggleClearFilterBarQuickAction = ___lr_toggle_clear_filter_bar["ToggleClearFilterBarQuickAction"];
|
|
9
|
+
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
|
+
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
|
+
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
+
const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
|
|
13
|
+
const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
|
|
14
|
+
const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
|
|
15
|
+
const EnableTableFilteringQuickAction = ___lr_enable_table_filtering["EnableTableFilteringQuickAction"];
|
|
16
|
+
const ToggleSemanticDateRangeFilterBar = ___lr_enable_semantic_date_range_filter_bar["ToggleSemanticDateRangeFilterBar"];
|
|
17
|
+
const EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
|
|
18
|
+
const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
|
|
19
|
+
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
20
|
+
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
21
|
+
const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
|
|
22
|
+
/**
|
|
23
|
+
* Quick Action provider for SAP Fiori Elements V2 applications.
|
|
24
|
+
*/
|
|
25
|
+
class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
26
|
+
PAGE_NAME_MAP = {
|
|
27
|
+
[LIST_REPORT_TYPE]: 'listReport',
|
|
28
|
+
[OBJECT_PAGE_TYPE]: 'objectPage',
|
|
29
|
+
[ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
|
|
30
|
+
};
|
|
31
|
+
getDefinitions(context) {
|
|
32
|
+
const activePages = this.getActivePageContent(context.controlIndex);
|
|
33
|
+
const definitionGroups = [];
|
|
34
|
+
for (let index = 0; index < activePages.length; index++) {
|
|
35
|
+
const {
|
|
36
|
+
name,
|
|
37
|
+
view
|
|
38
|
+
} = activePages[index];
|
|
39
|
+
if (name === 'listReport') {
|
|
40
|
+
definitionGroups.push({
|
|
41
|
+
title: 'LIST REPORT',
|
|
42
|
+
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
|
|
43
|
+
view,
|
|
44
|
+
key: name + index
|
|
45
|
+
});
|
|
46
|
+
} else if (name === 'objectPage') {
|
|
47
|
+
definitionGroups.push({
|
|
48
|
+
title: 'OBJECT PAGE',
|
|
49
|
+
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile],
|
|
50
|
+
view,
|
|
51
|
+
key: name + index
|
|
52
|
+
});
|
|
53
|
+
} else if (name === 'analyticalListPage') {
|
|
54
|
+
definitionGroups.push({
|
|
55
|
+
title: 'ANALYTICAL LIST PAGE',
|
|
56
|
+
definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
|
|
57
|
+
view,
|
|
58
|
+
key: name + index
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return definitionGroups;
|
|
63
|
+
}
|
|
64
|
+
getComponentContainerFromPage(page) {
|
|
65
|
+
// in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
|
|
66
|
+
const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
|
|
67
|
+
if (componentContainer instanceof ComponentContainer) {
|
|
68
|
+
return componentContainer;
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return FEV2QuickActionRegistry;
|
|
74
74
|
});
|
|
75
75
|
//# sourceMappingURL=registry.js.map
|
|
@@ -80,8 +80,14 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
80
80
|
title: 'ANALYTICAL LIST PAGE',
|
|
81
81
|
definitions: [
|
|
82
82
|
AddControllerToPageQuickAction,
|
|
83
|
+
AddPageActionQuickAction,
|
|
84
|
+
ToggleClearFilterBarQuickAction,
|
|
85
|
+
ToggleSemanticDateRangeFilterBar,
|
|
83
86
|
ChangeTableColumnsQuickAction,
|
|
84
|
-
|
|
87
|
+
AddTableActionQuickAction,
|
|
88
|
+
AddTableCustomColumnQuickAction,
|
|
89
|
+
EnableTableFilteringQuickAction,
|
|
90
|
+
AddNewAnnotationFile
|
|
85
91
|
],
|
|
86
92
|
view,
|
|
87
93
|
key: name + index
|
|
@@ -1,97 +1,97 @@
|
|
|
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 whether the manifest has array structured page definitions
|
|
46
|
-
* @param manifest - manifest object
|
|
47
|
-
* @returns true if pages are defined as array, false if defined as object
|
|
48
|
-
*/
|
|
49
|
-
function isManifestArrayStructured(manifest) {
|
|
50
|
-
return Array.isArray(manifest['sap.ui.generic.app']?.pages);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Checks if the current UI5 version and manifest structure is supported in v2 applications.
|
|
55
|
-
*
|
|
56
|
-
* @param manifest - manifest changes of the current application.
|
|
57
|
-
*
|
|
58
|
-
* Returns `false`
|
|
59
|
-
*
|
|
60
|
-
* - If the manifest is structured is an array
|
|
61
|
-
* - If the UI5 version is not supported
|
|
62
|
-
* Otherwise, returns `true`.
|
|
63
|
-
*
|
|
64
|
-
*/
|
|
65
|
-
async function areManifestChangesSupported(manifest) {
|
|
66
|
-
if (isManifestArrayStructured(manifest)) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
const version = await getUi5Version();
|
|
70
|
-
const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
|
|
71
|
-
major: 1,
|
|
72
|
-
minor: 128
|
|
73
|
-
});
|
|
74
|
-
const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
|
|
75
|
-
major: 1,
|
|
76
|
-
minor: 96,
|
|
77
|
-
patch: 35
|
|
78
|
-
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
79
|
-
major: 1,
|
|
80
|
-
minor: 108,
|
|
81
|
-
patch: 38
|
|
82
|
-
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
83
|
-
major: 1,
|
|
84
|
-
minor: 120,
|
|
85
|
-
patch: 23
|
|
86
|
-
});
|
|
87
|
-
return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
|
|
88
|
-
}
|
|
89
|
-
var __exports = {
|
|
90
|
-
__esModule: true
|
|
91
|
-
};
|
|
92
|
-
__exports.prepareManifestChange = prepareManifestChange;
|
|
93
|
-
__exports.isManifestArrayStructured = isManifestArrayStructured;
|
|
94
|
-
__exports.areManifestChangesSupported = areManifestChangesSupported;
|
|
95
|
-
return __exports;
|
|
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 whether the manifest has array structured page definitions
|
|
46
|
+
* @param manifest - manifest object
|
|
47
|
+
* @returns true if pages are defined as array, false if defined as object
|
|
48
|
+
*/
|
|
49
|
+
function isManifestArrayStructured(manifest) {
|
|
50
|
+
return Array.isArray(manifest['sap.ui.generic.app']?.pages);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Checks if the current UI5 version and manifest structure is supported in v2 applications.
|
|
55
|
+
*
|
|
56
|
+
* @param manifest - manifest changes of the current application.
|
|
57
|
+
*
|
|
58
|
+
* Returns `false`
|
|
59
|
+
*
|
|
60
|
+
* - If the manifest is structured is an array
|
|
61
|
+
* - If the UI5 version is not supported
|
|
62
|
+
* Otherwise, returns `true`.
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
async function areManifestChangesSupported(manifest) {
|
|
66
|
+
if (isManifestArrayStructured(manifest)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const version = await getUi5Version();
|
|
70
|
+
const isAboveOrEqualMinimalVersion = !isLowerThanMinimalUi5Version(version, {
|
|
71
|
+
major: 1,
|
|
72
|
+
minor: 128
|
|
73
|
+
});
|
|
74
|
+
const isSupportedPatchVersion = isVersionEqualOrHasNewerPatch(version, {
|
|
75
|
+
major: 1,
|
|
76
|
+
minor: 96,
|
|
77
|
+
patch: 35
|
|
78
|
+
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
79
|
+
major: 1,
|
|
80
|
+
minor: 108,
|
|
81
|
+
patch: 38
|
|
82
|
+
}) || isVersionEqualOrHasNewerPatch(version, {
|
|
83
|
+
major: 1,
|
|
84
|
+
minor: 120,
|
|
85
|
+
patch: 23
|
|
86
|
+
});
|
|
87
|
+
return isAboveOrEqualMinimalVersion || isSupportedPatchVersion;
|
|
88
|
+
}
|
|
89
|
+
var __exports = {
|
|
90
|
+
__esModule: true
|
|
91
|
+
};
|
|
92
|
+
__exports.prepareManifestChange = prepareManifestChange;
|
|
93
|
+
__exports.isManifestArrayStructured = isManifestArrayStructured;
|
|
94
|
+
__exports.areManifestChangesSupported = areManifestChangesSupported;
|
|
95
|
+
return __exports;
|
|
96
96
|
});
|
|
97
97
|
//# sourceMappingURL=utils.js.map
|