@sap-ux/preview-middleware 0.23.47 → 0.23.49
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/command-executor.js +99 -66
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
- package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
- package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
- package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
- package/dist/client/adp/extension-point.js +81 -60
- package/dist/client/adp/init.js +100 -99
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
- package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
- package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
- package/dist/client/adp/sync-views-utils.js +119 -83
- package/dist/client/cpe/changes/flex-change.js +64 -48
- package/dist/client/cpe/changes/service.js +492 -367
- package/dist/client/cpe/communication-service.js +41 -29
- package/dist/client/cpe/connector-service.js +87 -64
- package/dist/client/cpe/context-menu-service.js +87 -74
- package/dist/client/cpe/control-data.js +353 -263
- package/dist/client/cpe/documentation.js +183 -126
- package/dist/client/cpe/init.js +69 -75
- package/dist/client/cpe/outline/service.js +60 -45
- package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
- package/dist/client/cpe/rta-service.js +91 -69
- package/dist/client/cpe/selection.js +239 -187
- package/dist/client/cpe/types.js +0 -4
- package/dist/client/flp/init.js +403 -296
- package/dist/client/manifest.json +7 -4
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
- package/dist/client/utils/info-center-message.js +59 -31
- package/dist/client/utils/version.js +128 -72
- package/package.json +3 -3
|
@@ -1,153 +1,171 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "sap/ui/dt/OverlayRegistry", "sap/ui/rta/command/CommandFactory", "../../../utils/application", "../../../utils/fe-v4", "../../../utils/version", "../../api-handler", "../../dialog-factory", "../dialog-enablement-validator", "../fe-v2/utils", "../quick-action-base"], function (___sap_ux_private_control_property_editor_common, OverlayRegistry, CommandFactory, _____utils_application, _____utils_fe_v4, _____utils_version, ____api_handler, ____dialog_factory, ___dialog_enablement_validator, ___fe_v2_utils, ___quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common["NESTED_QUICK_ACTION_KIND"];
|
|
7
|
+
const getApplicationType = _____utils_application["getApplicationType"];
|
|
8
|
+
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
9
|
+
const getUi5Version = _____utils_version["getUi5Version"];
|
|
10
|
+
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
11
|
+
const getDataSourceAnnotationFileMap = ____api_handler["getDataSourceAnnotationFileMap"];
|
|
12
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
13
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
14
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
15
|
+
const getV2AppComponent = ___fe_v2_utils["getV2AppComponent"];
|
|
16
|
+
const QuickActionDefinitionBase = ___quick_action_base["QuickActionDefinitionBase"];
|
|
17
|
+
const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
|
|
18
|
+
const ADD_NEW_ANNOTATION_FILE_TITLE = 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Add New Annotation File.
|
|
22
|
+
*/
|
|
23
|
+
class AddNewAnnotationFile extends QuickActionDefinitionBase {
|
|
24
|
+
children = [];
|
|
25
|
+
get quickActionSteps() {
|
|
26
|
+
return 1;
|
|
27
|
+
}
|
|
28
|
+
kind = (() => NESTED_QUICK_ACTION_KIND)();
|
|
29
|
+
type = (() => ADD_NEW_ANNOTATION_FILE)();
|
|
30
|
+
forceRefreshAfterExecution = true;
|
|
31
|
+
isApplicable = true;
|
|
32
|
+
get id() {
|
|
33
|
+
return `${this.context.key}-${this.type}`;
|
|
34
|
+
}
|
|
35
|
+
constructor(context) {
|
|
36
|
+
super(ADD_NEW_ANNOTATION_FILE, NESTED_QUICK_ACTION_KIND, '', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
37
|
+
this.context = context;
|
|
38
|
+
}
|
|
39
|
+
async initialize() {
|
|
40
|
+
const version = await getUi5Version();
|
|
41
|
+
if (isLowerThanMinimalUi5Version(version, {
|
|
42
|
+
major: 1,
|
|
43
|
+
minor: 108,
|
|
44
|
+
patch: 27
|
|
45
|
+
})) {
|
|
46
|
+
this.isApplicable = false;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
|
|
50
|
+
const {
|
|
51
|
+
annotationDataSourceMap
|
|
52
|
+
} = this.annotationDataSourceData;
|
|
53
|
+
if (!Object.keys(this.annotationDataSourceData.annotationDataSourceMap).length) {
|
|
54
|
+
throw new Error('No data sources found in the manifest');
|
|
55
|
+
}
|
|
56
|
+
for (const key in annotationDataSourceMap) {
|
|
57
|
+
if (Object.prototype.hasOwnProperty.call(annotationDataSourceMap, key)) {
|
|
58
|
+
const source = annotationDataSourceMap[key];
|
|
59
|
+
const {
|
|
60
|
+
annotationExistsInWS
|
|
61
|
+
} = source.annotationDetails;
|
|
62
|
+
if (source.metadataReadErrorMsg) {
|
|
63
|
+
this.children.push({
|
|
64
|
+
path: this.children.length.toString(),
|
|
65
|
+
enabled: false,
|
|
66
|
+
tooltip: source.metadataReadErrorMsg,
|
|
67
|
+
label: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
68
|
+
children: []
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
this.children.push({
|
|
72
|
+
path: this.children.length.toString(),
|
|
73
|
+
enabled: true,
|
|
74
|
+
label: annotationExistsInWS ? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key]) : this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
75
|
+
children: []
|
|
76
|
+
});
|
|
77
|
+
}
|
|
44
78
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
|
|
56
|
-
const {annotationDataSourceMap} = this.annotationDataSourceData;
|
|
57
|
-
if (!Object.keys(this.annotationDataSourceData.annotationDataSourceMap).length) {
|
|
58
|
-
throw new Error('No data sources found in the manifest');
|
|
59
|
-
}
|
|
60
|
-
for (const key in annotationDataSourceMap) {
|
|
61
|
-
if (Object.prototype.hasOwnProperty.call(annotationDataSourceMap, key)) {
|
|
62
|
-
const source = annotationDataSourceMap[key];
|
|
63
|
-
const {annotationExistsInWS} = source.annotationDetails;
|
|
64
|
-
if (source.metadataReadErrorMsg) {
|
|
65
|
-
this.children.push({
|
|
66
|
-
path: this.children.length.toString(),
|
|
67
|
-
enabled: false,
|
|
68
|
-
tooltip: source.metadataReadErrorMsg,
|
|
69
|
-
label: this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
70
|
-
children: []
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
this.children.push({
|
|
74
|
-
path: this.children.length.toString(),
|
|
75
|
-
enabled: true,
|
|
76
|
-
label: annotationExistsInWS ? this.context.resourceBundle.getText('SHOW_ANNOTATION_FILE', [key]) : this.context.resourceBundle.getText('ADD_ANNOTATION_FILE', [key]),
|
|
77
|
-
children: []
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
get textKey() {
|
|
82
|
+
let result = ADD_NEW_ANNOTATION_FILE_TITLE;
|
|
83
|
+
const dataSourceIds = Object.keys(this.annotationDataSourceData.annotationDataSourceMap);
|
|
84
|
+
if (dataSourceIds.length === 1) {
|
|
85
|
+
const details = this.annotationDataSourceData.annotationDataSourceMap[dataSourceIds[0]];
|
|
86
|
+
if (details.annotationDetails.annotationExistsInWS) {
|
|
87
|
+
result = 'QUICK_ACTION_SHOW_ANNOTATION_FILE';
|
|
82
88
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
async execute(path) {
|
|
93
|
+
const {
|
|
94
|
+
annotationDataSourceMap,
|
|
95
|
+
isRunningInBAS
|
|
96
|
+
} = this.annotationDataSourceData;
|
|
97
|
+
const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
98
|
+
const index = Number(path);
|
|
99
|
+
if (index >= 0) {
|
|
100
|
+
const dataSourceId = Object.keys(annotationDataSourceMap)[index];
|
|
101
|
+
const dataSource = annotationDataSourceMap[dataSourceId];
|
|
102
|
+
if (dataSource?.annotationDetails.annotationExistsInWS) {
|
|
103
|
+
const annotationFileDetails = dataSource.annotationDetails;
|
|
104
|
+
const {
|
|
105
|
+
annotationPath,
|
|
106
|
+
annotationPathFromRoot
|
|
107
|
+
} = annotationFileDetails;
|
|
108
|
+
await DialogFactory.createDialog(OverlayRegistry.getOverlay(this.context.view),
|
|
109
|
+
// this passed only because, for method param is required.
|
|
110
|
+
this.context.rta,
|
|
111
|
+
// same as above
|
|
112
|
+
DialogNames.FILE_EXISTS, undefined, {
|
|
113
|
+
fileName: annotationPathFromRoot,
|
|
114
|
+
filePath: annotationPath,
|
|
115
|
+
isRunningInBAS: isRunningInBAS
|
|
116
|
+
});
|
|
93
117
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} else if (dataSource) {
|
|
110
|
-
const timestamp = Date.now();
|
|
111
|
-
const annotationFileNameWithoutExtension = `annotation_${ timestamp }`;
|
|
112
|
-
const annotationFileName = `${ annotationFileNameWithoutExtension }.xml`;
|
|
113
|
-
const annotationNameSpace = this.context.flexSettings.layer === 'CUSTOMER_BASE' ? `customer.annotation.${ annotationFileNameWithoutExtension }` : `annotation.${ annotationFileNameWithoutExtension }`;
|
|
114
|
-
const parameters = {
|
|
115
|
-
dataSourceId: dataSourceId,
|
|
116
|
-
annotations: [annotationNameSpace],
|
|
117
|
-
annotationsInsertPosition: 'END',
|
|
118
|
-
dataSource: {
|
|
119
|
-
[annotationNameSpace]: {
|
|
120
|
-
uri: `annotations/${ annotationFileName }`,
|
|
121
|
-
type: 'ODataAnnotation'
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const modifiedValue = {
|
|
126
|
-
changeType: 'appdescr_app_addAnnotationsToOData',
|
|
127
|
-
appComponent: appType === 'fe-v4' ? getV4AppComponent(this.context.view) : getV2AppComponent(this.context.view),
|
|
128
|
-
generator: this.context.flexSettings.generator,
|
|
129
|
-
reference: this.context.flexSettings.projectId,
|
|
130
|
-
parameters,
|
|
131
|
-
serviceUrl: dataSource.serviceUrl
|
|
132
|
-
};
|
|
133
|
-
const command = await CommandFactory.getCommandFor(this.context.view, 'appDescriptor', modifiedValue, null, this.context.flexSettings);
|
|
134
|
-
return [command];
|
|
135
|
-
}
|
|
118
|
+
// Create annotation file only, if no file exists already for datasource id or if the change file exist and but no annotation file exists in file system.
|
|
119
|
+
else if (dataSource) {
|
|
120
|
+
const timestamp = Date.now();
|
|
121
|
+
const annotationFileNameWithoutExtension = `annotation_${timestamp}`;
|
|
122
|
+
const annotationFileName = `${annotationFileNameWithoutExtension}.xml`;
|
|
123
|
+
const annotationNameSpace = this.context.flexSettings.layer === 'CUSTOMER_BASE' ? `customer.annotation.${annotationFileNameWithoutExtension}` : `annotation.${annotationFileNameWithoutExtension}`;
|
|
124
|
+
const parameters = {
|
|
125
|
+
dataSourceId: dataSourceId,
|
|
126
|
+
annotations: [annotationNameSpace],
|
|
127
|
+
annotationsInsertPosition: 'END',
|
|
128
|
+
dataSource: {
|
|
129
|
+
[annotationNameSpace]: {
|
|
130
|
+
uri: `annotations/${annotationFileName}`,
|
|
131
|
+
type: 'ODataAnnotation'
|
|
132
|
+
}
|
|
136
133
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
};
|
|
135
|
+
const modifiedValue = {
|
|
136
|
+
changeType: 'appdescr_app_addAnnotationsToOData',
|
|
137
|
+
appComponent: appType === 'fe-v4' ? getV4AppComponent(this.context.view) : getV2AppComponent(this.context.view),
|
|
138
|
+
generator: this.context.flexSettings.generator,
|
|
139
|
+
reference: this.context.flexSettings.projectId,
|
|
140
|
+
parameters,
|
|
141
|
+
serviceUrl: dataSource.serviceUrl
|
|
142
|
+
};
|
|
143
|
+
const command = await CommandFactory.getCommandFor(this.context.view, 'appDescriptor', modifiedValue, null, this.context.flexSettings);
|
|
144
|
+
return [command];
|
|
147
145
|
}
|
|
146
|
+
}
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Prepares nested quick action object
|
|
152
|
+
* @returns action instance
|
|
153
|
+
*/
|
|
154
|
+
getActionObject() {
|
|
155
|
+
return {
|
|
156
|
+
kind: NESTED_QUICK_ACTION_KIND,
|
|
157
|
+
id: this.id,
|
|
158
|
+
enabled: this.isApplicable,
|
|
159
|
+
title: this.context.resourceBundle.getText(this.textKey),
|
|
160
|
+
children: this.children
|
|
161
|
+
};
|
|
148
162
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
163
|
+
}
|
|
164
|
+
var __exports = {
|
|
165
|
+
__esModule: true
|
|
166
|
+
};
|
|
167
|
+
__exports.ADD_NEW_ANNOTATION_FILE = ADD_NEW_ANNOTATION_FILE;
|
|
168
|
+
__exports.AddNewAnnotationFile = AddNewAnnotationFile;
|
|
169
|
+
return __exports;
|
|
170
|
+
});
|
|
171
|
+
//# sourceMappingURL=add-new-annotation-file.js.map
|
|
@@ -1,103 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (iconTabBar && iconTabBarFilterKey) {
|
|
42
|
-
iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
43
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../dialog-enablement-validator", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../../../utils/info-center-message"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___control_types, ___table_quick_action_base, ___dialog_enablement_validator, ___sap_ux_private_control_property_editor_common, _____utils_info_center_message) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const isA = _____utils_core["isA"];
|
|
8
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
9
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
10
|
+
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
11
|
+
const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
|
|
12
|
+
const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
|
|
13
|
+
const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
|
|
14
|
+
const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
|
|
15
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
16
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
17
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
|
|
18
|
+
const sendInfoCenterMessage = _____utils_info_center_message["sendInfoCenterMessage"];
|
|
19
|
+
const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
20
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Reusable function which performs some preparation steps before table action execution
|
|
24
|
+
*
|
|
25
|
+
* @param table - table element
|
|
26
|
+
* @param sectionInfo - section data
|
|
27
|
+
* @param iconTabBar - icon tab bar element
|
|
28
|
+
* @param iconTabBarFilterKey - tab bar key to select a tab
|
|
29
|
+
*/
|
|
30
|
+
function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
|
|
31
|
+
if (sectionInfo) {
|
|
32
|
+
const {
|
|
33
|
+
layout,
|
|
34
|
+
section,
|
|
35
|
+
subSection
|
|
36
|
+
} = sectionInfo;
|
|
37
|
+
layout?.setSelectedSection(section);
|
|
38
|
+
section.setSelectedSubSection(subSection);
|
|
39
|
+
} else {
|
|
40
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
44
41
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
|
|
76
|
-
await sendInfoCenterMessage({
|
|
77
|
-
title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
|
|
78
|
-
description: { key: 'TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN' },
|
|
79
|
-
type: MessageBarType.error
|
|
80
|
-
});
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
const dialog = [
|
|
84
|
-
TREE_TABLE_TYPE,
|
|
85
|
-
ANALYTICAL_TABLE_TYPE,
|
|
86
|
-
GRID_TABLE_TYPE
|
|
87
|
-
].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
88
|
-
await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
|
|
89
|
-
aggregation: 'columns',
|
|
90
|
-
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
91
|
-
}, {
|
|
92
|
-
actionName: this.type,
|
|
93
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
94
|
-
});
|
|
95
|
-
return [];
|
|
42
|
+
if (iconTabBar && iconTabBarFilterKey) {
|
|
43
|
+
iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
|
|
47
|
+
constructor(context) {
|
|
48
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
|
|
49
|
+
areTableRowsRequired: true
|
|
50
|
+
}, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
51
|
+
}
|
|
52
|
+
async execute(path) {
|
|
53
|
+
const {
|
|
54
|
+
table,
|
|
55
|
+
iconTabBarFilterKey,
|
|
56
|
+
sectionInfo
|
|
57
|
+
} = this.tableMap[path];
|
|
58
|
+
if (!table) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
62
|
+
this.selectOverlay(table);
|
|
63
|
+
let tableInternal = table;
|
|
64
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
65
|
+
const itemsAggregation = table.getAggregation('items');
|
|
66
|
+
tableInternal = itemsAggregation.find(item => {
|
|
67
|
+
return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
|
|
68
|
+
});
|
|
69
|
+
if (!tableInternal) {
|
|
70
|
+
return [];
|
|
96
71
|
}
|
|
72
|
+
}
|
|
73
|
+
const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
|
|
74
|
+
if (!overlay) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
|
|
78
|
+
await sendInfoCenterMessage({
|
|
79
|
+
title: {
|
|
80
|
+
key: 'ADP_CREATE_XML_FRAGMENT_TITLE'
|
|
81
|
+
},
|
|
82
|
+
description: {
|
|
83
|
+
key: 'TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'
|
|
84
|
+
},
|
|
85
|
+
type: MessageBarType.error
|
|
86
|
+
});
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
90
|
+
await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
|
|
91
|
+
aggregation: 'columns',
|
|
92
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
93
|
+
}, {
|
|
94
|
+
actionName: this.type,
|
|
95
|
+
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
96
|
+
});
|
|
97
|
+
return [];
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
}
|
|
100
|
+
var __exports = {
|
|
101
|
+
__esModule: true
|
|
102
|
+
};
|
|
103
|
+
__exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
|
|
104
|
+
__exports.preprocessActionExecution = preprocessActionExecution;
|
|
105
|
+
__exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
|
|
106
|
+
return __exports;
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=create-table-custom-column.js.map
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor(type, controlTypes, defaultTextKey, context) {
|
|
16
|
-
let enablementValidators = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
17
|
-
super(type, SIMPLE_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
|
|
18
|
-
this.type = type;
|
|
19
|
-
this.controlTypes = controlTypes;
|
|
20
|
-
this.defaultTextKey = defaultTextKey;
|
|
21
|
-
this.context = context;
|
|
22
|
-
this.enablementValidators = enablementValidators;
|
|
23
|
-
}
|
|
24
|
-
initialize() {
|
|
25
|
-
this.control = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)[0];
|
|
26
|
-
return Promise.resolve();
|
|
27
|
-
}
|
|
28
|
-
getActionObject() {
|
|
29
|
-
return {
|
|
30
|
-
kind: SIMPLE_QUICK_ACTION_KIND,
|
|
31
|
-
id: this.id,
|
|
32
|
-
enabled: !this.isDisabled,
|
|
33
|
-
tooltip: this.tooltip,
|
|
34
|
-
title: this.context.resourceBundle.getText(this.textKey)
|
|
35
|
-
};
|
|
36
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../../cpe/quick-actions/utils", "./quick-action-base"], function (___sap_ux_private_control_property_editor_common, ____cpe_quick_actions_utils, ___quick_action_base) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const SIMPLE_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common["SIMPLE_QUICK_ACTION_KIND"];
|
|
7
|
+
const getRelevantControlFromActivePage = ____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
8
|
+
const QuickActionDefinitionBase = ___quick_action_base["QuickActionDefinitionBase"];
|
|
9
|
+
/**
|
|
10
|
+
* Base class for all simple quick actions.
|
|
11
|
+
*/
|
|
12
|
+
class SimpleQuickActionDefinitionBase extends QuickActionDefinitionBase {
|
|
13
|
+
get isApplicable() {
|
|
14
|
+
return this.control !== undefined;
|
|
37
15
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
16
|
+
constructor(type, controlTypes, defaultTextKey, context) {
|
|
17
|
+
let enablementValidators = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
18
|
+
super(type, SIMPLE_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.controlTypes = controlTypes;
|
|
21
|
+
this.defaultTextKey = defaultTextKey;
|
|
22
|
+
this.context = context;
|
|
23
|
+
this.enablementValidators = enablementValidators;
|
|
24
|
+
}
|
|
25
|
+
initialize() {
|
|
26
|
+
this.control = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, this.controlTypes)[0];
|
|
27
|
+
return Promise.resolve();
|
|
28
|
+
}
|
|
29
|
+
getActionObject() {
|
|
30
|
+
return {
|
|
31
|
+
kind: SIMPLE_QUICK_ACTION_KIND,
|
|
32
|
+
id: this.id,
|
|
33
|
+
enabled: !this.isDisabled,
|
|
34
|
+
tooltip: this.tooltip,
|
|
35
|
+
title: this.context.resourceBundle.getText(this.textKey)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
var __exports = {
|
|
40
|
+
__esModule: true
|
|
41
|
+
};
|
|
42
|
+
__exports.SimpleQuickActionDefinitionBase = SimpleQuickActionDefinitionBase;
|
|
43
|
+
return __exports;
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=simple-quick-action-base.js.map
|