@sap-ux/preview-middleware 0.20.73 → 0.20.74
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 +5 -5
|
@@ -8,8 +8,9 @@ sap.ui.define([
|
|
|
8
8
|
'sap/ui/dt/OverlayRegistry',
|
|
9
9
|
'sap/ui/dt/OverlayUtil',
|
|
10
10
|
'../utils/core',
|
|
11
|
-
'../utils/error'
|
|
12
|
-
|
|
11
|
+
'../utils/error',
|
|
12
|
+
'../utils/info-center-message'
|
|
13
|
+
], function (___sap_ux_private_control_property_editor_common, ___control_data, ___utils, Log, ___documentation, OverlayRegistry, OverlayUtil, ___utils_core, ___utils_error, ___utils_info_center_message) {
|
|
13
14
|
'use strict';
|
|
14
15
|
const controlSelected = ___sap_ux_private_control_property_editor_common['controlSelected'];
|
|
15
16
|
const propertyChanged = ___sap_ux_private_control_property_editor_common['propertyChanged'];
|
|
@@ -17,6 +18,7 @@ sap.ui.define([
|
|
|
17
18
|
const reportTelemetry = ___sap_ux_private_control_property_editor_common['reportTelemetry'];
|
|
18
19
|
const changeProperty = ___sap_ux_private_control_property_editor_common['changeProperty'];
|
|
19
20
|
const PropertyType = ___sap_ux_private_control_property_editor_common['PropertyType'];
|
|
21
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
20
22
|
const buildControlData = ___control_data['buildControlData'];
|
|
21
23
|
const getOverlay = ___utils['getOverlay'];
|
|
22
24
|
const getRuntimeControl = ___utils['getRuntimeControl'];
|
|
@@ -24,6 +26,7 @@ sap.ui.define([
|
|
|
24
26
|
const getComponent = ___utils_core['getComponent'];
|
|
25
27
|
const getControlById = ___utils_core['getControlById'];
|
|
26
28
|
const getError = ___utils_error['getError'];
|
|
29
|
+
const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
|
|
27
30
|
function propertyChangeId(controlId, propertyName) {
|
|
28
31
|
return [
|
|
29
32
|
controlId,
|
|
@@ -67,7 +70,15 @@ sap.ui.define([
|
|
|
67
70
|
const eventOrigin = new Set();
|
|
68
71
|
const onselectionChange = this.createOnSelectionChangeHandler(sendAction, eventOrigin);
|
|
69
72
|
this.rta.attachSelectionChange(event => {
|
|
70
|
-
onselectionChange(event).catch(error =>
|
|
73
|
+
onselectionChange(event).catch(error => {
|
|
74
|
+
const extendedError = getError(error);
|
|
75
|
+
Log.error('Event interrupted: ', extendedError);
|
|
76
|
+
return sendInfoCenterMessage({
|
|
77
|
+
title: { key: 'CHANGE_SELECTION_ERROR_TITLE' },
|
|
78
|
+
description: extendedError.message,
|
|
79
|
+
type: MessageBarType.error
|
|
80
|
+
});
|
|
81
|
+
});
|
|
71
82
|
});
|
|
72
83
|
subscribe(async action => {
|
|
73
84
|
if (changeProperty.match(action)) {
|
|
@@ -152,7 +163,8 @@ sap.ui.define([
|
|
|
152
163
|
});
|
|
153
164
|
}
|
|
154
165
|
} catch (error) {
|
|
155
|
-
|
|
166
|
+
const extendedError = getError(error);
|
|
167
|
+
Log.error('Failed to report telemetry', extendedError);
|
|
156
168
|
} finally {
|
|
157
169
|
await this.buildProperties(runtimeControl, sendAction, overlayControl);
|
|
158
170
|
eventOrigin.delete('outline');
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
reportTelemetry,
|
|
7
7
|
Properties,
|
|
8
8
|
changeProperty,
|
|
9
|
-
PropertyType
|
|
9
|
+
PropertyType,
|
|
10
|
+
MessageBarType
|
|
10
11
|
} from '@sap-ux-private/control-property-editor-common';
|
|
11
12
|
import { buildControlData } from './control-data';
|
|
12
13
|
import { getOverlay, getRuntimeControl, ManagedObjectMetadataProperties, PropertiesInfo } from './utils';
|
|
@@ -24,6 +25,7 @@ import OverlayUtil from 'sap/ui/dt/OverlayUtil';
|
|
|
24
25
|
import { getComponent, getControlById } from '../utils/core';
|
|
25
26
|
import { getError } from '../utils/error';
|
|
26
27
|
import { ChangeService } from './changes';
|
|
28
|
+
import { sendInfoCenterMessage } from '../utils/info-center-message';
|
|
27
29
|
|
|
28
30
|
export interface PropertyChangeParams {
|
|
29
31
|
name: string;
|
|
@@ -112,7 +114,15 @@ export class SelectionService implements Service {
|
|
|
112
114
|
const eventOrigin: Set<string> = new Set();
|
|
113
115
|
const onselectionChange = this.createOnSelectionChangeHandler(sendAction, eventOrigin);
|
|
114
116
|
this.rta.attachSelectionChange((event) => {
|
|
115
|
-
onselectionChange(event).catch((error) =>
|
|
117
|
+
onselectionChange(event).catch((error) => {
|
|
118
|
+
const extendedError = getError(error);
|
|
119
|
+
Log.error('Event interrupted: ', extendedError);
|
|
120
|
+
return sendInfoCenterMessage({
|
|
121
|
+
title: { key: 'CHANGE_SELECTION_ERROR_TITLE' },
|
|
122
|
+
description: extendedError.message,
|
|
123
|
+
type: MessageBarType.error
|
|
124
|
+
});
|
|
125
|
+
});
|
|
116
126
|
});
|
|
117
127
|
subscribe(async (action: ExternalAction): Promise<void> => {
|
|
118
128
|
if (changeProperty.match(action)) {
|
|
@@ -216,7 +226,8 @@ export class SelectionService implements Service {
|
|
|
216
226
|
reportTelemetry({ category: 'Overlay Selection', controlName: name });
|
|
217
227
|
}
|
|
218
228
|
} catch (error) {
|
|
219
|
-
|
|
229
|
+
const extendedError = getError(error);
|
|
230
|
+
Log.error('Failed to report telemetry', extendedError);
|
|
220
231
|
} finally {
|
|
221
232
|
await this.buildProperties(runtimeControl, sendAction, overlayControl);
|
|
222
233
|
eventOrigin.delete('outline');
|
package/dist/client/flp/init.js
CHANGED
|
@@ -9,9 +9,8 @@ sap.ui.define([
|
|
|
9
9
|
'./initCdm',
|
|
10
10
|
'./initConnectors',
|
|
11
11
|
'../utils/version',
|
|
12
|
-
'../
|
|
13
|
-
|
|
14
|
-
], function (Log, ___sap_ux_private_control_property_editor_common, IconPool, ResourceBundle, ___adp_api_handler, ___utils_error, __initCdm, __initConnectors, ___utils_version, ___cpe_communication_service, ___i18n) {
|
|
12
|
+
'../utils/info-center-message'
|
|
13
|
+
], function (Log, ___sap_ux_private_control_property_editor_common, IconPool, ResourceBundle, ___adp_api_handler, ___utils_error, __initCdm, __initConnectors, ___utils_version, ___utils_info_center_message) {
|
|
15
14
|
'use strict';
|
|
16
15
|
function _interopRequireDefault(obj) {
|
|
17
16
|
return obj && obj.__esModule && typeof obj.default !== 'undefined' ? obj.default : obj;
|
|
@@ -29,16 +28,15 @@ sap.ui.define([
|
|
|
29
28
|
});
|
|
30
29
|
});
|
|
31
30
|
}
|
|
31
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
32
32
|
const SCENARIO = ___sap_ux_private_control_property_editor_common['SCENARIO'];
|
|
33
|
-
const showMessage = ___sap_ux_private_control_property_editor_common['showMessage'];
|
|
34
33
|
const getManifestAppdescr = ___adp_api_handler['getManifestAppdescr'];
|
|
35
34
|
const getError = ___utils_error['getError'];
|
|
36
35
|
const initCdm = _interopRequireDefault(__initCdm);
|
|
37
36
|
const initConnectors = _interopRequireDefault(__initConnectors);
|
|
38
37
|
const getUi5Version = ___utils_version['getUi5Version'];
|
|
39
38
|
const isLowerThanMinimalUi5Version = ___utils_version['isLowerThanMinimalUi5Version'];
|
|
40
|
-
const
|
|
41
|
-
const getTextBundle = ___i18n['getTextBundle'];
|
|
39
|
+
const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
|
|
42
40
|
const UI5_LIBS = [
|
|
43
41
|
'sap.apf',
|
|
44
42
|
'sap.base',
|
|
@@ -144,6 +142,11 @@ sap.ui.define([
|
|
|
144
142
|
registerModules(await response.json());
|
|
145
143
|
} catch (error) {
|
|
146
144
|
Log.error(`Registering of reuse libs failed. Error:${ error }`);
|
|
145
|
+
await sendInfoCenterMessage({
|
|
146
|
+
title: { key: 'FLP_REGISTER_LIBS_FAILED_TITLE' },
|
|
147
|
+
description: getError(error).message,
|
|
148
|
+
type: MessageBarType.error
|
|
149
|
+
});
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|
|
@@ -232,6 +235,11 @@ sap.ui.define([
|
|
|
232
235
|
try {
|
|
233
236
|
await startAdaptation(options, pluginScript);
|
|
234
237
|
} catch (error) {
|
|
238
|
+
await sendInfoCenterMessage({
|
|
239
|
+
title: { key: 'FLP_ADAPTATION_START_FAILED_TITLE' },
|
|
240
|
+
description: getError(error).message,
|
|
241
|
+
type: MessageBarType.error
|
|
242
|
+
});
|
|
235
243
|
await handleHigherLayerChanges(error, ui5VersionInfo);
|
|
236
244
|
}
|
|
237
245
|
});
|
|
@@ -251,6 +259,11 @@ sap.ui.define([
|
|
|
251
259
|
});
|
|
252
260
|
} else {
|
|
253
261
|
Log.warning('Card generator is not supported for the current UI5 version.');
|
|
262
|
+
await sendInfoCenterMessage({
|
|
263
|
+
title: { key: 'FLP_CARD_GENERATOR_NOT_SUPPORTED_TITLE' },
|
|
264
|
+
description: { key: 'FLP_CARD_GENERATOR_NOT_SUPPORTED_DESCRIPTION' },
|
|
265
|
+
type: MessageBarType.warning
|
|
266
|
+
});
|
|
254
267
|
}
|
|
255
268
|
if (urlParams.get('fiori-tools-iapp-state')?.toLocaleLowerCase() !== 'true') {
|
|
256
269
|
await resetAppState(container);
|
|
@@ -282,6 +295,11 @@ sap.ui.define([
|
|
|
282
295
|
}).catch(e => {
|
|
283
296
|
const error = getError(e);
|
|
284
297
|
Log.error('Sandbox initialization failed: ' + error.message);
|
|
298
|
+
return sendInfoCenterMessage({
|
|
299
|
+
title: { key: 'FLP_SANDBOX_INIT_FAILED_TITLE' },
|
|
300
|
+
description: error.message,
|
|
301
|
+
type: MessageBarType.error
|
|
302
|
+
});
|
|
285
303
|
});
|
|
286
304
|
}
|
|
287
305
|
async function handleHigherLayerChanges(error, ui5VersionInfo) {
|
|
@@ -291,12 +309,11 @@ sap.ui.define([
|
|
|
291
309
|
major: 1,
|
|
292
310
|
minor: 84
|
|
293
311
|
})) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
312
|
+
await sendInfoCenterMessage({
|
|
313
|
+
title: { key: 'HIGHER_LAYER_CHANGES_TITLE' },
|
|
314
|
+
description: { key: 'HIGHER_LAYER_CHANGES_INFO_MESSAGE' },
|
|
315
|
+
type: MessageBarType.warning
|
|
298
316
|
});
|
|
299
|
-
CommunicationService.sendAction(action);
|
|
300
317
|
}
|
|
301
318
|
window.location.reload();
|
|
302
319
|
}
|
package/dist/client/flp/init.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Log from 'sap/base/Log';
|
|
2
2
|
import type AppLifeCycle from 'sap/ushell/services/AppLifeCycle';
|
|
3
3
|
import type { InitRtaScript, RTAPlugin, StartAdaptation } from 'sap/ui/rta/api/startAdaptation';
|
|
4
|
-
import {
|
|
4
|
+
import { MessageBarType, SCENARIO, type Scenario } from '@sap-ux-private/control-property-editor-common';
|
|
5
5
|
import type { FlexSettings, RTAOptions } from 'sap/ui/rta/RuntimeAuthoring';
|
|
6
6
|
import IconPool from 'sap/ui/core/IconPool';
|
|
7
7
|
import ResourceBundle from 'sap/base/i18n/ResourceBundle';
|
|
@@ -11,11 +11,10 @@ import { getError } from '../utils/error';
|
|
|
11
11
|
import initCdm from './initCdm';
|
|
12
12
|
import initConnectors from './initConnectors';
|
|
13
13
|
import { getUi5Version, isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
|
|
14
|
-
import { CommunicationService } from '../cpe/communication-service';
|
|
15
|
-
import { getTextBundle } from '../i18n';
|
|
16
14
|
import type Component from 'sap/ui/core/Component';
|
|
17
15
|
import type Extension from 'sap/ushell/services/Extension';
|
|
18
16
|
import type { CardGeneratorType } from 'sap/cards/ap/generator';
|
|
17
|
+
import { sendInfoCenterMessage } from '../utils/info-center-message';
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* SAPUI5 delivered namespaces from https://ui5.sap.com/#/api/sap
|
|
@@ -197,6 +196,11 @@ export async function registerComponentDependencyPaths(appUrls: string[], urlPar
|
|
|
197
196
|
registerModules((await response.json()) as AppIndexData);
|
|
198
197
|
} catch (error) {
|
|
199
198
|
Log.error(`Registering of reuse libs failed. Error:${error}`);
|
|
199
|
+
await sendInfoCenterMessage({
|
|
200
|
+
title: { key: 'FLP_REGISTER_LIBS_FAILED_TITLE' },
|
|
201
|
+
description: getError(error).message,
|
|
202
|
+
type: MessageBarType.error
|
|
203
|
+
});
|
|
200
204
|
}
|
|
201
205
|
}
|
|
202
206
|
}
|
|
@@ -256,14 +260,12 @@ export function setI18nTitle(resourceBundle: ResourceBundle, i18nKey = 'appTitle
|
|
|
256
260
|
|
|
257
261
|
/**
|
|
258
262
|
* This function dynamically adds a "Generate Card" action to the SAP Fiori Launchpad for the given component instance.
|
|
259
|
-
*
|
|
263
|
+
*
|
|
260
264
|
* @param componentInstance - The instance of the component for which the card generation action is being added.
|
|
261
265
|
* @param container - The SAP Fiori Launchpad container instance used to access services.
|
|
262
266
|
*/
|
|
263
|
-
function addCardGenerationUserAction(componentInstance
|
|
264
|
-
sap.ui.require([
|
|
265
|
-
'sap/cards/ap/generator/CardGenerator'
|
|
266
|
-
], async (CardGenerator : CardGeneratorType) => {
|
|
267
|
+
function addCardGenerationUserAction(componentInstance: Component, container: typeof sap.ushell.Container) {
|
|
268
|
+
sap.ui.require(['sap/cards/ap/generator/CardGenerator'], async (CardGenerator: CardGeneratorType) => {
|
|
267
269
|
const extensionService = await container.getServiceAsync<Extension>('Extension');
|
|
268
270
|
const controlProperties = {
|
|
269
271
|
icon: 'sap-icon://add',
|
|
@@ -303,7 +305,7 @@ export async function init({
|
|
|
303
305
|
flex?: string | null;
|
|
304
306
|
customInit?: string | null;
|
|
305
307
|
enhancedHomePage?: boolean | null;
|
|
306
|
-
enableCardGenerator?: boolean
|
|
308
|
+
enableCardGenerator?: boolean;
|
|
307
309
|
}): Promise<void> {
|
|
308
310
|
// Set CDM configuration before importing ushell container
|
|
309
311
|
// to ensure proper configuration pickup during bootstrap
|
|
@@ -312,8 +314,9 @@ export async function init({
|
|
|
312
314
|
}
|
|
313
315
|
|
|
314
316
|
const urlParams = new URLSearchParams(window.location.search);
|
|
315
|
-
const container =
|
|
316
|
-
|
|
317
|
+
const container =
|
|
318
|
+
sap?.ushell?.Container ??
|
|
319
|
+
((await import('sap/ushell/Container')).default as unknown as typeof sap.ushell.Container);
|
|
317
320
|
let scenario: string = '';
|
|
318
321
|
const ui5VersionInfo = await getUi5Version();
|
|
319
322
|
// Register RTA if configured
|
|
@@ -352,6 +355,11 @@ export async function init({
|
|
|
352
355
|
try {
|
|
353
356
|
await startAdaptation(options, pluginScript);
|
|
354
357
|
} catch (error) {
|
|
358
|
+
await sendInfoCenterMessage({
|
|
359
|
+
title: { key: 'FLP_ADAPTATION_START_FAILED_TITLE' },
|
|
360
|
+
description: getError(error).message,
|
|
361
|
+
type: MessageBarType.error
|
|
362
|
+
});
|
|
355
363
|
await handleHigherLayerChanges(error, ui5VersionInfo);
|
|
356
364
|
}
|
|
357
365
|
}
|
|
@@ -367,9 +375,14 @@ export async function init({
|
|
|
367
375
|
addCardGenerationUserAction(componentInstance as unknown as Component, container);
|
|
368
376
|
});
|
|
369
377
|
});
|
|
370
|
-
} else {
|
|
378
|
+
} else {
|
|
371
379
|
Log.warning('Card generator is not supported for the current UI5 version.');
|
|
372
|
-
|
|
380
|
+
await sendInfoCenterMessage({
|
|
381
|
+
title: { key: 'FLP_CARD_GENERATOR_NOT_SUPPORTED_TITLE' },
|
|
382
|
+
description: { key: 'FLP_CARD_GENERATOR_NOT_SUPPORTED_DESCRIPTION' },
|
|
383
|
+
type: MessageBarType.warning
|
|
384
|
+
});
|
|
385
|
+
}
|
|
373
386
|
|
|
374
387
|
// reset app state if requested
|
|
375
388
|
if (urlParams.get('fiori-tools-iapp-state')?.toLocaleLowerCase() !== 'true') {
|
|
@@ -399,7 +412,7 @@ export async function init({
|
|
|
399
412
|
}
|
|
400
413
|
|
|
401
414
|
const renderer =
|
|
402
|
-
|
|
415
|
+
ui5VersionInfo.major < 2 && !ui5VersionInfo.label?.includes('legacy-free')
|
|
403
416
|
? await container.createRenderer(undefined, true)
|
|
404
417
|
: await container.createRendererInternal(undefined, true);
|
|
405
418
|
renderer.placeAt('content');
|
|
@@ -417,6 +430,11 @@ if (bootstrapConfig) {
|
|
|
417
430
|
}).catch((e) => {
|
|
418
431
|
const error = getError(e);
|
|
419
432
|
Log.error('Sandbox initialization failed: ' + error.message);
|
|
433
|
+
return sendInfoCenterMessage({
|
|
434
|
+
title: { key: 'FLP_SANDBOX_INIT_FAILED_TITLE' },
|
|
435
|
+
description: error.message,
|
|
436
|
+
type: MessageBarType.error
|
|
437
|
+
});
|
|
420
438
|
});
|
|
421
439
|
}
|
|
422
440
|
|
|
@@ -432,12 +450,11 @@ export async function handleHigherLayerChanges(error: unknown, ui5VersionInfo: U
|
|
|
432
450
|
const err = getError(error);
|
|
433
451
|
if (err.message.includes('Reload triggered')) {
|
|
434
452
|
if (!isLowerThanMinimalUi5Version(ui5VersionInfo, { major: 1, minor: 84 })) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
453
|
+
await sendInfoCenterMessage({
|
|
454
|
+
title: { key: 'HIGHER_LAYER_CHANGES_TITLE' },
|
|
455
|
+
description: { key: 'HIGHER_LAYER_CHANGES_INFO_MESSAGE' },
|
|
456
|
+
type: MessageBarType.warning
|
|
439
457
|
});
|
|
440
|
-
CommunicationService.sendAction(action);
|
|
441
458
|
}
|
|
442
459
|
|
|
443
460
|
// eslint-disable-next-line fiori-custom/sap-no-location-reload
|
|
@@ -52,10 +52,43 @@ ADP_ADD_FRAGMENT_MENU_ITEM_UNSTABLE_ID = Add: Fragment (This action is disabled
|
|
|
52
52
|
ADP_ADD_CONTROLLER_EXTENSION_MENU_ITEM = Extend Controller
|
|
53
53
|
ADP_ADD_CONTROLLER_EXTENSION_MENU_ITEM_REUSE_COMPONENT = Extend Controller (This action is disabled because the control is a reuse component)
|
|
54
54
|
ADP_ADD_CONTROLLER_EXTENSION_MENU_ITEM_SYNC_VIEW = Extend Controller (This action is disabled because the controls are part of a synchronous view)
|
|
55
|
-
|
|
55
|
+
ADP_SYNC_VIEWS_TITLE = Synchronous Views Detected
|
|
56
|
+
ADP_CREATE_XML_FRAGMENT_TITLE = Create XML Fragment
|
|
57
|
+
ADP_CREATE_XML_FRAGMENT_DESCRIPTION = Note: The ''{0}.fragment.xml'' fragment will be created once you save the change.
|
|
58
|
+
ADP_GET_COMMAND_FAILURE_TITLE = Get Command Failed
|
|
59
|
+
ADP_GET_COMMAND_FAILURE_DESCRIPTION = Could not get the command for ''{0}''. {1}.
|
|
60
|
+
ADP_GET_COMPOSITE_COMMAND_FAILURE_DESCRIPTION = Could not get the composite command. {0}.
|
|
61
|
+
ADP_RUN_COMMAND_FAILED_TITLE = Run Command Failed
|
|
62
|
+
ADP_ADD_FRAGMENT_FAILURE_TITLE = Add Fragment Failed
|
|
63
|
+
ADP_GET_FRAGMENTS_FAILURE_TITLE = Get Fragments Failed
|
|
64
|
+
ADP_CONTROLLER_ERROR_TITLE = Controller Error
|
|
65
|
+
ADP_EXTENSION_POINT_ERROR_TITLE = Extension Point Error
|
|
66
|
+
ADP_GET_ANNOTATION_ERROR_TITLE = Get Annotation Error
|
|
67
|
+
ADP_CREATE_CONTROLLER_EXTENSION_TITLE = Create Controller Extension
|
|
68
|
+
ADP_CREATE_CONTROLLER_EXTENSION_DESCRIPTION = Controller extension with name ''{0}'' was created.
|
|
69
|
+
CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_TITLE = Save and Reload Required
|
|
70
|
+
CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_DESCRIPTION = Note: The change will be visible after save and reload.
|
|
71
|
+
CHANGE_CREATION_FAILED_TITLE = Change Creation Failed
|
|
72
|
+
OUTLINE_ERROR_TITLE = Outline Update Failed
|
|
73
|
+
DOCUMENTATION_ERROR_TITLE = Documentation Error
|
|
74
|
+
DOCUMENTATION_ERROR_DESCRIPTION = An error occurred in getting documentation for {0}. Check the control exists and try again.
|
|
75
|
+
LIBRARY_ERROR_TITLE = Library Error
|
|
76
|
+
INIT_ERROR_TITLE = Control Property Editor Initialization Failed
|
|
77
|
+
CHANGE_SELECTION_ERROR_TITLE = Change Selection Error
|
|
78
|
+
FLP_REGISTER_LIBS_FAILED_TITLE = Registering of Reuse Libraries Failed
|
|
79
|
+
FLP_ADAPTATION_START_FAILED_TITLE = Adaptation Initialization Failed
|
|
80
|
+
FLP_SANDBOX_INIT_FAILED_TITLE = Sandbox Initialization Failed
|
|
81
|
+
FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE = SAPUI5 Version Retrieval Failed
|
|
82
|
+
FLP_UI_INVALID_UI5_VERSION_DESCRIPTION = Invalid version info
|
|
83
|
+
FLP_UI_VERSION_RETRIEVAL_FAILURE_DESCRIPTION = Could not get the SAPUI5 version of the application. Using {0} as fallback.
|
|
84
|
+
FLP_UI5_VERSION_WARNING_TITLE = SAPUI5 Version Warning
|
|
85
|
+
FLP_UI5_VERSION_WARNING_DESCRIPTION = The current SAPUI5 version set for this adaptation project is {0}. The minimum version for SAPUI5 Adaptation Project and its SAPUI5 Adaptation Editor is {1}. Install version {1} or higher.
|
|
86
|
+
FLP_CARD_GENERATOR_NOT_SUPPORTED_TITLE = Card Generator Not Supported
|
|
87
|
+
FLP_CARD_GENERATOR_NOT_SUPPORTED_DESCRIPTION = The card generator is not supported by the SAPUI5 version you have installed. Install a supported version.
|
|
56
88
|
|
|
57
89
|
TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN=At least one table row is required to create a new custom column. Make sure the table data is loaded and try again.
|
|
58
90
|
|
|
91
|
+
HIGHER_LAYER_CHANGES_TITLE = Higher Layer Changes Detected
|
|
59
92
|
HIGHER_LAYER_CHANGES_INFO_MESSAGE=The preview of the project was reloaded due to detected changes in higher layer than the one used in your project.
|
|
60
93
|
|
|
61
94
|
TABLE_CUSTOM_COLUMN_ACTION_NOT_AVAILABLE=This action has been disabled because the table rows are not available. Please load the table data and try again
|
|
@@ -8,7 +8,7 @@ sap.ui.define((function () { 'use strict';
|
|
|
8
8
|
|
|
9
9
|
(function (exports) {
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.requestControlContextMenu = exports.showInfoCenterMessage = exports.externalFileChange = exports.setApplicationRequiresReload = exports.executeContextMenuAction = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.
|
|
11
|
+
exports.requestControlContextMenu = exports.showInfoCenterMessage = exports.externalFileChange = exports.setApplicationRequiresReload = exports.executeContextMenuAction = exports.executeQuickAction = exports.updateQuickAction = exports.quickActionListChanged = exports.save = exports.redo = exports.undo = exports.appLoaded = exports.setSaveEnablement = exports.setUndoRedoEnablement = exports.applicationModeChanged = exports.setAppMode = exports.storageFileChanged = exports.reloadApplication = exports.toggleAppPreviewVisibility = exports.changeStackModified = exports.propertyChangeFailed = exports.propertyChanged = exports.changeProperty = exports.outlineChanged = exports.deletePropertyChanges = exports.addExtensionPoint = exports.selectControl = exports.controlSelected = exports.iconsLoaded = exports.EXTERNAL_ACTION_PREFIX = exports.REJECTED_SUFFIX = exports.FULFILLED_SUFFIX = exports.PENDING_SUFFIX = exports.MessageBarType = exports.NESTED_QUICK_ACTION_KIND = exports.SIMPLE_QUICK_ACTION_KIND = exports.CONTROL_CHANGE_KIND = exports.GENERIC_CHANGE_KIND = exports.UNKNOWN_CHANGE_KIND = exports.SAVED_CHANGE_TYPE = exports.PENDING_CHANGE_TYPE = exports.PropertyType = exports.SCENARIO = exports.CHECKBOX_EDITOR_TYPE = exports.DROPDOWN_EDITOR_TYPE = exports.INPUT_EDITOR_TYPE = exports.STRING_VALUE_TYPE = exports.FLOAT_VALUE_TYPE = exports.INTEGER_VALUE_TYPE = exports.BOOLEAN_VALUE_TYPE = void 0;
|
|
12
12
|
exports.createAsyncActionFactory = createAsyncActionFactory;
|
|
13
13
|
exports.BOOLEAN_VALUE_TYPE = 'boolean';
|
|
14
14
|
exports.INTEGER_VALUE_TYPE = 'integer';
|
|
@@ -161,7 +161,7 @@ sap.ui.define((function () { 'use strict';
|
|
|
161
161
|
exports.propertyChanged = createExternalAction('property-changed');
|
|
162
162
|
exports.propertyChangeFailed = createExternalAction('change-property-failed');
|
|
163
163
|
exports.changeStackModified = createExternalAction('change-stack-modified');
|
|
164
|
-
exports.
|
|
164
|
+
exports.toggleAppPreviewVisibility = createExternalAction('toggle-app-preview-visibility');
|
|
165
165
|
exports.reloadApplication = createExternalAction('reload-application');
|
|
166
166
|
exports.storageFileChanged = createExternalAction('storage-file-changed');
|
|
167
167
|
exports.setAppMode = createExternalAction('set-app-mode');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
sap.ui.define([
|
|
3
|
+
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
4
|
+
'../cpe/communication-service',
|
|
5
|
+
'../i18n'
|
|
6
|
+
], function (___sap_ux_private_control_property_editor_common, ___cpe_communication_service, ___i18n) {
|
|
7
|
+
'use strict';
|
|
8
|
+
const showInfoCenterMessage = ___sap_ux_private_control_property_editor_common['showInfoCenterMessage'];
|
|
9
|
+
const CommunicationService = ___cpe_communication_service['CommunicationService'];
|
|
10
|
+
const getTextBundle = ___i18n['getTextBundle'];
|
|
11
|
+
async function sendInfoCenterMessage(_ref) {
|
|
12
|
+
let {title, description, details, type} = _ref;
|
|
13
|
+
CommunicationService.sendAction(showInfoCenterMessage({
|
|
14
|
+
title: await getTranslation(title),
|
|
15
|
+
description: await getTranslation(description),
|
|
16
|
+
details: await getTranslation(details),
|
|
17
|
+
type
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
async function getTranslation(value) {
|
|
21
|
+
if (value === undefined) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
if (typeof value === 'string') {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
const bundle = await getTextBundle();
|
|
28
|
+
return bundle.getText(value.key, value.params);
|
|
29
|
+
}
|
|
30
|
+
var __exports = { __esModule: true };
|
|
31
|
+
__exports.sendInfoCenterMessage = sendInfoCenterMessage;
|
|
32
|
+
return __exports;
|
|
33
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MessageBarType, showInfoCenterMessage } from '@sap-ux-private/control-property-editor-common';
|
|
2
|
+
import { CommunicationService } from '../cpe/communication-service';
|
|
3
|
+
import { getTextBundle } from '../i18n';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Localization key interface for defining message keys and optional parameters.
|
|
7
|
+
*/
|
|
8
|
+
interface LocalizationKey {
|
|
9
|
+
key: string;
|
|
10
|
+
params?: string[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* InfoCenterMessage interface for defining the structure of an Info center message.
|
|
15
|
+
* It includes title, description, optional details, and type.
|
|
16
|
+
*/
|
|
17
|
+
interface InfoCenterMessage {
|
|
18
|
+
title: LocalizationKey | string;
|
|
19
|
+
description: LocalizationKey | string;
|
|
20
|
+
details?: LocalizationKey | string;
|
|
21
|
+
type: MessageBarType;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Shows a localized/plain string message in the Info center.
|
|
26
|
+
*
|
|
27
|
+
* @param {InfoCenterMessage} message - The message object containing title, description,
|
|
28
|
+
* details and type for the message. Each text in the message can be localized or
|
|
29
|
+
* left as a plain string.
|
|
30
|
+
*/
|
|
31
|
+
export async function sendInfoCenterMessage({ title, description, details, type }: InfoCenterMessage): Promise<void> {
|
|
32
|
+
CommunicationService.sendAction(
|
|
33
|
+
showInfoCenterMessage({
|
|
34
|
+
title: (await getTranslation(title))!,
|
|
35
|
+
description: (await getTranslation(description))!,
|
|
36
|
+
details: await getTranslation(details),
|
|
37
|
+
type
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Util function which returns translation for a localization key or a plain string.
|
|
44
|
+
* If the value is undefined, it returns undefined.
|
|
45
|
+
*
|
|
46
|
+
* @param {LocalizationKey | string | undefined} value - The localization key, plain string or undefined.
|
|
47
|
+
* @returns {Promise<string>} A promise that resolves to the translated string.
|
|
48
|
+
*/
|
|
49
|
+
async function getTranslation(value: LocalizationKey | string | undefined): Promise<string | undefined> {
|
|
50
|
+
if (value === undefined) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (typeof value === 'string') {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const bundle = await getTextBundle();
|
|
59
|
+
return bundle.getText(value.key, value.params);
|
|
60
|
+
}
|