@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.
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
@@ -1,29 +1,34 @@
1
1
  'use strict';
2
2
  sap.ui.define([
3
- '../../api-handler',
4
3
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
5
- '../../dialog-factory',
6
4
  'sap/ui/dt/OverlayRegistry',
7
- '../quick-action-base',
8
- '../dialog-enablement-validator',
9
5
  'sap/ui/rta/command/CommandFactory',
6
+ '../../../utils/application',
7
+ '../../../utils/error',
8
+ '../../../utils/fe-v4',
9
+ '../../../utils/info-center-message',
10
10
  '../../../utils/version',
11
+ '../../api-handler',
12
+ '../../dialog-factory',
13
+ '../dialog-enablement-validator',
11
14
  '../fe-v2/utils',
12
- '../../../utils/fe-v4',
13
- '../../../utils/application'
14
- ], function (____api_handler, ___sap_ux_private_control_property_editor_common, ____dialog_factory, OverlayRegistry, ___quick_action_base, ___dialog_enablement_validator, CommandFactory, _____utils_version, ___fe_v2_utils, _____utils_fe_v4, _____utils_application) {
15
+ '../quick-action-base'
16
+ ], function (___sap_ux_private_control_property_editor_common, OverlayRegistry, CommandFactory, _____utils_application, _____utils_error, _____utils_fe_v4, _____utils_info_center_message, _____utils_version, ____api_handler, ____dialog_factory, ___dialog_enablement_validator, ___fe_v2_utils, ___quick_action_base) {
15
17
  'use strict';
16
- const getDataSourceAnnotationFileMap = ____api_handler['getDataSourceAnnotationFileMap'];
18
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
17
19
  const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
20
+ const getApplicationType = _____utils_application['getApplicationType'];
21
+ const getError = _____utils_error['getError'];
22
+ const getV4AppComponent = _____utils_fe_v4['getV4AppComponent'];
23
+ const sendInfoCenterMessage = _____utils_info_center_message['sendInfoCenterMessage'];
24
+ const getUi5Version = _____utils_version['getUi5Version'];
25
+ const isLowerThanMinimalUi5Version = _____utils_version['isLowerThanMinimalUi5Version'];
26
+ const getDataSourceAnnotationFileMap = ____api_handler['getDataSourceAnnotationFileMap'];
18
27
  const DialogFactory = ____dialog_factory['DialogFactory'];
19
28
  const DialogNames = ____dialog_factory['DialogNames'];
20
- const QuickActionDefinitionBase = ___quick_action_base['QuickActionDefinitionBase'];
21
29
  const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator['DIALOG_ENABLEMENT_VALIDATOR'];
22
- const getUi5Version = _____utils_version['getUi5Version'];
23
- const isLowerThanMinimalUi5Version = _____utils_version['isLowerThanMinimalUi5Version'];
24
30
  const getV2AppComponent = ___fe_v2_utils['getV2AppComponent'];
25
- const getV4AppComponent = _____utils_fe_v4['getV4AppComponent'];
26
- const getApplicationType = _____utils_application['getApplicationType'];
31
+ const QuickActionDefinitionBase = ___quick_action_base['QuickActionDefinitionBase'];
27
32
  const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
28
33
  const ADD_NEW_ANNOTATION_FILE_TITLE = 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE';
29
34
  class AddNewAnnotationFile extends QuickActionDefinitionBase {
@@ -52,7 +57,17 @@ sap.ui.define([
52
57
  this.isApplicable = false;
53
58
  return;
54
59
  }
55
- this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
60
+ try {
61
+ this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
62
+ } catch (e) {
63
+ const error = getError(e);
64
+ await sendInfoCenterMessage({
65
+ title: { key: 'ADP_GET_ANNOTATION_ERROR_TITLE' },
66
+ description: error.message,
67
+ type: MessageBarType.error
68
+ });
69
+ throw error;
70
+ }
56
71
  const {annotationDataSourceMap} = this.annotationDataSourceData;
57
72
  if (!Object.keys(this.annotationDataSourceData.annotationDataSourceMap).length) {
58
73
  throw new Error('No data sources found in the manifest');
@@ -1,22 +1,25 @@
1
1
  import FlexCommand from 'sap/ui/rta/command/FlexCommand';
2
2
 
3
- import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
4
- import type { AnnotationDataSourceResponse } from '../../api-handler';
5
- import { getDataSourceAnnotationFileMap } from '../../api-handler';
6
3
  import {
4
+ MessageBarType,
7
5
  NESTED_QUICK_ACTION_KIND,
8
6
  NestedQuickAction,
9
7
  NestedQuickActionChild
10
8
  } from '@sap-ux-private/control-property-editor-common';
11
- import { DialogFactory, DialogNames } from '../../dialog-factory';
12
9
  import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
13
- import { QuickActionDefinitionBase } from '../quick-action-base';
14
- import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
15
10
  import CommandFactory from 'sap/ui/rta/command/CommandFactory';
11
+ import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition';
12
+ import { getApplicationType } from '../../../utils/application';
13
+ import { getError } from '../../../utils/error';
14
+ import { getV4AppComponent } from '../../../utils/fe-v4';
15
+ import { sendInfoCenterMessage } from '../../../utils/info-center-message';
16
16
  import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
17
+ import type { AnnotationDataSourceResponse } from '../../api-handler';
18
+ import { getDataSourceAnnotationFileMap } from '../../api-handler';
19
+ import { DialogFactory, DialogNames } from '../../dialog-factory';
20
+ import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
17
21
  import { getV2AppComponent } from '../fe-v2/utils';
18
- import { getV4AppComponent } from '../../../utils/fe-v4';
19
- import { getApplicationType } from '../../../utils/application';
22
+ import { QuickActionDefinitionBase } from '../quick-action-base';
20
23
 
21
24
  export const ADD_NEW_ANNOTATION_FILE = 'add-new-annotation-file';
22
25
  const ADD_NEW_ANNOTATION_FILE_TITLE = 'QUICK_ACTION_ADD_NEW_ANNOTATION_FILE';
@@ -50,7 +53,17 @@ export class AddNewAnnotationFile
50
53
  this.isApplicable = false;
51
54
  return;
52
55
  }
53
- this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
56
+ try {
57
+ this.annotationDataSourceData = await getDataSourceAnnotationFileMap();
58
+ } catch (e) {
59
+ const error = getError(e);
60
+ await sendInfoCenterMessage({
61
+ title: { key: 'ADP_GET_ANNOTATION_ERROR_TITLE' },
62
+ description: error.message,
63
+ type: MessageBarType.error
64
+ });
65
+ throw error;
66
+ }
54
67
  const { annotationDataSourceMap } = this.annotationDataSourceData;
55
68
  if (!Object.keys(this.annotationDataSourceData.annotationDataSourceMap).length) {
56
69
  throw new Error('No data sources found in the manifest');
@@ -1,101 +1,103 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../control-types", "../table-quick-action-base", "../../utils", "../../../i18n", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___control_types, ___table_quick_action_base, ____utils, _____i18n, ___dialog_enablement_validator) {
4
- "use strict";
5
-
6
- const getControlById = _____utils_core["getControlById"];
7
- const isA = _____utils_core["isA"];
8
- const DialogNames = ____dialog_factory["DialogNames"];
9
- const DialogFactory = ____dialog_factory["DialogFactory"];
10
- const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
11
- const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
12
- const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
13
- const SMART_TABLE_TYPE = ___control_types["SMART_TABLE_TYPE"];
14
- const TREE_TABLE_TYPE = ___control_types["TREE_TABLE_TYPE"];
15
- const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
16
- const notifyUser = ____utils["notifyUser"];
17
- const getTextBundle = _____i18n["getTextBundle"];
18
- const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
19
- const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
20
- const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
21
-
22
- /**
23
- * Reusable function which performs some preparation steps before table action execution
24
- *
25
- * @param table - table element
26
- * @param sectionInfo - section data
27
- * @param iconTabBar - icon tab bar element
28
- * @param iconTabBarFilterKey - tab bar key to select a tab
29
- */
30
- function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
31
- if (sectionInfo) {
32
- const {
33
- layout,
34
- section,
35
- subSection
36
- } = sectionInfo;
37
- layout?.setSelectedSection(section);
38
- section.setSelectedSubSection(subSection);
39
- } else {
40
- getControlById(table.getId())?.getDomRef()?.scrollIntoView();
41
- }
42
- if (iconTabBar && iconTabBarFilterKey) {
43
- iconTabBar.setSelectedKey(iconTabBarFilterKey);
44
- }
45
- }
46
- class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
47
- constructor(context) {
48
- super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
49
- areTableRowsRequired: true
50
- }, [DIALOG_ENABLEMENT_VALIDATOR]);
1
+ 'use strict';
2
+ sap.ui.define([
3
+ 'sap/ui/dt/OverlayRegistry',
4
+ '../../../utils/core',
5
+ '../../dialog-factory',
6
+ '../control-types',
7
+ '../table-quick-action-base',
8
+ '../dialog-enablement-validator',
9
+ 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
10
+ '../../../utils/info-center-message'
11
+ ], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___control_types, ___table_quick_action_base, ___dialog_enablement_validator, ___sap_ux_private_control_property_editor_common, _____utils_info_center_message) {
12
+ 'use strict';
13
+ const getControlById = _____utils_core['getControlById'];
14
+ const isA = _____utils_core['isA'];
15
+ const DialogNames = ____dialog_factory['DialogNames'];
16
+ const DialogFactory = ____dialog_factory['DialogFactory'];
17
+ const ANALYTICAL_TABLE_TYPE = ___control_types['ANALYTICAL_TABLE_TYPE'];
18
+ const GRID_TABLE_TYPE = ___control_types['GRID_TABLE_TYPE'];
19
+ const M_TABLE_TYPE = ___control_types['M_TABLE_TYPE'];
20
+ const SMART_TABLE_TYPE = ___control_types['SMART_TABLE_TYPE'];
21
+ const TREE_TABLE_TYPE = ___control_types['TREE_TABLE_TYPE'];
22
+ const TableQuickActionDefinitionBase = ___table_quick_action_base['TableQuickActionDefinitionBase'];
23
+ const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator['DIALOG_ENABLEMENT_VALIDATOR'];
24
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
25
+ const sendInfoCenterMessage = _____utils_info_center_message['sendInfoCenterMessage'];
26
+ const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
27
+ const CONTROL_TYPES = [
28
+ SMART_TABLE_TYPE,
29
+ M_TABLE_TYPE,
30
+ TREE_TABLE_TYPE,
31
+ GRID_TABLE_TYPE
32
+ ];
33
+ function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
34
+ if (sectionInfo) {
35
+ const {layout, section, subSection} = sectionInfo;
36
+ layout?.setSelectedSection(section);
37
+ section.setSelectedSubSection(subSection);
38
+ } else {
39
+ getControlById(table.getId())?.getDomRef()?.scrollIntoView();
40
+ }
41
+ if (iconTabBar && iconTabBarFilterKey) {
42
+ iconTabBar.setSelectedKey(iconTabBarFilterKey);
43
+ }
51
44
  }
52
- async execute(path) {
53
- const {
54
- table,
55
- iconTabBarFilterKey,
56
- sectionInfo
57
- } = this.tableMap[path];
58
- if (!table) {
59
- return [];
60
- }
61
- preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
62
- this.selectOverlay(table);
63
- let tableInternal = table;
64
- if (isA(SMART_TABLE_TYPE, table)) {
65
- const itemsAggregation = table.getAggregation('items');
66
- tableInternal = itemsAggregation.find(item => {
67
- return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
68
- });
69
- if (!tableInternal) {
70
- return [];
45
+ class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
46
+ constructor(context) {
47
+ super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, { areTableRowsRequired: true }, [DIALOG_ENABLEMENT_VALIDATOR]);
48
+ }
49
+ async execute(path) {
50
+ const {table, iconTabBarFilterKey, sectionInfo} = this.tableMap[path];
51
+ if (!table) {
52
+ return [];
53
+ }
54
+ preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
55
+ this.selectOverlay(table);
56
+ let tableInternal = table;
57
+ if (isA(SMART_TABLE_TYPE, table)) {
58
+ const itemsAggregation = table.getAggregation('items');
59
+ tableInternal = itemsAggregation.find(item => {
60
+ return [
61
+ M_TABLE_TYPE,
62
+ TREE_TABLE_TYPE,
63
+ ANALYTICAL_TABLE_TYPE,
64
+ GRID_TABLE_TYPE
65
+ ].some(tType => isA(tType, item));
66
+ });
67
+ if (!tableInternal) {
68
+ return [];
69
+ }
70
+ }
71
+ const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
72
+ if (!overlay) {
73
+ return [];
74
+ }
75
+ if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
76
+ await sendInfoCenterMessage({
77
+ title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
78
+ description: { key: 'TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN' },
79
+ type: MessageBarType.error
80
+ });
81
+ return [];
82
+ }
83
+ const dialog = [
84
+ TREE_TABLE_TYPE,
85
+ ANALYTICAL_TABLE_TYPE,
86
+ GRID_TABLE_TYPE
87
+ ].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
88
+ await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
89
+ aggregation: 'columns',
90
+ title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
91
+ }, {
92
+ actionName: this.type,
93
+ telemetryEventIdentifier: this.getTelemetryIdentifier()
94
+ });
95
+ return [];
71
96
  }
72
- }
73
- const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
74
- if (!overlay) {
75
- return [];
76
- }
77
- if (isA(M_TABLE_TYPE, tableInternal) && tableInternal.getAggregation('items').length === 0) {
78
- const bundle = await getTextBundle();
79
- notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
80
- return [];
81
- }
82
- const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
83
- await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
84
- aggregation: 'columns',
85
- title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
86
- }, {
87
- actionName: this.type,
88
- telemetryEventIdentifier: this.getTelemetryIdentifier()
89
- });
90
- return [];
91
97
  }
92
- }
93
- var __exports = {
94
- __esModule: true
95
- };
96
- __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
97
- __exports.preprocessActionExecution = preprocessActionExecution;
98
- __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
99
- return __exports;
100
- });
101
- //# sourceMappingURL=create-table-custom-column.js.map
98
+ var __exports = { __esModule: true };
99
+ __exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
100
+ __exports.preprocessActionExecution = preprocessActionExecution;
101
+ __exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
102
+ return __exports;
103
+ });
@@ -12,10 +12,7 @@ import IconTabBar from 'sap/m/IconTabBar';
12
12
 
13
13
  import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
14
14
 
15
- import {
16
- QuickActionContext,
17
- NestedQuickActionDefinition
18
- } from '../../../cpe/quick-actions/quick-action-definition';
15
+ import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
19
16
  import { getControlById, isA } from '../../../utils/core';
20
17
  import { DialogNames, DialogFactory } from '../../dialog-factory';
21
18
  import {
@@ -26,9 +23,9 @@ import {
26
23
  TREE_TABLE_TYPE
27
24
  } from '../control-types';
28
25
  import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
29
- import { notifyUser } from '../../utils';
30
- import { getTextBundle } from '../../../i18n';
31
26
  import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
27
+ import { MessageBarType } from '@sap-ux-private/control-property-editor-common';
28
+ import { sendInfoCenterMessage } from '../../../utils/info-center-message';
32
29
 
33
30
  export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
34
31
 
@@ -115,8 +112,11 @@ export class AddTableCustomColumnQuickAction
115
112
  isA(M_TABLE_TYPE, tableInternal) &&
116
113
  (tableInternal.getAggregation('items') as ManagedObject[]).length === 0
117
114
  ) {
118
- const bundle = await getTextBundle();
119
- notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
115
+ await sendInfoCenterMessage({
116
+ title: { key: 'ADP_CREATE_XML_FRAGMENT_TITLE' },
117
+ description: { key: 'TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN' },
118
+ type: MessageBarType.error
119
+ });
120
120
  return [];
121
121
  }
122
122
  const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some((type) =>
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
  sap.ui.define([
3
- 'sap/ui/core/Element',
4
3
  'sap/base/Log',
4
+ 'sap/ui/core/Element',
5
5
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
6
6
  '../utils/error',
7
- '../utils/version',
8
- '../i18n',
9
- '../cpe/communication-service'
10
- ], function (Element, Log, ___sap_ux_private_control_property_editor_common, ___utils_error, ___utils_version, ___i18n, ___cpe_communication_service) {
7
+ '../utils/info-center-message',
8
+ '../utils/version'
9
+ ], function (Log, Element, ___sap_ux_private_control_property_editor_common, ___utils_error, ___utils_info_center_message, ___utils_version) {
11
10
  'use strict';
12
11
  function __ui5_require_async(path) {
13
12
  return new Promise(function (resolve, reject) {
@@ -22,11 +21,10 @@ sap.ui.define([
22
21
  });
23
22
  });
24
23
  }
25
- const showMessage = ___sap_ux_private_control_property_editor_common['showMessage'];
24
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
26
25
  const getError = ___utils_error['getError'];
26
+ const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
27
27
  const isLowerThanMinimalUi5Version = ___utils_version['isLowerThanMinimalUi5Version'];
28
- const getTextBundle = ___i18n['getTextBundle'];
29
- const CommunicationService = ___cpe_communication_service['CommunicationService'];
30
28
  const syncViews = new Set();
31
29
  let warningShown = false;
32
30
  async function updateSyncViewsIds(ui5VersionInfo) {
@@ -64,11 +62,11 @@ sap.ui.define([
64
62
  return;
65
63
  }
66
64
  warningShown = true;
67
- const bundle = await getTextBundle();
68
- CommunicationService.sendAction(showMessage({
69
- message: bundle.getText('ADP_SYNC_VIEWS_MESSAGE'),
70
- shouldHideIframe: false
71
- }));
65
+ await sendInfoCenterMessage({
66
+ title: { key: 'ADP_SYNC_VIEWS_TITLE' },
67
+ description: { key: 'ADP_SYNC_VIEWS_MESSAGE' },
68
+ type: MessageBarType.warning
69
+ });
72
70
  }
73
71
  function isSyncView(element) {
74
72
  return element?.getMetadata()?.getName()?.includes('XMLView') && element?.oAsyncState === undefined;
@@ -1,12 +1,11 @@
1
- import type DTElement from 'sap/ui/dt/Element';
2
- import Element from 'sap/ui/core/Element';
3
1
  import Log from 'sap/base/Log';
4
- import { showMessage } from '@sap-ux-private/control-property-editor-common';
2
+ import Element from 'sap/ui/core/Element';
3
+ import type DTElement from 'sap/ui/dt/Element';
5
4
 
5
+ import { MessageBarType } from '@sap-ux-private/control-property-editor-common';
6
6
  import { getError } from '../utils/error';
7
+ import { sendInfoCenterMessage } from '../utils/info-center-message';
7
8
  import { isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
8
- import { getTextBundle } from '../i18n';
9
- import { CommunicationService } from '../cpe/communication-service';
10
9
 
11
10
  const syncViews = new Set<string>();
12
11
  let warningShown = false;
@@ -54,13 +53,12 @@ export async function showSyncViewsWarning(): Promise<void> {
54
53
  }
55
54
 
56
55
  warningShown = true;
57
- const bundle = await getTextBundle();
58
- CommunicationService.sendAction(
59
- showMessage({
60
- message: bundle.getText('ADP_SYNC_VIEWS_MESSAGE'),
61
- shouldHideIframe: false
62
- })
63
- );
56
+
57
+ await sendInfoCenterMessage({
58
+ title: { key: 'ADP_SYNC_VIEWS_TITLE' },
59
+ description: { key: 'ADP_SYNC_VIEWS_MESSAGE' },
60
+ type: MessageBarType.warning
61
+ });
64
62
  }
65
63
 
66
64
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/m/MessageToast", "sap/ui/fl/Utils", "../utils/core", "../utils/version"], function (MessageToast, FlexUtils, ___utils_core, ___utils_version) {
3
+ sap.ui.define(["sap/ui/fl/Utils", "../utils/core", "../utils/version"], function (FlexUtils, ___utils_core, ___utils_version) {
4
4
  "use strict";
5
5
 
6
6
  function __ui5_require_async(path) {
@@ -109,19 +109,6 @@ sap.ui.define(["sap/m/MessageToast", "sap/ui/fl/Utils", "../utils/core", "../uti
109
109
  const nestedProperty = getNestedProperty(change, propertyPath);
110
110
  return typeof nestedProperty === 'string' ? nestedProperty.includes(propertyValue) : false;
111
111
  }
112
-
113
- /**
114
- * Displays a message to the user indicating that an XML fragment will be created upon saving a change.
115
- *
116
- * @param {string} message - The message to be shown in the message toast.
117
- * @param {number} duration - The duration during which message toast will be active.
118
- */
119
- function notifyUser(message) {
120
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5000;
121
- MessageToast.show(message, {
122
- duration
123
- });
124
- }
125
112
  /**
126
113
  * Gets controller name and view ID for the given UI5 control.
127
114
  *
@@ -204,7 +191,6 @@ sap.ui.define(["sap/m/MessageToast", "sap/ui/fl/Utils", "../utils/core", "../uti
204
191
  __exports.checkForExistingChange = checkForExistingChange;
205
192
  __exports.getNestedProperty = getNestedProperty;
206
193
  __exports.matchesChangeProperty = matchesChangeProperty;
207
- __exports.notifyUser = notifyUser;
208
194
  __exports.getControllerInfoForControl = getControllerInfoForControl;
209
195
  __exports.getControllerInfo = getControllerInfo;
210
196
  __exports.getReuseComponentChecker = getReuseComponentChecker;
@@ -1,4 +1,3 @@
1
- import MessageToast from 'sap/m/MessageToast';
2
1
  import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
3
2
  import type ManagedObject from 'sap/ui/base/ManagedObject';
4
3
  import type ElementOverlay from 'sap/ui/dt/ElementOverlay';
@@ -118,19 +117,6 @@ export function matchesChangeProperty(command: FlexCommand, propertyPath: string
118
117
  const nestedProperty = getNestedProperty(change, propertyPath);
119
118
  return typeof nestedProperty === 'string' ? nestedProperty.includes(propertyValue) : false;
120
119
  }
121
-
122
- /**
123
- * Displays a message to the user indicating that an XML fragment will be created upon saving a change.
124
- *
125
- * @param {string} message - The message to be shown in the message toast.
126
- * @param {number} duration - The duration during which message toast will be active.
127
- */
128
- export function notifyUser(message: string, duration: number = 5000) {
129
- MessageToast.show(message, {
130
- duration
131
- });
132
- }
133
-
134
120
  interface ControllerInfo {
135
121
  controllerName: string;
136
122
  viewId: string;
@@ -1,35 +1,37 @@
1
1
  'use strict';
2
2
  sap.ui.define([
3
3
  'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
4
- './flex-change',
5
4
  'sap/base/Log',
6
- '../rta-service',
7
- '../../utils/error',
8
- 'sap/m/MessageToast',
9
5
  '../../i18n',
10
- '../../utils/core',
11
6
  '../../utils/additional-change-info',
7
+ '../../utils/core',
8
+ '../../utils/error',
9
+ '../../utils/info-center-message',
10
+ '../rta-service',
11
+ './flex-change',
12
12
  './generic-change'
13
- ], function (___sap_ux_private_control_property_editor_common, ___flex_change, Log, ___rta_service, ____utils_error, MessageToast, ____i18n, ____utils_core, ____utils_additional_change_info, ___generic_change) {
13
+ ], function (___sap_ux_private_control_property_editor_common, Log, ____i18n, ____utils_additional_change_info, ____utils_core, ____utils_error, ____utils_info_center_message, ___rta_service, ___flex_change, ___generic_change) {
14
14
  'use strict';
15
15
  const changeProperty = ___sap_ux_private_control_property_editor_common['changeProperty'];
16
16
  const changeStackModified = ___sap_ux_private_control_property_editor_common['changeStackModified'];
17
17
  const deletePropertyChanges = ___sap_ux_private_control_property_editor_common['deletePropertyChanges'];
18
- const propertyChangeFailed = ___sap_ux_private_control_property_editor_common['propertyChangeFailed'];
19
18
  const FlexChangesEndPoints = ___sap_ux_private_control_property_editor_common['FlexChangesEndPoints'];
19
+ const GENERIC_CHANGE_KIND = ___sap_ux_private_control_property_editor_common['GENERIC_CHANGE_KIND'];
20
+ const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
21
+ const PENDING_CHANGE_TYPE = ___sap_ux_private_control_property_editor_common['PENDING_CHANGE_TYPE'];
22
+ const propertyChangeFailed = ___sap_ux_private_control_property_editor_common['propertyChangeFailed'];
20
23
  const reloadApplication = ___sap_ux_private_control_property_editor_common['reloadApplication'];
21
- const setApplicationRequiresReload = ___sap_ux_private_control_property_editor_common['setApplicationRequiresReload'];
22
24
  const save = ___sap_ux_private_control_property_editor_common['save'];
23
- const PENDING_CHANGE_TYPE = ___sap_ux_private_control_property_editor_common['PENDING_CHANGE_TYPE'];
25
+ const setApplicationRequiresReload = ___sap_ux_private_control_property_editor_common['setApplicationRequiresReload'];
24
26
  const UNKNOWN_CHANGE_KIND = ___sap_ux_private_control_property_editor_common['UNKNOWN_CHANGE_KIND'];
25
- const GENERIC_CHANGE_KIND = ___sap_ux_private_control_property_editor_common['GENERIC_CHANGE_KIND'];
26
- const applyChange = ___flex_change['applyChange'];
27
- const modeAndStackChangeHandler = ___rta_service['modeAndStackChangeHandler'];
28
- const getError = ____utils_error['getError'];
29
27
  const getTextBundle = ____i18n['getTextBundle'];
28
+ const setAdditionalChangeInfo = ____utils_additional_change_info['setAdditionalChangeInfo'];
30
29
  const getControlById = ____utils_core['getControlById'];
31
30
  const isA = ____utils_core['isA'];
32
- const setAdditionalChangeInfo = ____utils_additional_change_info['setAdditionalChangeInfo'];
31
+ const getError = ____utils_error['getError'];
32
+ const sendInfoCenterMessage = ____utils_info_center_message['sendInfoCenterMessage'];
33
+ const modeAndStackChangeHandler = ___rta_service['modeAndStackChangeHandler'];
34
+ const applyChange = ___flex_change['applyChange'];
33
35
  const GENERIC_CHANGE_HANDLER = ___generic_change['GENERIC_CHANGE_HANDLER'];
34
36
  const getControlIdByChange = ___generic_change['getControlIdByChange'];
35
37
  const getFlexObject = ___generic_change['getFlexObject'];
@@ -66,6 +68,11 @@ sap.ui.define([
66
68
  const error = getError(exception);
67
69
  const modifiedMessage = modifyRTAErrorMessage(error.toString(), id, name);
68
70
  const errorMessage = modifiedMessage || `RTA Exception applying expression "${ action.payload.value }"`;
71
+ await sendInfoCenterMessage({
72
+ title: { key: 'CHANGE_CREATION_FAILED_TITLE' },
73
+ description: errorMessage,
74
+ type: MessageBarType.error
75
+ });
69
76
  const propertyChangeFailedAction = propertyChangeFailed({
70
77
  ...action.payload,
71
78
  errorMessage
@@ -205,13 +212,16 @@ sap.ui.define([
205
212
  Log.error('CPE: Change creation Failed', getError(error));
206
213
  }
207
214
  }
208
- const resourceBundle = await getTextBundle();
209
215
  const eventIndex = this.eventStack.indexOf(event);
210
216
  if (this.eventStack.length - 1 === eventIndex) {
211
217
  this.pendingChanges = pendingChanges.filter(change => !!change);
212
218
  const changesRequiringReload = this.pendingChanges.reduce((sum, change) => isGenericConfigChange(change) ? sum + 1 : sum, 0);
213
219
  if (changesRequiringReload > this.changesRequiringReload) {
214
- MessageToast.show(resourceBundle.getText('CPE_CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_MESSAGE'), { duration: 8000 });
220
+ await sendInfoCenterMessage({
221
+ title: { key: 'CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_TITLE' },
222
+ description: { key: 'CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_DESCRIPTION' },
223
+ type: MessageBarType.info
224
+ });
215
225
  this.sendAction(setApplicationRequiresReload(changesRequiringReload > 0));
216
226
  }
217
227
  this.changesRequiringReload = changesRequiringReload;