@sap-ux/preview-middleware 0.25.39 → 0.25.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +2 -5
- package/dist/client/adp/controllers/AddCustomFragment.controller.ts +2 -5
- package/dist/client/adp/controllers/types.js +0 -2
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +0 -97
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +0 -74
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +0 -171
- package/dist/client/adp/quick-actions/common/create-page-action.js +0 -56
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +0 -41
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +0 -69
- package/dist/client/adp/quick-actions/control-types.js +0 -25
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +0 -26
- package/dist/client/flp/init.js +2 -2
- package/dist/client/flp/init.ts +2 -2
- package/package.json +6 -6
|
@@ -112,11 +112,8 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "../../i18n", "../command-executor
|
|
|
112
112
|
*/
|
|
113
113
|
buildDialogData: async function _buildDialogData() {
|
|
114
114
|
try {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
await this.addFragmentListToModel();
|
|
118
|
-
isCustomColumnFragment = true;
|
|
119
|
-
}
|
|
115
|
+
const isCustomColumnFragment = this.options.type === 'tableColumn';
|
|
116
|
+
await this.addFragmentListToModel();
|
|
120
117
|
this.model.setProperty('/isCustomColumnFragment', isCustomColumnFragment);
|
|
121
118
|
} catch (e) {
|
|
122
119
|
const error = getError(e);
|
|
@@ -145,11 +145,8 @@ export default class AddCustomFragment extends BaseDialog<AddFragmentModel> {
|
|
|
145
145
|
*/
|
|
146
146
|
async buildDialogData(): Promise<void> {
|
|
147
147
|
try {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
await this.addFragmentListToModel();
|
|
151
|
-
isCustomColumnFragment = true;
|
|
152
|
-
}
|
|
148
|
+
const isCustomColumnFragment = this.options.type === 'tableColumn';
|
|
149
|
+
await this.addFragmentListToModel();
|
|
153
150
|
this.model.setProperty('/isCustomColumnFragment', isCustomColumnFragment);
|
|
154
151
|
} catch (e) {
|
|
155
152
|
const error = getError(e);
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../cpe/quick-actions/utils", "../../utils/core", "../dialog-factory", "../../i18n", "./simple-quick-action-base", "./dialog-enablement-validator"], function (Component, OverlayRegistry, ____cpe_quick_actions_utils, ____utils_core, ___dialog_factory, ____i18n, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const pageHasControlId = ____cpe_quick_actions_utils["pageHasControlId"];
|
|
7
|
-
const getControlById = ____utils_core["getControlById"];
|
|
8
|
-
const DialogFactory = ___dialog_factory["DialogFactory"];
|
|
9
|
-
const DialogNames = ___dialog_factory["DialogNames"];
|
|
10
|
-
const getTextBundle = ____i18n["getTextBundle"];
|
|
11
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
12
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
13
|
-
const ADD_NEW_OBJECT_PAGE_ACTION = 'add-new-subpage';
|
|
14
|
-
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
15
|
-
/**
|
|
16
|
-
* Base Quick Action class for adding a custom page action.
|
|
17
|
-
*/
|
|
18
|
-
class AddNewSubpageBase extends SimpleQuickActionDefinitionBase {
|
|
19
|
-
constructor(context) {
|
|
20
|
-
super(ADD_NEW_OBJECT_PAGE_ACTION, [], 'QUICK_ACTION_ADD_NEW_SUB_PAGE', context, [{
|
|
21
|
-
run: async () => {
|
|
22
|
-
const i18n = await getTextBundle();
|
|
23
|
-
if (this.navProperties.length === 0) {
|
|
24
|
-
return {
|
|
25
|
-
type: 'error',
|
|
26
|
-
message: i18n.getText('NO_SUB_PAGES_TO_ADD')
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
}, DIALOG_ENABLEMENT_VALIDATOR]);
|
|
32
|
-
this.appReference = context.flexSettings.projectId ?? '';
|
|
33
|
-
this.existingPages = this.getApplicationPages();
|
|
34
|
-
}
|
|
35
|
-
async addNavigationOptionIfAvailable(metaModel, targetEntitySet, navProperty) {
|
|
36
|
-
if (!targetEntitySet) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const pageExists = await this.isPageExists(targetEntitySet, metaModel);
|
|
40
|
-
if (!pageExists) {
|
|
41
|
-
this.navProperties.push({
|
|
42
|
-
entitySet: targetEntitySet,
|
|
43
|
-
navProperty: navProperty ?? targetEntitySet
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async initialize() {
|
|
48
|
-
if (!this.appReference) {
|
|
49
|
-
throw new Error('App reference not defined');
|
|
50
|
-
}
|
|
51
|
-
const allControls = CONTROL_TYPES.flatMap(item => this.context.controlIndex[item] ?? []);
|
|
52
|
-
const control = allControls.find(c => pageHasControlId(this.context.view, c.controlId));
|
|
53
|
-
this.pageType = this.context.view.getViewName().split('.view.')[0];
|
|
54
|
-
const metaModel = this.getODataMetaModel();
|
|
55
|
-
if (!metaModel || !control) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const modifiedControl = getControlById(control.controlId);
|
|
59
|
-
if (!modifiedControl) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const component = Component.getOwnerComponentFor(modifiedControl);
|
|
63
|
-
const entitySetName = await this.getEntitySetNameFromPageComponent(component, metaModel);
|
|
64
|
-
if (!entitySetName) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.entitySet = entitySetName;
|
|
68
|
-
this.navProperties = [];
|
|
69
|
-
if (!this.isCurrentObjectPage()) {
|
|
70
|
-
await this.addNavigationOptionIfAvailable(metaModel, this.entitySet);
|
|
71
|
-
} else {
|
|
72
|
-
await this.prepareNavigationData(metaModel);
|
|
73
|
-
}
|
|
74
|
-
this.control = modifiedControl;
|
|
75
|
-
}
|
|
76
|
-
async execute() {
|
|
77
|
-
const overlay = OverlayRegistry.getOverlay(this.control);
|
|
78
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_SUBPAGE, undefined, {
|
|
79
|
-
appReference: this.appReference,
|
|
80
|
-
navProperties: this.navProperties,
|
|
81
|
-
title: 'ADD_SUB_PAGE_DIALOG_TITLE',
|
|
82
|
-
pageDescriptor: this.currentPageDescriptor
|
|
83
|
-
}, {
|
|
84
|
-
actionName: this.type,
|
|
85
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
86
|
-
});
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
var __exports = {
|
|
91
|
-
__esModule: true
|
|
92
|
-
};
|
|
93
|
-
__exports.ADD_NEW_OBJECT_PAGE_ACTION = ADD_NEW_OBJECT_PAGE_ACTION;
|
|
94
|
-
__exports.AddNewSubpageBase = AddNewSubpageBase;
|
|
95
|
-
return __exports;
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=add-new-subpage-quick-action-base.js.map
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/version", "../../utils", "../../../cpe/quick-actions/utils", "../../../i18n", "../../api-handler", "../../dialog-factory", "../../init-dialogs", "../dialog-enablement-validator", "../simple-quick-action-base"], function (OverlayRegistry, _____utils_version, ____utils, _____cpe_quick_actions_utils, _____i18n, ____api_handler, ____dialog_factory, ____init_dialogs, ___dialog_enablement_validator, ___simple_quick_action_base) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getUi5Version = _____utils_version["getUi5Version"];
|
|
7
|
-
const getControllerInfoForControl = ____utils["getControllerInfoForControl"];
|
|
8
|
-
const getReuseComponentChecker = ____utils["getReuseComponentChecker"];
|
|
9
|
-
const checkForExistingChange = ____utils["checkForExistingChange"];
|
|
10
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
11
|
-
const getTextBundle = _____i18n["getTextBundle"];
|
|
12
|
-
const getExistingController = ____api_handler["getExistingController"];
|
|
13
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
14
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
15
|
-
const isControllerExtensionEnabledForControl = ____init_dialogs["isControllerExtensionEnabledForControl"];
|
|
16
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
17
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
18
|
-
const ADD_CONTROLLER_TO_PAGE_TYPE = 'add-controller-to-page';
|
|
19
|
-
const CONTROL_TYPES = ['sap.f.DynamicPage', 'sap.uxap.ObjectPageLayout'];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Quick Action for adding controller to a page.
|
|
23
|
-
*/
|
|
24
|
-
class AddControllerToPageQuickAction extends SimpleQuickActionDefinitionBase {
|
|
25
|
-
constructor(context) {
|
|
26
|
-
super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context, [DIALOG_ENABLEMENT_VALIDATOR, {
|
|
27
|
-
run: async () => {
|
|
28
|
-
const controllerName = getControllerInfoForControl(this.context.view).controllerName;
|
|
29
|
-
const i18n = await getTextBundle();
|
|
30
|
-
if (checkForExistingChange(this.context.rta, 'codeExt', 'selector.controllerName', controllerName)) {
|
|
31
|
-
return {
|
|
32
|
-
type: 'error',
|
|
33
|
-
message: i18n.getText('ADP_QUICK_ACTION_CONTROLLER_PENDING_CHANGE_EXISTS')
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}]);
|
|
38
|
-
}
|
|
39
|
-
controllerExists = false;
|
|
40
|
-
forceRefreshAfterExecution = true;
|
|
41
|
-
async initialize() {
|
|
42
|
-
const version = await getUi5Version();
|
|
43
|
-
const isReuseComponent = await getReuseComponentChecker(version);
|
|
44
|
-
const control = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
45
|
-
if (control) {
|
|
46
|
-
const controlInfo = getControllerInfoForControl(control);
|
|
47
|
-
const data = await getExistingController(controlInfo.controllerName);
|
|
48
|
-
this.controllerExists = data?.controllerExists;
|
|
49
|
-
const isActiveAction = isControllerExtensionEnabledForControl(control, isReuseComponent, this.context.flexSettings.isCloud);
|
|
50
|
-
this.control = isActiveAction ? control : undefined;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
get textKey() {
|
|
54
|
-
return this.controllerExists ? 'QUICK_ACTION_SHOW_PAGE_CONTROLLER' : 'QUICK_ACTION_ADD_PAGE_CONTROLLER';
|
|
55
|
-
}
|
|
56
|
-
async execute() {
|
|
57
|
-
if (this.control) {
|
|
58
|
-
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
59
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.CONTROLLER_EXTENSION, undefined, {}, {
|
|
60
|
-
actionName: this.type,
|
|
61
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
var __exports = {
|
|
68
|
-
__esModule: true
|
|
69
|
-
};
|
|
70
|
-
__exports.ADD_CONTROLLER_TO_PAGE_TYPE = ADD_CONTROLLER_TO_PAGE_TYPE;
|
|
71
|
-
__exports.AddControllerToPageQuickAction = AddControllerToPageQuickAction;
|
|
72
|
-
return __exports;
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=add-controller-to-page.js.map
|
|
@@ -1,171 +0,0 @@
|
|
|
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
|
-
}
|
|
78
|
-
}
|
|
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';
|
|
88
|
-
}
|
|
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
|
-
});
|
|
117
|
-
}
|
|
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
|
-
}
|
|
133
|
-
}
|
|
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];
|
|
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
|
-
};
|
|
162
|
-
}
|
|
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,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../simple-quick-action-base", "../../../utils/application", "../../../utils/version", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, ___simple_quick_action_base, _____utils_application, _____utils_version, ___dialog_enablement_validator) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
|
-
const getApplicationType = _____utils_application["getApplicationType"];
|
|
10
|
-
const getUi5Version = _____utils_version["getUi5Version"];
|
|
11
|
-
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
12
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
13
|
-
const ADD_PAGE_ACTION = 'add-page-action';
|
|
14
|
-
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Quick Action for adding a custom page action.
|
|
18
|
-
*/
|
|
19
|
-
class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
20
|
-
constructor(context) {
|
|
21
|
-
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
22
|
-
this.appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
23
|
-
}
|
|
24
|
-
async initialize() {
|
|
25
|
-
const version = await getUi5Version();
|
|
26
|
-
if (this.appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, {
|
|
27
|
-
major: 1,
|
|
28
|
-
minor: 130
|
|
29
|
-
})) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
await super.initialize();
|
|
33
|
-
}
|
|
34
|
-
async execute() {
|
|
35
|
-
if (this.control) {
|
|
36
|
-
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
37
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
38
|
-
aggregation: 'actions',
|
|
39
|
-
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION',
|
|
40
|
-
defaultAggregationArrayIndex: 1
|
|
41
|
-
}, {
|
|
42
|
-
actionName: this.type,
|
|
43
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
var __exports = {
|
|
50
|
-
__esModule: true
|
|
51
|
-
};
|
|
52
|
-
__exports.ADD_PAGE_ACTION = ADD_PAGE_ACTION;
|
|
53
|
-
__exports.AddPageActionQuickAction = AddPageActionQuickAction;
|
|
54
|
-
return __exports;
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=create-page-action.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
-
const OP_ADD_CUSTOM_SECTION = 'op-add-custom-section';
|
|
12
|
-
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Quick Action for adding a Header Field to an Object Page.
|
|
16
|
-
*/
|
|
17
|
-
class AddCustomSectionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
18
|
-
constructor(context) {
|
|
19
|
-
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
|
-
}
|
|
21
|
-
async execute() {
|
|
22
|
-
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
23
|
-
const overlay = OverlayRegistry.getOverlay(objectPageLayout) || [];
|
|
24
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
25
|
-
aggregation: 'sections',
|
|
26
|
-
title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION'
|
|
27
|
-
}, {
|
|
28
|
-
actionName: this.type,
|
|
29
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
30
|
-
});
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
var __exports = {
|
|
35
|
-
__esModule: true
|
|
36
|
-
};
|
|
37
|
-
__exports.OP_ADD_CUSTOM_SECTION = OP_ADD_CUSTOM_SECTION;
|
|
38
|
-
__exports.AddCustomSectionQuickAction = AddCustomSectionQuickAction;
|
|
39
|
-
return __exports;
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=op-add-custom-section.js.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator", "../../../i18n"], function (OverlayRegistry, ____dialog_factory, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator, _____i18n) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
-
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
-
const isA = _____utils_core["isA"];
|
|
9
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
-
const getTextBundle = _____i18n["getTextBundle"];
|
|
12
|
-
const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
|
|
13
|
-
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Quick Action for adding a Header Field to an Object Page.
|
|
17
|
-
*/
|
|
18
|
-
class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
|
|
19
|
-
constructor(context) {
|
|
20
|
-
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR, {
|
|
21
|
-
run: async () => {
|
|
22
|
-
const i18n = await getTextBundle();
|
|
23
|
-
if (!this.control?.getShowHeaderContent()) {
|
|
24
|
-
return {
|
|
25
|
-
type: 'error',
|
|
26
|
-
message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
}]);
|
|
32
|
-
}
|
|
33
|
-
async execute() {
|
|
34
|
-
if (!this.control) {
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
const headerContent = this.control.getHeaderContent();
|
|
38
|
-
|
|
39
|
-
// check if only flex box exist in the headerContent.
|
|
40
|
-
if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
|
|
41
|
-
const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
|
|
42
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
43
|
-
aggregation: 'items',
|
|
44
|
-
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
45
|
-
}, {
|
|
46
|
-
actionName: this.type,
|
|
47
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
48
|
-
});
|
|
49
|
-
} else if (this.control) {
|
|
50
|
-
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
51
|
-
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
52
|
-
aggregation: 'headerContent',
|
|
53
|
-
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
54
|
-
}, {
|
|
55
|
-
actionName: this.type,
|
|
56
|
-
telemetryEventIdentifier: this.getTelemetryIdentifier()
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
var __exports = {
|
|
63
|
-
__esModule: true
|
|
64
|
-
};
|
|
65
|
-
__exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
|
|
66
|
-
__exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
|
|
67
|
-
return __exports;
|
|
68
|
-
});
|
|
69
|
-
//# sourceMappingURL=op-add-header-field.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define([], function () {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
7
|
-
const M_TABLE_TYPE = 'sap.m.Table';
|
|
8
|
-
const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
|
|
9
|
-
const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
|
|
10
|
-
const GRID_TABLE_TYPE = 'sap.ui.table.Table';
|
|
11
|
-
const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
|
|
12
|
-
const MDC_ACTION_TOOLBAR_TYPE = 'sap.ui.mdc.ActionToolbar';
|
|
13
|
-
var __exports = {
|
|
14
|
-
__esModule: true
|
|
15
|
-
};
|
|
16
|
-
__exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
|
|
17
|
-
__exports.M_TABLE_TYPE = M_TABLE_TYPE;
|
|
18
|
-
__exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
|
|
19
|
-
__exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
|
|
20
|
-
__exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
|
|
21
|
-
__exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
|
|
22
|
-
__exports.MDC_ACTION_TOOLBAR_TYPE = MDC_ACTION_TOOLBAR_TYPE;
|
|
23
|
-
return __exports;
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=control-types.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../i18n", "../dialog-factory"], function (____i18n, ___dialog_factory) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getTextBundle = ____i18n["getTextBundle"];
|
|
7
|
-
const DialogFactory = ___dialog_factory["DialogFactory"];
|
|
8
|
-
const DIALOG_ENABLEMENT_VALIDATOR = {
|
|
9
|
-
run: async () => {
|
|
10
|
-
const i18n = await getTextBundle();
|
|
11
|
-
if (!DialogFactory.canOpenDialog) {
|
|
12
|
-
return {
|
|
13
|
-
type: 'error',
|
|
14
|
-
message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var __exports = {
|
|
21
|
-
__esModule: true
|
|
22
|
-
};
|
|
23
|
-
__exports.DIALOG_ENABLEMENT_VALIDATOR = DIALOG_ENABLEMENT_VALIDATOR;
|
|
24
|
-
return __exports;
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=dialog-enablement-validator.js.map
|
package/dist/client/flp/init.js
CHANGED
|
@@ -150,9 +150,9 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
150
150
|
async function registerComponentDependencyPaths(appUrls, urlParams) {
|
|
151
151
|
const libs = await getManifestLibs(appUrls);
|
|
152
152
|
if (libs && libs.length > 0) {
|
|
153
|
-
let url = '/sap/bc/ui2/app_index/ui5_app_info?id=' + libs;
|
|
153
|
+
let url = '/sap/bc/ui2/app_index/ui5_app_info?id=' + encodeURIComponent(libs);
|
|
154
154
|
const sapClient = urlParams.get('sap-client');
|
|
155
|
-
if (sapClient?.length === 3) {
|
|
155
|
+
if (sapClient?.length === 3 && /^\d+$/.test(sapClient)) {
|
|
156
156
|
url = url + '&sap-client=' + sapClient;
|
|
157
157
|
}
|
|
158
158
|
const response = await fetch(url);
|
package/dist/client/flp/init.ts
CHANGED
|
@@ -185,9 +185,9 @@ export async function resetAppState(container: typeof sap.ushell.Container): Pro
|
|
|
185
185
|
export async function registerComponentDependencyPaths(appUrls: string[], urlParams: URLSearchParams): Promise<void> {
|
|
186
186
|
const libs = await getManifestLibs(appUrls);
|
|
187
187
|
if (libs && libs.length > 0) {
|
|
188
|
-
let url = '/sap/bc/ui2/app_index/ui5_app_info?id=' + libs;
|
|
188
|
+
let url = '/sap/bc/ui2/app_index/ui5_app_info?id=' + encodeURIComponent(libs);
|
|
189
189
|
const sapClient = urlParams.get('sap-client');
|
|
190
|
-
if (sapClient?.length === 3) {
|
|
190
|
+
if (sapClient?.length === 3 && /^\d+$/.test(sapClient)) {
|
|
191
191
|
url = url + '&sap-client=' + sapClient;
|
|
192
192
|
}
|
|
193
193
|
const response = await fetch(url);
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.25.
|
|
12
|
+
"version": "0.25.41",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"qrcode": "1.5.4",
|
|
29
29
|
"@sap/bas-sdk": "3.13.6",
|
|
30
30
|
"@sap-ux/adp-tooling": "0.18.129",
|
|
31
|
-
"@sap-ux/btp-utils": "1.1.15",
|
|
32
31
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.25",
|
|
32
|
+
"@sap-ux/btp-utils": "1.1.15",
|
|
33
33
|
"@sap-ux/feature-toggle": "0.3.8",
|
|
34
34
|
"@sap-ux/logger": "0.8.5",
|
|
35
|
-
"@sap-ux/project-access": "1.36.3",
|
|
36
35
|
"@sap-ux/system-access": "0.7.11",
|
|
36
|
+
"@sap-ux/project-access": "1.36.3",
|
|
37
37
|
"@sap-ux/i18n": "0.3.11"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"nock": "14.0.11",
|
|
54
54
|
"npm-run-all2": "8.0.4",
|
|
55
55
|
"supertest": "7.2.2",
|
|
56
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.25.
|
|
57
|
-
"@sap-ux/axios-extension": "1.25.35",
|
|
56
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.25.41",
|
|
58
57
|
"@sap-ux/store": "1.5.13",
|
|
59
|
-
"@sap-ux/ui5-info": "0.13.21"
|
|
58
|
+
"@sap-ux/ui5-info": "0.13.21",
|
|
59
|
+
"@sap-ux/axios-extension": "1.25.35"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"express": "4"
|