@sap-ux/preview-middleware 0.20.72 → 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.
Files changed (48) hide show
  1. package/dist/client/adp/api-handler.js +2 -2
  2. package/dist/client/adp/api-handler.ts +2 -2
  3. package/dist/client/adp/command-executor.js +66 -76
  4. package/dist/client/adp/command-executor.ts +28 -13
  5. package/dist/client/adp/controllers/AddCustomFragment.controller.js +22 -8
  6. package/dist/client/adp/controllers/AddCustomFragment.controller.ts +16 -6
  7. package/dist/client/adp/controllers/AddFragment.controller.js +32 -18
  8. package/dist/client/adp/controllers/AddFragment.controller.ts +23 -13
  9. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +35 -19
  10. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +26 -20
  11. package/dist/client/adp/controllers/BaseDialog.controller.js +1 -9
  12. package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -14
  13. package/dist/client/adp/controllers/ControllerExtension.controller.js +252 -267
  14. package/dist/client/adp/controllers/ControllerExtension.controller.ts +61 -17
  15. package/dist/client/adp/controllers/ExtensionPoint.controller.js +115 -140
  16. package/dist/client/adp/controllers/ExtensionPoint.controller.ts +17 -5
  17. package/dist/client/adp/init.js +22 -10
  18. package/dist/client/adp/init.ts +31 -13
  19. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +4 -4
  20. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +6 -4
  21. package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +29 -14
  22. package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +22 -9
  23. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +100 -98
  24. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +8 -8
  25. package/dist/client/adp/sync-views-utils.js +11 -13
  26. package/dist/client/adp/sync-views-utils.ts +10 -12
  27. package/dist/client/adp/utils.js +1 -15
  28. package/dist/client/adp/utils.ts +0 -14
  29. package/dist/client/cpe/changes/service.js +26 -16
  30. package/dist/client/cpe/changes/service.ts +28 -21
  31. package/dist/client/cpe/documentation.js +125 -159
  32. package/dist/client/cpe/documentation.ts +16 -2
  33. package/dist/client/cpe/init.js +27 -5
  34. package/dist/client/cpe/init.ts +29 -4
  35. package/dist/client/cpe/outline/service.js +12 -3
  36. package/dist/client/cpe/outline/service.ts +10 -8
  37. package/dist/client/cpe/quick-actions/quick-action-service.ts +0 -1
  38. package/dist/client/cpe/selection.js +16 -4
  39. package/dist/client/cpe/selection.ts +14 -3
  40. package/dist/client/flp/init.js +28 -11
  41. package/dist/client/flp/init.ts +36 -19
  42. package/dist/client/messagebundle.properties +34 -1
  43. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +2 -2
  44. package/dist/client/utils/info-center-message.js +33 -0
  45. package/dist/client/utils/info-center-message.ts +60 -0
  46. package/dist/client/utils/version.js +69 -104
  47. package/dist/client/utils/version.ts +25 -14
  48. package/package.json +5 -5
@@ -41,8 +41,8 @@ sap.ui.define(["../utils/error"], function (___utils_error) {
41
41
  const response = await fetch(endpoint, config);
42
42
  if (!response.ok) {
43
43
  const errorData = await response.json();
44
- const message = errorData?.message ?? '';
45
- throw new Error(`Request failed, status: ${response.status}. ${message}`.trim());
44
+ const message = errorData?.message ? ` Server message: ${errorData.message}.` : '';
45
+ throw new Error(`Request failed, status: ${response.status}.${message}`);
46
46
  }
47
47
  switch (method) {
48
48
  case RequestMethod.GET:
@@ -87,8 +87,8 @@ export async function request<T>(endpoint: ApiEndpoints, method: RequestMethod,
87
87
 
88
88
  if (!response.ok) {
89
89
  const errorData = (await response.json()) as ResponseMessage;
90
- const message = errorData?.message ?? '';
91
- throw new Error(`Request failed, status: ${response.status}. ${message}`.trim());
90
+ const message = errorData?.message ? ` Server message: ${errorData.message}.` : '';
91
+ throw new Error(`Request failed, status: ${response.status}.${message}`);
92
92
  }
93
93
 
94
94
  switch (method) {
@@ -1,77 +1,67 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/m/MessageToast", "sap/ui/rta/command/CommandFactory", "../utils/error"], function (MessageToast, CommandFactory, ___utils_error) {
4
- "use strict";
5
-
6
- const getError = ___utils_error["getError"];
7
- /**
8
- * Class responsible for handling rta calls
9
- */
10
- class CommandExecutor {
11
- /**
12
- *
13
- * @param rta Runtime Authoring
14
- */
15
- constructor(rta) {
16
- this.rta = rta;
1
+ 'use strict';
2
+ sap.ui.define([
3
+ 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
4
+ 'sap/ui/rta/command/CommandFactory',
5
+ '../utils/error',
6
+ '../utils/info-center-message'
7
+ ], function (___sap_ux_private_control_property_editor_common, CommandFactory, ___utils_error, ___utils_info_center_message) {
8
+ 'use strict';
9
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
10
+ const getError = ___utils_error['getError'];
11
+ const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
12
+ class CommandExecutor {
13
+ constructor(rta) {
14
+ this.rta = rta;
15
+ }
16
+ async getCommand(runtimeControl, commandName, modifiedValue, flexSettings, designMetadata) {
17
+ try {
18
+ return await CommandFactory.getCommandFor(runtimeControl, commandName, modifiedValue, designMetadata, flexSettings);
19
+ } catch (e) {
20
+ const error = getError(e);
21
+ await sendInfoCenterMessage({
22
+ title: { key: 'ADP_GET_COMMAND_FAILURE_TITLE' },
23
+ description: {
24
+ key: 'ADP_GET_COMMAND_FAILURE_DESCRIPTION',
25
+ params: [
26
+ commandName,
27
+ error.message
28
+ ]
29
+ },
30
+ type: MessageBarType.error
31
+ });
32
+ error.message = `Could not get command for '${ commandName }'. ${ error.message }`;
33
+ throw error;
34
+ }
35
+ }
36
+ async createCompositeCommand(runtimeControl) {
37
+ try {
38
+ return await CommandFactory.getCommandFor(runtimeControl, 'composite');
39
+ } catch (e) {
40
+ const error = getError(e);
41
+ await sendInfoCenterMessage({
42
+ title: { key: 'ADP_GET_COMMAND_FAILURE_TITLE' },
43
+ description: {
44
+ key: 'ADP_GET_COMPOSITE_COMMAND_FAILURE_DESCRIPTION',
45
+ params: [error.message]
46
+ },
47
+ type: MessageBarType.error
48
+ });
49
+ throw error;
50
+ }
51
+ }
52
+ async pushAndExecuteCommand(command) {
53
+ try {
54
+ await this.rta.getCommandStack().pushAndExecute(command);
55
+ } catch (e) {
56
+ const error = getError(e);
57
+ await sendInfoCenterMessage({
58
+ title: { key: 'ADP_RUN_COMMAND_FAILED_TITLE' },
59
+ description: error.message,
60
+ type: MessageBarType.error
61
+ });
62
+ throw error;
63
+ }
64
+ }
17
65
  }
18
-
19
- /**
20
- * Generates command based on given values
21
- *
22
- * @param runtimeControl Managed object
23
- * @param commandName Command name
24
- * @param modifiedValue Modified value/s
25
- * @param flexSettings Additional flex settings
26
- * @param designMetadata Design time metadata
27
- */
28
- async getCommand(runtimeControl, commandName, modifiedValue, flexSettings, designMetadata) {
29
- try {
30
- return await CommandFactory.getCommandFor(runtimeControl, commandName, modifiedValue, designMetadata, flexSettings);
31
- } catch (e) {
32
- const error = getError(e);
33
- const msgToastErrorMsg = `Could not get command for '${commandName}'. ${error.message}`;
34
- error.message = msgToastErrorMsg;
35
- MessageToast.show(msgToastErrorMsg);
36
- throw error;
37
- }
38
- }
39
-
40
- /**
41
- * Creates composite command without nested commands
42
- *
43
- * @param runtimeControl Managed object
44
- */
45
- async createCompositeCommand(runtimeControl) {
46
- try {
47
- return await CommandFactory.getCommandFor(runtimeControl, 'composite');
48
- } catch (e) {
49
- const error = getError(e);
50
- const msgToastErrorMsg = `Could not get composite command'. ${error.message}`;
51
- error.message = msgToastErrorMsg;
52
- MessageToast.show(msgToastErrorMsg);
53
- throw error;
54
- }
55
- }
56
-
57
- /**
58
- * Pushed and executes the provided command
59
- *
60
- * @param command Command
61
- */
62
- async pushAndExecuteCommand(command) {
63
- try {
64
- /**
65
- * The change will have pending state and will only be saved to the workspace when the user clicks save icon
66
- */
67
- await this.rta.getCommandStack().pushAndExecute(command);
68
- } catch (e) {
69
- const error = getError(e);
70
- MessageToast.show(error.message);
71
- throw error;
72
- }
73
- }
74
- }
75
- return CommandExecutor;
76
- });
77
- //# sourceMappingURL=command-executor.js.map
66
+ return CommandExecutor;
67
+ });
@@ -1,13 +1,13 @@
1
- import MessageToast from 'sap/m/MessageToast';
1
+ import { MessageBarType } from '@sap-ux-private/control-property-editor-common';
2
2
  import type ManagedObject from 'sap/ui/base/ManagedObject';
3
+ import type DesignTimeMetadata from 'sap/ui/dt/DesignTimeMetadata';
3
4
  import CommandFactory from 'sap/ui/rta/command/CommandFactory';
4
- import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
5
5
  import type CompositeCommand from 'sap/ui/rta/command/CompositeCommand';
6
- import type { FlexSettings } from 'sap/ui/rta/RuntimeAuthoring';
7
- import type DesignTimeMetadata from 'sap/ui/dt/DesignTimeMetadata';
8
6
  import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
7
+ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
8
+ import type { FlexSettings } from 'sap/ui/rta/RuntimeAuthoring';
9
9
  import { getError } from '../utils/error';
10
-
10
+ import { sendInfoCenterMessage } from '../utils/info-center-message';
11
11
  type CommandNames = 'addXML' | 'codeExt' | 'appDescriptor';
12
12
 
13
13
  /**
@@ -37,7 +37,7 @@ export default class CommandExecutor {
37
37
  designMetadata?: DesignTimeMetadata
38
38
  ): Promise<FlexCommand<T>> {
39
39
  try {
40
- return await CommandFactory.getCommandFor(
40
+ return await CommandFactory.getCommandFor<FlexCommand<T>>(
41
41
  runtimeControl,
42
42
  commandName,
43
43
  modifiedValue,
@@ -46,9 +46,15 @@ export default class CommandExecutor {
46
46
  );
47
47
  } catch (e) {
48
48
  const error = getError(e);
49
- const msgToastErrorMsg = `Could not get command for '${commandName}'. ${error.message}`;
50
- error.message = msgToastErrorMsg;
51
- MessageToast.show(msgToastErrorMsg);
49
+ await sendInfoCenterMessage({
50
+ title: { key: 'ADP_GET_COMMAND_FAILURE_TITLE' },
51
+ description: {
52
+ key: 'ADP_GET_COMMAND_FAILURE_DESCRIPTION',
53
+ params: [commandName, error.message]
54
+ },
55
+ type: MessageBarType.error
56
+ });
57
+ error.message = `Could not get command for '${commandName}'. ${error.message}`;
52
58
  throw error;
53
59
  }
54
60
  }
@@ -63,9 +69,14 @@ export default class CommandExecutor {
63
69
  return await CommandFactory.getCommandFor<CompositeCommand>(runtimeControl, 'composite');
64
70
  } catch (e) {
65
71
  const error = getError(e);
66
- const msgToastErrorMsg = `Could not get composite command'. ${error.message}`;
67
- error.message = msgToastErrorMsg;
68
- MessageToast.show(msgToastErrorMsg);
72
+ await sendInfoCenterMessage({
73
+ title: { key: 'ADP_GET_COMMAND_FAILURE_TITLE' },
74
+ description: {
75
+ key: 'ADP_GET_COMPOSITE_COMMAND_FAILURE_DESCRIPTION',
76
+ params: [error.message]
77
+ },
78
+ type: MessageBarType.error
79
+ });
69
80
  throw error;
70
81
  }
71
82
  }
@@ -83,7 +94,11 @@ export default class CommandExecutor {
83
94
  await this.rta.getCommandStack().pushAndExecute(command);
84
95
  } catch (e) {
85
96
  const error = getError(e);
86
- MessageToast.show(error.message);
97
+ await sendInfoCenterMessage({
98
+ title: { key: 'ADP_RUN_COMMAND_FAILED_TITLE' },
99
+ description: error.message,
100
+ type: MessageBarType.error
101
+ });
87
102
  throw error;
88
103
  }
89
104
  }
@@ -5,22 +5,24 @@ sap.ui.define([
5
5
  '../command-executor',
6
6
  '../api-handler',
7
7
  './BaseDialog.controller',
8
- '../utils',
9
8
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
10
- '../../cpe/communication-service'
11
- ], function (JSONModel, ____i18n, __CommandExecutor, ___api_handler, __BaseDialog, ___utils, ___sap_ux_private_control_property_editor_common, ____cpe_communication_service) {
9
+ '../../cpe/communication-service',
10
+ '../../utils/info-center-message',
11
+ '../../utils/error'
12
+ ], function (JSONModel, ____i18n, __CommandExecutor, ___api_handler, __BaseDialog, ___sap_ux_private_control_property_editor_common, ____cpe_communication_service, ____utils_info_center_message, ____utils_error) {
12
13
  'use strict';
13
14
  function _interopRequireDefault(obj) {
14
15
  return obj && obj.__esModule && typeof obj.default !== 'undefined' ? obj.default : obj;
15
16
  }
16
17
  const getResourceModel = ____i18n['getResourceModel'];
17
- const getTextBundle = ____i18n['getTextBundle'];
18
18
  const CommandExecutor = _interopRequireDefault(__CommandExecutor);
19
19
  const getFragments = ___api_handler['getFragments'];
20
20
  const BaseDialog = _interopRequireDefault(__BaseDialog);
21
- const notifyUser = ___utils['notifyUser'];
21
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
22
22
  const setApplicationRequiresReload = ___sap_ux_private_control_property_editor_common['setApplicationRequiresReload'];
23
23
  const CommunicationService = ____cpe_communication_service['CommunicationService'];
24
+ const sendInfoCenterMessage = ____utils_info_center_message['sendInfoCenterMessage'];
25
+ const getError = ____utils_error['getError'];
24
26
  const AddCustomFragment = BaseDialog.extend('open.ux.preview.client.adp.controllers.AddCustomFragment', {
25
27
  constructor: function _constructor(name, overlays, rta, options, telemetryData) {
26
28
  BaseDialog.prototype.constructor.call(this, name, telemetryData);
@@ -47,8 +49,14 @@ sap.ui.define([
47
49
  const template = `fragments.${ fragmentName }`;
48
50
  await this.createAppDescriptorChangeForV4(template);
49
51
  CommunicationService.sendAction(setApplicationRequiresReload(true));
50
- const bundle = await getTextBundle();
51
- notifyUser(bundle.getText('ADP_ADD_FRAGMENT_NOTIFICATION', [fragmentName]), 8000);
52
+ await sendInfoCenterMessage({
53
+ title: { key: 'ADP_ADD_FRAGMENT_DIALOG_TITLE' },
54
+ description: {
55
+ key: 'ADP_ADD_FRAGMENT_NOTIFICATION',
56
+ params: [fragmentName]
57
+ },
58
+ type: MessageBarType.warning
59
+ });
52
60
  this.handleDialogClose();
53
61
  },
54
62
  buildDialogData: async function _buildDialogData() {
@@ -56,7 +64,13 @@ sap.ui.define([
56
64
  const {fragments} = await getFragments();
57
65
  this.model.setProperty('/fragmentList', fragments);
58
66
  } catch (e) {
59
- this.handleError(e);
67
+ const error = getError(e);
68
+ await sendInfoCenterMessage({
69
+ title: { key: 'ADP_ADD_FRAGMENT_DIALOG_TITLE' },
70
+ description: error.message,
71
+ type: MessageBarType.error
72
+ });
73
+ throw error;
60
74
  }
61
75
  },
62
76
  createAppDescriptorChangeForV4: async function _createAppDescriptorChangeForV(templatePath) {
@@ -14,16 +14,17 @@ import JSONModel from 'sap/ui/model/json/JSONModel';
14
14
  /** sap.ui.rta */
15
15
  import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
16
16
 
17
- import { getResourceModel, getTextBundle } from '../../i18n';
17
+ import { getResourceModel } from '../../i18n';
18
18
  import CommandExecutor from '../command-executor';
19
19
  import { getFragments } from '../api-handler';
20
20
  import BaseDialog from './BaseDialog.controller';
21
- import { notifyUser } from '../utils';
22
21
  import { QuickActionTelemetryData } from '../../cpe/quick-actions/quick-action-definition';
23
- import { setApplicationRequiresReload } from '@sap-ux-private/control-property-editor-common';
22
+ import { MessageBarType, setApplicationRequiresReload } from '@sap-ux-private/control-property-editor-common';
24
23
  import { CommunicationService } from '../../cpe/communication-service';
25
24
  import FlexCommand from 'sap/ui/rta/command/FlexCommand';
26
25
  import type AppComponentV4 from 'sap/fe/core/AppComponent';
26
+ import { sendInfoCenterMessage } from '../../utils/info-center-message';
27
+ import { getError } from '../../utils/error';
27
28
 
28
29
  export type AddFragmentModel = JSONModel & {
29
30
  getProperty(sPath: '/title'): string;
@@ -97,8 +98,11 @@ export default class AddCustomFragment extends BaseDialog<AddFragmentModel> {
97
98
  await this.createAppDescriptorChangeForV4(template);
98
99
  CommunicationService.sendAction(setApplicationRequiresReload(true));
99
100
 
100
- const bundle = await getTextBundle();
101
- notifyUser(bundle.getText('ADP_ADD_FRAGMENT_NOTIFICATION', [fragmentName]), 8000);
101
+ await sendInfoCenterMessage({
102
+ title: { key: 'ADP_ADD_FRAGMENT_DIALOG_TITLE' },
103
+ description: { key: 'ADP_ADD_FRAGMENT_NOTIFICATION', params: [fragmentName] },
104
+ type: MessageBarType.warning
105
+ });
102
106
 
103
107
  this.handleDialogClose();
104
108
  }
@@ -111,7 +115,13 @@ export default class AddCustomFragment extends BaseDialog<AddFragmentModel> {
111
115
  const { fragments } = await getFragments();
112
116
  this.model.setProperty('/fragmentList', fragments);
113
117
  } catch (e) {
114
- this.handleError(e);
118
+ const error = getError(e);
119
+ await sendInfoCenterMessage({
120
+ title: { key: 'ADP_ADD_FRAGMENT_DIALOG_TITLE' },
121
+ description: error.message,
122
+ type: MessageBarType.error
123
+ });
124
+ throw error;
115
125
  }
116
126
  }
117
127
 
@@ -3,29 +3,31 @@ sap.ui.define([
3
3
  'sap/ui/model/json/JSONModel',
4
4
  'sap/ui/dt/OverlayRegistry',
5
5
  '../../i18n',
6
- '../control-utils',
7
- '../command-executor',
8
- '../api-handler',
9
- './BaseDialog.controller',
10
- '../utils',
11
- '../../cpe/additional-change-info/add-xml-additional-info',
12
6
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
13
- '../../cpe/communication-service'
14
- ], function (JSONModel, OverlayRegistry, ____i18n, __ControlUtils, __CommandExecutor, ___api_handler, __BaseDialog, ___utils, ____cpe_additional_change_info_add_xml_additional_info, ___sap_ux_private_control_property_editor_common, ____cpe_communication_service) {
7
+ '../../cpe/additional-change-info/add-xml-additional-info',
8
+ '../../cpe/communication-service',
9
+ '../../utils/error',
10
+ '../../utils/info-center-message',
11
+ '../api-handler',
12
+ '../command-executor',
13
+ '../control-utils',
14
+ './BaseDialog.controller'
15
+ ], function (JSONModel, OverlayRegistry, ____i18n, ___sap_ux_private_control_property_editor_common, ____cpe_additional_change_info_add_xml_additional_info, ____cpe_communication_service, ____utils_error, ____utils_info_center_message, ___api_handler, __CommandExecutor, __ControlUtils, __BaseDialog) {
15
16
  'use strict';
16
17
  function _interopRequireDefault(obj) {
17
18
  return obj && obj.__esModule && typeof obj.default !== 'undefined' ? obj.default : obj;
18
19
  }
19
20
  const getResourceModel = ____i18n['getResourceModel'];
20
- const getTextBundle = ____i18n['getTextBundle'];
21
- const ControlUtils = _interopRequireDefault(__ControlUtils);
22
- const CommandExecutor = _interopRequireDefault(__CommandExecutor);
23
- const getFragments = ___api_handler['getFragments'];
24
- const BaseDialog = _interopRequireDefault(__BaseDialog);
25
- const notifyUser = ___utils['notifyUser'];
26
- const getFragmentTemplateName = ____cpe_additional_change_info_add_xml_additional_info['getFragmentTemplateName'];
21
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
27
22
  const setApplicationRequiresReload = ___sap_ux_private_control_property_editor_common['setApplicationRequiresReload'];
23
+ const getFragmentTemplateName = ____cpe_additional_change_info_add_xml_additional_info['getFragmentTemplateName'];
28
24
  const CommunicationService = ____cpe_communication_service['CommunicationService'];
25
+ const getError = ____utils_error['getError'];
26
+ const sendInfoCenterMessage = ____utils_info_center_message['sendInfoCenterMessage'];
27
+ const getFragments = ___api_handler['getFragments'];
28
+ const CommandExecutor = _interopRequireDefault(__CommandExecutor);
29
+ const ControlUtils = _interopRequireDefault(__ControlUtils);
30
+ const BaseDialog = _interopRequireDefault(__BaseDialog);
29
31
  const radix = 10;
30
32
  const AddFragment = BaseDialog.extend('open.ux.preview.client.adp.controllers.AddFragment', {
31
33
  constructor: function _constructor(name, overlays, rta, options, data, telemetryData) {
@@ -90,8 +92,14 @@ sap.ui.define([
90
92
  if (templateName) {
91
93
  CommunicationService.sendAction(setApplicationRequiresReload(true));
92
94
  }
93
- const bundle = await getTextBundle();
94
- notifyUser(bundle.getText('ADP_ADD_FRAGMENT_NOTIFICATION', [fragmentName]), 8000);
95
+ await sendInfoCenterMessage({
96
+ title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
97
+ description: {
98
+ key: 'ADP_ADD_FRAGMENT_NOTIFICATION',
99
+ params: [fragmentName]
100
+ },
101
+ type: MessageBarType.info
102
+ });
95
103
  this.handleDialogClose();
96
104
  },
97
105
  buildDialogData: async function _buildDialogData() {
@@ -129,7 +137,13 @@ sap.ui.define([
129
137
  const {fragments} = await getFragments();
130
138
  this.model.setProperty('/fragmentList', fragments);
131
139
  } catch (e) {
132
- this.handleError(e);
140
+ const error = getError(e);
141
+ await sendInfoCenterMessage({
142
+ title: { key: 'ADP_ADD_FRAGMENT_FAILURE_TITLE' },
143
+ description: error.message,
144
+ type: MessageBarType.error
145
+ });
146
+ throw error;
133
147
  }
134
148
  this.model.setProperty('/selectedIndex', indexArray.length - 1);
135
149
  this.model.setProperty('/targetAggregation', controlAggregation);
@@ -1,7 +1,7 @@
1
1
  /** sap.m */
2
2
  import Button from 'sap/m/Button';
3
- import type Dialog from 'sap/m/Dialog';
4
3
  import type ComboBox from 'sap/m/ComboBox';
4
+ import type Dialog from 'sap/m/Dialog';
5
5
 
6
6
  /** sap.ui.core */
7
7
  import type UI5Element from 'sap/ui/core/Element';
@@ -21,18 +21,19 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
21
21
  /** sap.ui.fl */
22
22
  import { type AddFragmentChangeContentType } from 'sap/ui/fl/Change';
23
23
 
24
- import { getResourceModel, getTextBundle } from '../../i18n';
24
+ import { getResourceModel } from '../../i18n';
25
25
 
26
- import ControlUtils from '../control-utils';
27
- import CommandExecutor from '../command-executor';
28
- import { getFragments } from '../api-handler';
29
- import BaseDialog from './BaseDialog.controller';
30
- import { notifyUser } from '../utils';
31
- import { QuickActionTelemetryData } from '../../cpe/quick-actions/quick-action-definition';
26
+ import { MessageBarType, setApplicationRequiresReload } from '@sap-ux-private/control-property-editor-common';
32
27
  import { getFragmentTemplateName } from '../../cpe/additional-change-info/add-xml-additional-info';
33
- import type { AddFragmentData, DeferredXmlFragmentData } from '../add-fragment';
34
- import { setApplicationRequiresReload } from '@sap-ux-private/control-property-editor-common';
35
28
  import { CommunicationService } from '../../cpe/communication-service';
29
+ import { QuickActionTelemetryData } from '../../cpe/quick-actions/quick-action-definition';
30
+ import { getError } from '../../utils/error';
31
+ import { sendInfoCenterMessage } from '../../utils/info-center-message';
32
+ import type { AddFragmentData, DeferredXmlFragmentData } from '../add-fragment';
33
+ import { getFragments } from '../api-handler';
34
+ import CommandExecutor from '../command-executor';
35
+ import ControlUtils from '../control-utils';
36
+ import BaseDialog from './BaseDialog.controller';
36
37
 
37
38
  const radix = 10;
38
39
 
@@ -162,8 +163,11 @@ export default class AddFragment extends BaseDialog<AddFragmentModel> {
162
163
  CommunicationService.sendAction(setApplicationRequiresReload(true));
163
164
  }
164
165
 
165
- const bundle = await getTextBundle();
166
- notifyUser(bundle.getText('ADP_ADD_FRAGMENT_NOTIFICATION', [fragmentName]), 8000);
166
+ await sendInfoCenterMessage({
167
+ title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
168
+ description: { key: 'ADP_ADD_FRAGMENT_NOTIFICATION', params: [fragmentName] },
169
+ type: MessageBarType.info
170
+ });
167
171
 
168
172
  this.handleDialogClose();
169
173
  }
@@ -215,7 +219,13 @@ export default class AddFragment extends BaseDialog<AddFragmentModel> {
215
219
 
216
220
  this.model.setProperty('/fragmentList', fragments);
217
221
  } catch (e) {
218
- this.handleError(e);
222
+ const error = getError(e);
223
+ await sendInfoCenterMessage({
224
+ title: { key: 'ADP_ADD_FRAGMENT_FAILURE_TITLE' },
225
+ description: error.message,
226
+ type: MessageBarType.error
227
+ });
228
+ throw error;
219
229
  }
220
230
 
221
231
  this.model.setProperty('/selectedIndex', indexArray.length - 1);
@@ -3,31 +3,33 @@ sap.ui.define([
3
3
  'sap/ui/model/json/JSONModel',
4
4
  'sap/ui/dt/OverlayRegistry',
5
5
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
6
- '../../i18n',
7
6
  '../../cpe/communication-service',
8
- '../control-utils',
9
- '../command-executor',
10
- '../api-handler',
11
- './BaseDialog.controller',
12
- '../utils',
7
+ '../../i18n',
13
8
  'sap/ui/core/library',
14
- '../../utils/additional-change-info'
15
- ], function (JSONModel, OverlayRegistry, ___sap_ux_private_control_property_editor_common, ____i18n, ____cpe_communication_service, __ControlUtils, __CommandExecutor, ___api_handler, __BaseDialog, ___utils, sap_ui_core_library, ____utils_additional_change_info) {
9
+ '../../utils/additional-change-info',
10
+ '../../utils/error',
11
+ '../../utils/info-center-message',
12
+ '../api-handler',
13
+ '../command-executor',
14
+ '../control-utils',
15
+ './BaseDialog.controller'
16
+ ], function (JSONModel, OverlayRegistry, ___sap_ux_private_control_property_editor_common, ____cpe_communication_service, ____i18n, sap_ui_core_library, ____utils_additional_change_info, ____utils_error, ____utils_info_center_message, ___api_handler, __CommandExecutor, __ControlUtils, __BaseDialog) {
16
17
  'use strict';
17
18
  function _interopRequireDefault(obj) {
18
19
  return obj && obj.__esModule && typeof obj.default !== 'undefined' ? obj.default : obj;
19
20
  }
21
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
20
22
  const setApplicationRequiresReload = ___sap_ux_private_control_property_editor_common['setApplicationRequiresReload'];
21
- const getResourceModel = ____i18n['getResourceModel'];
22
- const getTextBundle = ____i18n['getTextBundle'];
23
23
  const CommunicationService = ____cpe_communication_service['CommunicationService'];
24
- const ControlUtils = _interopRequireDefault(__ControlUtils);
25
- const CommandExecutor = _interopRequireDefault(__CommandExecutor);
26
- const getFragments = ___api_handler['getFragments'];
27
- const BaseDialog = _interopRequireDefault(__BaseDialog);
28
- const notifyUser = ___utils['notifyUser'];
24
+ const getResourceModel = ____i18n['getResourceModel'];
29
25
  const ValueState = sap_ui_core_library['ValueState'];
30
26
  const setAdditionalChangeInfoForChangeFile = ____utils_additional_change_info['setAdditionalChangeInfoForChangeFile'];
27
+ const getError = ____utils_error['getError'];
28
+ const sendInfoCenterMessage = ____utils_info_center_message['sendInfoCenterMessage'];
29
+ const getFragments = ___api_handler['getFragments'];
30
+ const CommandExecutor = _interopRequireDefault(__CommandExecutor);
31
+ const ControlUtils = _interopRequireDefault(__ControlUtils);
32
+ const BaseDialog = _interopRequireDefault(__BaseDialog);
31
33
  const radix = 10;
32
34
  const COLUMNS_AGGREGATION = 'columns';
33
35
  const ITEMS_AGGREGATION = 'items';
@@ -71,9 +73,17 @@ sap.ui.define([
71
73
  ]
72
74
  };
73
75
  await this.createFragmentChange(fragmentData);
74
- const textKey = 'ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION';
75
- const bundle = await getTextBundle();
76
- notifyUser(bundle.getText(textKey, fragmentData.fragments.map(item => item.fragmentName)), 8000);
76
+ await sendInfoCenterMessage({
77
+ title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
78
+ description: {
79
+ key: 'ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION',
80
+ params: [
81
+ columnFragmentName,
82
+ cellFragmentName
83
+ ]
84
+ },
85
+ type: MessageBarType.info
86
+ });
77
87
  this.handleDialogClose();
78
88
  },
79
89
  buildDialogData: async function _buildDialogData() {
@@ -99,7 +109,13 @@ sap.ui.define([
99
109
  const {fragments} = await getFragments();
100
110
  this.model.setProperty('/fragmentList', fragments);
101
111
  } catch (e) {
102
- this.handleError(e);
112
+ const error = getError(e);
113
+ await sendInfoCenterMessage({
114
+ title: { key: 'ADP_GET_FRAGMENTS_FAILURE_TITLE' },
115
+ description: error.message,
116
+ type: MessageBarType.error
117
+ });
118
+ throw error;
103
119
  }
104
120
  this.model.setProperty('/index', indexArray);
105
121
  this.model.setProperty('/selectedIndex', indexArray.length - 1);