@sap-ux/preview-middleware 0.20.73 → 0.21.0
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 +2 -2
- package/dist/client/adp/api-handler.ts +2 -2
- package/dist/client/adp/command-executor.js +66 -76
- package/dist/client/adp/command-executor.ts +28 -13
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +22 -8
- package/dist/client/adp/controllers/AddCustomFragment.controller.ts +16 -6
- package/dist/client/adp/controllers/AddFragment.controller.js +32 -18
- package/dist/client/adp/controllers/AddFragment.controller.ts +23 -13
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +35 -19
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +26 -20
- package/dist/client/adp/controllers/BaseDialog.controller.js +1 -9
- package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -14
- package/dist/client/adp/controllers/ControllerExtension.controller.js +252 -267
- package/dist/client/adp/controllers/ControllerExtension.controller.ts +61 -17
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +115 -140
- package/dist/client/adp/controllers/ExtensionPoint.controller.ts +17 -5
- package/dist/client/adp/init.js +22 -10
- package/dist/client/adp/init.ts +31 -13
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +4 -4
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +6 -4
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +29 -14
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +22 -9
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +100 -98
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +8 -8
- package/dist/client/adp/sync-views-utils.js +11 -13
- package/dist/client/adp/sync-views-utils.ts +10 -12
- package/dist/client/adp/utils.js +1 -15
- package/dist/client/adp/utils.ts +0 -14
- package/dist/client/cpe/changes/service.js +26 -16
- package/dist/client/cpe/changes/service.ts +28 -21
- package/dist/client/cpe/documentation.js +125 -159
- package/dist/client/cpe/documentation.ts +16 -2
- package/dist/client/cpe/init.js +27 -5
- package/dist/client/cpe/init.ts +29 -4
- package/dist/client/cpe/outline/service.js +12 -3
- package/dist/client/cpe/outline/service.ts +10 -8
- package/dist/client/cpe/quick-actions/quick-action-service.ts +0 -1
- package/dist/client/cpe/selection.js +16 -4
- package/dist/client/cpe/selection.ts +14 -3
- package/dist/client/flp/init.js +28 -11
- package/dist/client/flp/init.ts +36 -19
- package/dist/client/messagebundle.properties +34 -1
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +2 -2
- package/dist/client/utils/info-center-message.js +33 -0
- package/dist/client/utils/info-center-message.ts +60 -0
- package/dist/client/utils/version.js +69 -104
- package/dist/client/utils/version.ts +25 -14
- package/package.json +7 -7
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
ConfigurationValue,
|
|
2
3
|
ExternalAction,
|
|
3
4
|
PendingChange,
|
|
4
|
-
|
|
5
|
+
PendingGenericChange,
|
|
6
|
+
SavedChange,
|
|
5
7
|
SavedControlChange,
|
|
6
|
-
ConfigurationValue,
|
|
7
8
|
SavedGenericChange,
|
|
8
|
-
|
|
9
|
-
PendingGenericChange
|
|
9
|
+
UnknownSavedChange
|
|
10
10
|
} from '@sap-ux-private/control-property-editor-common';
|
|
11
11
|
import {
|
|
12
12
|
changeProperty,
|
|
13
13
|
changeStackModified,
|
|
14
14
|
deletePropertyChanges,
|
|
15
|
-
propertyChangeFailed,
|
|
16
15
|
FlexChangesEndPoints,
|
|
16
|
+
GENERIC_CHANGE_KIND,
|
|
17
|
+
MessageBarType,
|
|
18
|
+
PENDING_CHANGE_TYPE,
|
|
19
|
+
propertyChangeFailed,
|
|
17
20
|
reloadApplication,
|
|
18
|
-
setApplicationRequiresReload,
|
|
19
21
|
save,
|
|
20
|
-
|
|
21
|
-
UNKNOWN_CHANGE_KIND
|
|
22
|
-
GENERIC_CHANGE_KIND
|
|
22
|
+
setApplicationRequiresReload,
|
|
23
|
+
UNKNOWN_CHANGE_KIND
|
|
23
24
|
} from '@sap-ux-private/control-property-editor-common';
|
|
24
|
-
import { applyChange } from './flex-change';
|
|
25
|
-
import type { ActionSenderFunction, SubscribeFunction, UI5AdaptationOptions } from '../types';
|
|
26
|
-
import type Event from 'sap/ui/base/Event';
|
|
27
|
-
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
28
25
|
import Log from 'sap/base/Log';
|
|
29
|
-
import
|
|
26
|
+
import type Event from 'sap/ui/base/Event';
|
|
27
|
+
import UI5Element from 'sap/ui/core/Element';
|
|
30
28
|
import { ChangeDefinition } from 'sap/ui/fl/Change';
|
|
31
|
-
import
|
|
32
|
-
import MessageToast from 'sap/m/MessageToast';
|
|
29
|
+
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
33
30
|
import { getTextBundle } from '../../i18n';
|
|
34
|
-
import { getControlById, isA } from '../../utils/core';
|
|
35
|
-
import UI5Element from 'sap/ui/core/Element';
|
|
36
31
|
import { setAdditionalChangeInfo } from '../../utils/additional-change-info';
|
|
32
|
+
import { getControlById, isA } from '../../utils/core';
|
|
33
|
+
import { getError } from '../../utils/error';
|
|
34
|
+
import { sendInfoCenterMessage } from '../../utils/info-center-message';
|
|
35
|
+
import { modeAndStackChangeHandler } from '../rta-service';
|
|
36
|
+
import type { ActionSenderFunction, SubscribeFunction, UI5AdaptationOptions } from '../types';
|
|
37
|
+
import { applyChange } from './flex-change';
|
|
37
38
|
import {
|
|
38
39
|
ChangeHandler,
|
|
39
40
|
ChangeType,
|
|
@@ -115,6 +116,11 @@ export class ChangeService extends EventTarget {
|
|
|
115
116
|
const modifiedMessage = modifyRTAErrorMessage(error.toString(), id, name);
|
|
116
117
|
const errorMessage =
|
|
117
118
|
modifiedMessage || `RTA Exception applying expression "${action.payload.value}"`;
|
|
119
|
+
await sendInfoCenterMessage({
|
|
120
|
+
title: { key: 'CHANGE_CREATION_FAILED_TITLE' },
|
|
121
|
+
description: errorMessage,
|
|
122
|
+
type: MessageBarType.error
|
|
123
|
+
});
|
|
118
124
|
const propertyChangeFailedAction = propertyChangeFailed({ ...action.payload, errorMessage });
|
|
119
125
|
sendAction(propertyChangeFailedAction);
|
|
120
126
|
}
|
|
@@ -315,7 +321,6 @@ export class ChangeService extends EventTarget {
|
|
|
315
321
|
Log.error('CPE: Change creation Failed', getError(error));
|
|
316
322
|
}
|
|
317
323
|
}
|
|
318
|
-
const resourceBundle = await getTextBundle();
|
|
319
324
|
const eventIndex = this.eventStack.indexOf(event);
|
|
320
325
|
if (this.eventStack.length - 1 === eventIndex) {
|
|
321
326
|
this.pendingChanges = pendingChanges.filter((change): boolean => !!change);
|
|
@@ -324,8 +329,10 @@ export class ChangeService extends EventTarget {
|
|
|
324
329
|
0
|
|
325
330
|
);
|
|
326
331
|
if (changesRequiringReload > this.changesRequiringReload) {
|
|
327
|
-
|
|
328
|
-
|
|
332
|
+
await sendInfoCenterMessage({
|
|
333
|
+
title: { key: 'CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_TITLE' },
|
|
334
|
+
description: { key: 'CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_DESCRIPTION' },
|
|
335
|
+
type: MessageBarType.info
|
|
329
336
|
});
|
|
330
337
|
this.sendAction(setApplicationRequiresReload(changesRequiringReload > 0));
|
|
331
338
|
}
|
|
@@ -1,166 +1,132 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* load ui5 controls design time metadata api.json for following libraries
|
|
20
|
-
* sap.m, sap.ui.comp, sap.f, sap.ui.core
|
|
21
|
-
* loading libraries(more in file size) in parallel during initialization.
|
|
22
|
-
* Others (less in file size) are loaded dynamically in getControlMetadata method
|
|
23
|
-
*/
|
|
24
|
-
const ui5ApiDtMetadata = new Map();
|
|
25
|
-
function loadDefaultLibraries() {
|
|
26
|
-
const allData = Promise.all([getUi5ApiDtMetadata('sap.m'), getUi5ApiDtMetadata('sap.ui.comp'), getUi5ApiDtMetadata('sap.ui.core'), getUi5ApiDtMetadata('sap.f')]);
|
|
27
|
-
allData.then(res => {
|
|
28
|
-
res.forEach(api => {
|
|
29
|
-
if (api.library) {
|
|
30
|
-
ui5ApiDtMetadata.set(api.library, api);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}).catch(reason => Log.error('Loading Library Failed: ' + reason));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Format html text.
|
|
38
|
-
*
|
|
39
|
-
* @param sHtml - html string
|
|
40
|
-
* @returns string
|
|
41
|
-
*/
|
|
42
|
-
function formatHtmlText(sHtml) {
|
|
43
|
-
// replaced "sHtml.replace(new RegExp('<[^>]*>', 'g')" due to regex runtime vulnerability
|
|
44
|
-
const parts = (sHtml || '').split('<');
|
|
45
|
-
let result = '';
|
|
46
|
-
for (const part of parts) {
|
|
47
|
-
if (!result) {
|
|
48
|
-
result = part;
|
|
49
|
-
} else {
|
|
50
|
-
const indexClosingBracket = part.indexOf('>');
|
|
51
|
-
result += indexClosingBracket >= 0 ? part.substring(indexClosingBracket + 1) : `<${part}`;
|
|
52
|
-
}
|
|
1
|
+
'use strict';
|
|
2
|
+
sap.ui.define([
|
|
3
|
+
'./utils',
|
|
4
|
+
'sap/base/Log',
|
|
5
|
+
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
6
|
+
'../utils/info-center-message',
|
|
7
|
+
'../utils/error'
|
|
8
|
+
], function (___utils, Log, ___sap_ux_private_control_property_editor_common, ___utils_info_center_message, ___utils_error) {
|
|
9
|
+
'use strict';
|
|
10
|
+
const getLibrary = ___utils['getLibrary'];
|
|
11
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
12
|
+
const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
|
|
13
|
+
const getError = ___utils_error['getError'];
|
|
14
|
+
async function getUi5ApiDtMetadata(libName) {
|
|
15
|
+
const libUrl = '/test-resources/' + libName.split('.').join('/') + '/designtime/api.json';
|
|
16
|
+
return fetch(libUrl).then(res => res.json());
|
|
53
17
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const properties = selectedControlMetadata['ui5-metadata'].properties;
|
|
76
|
-
if (properties) {
|
|
77
|
-
properties.forEach(prop => {
|
|
78
|
-
prop.description = formatHtmlText(prop.description || '');
|
|
79
|
-
prop.propertyName = prop.name;
|
|
80
|
-
prop.propertyType = prop.type;
|
|
81
|
-
if (prop.defaultValue === null || prop.defaultValue === '') {
|
|
82
|
-
prop.defaultValue = '-';
|
|
83
|
-
}
|
|
84
|
-
controlInfo.properties[prop.name] = {
|
|
85
|
-
...prop
|
|
86
|
-
};
|
|
18
|
+
const ui5ApiDtMetadata = new Map();
|
|
19
|
+
function loadDefaultLibraries() {
|
|
20
|
+
const allData = Promise.all([
|
|
21
|
+
getUi5ApiDtMetadata('sap.m'),
|
|
22
|
+
getUi5ApiDtMetadata('sap.ui.comp'),
|
|
23
|
+
getUi5ApiDtMetadata('sap.ui.core'),
|
|
24
|
+
getUi5ApiDtMetadata('sap.f')
|
|
25
|
+
]);
|
|
26
|
+
allData.then(res => {
|
|
27
|
+
res.forEach(api => {
|
|
28
|
+
if (api.library) {
|
|
29
|
+
ui5ApiDtMetadata.set(api.library, api);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}).catch(reason => {
|
|
33
|
+
Log.error('Loading Library Failed: ' + reason);
|
|
34
|
+
return sendInfoCenterMessage({
|
|
35
|
+
title: { key: 'LIBRARY_ERROR_TITLE' },
|
|
36
|
+
description: getError(reason).message,
|
|
37
|
+
type: MessageBarType.error
|
|
38
|
+
});
|
|
87
39
|
});
|
|
88
|
-
}
|
|
89
40
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
41
|
+
function formatHtmlText(sHtml) {
|
|
42
|
+
const parts = (sHtml || '').split('<');
|
|
43
|
+
let result = '';
|
|
44
|
+
for (const part of parts) {
|
|
45
|
+
if (!result) {
|
|
46
|
+
result = part;
|
|
47
|
+
} else {
|
|
48
|
+
const indexClosingBracket = part.indexOf('>');
|
|
49
|
+
result += indexClosingBracket >= 0 ? part.substring(indexClosingBracket + 1) : `<${ part }`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
function parseControlMetaModel(controlLibMetadata, controlName) {
|
|
55
|
+
const controlInfo = {
|
|
56
|
+
baseType: '',
|
|
57
|
+
doc: '',
|
|
58
|
+
properties: {}
|
|
59
|
+
};
|
|
60
|
+
const selectedControlMetadata = (controlLibMetadata.symbols ?? []).find(control => control.name === controlName);
|
|
61
|
+
if (selectedControlMetadata) {
|
|
62
|
+
controlInfo.baseType = selectedControlMetadata.extends;
|
|
63
|
+
controlInfo.doc = selectedControlMetadata.description ?? '';
|
|
64
|
+
const properties = selectedControlMetadata['ui5-metadata'].properties;
|
|
65
|
+
if (properties) {
|
|
66
|
+
properties.forEach(prop => {
|
|
67
|
+
prop.description = formatHtmlText(prop.description || '');
|
|
68
|
+
prop.propertyName = prop.name;
|
|
69
|
+
prop.propertyType = prop.type;
|
|
70
|
+
if (prop.defaultValue === null || prop.defaultValue === '') {
|
|
71
|
+
prop.defaultValue = '-';
|
|
72
|
+
}
|
|
73
|
+
controlInfo.properties[prop.name] = { ...prop };
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return controlInfo;
|
|
109
78
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*/
|
|
120
|
-
async function getControlPropertyDocumentation(controlName, contLibName) {
|
|
121
|
-
const doc = await getControlMetadata(controlName, contLibName);
|
|
122
|
-
if (doc) {
|
|
123
|
-
const baseControlType = doc.baseType;
|
|
124
|
-
if (baseControlType) {
|
|
125
|
-
const baseContLibName = await getLibrary(baseControlType);
|
|
126
|
-
if (baseContLibName) {
|
|
127
|
-
const baseControlProps = await getControlPropertyDocumentation(baseControlType, baseContLibName);
|
|
128
|
-
return {
|
|
129
|
-
...baseControlProps,
|
|
130
|
-
...doc.properties
|
|
131
|
-
};
|
|
79
|
+
async function getControlMetadata(controlName, contLibName) {
|
|
80
|
+
let result;
|
|
81
|
+
let controlLibMetadata = ui5ApiDtMetadata.get(contLibName);
|
|
82
|
+
if (controlLibMetadata) {
|
|
83
|
+
result = parseControlMetaModel(controlLibMetadata, controlName);
|
|
84
|
+
} else {
|
|
85
|
+
controlLibMetadata = await getUi5ApiDtMetadata(contLibName);
|
|
86
|
+
ui5ApiDtMetadata.set(contLibName, controlLibMetadata);
|
|
87
|
+
result = parseControlMetaModel(controlLibMetadata, controlName);
|
|
132
88
|
}
|
|
133
|
-
|
|
134
|
-
return {
|
|
135
|
-
...doc.properties
|
|
136
|
-
};
|
|
137
|
-
} else {
|
|
138
|
-
return undefined;
|
|
89
|
+
return result;
|
|
139
90
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
91
|
+
async function getControlPropertyDocumentation(controlName, contLibName) {
|
|
92
|
+
const doc = await getControlMetadata(controlName, contLibName);
|
|
93
|
+
if (doc) {
|
|
94
|
+
const baseControlType = doc.baseType;
|
|
95
|
+
if (baseControlType) {
|
|
96
|
+
const baseContLibName = await getLibrary(baseControlType);
|
|
97
|
+
if (baseContLibName) {
|
|
98
|
+
const baseControlProps = await getControlPropertyDocumentation(baseControlType, baseContLibName);
|
|
99
|
+
return {
|
|
100
|
+
...baseControlProps,
|
|
101
|
+
...doc.properties
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return { ...doc.properties };
|
|
106
|
+
} else {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function getDocumentation(controlName, contLibName) {
|
|
111
|
+
let doc;
|
|
112
|
+
try {
|
|
113
|
+
doc = await getControlPropertyDocumentation(controlName, contLibName);
|
|
114
|
+
} catch (err) {
|
|
115
|
+
Log.error(`Error in getting documentation for ${ contLibName }`);
|
|
116
|
+
await sendInfoCenterMessage({
|
|
117
|
+
title: { key: 'DOCUMENTATION_ERROR_TITLE' },
|
|
118
|
+
description: {
|
|
119
|
+
key: 'DOCUMENTATION_ERROR_DESCRIPTION',
|
|
120
|
+
params: [contLibName]
|
|
121
|
+
},
|
|
122
|
+
type: MessageBarType.error
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return doc;
|
|
155
126
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
__exports.loadDefaultLibraries = loadDefaultLibraries;
|
|
163
|
-
__exports.getDocumentation = getDocumentation;
|
|
164
|
-
return __exports;
|
|
165
|
-
});
|
|
166
|
-
//# sourceMappingURL=documentation.js.map
|
|
127
|
+
var __exports = { __esModule: true };
|
|
128
|
+
__exports.getUi5ApiDtMetadata = getUi5ApiDtMetadata;
|
|
129
|
+
__exports.loadDefaultLibraries = loadDefaultLibraries;
|
|
130
|
+
__exports.getDocumentation = getDocumentation;
|
|
131
|
+
return __exports;
|
|
132
|
+
});
|
|
@@ -2,7 +2,9 @@ import { getLibrary } from './utils';
|
|
|
2
2
|
import type { SchemaForApiJsonFiles, Ui5Metadata, Ui5Property } from './api-json';
|
|
3
3
|
import type { Properties } from './utils';
|
|
4
4
|
import Log from 'sap/base/Log';
|
|
5
|
-
import { PropertiesInfo } from '@sap-ux-private/control-property-editor-common';
|
|
5
|
+
import { MessageBarType, PropertiesInfo } from '@sap-ux-private/control-property-editor-common';
|
|
6
|
+
import { sendInfoCenterMessage } from '../utils/info-center-message';
|
|
7
|
+
import { getError } from '../utils/error';
|
|
6
8
|
|
|
7
9
|
export interface ControlMetadata {
|
|
8
10
|
baseType: string | undefined;
|
|
@@ -43,7 +45,14 @@ export function loadDefaultLibraries(): void {
|
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
47
|
})
|
|
46
|
-
.catch((reason) =>
|
|
48
|
+
.catch((reason) => {
|
|
49
|
+
Log.error('Loading Library Failed: ' + reason);
|
|
50
|
+
return sendInfoCenterMessage({
|
|
51
|
+
title: { key: 'LIBRARY_ERROR_TITLE' },
|
|
52
|
+
description: getError(reason).message,
|
|
53
|
+
type: MessageBarType.error
|
|
54
|
+
});
|
|
55
|
+
});
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
/**
|
|
@@ -163,6 +172,11 @@ export async function getDocumentation(controlName: string, contLibName: string)
|
|
|
163
172
|
doc = await getControlPropertyDocumentation(controlName, contLibName);
|
|
164
173
|
} catch (err) {
|
|
165
174
|
Log.error(`Error in getting documentation for ${contLibName}`);
|
|
175
|
+
await sendInfoCenterMessage({
|
|
176
|
+
title: { key: 'DOCUMENTATION_ERROR_TITLE' },
|
|
177
|
+
description: { key: 'DOCUMENTATION_ERROR_DESCRIPTION', params: [contLibName] },
|
|
178
|
+
type: MessageBarType.error
|
|
179
|
+
});
|
|
166
180
|
}
|
|
167
181
|
return doc;
|
|
168
182
|
}
|
package/dist/client/cpe/init.js
CHANGED
|
@@ -12,12 +12,14 @@ sap.ui.define([
|
|
|
12
12
|
'../utils/error',
|
|
13
13
|
'./quick-actions/quick-action-service',
|
|
14
14
|
'./communication-service',
|
|
15
|
-
'./context-menu-service'
|
|
16
|
-
|
|
15
|
+
'./context-menu-service',
|
|
16
|
+
'../utils/info-center-message'
|
|
17
|
+
], function (Log, ___sap_ux_private_control_property_editor_common, ___outline_service, ___selection, ___changes_service, ___documentation, ___ui5_utils, ___connector_service, ___rta_service, ___utils_error, ___quick_actions_quick_action_service, ___communication_service, ___context_menu_service, ___utils_info_center_message) {
|
|
17
18
|
'use strict';
|
|
18
19
|
const iconsLoaded = ___sap_ux_private_control_property_editor_common['iconsLoaded'];
|
|
19
20
|
const enableTelemetry = ___sap_ux_private_control_property_editor_common['enableTelemetry'];
|
|
20
21
|
const appLoaded = ___sap_ux_private_control_property_editor_common['appLoaded'];
|
|
22
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
21
23
|
const OutlineService = ___outline_service['OutlineService'];
|
|
22
24
|
const SelectionService = ___selection['SelectionService'];
|
|
23
25
|
const ChangeService = ___changes_service['ChangeService'];
|
|
@@ -29,6 +31,7 @@ sap.ui.define([
|
|
|
29
31
|
const QuickActionService = ___quick_actions_quick_action_service['QuickActionService'];
|
|
30
32
|
const CommunicationService = ___communication_service['CommunicationService'];
|
|
31
33
|
const ContextMenuService = ___context_menu_service['ContextMenuService'];
|
|
34
|
+
const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
|
|
32
35
|
function init(rta) {
|
|
33
36
|
let registries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
34
37
|
Log.info('Initializing Control Property Editor');
|
|
@@ -59,16 +62,35 @@ sap.ui.define([
|
|
|
59
62
|
loadDefaultLibraries();
|
|
60
63
|
const allPromises = services.map(service => {
|
|
61
64
|
return service.init(CommunicationService.sendAction, subscribe)?.catch(error => {
|
|
62
|
-
|
|
65
|
+
const extendedError = getError(error);
|
|
66
|
+
Log.error('Service Initialization Failed: ', extendedError);
|
|
67
|
+
return sendInfoCenterMessage({
|
|
68
|
+
title: { key: 'INIT_ERROR_TITLE' },
|
|
69
|
+
description: extendedError.message,
|
|
70
|
+
type: MessageBarType.error
|
|
71
|
+
});
|
|
63
72
|
});
|
|
64
73
|
});
|
|
65
74
|
Promise.all(allPromises).then(() => {
|
|
66
75
|
CommunicationService.sendAction(appLoaded());
|
|
67
|
-
}).catch(
|
|
76
|
+
}).catch(error => {
|
|
77
|
+
Log.error(error);
|
|
78
|
+
return sendInfoCenterMessage({
|
|
79
|
+
title: { key: 'INIT_ERROR_TITLE' },
|
|
80
|
+
description: getError(error).message,
|
|
81
|
+
type: MessageBarType.error
|
|
82
|
+
});
|
|
83
|
+
});
|
|
68
84
|
const icons = getIcons();
|
|
69
85
|
CommunicationService.sendAction(iconsLoaded(icons));
|
|
70
86
|
} catch (error) {
|
|
71
|
-
|
|
87
|
+
const extendedError = getError(error);
|
|
88
|
+
Log.error('Error during initialization of Control Property Editor', extendedError);
|
|
89
|
+
void sendInfoCenterMessage({
|
|
90
|
+
title: { key: 'INIT_ERROR_TITLE' },
|
|
91
|
+
description: extendedError.message,
|
|
92
|
+
type: MessageBarType.error
|
|
93
|
+
});
|
|
72
94
|
}
|
|
73
95
|
return Promise.resolve();
|
|
74
96
|
}
|
package/dist/client/cpe/init.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import Log from 'sap/base/Log';
|
|
2
2
|
import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
iconsLoaded,
|
|
6
|
+
enableTelemetry,
|
|
7
|
+
appLoaded,
|
|
8
|
+
MessageBarType
|
|
9
|
+
} from '@sap-ux-private/control-property-editor-common';
|
|
5
10
|
|
|
6
11
|
import type { ActionHandler, Service } from './types';
|
|
7
12
|
import { OutlineService } from './outline/service';
|
|
@@ -16,6 +21,7 @@ import { QuickActionService } from './quick-actions/quick-action-service';
|
|
|
16
21
|
import type { QuickActionDefinitionRegistry } from './quick-actions/registry';
|
|
17
22
|
import { CommunicationService } from './communication-service';
|
|
18
23
|
import { ContextMenuService } from './context-menu-service';
|
|
24
|
+
import { sendInfoCenterMessage } from '../utils/info-center-message';
|
|
19
25
|
|
|
20
26
|
export default function init(
|
|
21
27
|
rta: RuntimeAuthoring,
|
|
@@ -59,7 +65,13 @@ export default function init(
|
|
|
59
65
|
loadDefaultLibraries();
|
|
60
66
|
const allPromises = services.map((service) => {
|
|
61
67
|
return service.init(CommunicationService.sendAction, subscribe)?.catch((error) => {
|
|
62
|
-
|
|
68
|
+
const extendedError = getError(error);
|
|
69
|
+
Log.error('Service Initialization Failed: ', extendedError);
|
|
70
|
+
return sendInfoCenterMessage({
|
|
71
|
+
title: { key: 'INIT_ERROR_TITLE' },
|
|
72
|
+
description: extendedError.message,
|
|
73
|
+
type: MessageBarType.error
|
|
74
|
+
});
|
|
63
75
|
});
|
|
64
76
|
});
|
|
65
77
|
Promise.all(allPromises)
|
|
@@ -67,11 +79,24 @@ export default function init(
|
|
|
67
79
|
CommunicationService.sendAction(appLoaded());
|
|
68
80
|
})
|
|
69
81
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
70
|
-
.catch(
|
|
82
|
+
.catch((error) => {
|
|
83
|
+
Log.error(error);
|
|
84
|
+
return sendInfoCenterMessage({
|
|
85
|
+
title: { key: 'INIT_ERROR_TITLE' },
|
|
86
|
+
description: getError(error).message,
|
|
87
|
+
type: MessageBarType.error
|
|
88
|
+
});
|
|
89
|
+
});
|
|
71
90
|
const icons = getIcons();
|
|
72
91
|
CommunicationService.sendAction(iconsLoaded(icons));
|
|
73
92
|
} catch (error) {
|
|
74
|
-
|
|
93
|
+
const extendedError = getError(error);
|
|
94
|
+
Log.error('Error during initialization of Control Property Editor', extendedError);
|
|
95
|
+
void sendInfoCenterMessage({
|
|
96
|
+
title: { key: 'INIT_ERROR_TITLE' },
|
|
97
|
+
description: extendedError.message,
|
|
98
|
+
type: MessageBarType.error
|
|
99
|
+
});
|
|
75
100
|
}
|
|
76
101
|
|
|
77
102
|
// * This is returned immediately to avoid promise deadlock, preventing services from waiting indefinitely.
|
|
@@ -3,12 +3,15 @@ sap.ui.define([
|
|
|
3
3
|
'sap/base/Log',
|
|
4
4
|
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
5
5
|
'../../utils/error',
|
|
6
|
-
'./nodes'
|
|
7
|
-
|
|
6
|
+
'./nodes',
|
|
7
|
+
'../../utils/info-center-message'
|
|
8
|
+
], function (Log, ___sap_ux_private_control_property_editor_common, ____utils_error, ___nodes, ____utils_info_center_message) {
|
|
8
9
|
'use strict';
|
|
10
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
9
11
|
const outlineChanged = ___sap_ux_private_control_property_editor_common['outlineChanged'];
|
|
10
12
|
const getError = ____utils_error['getError'];
|
|
11
13
|
const transformNodes = ___nodes['transformNodes'];
|
|
14
|
+
const sendInfoCenterMessage = ____utils_info_center_message['sendInfoCenterMessage'];
|
|
12
15
|
const OUTLINE_CHANGE_EVENT = 'OUTLINE_CHANGED';
|
|
13
16
|
class OutlineService extends EventTarget {
|
|
14
17
|
constructor(rta, changeService) {
|
|
@@ -30,7 +33,13 @@ sap.ui.define([
|
|
|
30
33
|
sendAction(outlineChanged(outlineNodes));
|
|
31
34
|
await this.changeService.updateConfigurationProps(configPropertyIdMap);
|
|
32
35
|
} catch (error) {
|
|
33
|
-
|
|
36
|
+
const extendError = getError(error);
|
|
37
|
+
Log.error('Outline sync failed!', extendError);
|
|
38
|
+
await sendInfoCenterMessage({
|
|
39
|
+
title: { key: 'OUTLINE_ERROR_TITLE' },
|
|
40
|
+
description: extendError.message,
|
|
41
|
+
type: MessageBarType.error
|
|
42
|
+
});
|
|
34
43
|
}
|
|
35
44
|
};
|
|
36
45
|
await syncOutline();
|
|
@@ -3,14 +3,13 @@ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
|
|
|
3
3
|
import type RTAOutlineService from 'sap/ui/rta/command/OutlineService';
|
|
4
4
|
|
|
5
5
|
import type { ExternalAction } from '@sap-ux-private/control-property-editor-common';
|
|
6
|
-
import {
|
|
7
|
-
outlineChanged
|
|
8
|
-
} from '@sap-ux-private/control-property-editor-common';
|
|
6
|
+
import { MessageBarType, outlineChanged } from '@sap-ux-private/control-property-editor-common';
|
|
9
7
|
|
|
10
8
|
import { getError } from '../../utils/error';
|
|
11
9
|
import { ControlTreeIndex } from '../types';
|
|
12
10
|
import { transformNodes } from './nodes';
|
|
13
11
|
import { ChangeService } from '../changes';
|
|
12
|
+
import { sendInfoCenterMessage } from '../../utils/info-center-message';
|
|
14
13
|
|
|
15
14
|
export const OUTLINE_CHANGE_EVENT = 'OUTLINE_CHANGED';
|
|
16
15
|
|
|
@@ -21,10 +20,7 @@ export interface OutlineChangedEventDetail {
|
|
|
21
20
|
* A Class of WorkspaceConnectorService
|
|
22
21
|
*/
|
|
23
22
|
export class OutlineService extends EventTarget {
|
|
24
|
-
constructor(
|
|
25
|
-
private readonly rta: RuntimeAuthoring,
|
|
26
|
-
private readonly changeService: ChangeService
|
|
27
|
-
) {
|
|
23
|
+
constructor(private readonly rta: RuntimeAuthoring, private readonly changeService: ChangeService) {
|
|
28
24
|
super();
|
|
29
25
|
}
|
|
30
26
|
|
|
@@ -58,7 +54,13 @@ export class OutlineService extends EventTarget {
|
|
|
58
54
|
sendAction(outlineChanged(outlineNodes));
|
|
59
55
|
await this.changeService.updateConfigurationProps(configPropertyIdMap);
|
|
60
56
|
} catch (error) {
|
|
61
|
-
|
|
57
|
+
const extendError = getError(error);
|
|
58
|
+
Log.error('Outline sync failed!', extendError);
|
|
59
|
+
await sendInfoCenterMessage({
|
|
60
|
+
title: { key: 'OUTLINE_ERROR_TITLE' },
|
|
61
|
+
description: extendError.message,
|
|
62
|
+
type: MessageBarType.error
|
|
63
|
+
});
|
|
62
64
|
}
|
|
63
65
|
};
|
|
64
66
|
await syncOutline();
|