@sap-ux/preview-middleware 0.16.60 → 0.16.62

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/ui/core/mvc/XMLView", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field"], function (XMLView, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field) {
3
+ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field) {
4
4
  "use strict";
5
5
 
6
6
  const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
@@ -46,8 +46,10 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "../../../cpe/quick-actions/registry",
46
46
  return definitionGroups;
47
47
  }
48
48
  getComponentContainerFromPage(page) {
49
- if (page instanceof XMLView) {
50
- return page.getContent()[0];
49
+ // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
50
+ const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
51
+ if (componentContainer instanceof ComponentContainer) {
52
+ return componentContainer;
51
53
  }
52
54
  return undefined;
53
55
  }
@@ -1,4 +1,6 @@
1
1
  import XMLView from 'sap/ui/core/mvc/XMLView';
2
+ import Control from 'sap/ui/core/Control';
3
+ import ComponentContainer from 'sap/ui/core/ComponentContainer';
2
4
 
3
5
  import type {
4
6
  QuickActionActivationContext,
@@ -11,7 +13,6 @@ import { AddControllerToPageQuickAction } from '../common/add-controller-to-page
11
13
  import { ToggleClearFilterBarQuickAction } from './lr-toggle-clear-filter-bar';
12
14
  import { ChangeTableColumnsQuickAction } from './change-table-columns';
13
15
  import { AddHeaderFieldQuickAction } from '../common/op-add-header-field';
14
- import Control from 'sap/ui/core/Control';
15
16
 
16
17
  type PageName = 'listReport' | 'objectPage';
17
18
 
@@ -59,11 +60,12 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
59
60
  return definitionGroups;
60
61
  }
61
62
 
62
- protected getComponentContainerFromPage(page: Control): Control | undefined {
63
- if (page instanceof XMLView) {
64
- return page.getContent()[0];
63
+ protected getComponentContainerFromPage(page: Control): ComponentContainer | undefined {
64
+ // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer
65
+ const componentContainer = page instanceof XMLView ? page.getContent()[0] : page;
66
+ if (componentContainer instanceof ComponentContainer) {
67
+ return componentContainer;
65
68
  }
66
69
  return undefined;
67
70
  }
68
-
69
71
  }
@@ -27,6 +27,10 @@ sap.ui.define([], function () {
27
27
  * @returns Quick Action registries.
28
28
  */
29
29
  async function loadDefinitions(appType) {
30
+ // eslint-disable-next-line fiori-custom/sap-no-localstorage
31
+ if (localStorage.getItem('com.sap.ux.control-property-editor.features.quick-actions') !== 'true') {
32
+ return [];
33
+ }
30
34
  if (appType === 'fe-v2') {
31
35
  const FEV2QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v2/registry')).default;
32
36
  return [new FEV2QuickActionRegistry()];
@@ -8,6 +8,10 @@ import type { ApplicationType } from '../../utils/application';
8
8
  * @returns Quick Action registries.
9
9
  */
10
10
  export async function loadDefinitions(appType: ApplicationType): Promise<QuickActionDefinitionRegistry<string>[]> {
11
+ // eslint-disable-next-line fiori-custom/sap-no-localstorage
12
+ if (localStorage.getItem('com.sap.ux.control-property-editor.features.quick-actions') !== 'true') {
13
+ return [];
14
+ }
11
15
  if (appType === 'fe-v2') {
12
16
  const FEV2QuickActionRegistry = (await import('open/ux/preview/client/adp/quick-actions/fe-v2/registry'))
13
17
  .default;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/m/NavContainer", "sap/f/FlexibleColumnLayout", "sap/f/library", "sap/base/Log", "../../utils/core", "../utils"], function (NavContainer, FlexibleColumnLayout, sap_f_library, Log, ____utils_core, ___utils) {
3
+ sap.ui.define(["sap/m/NavContainer", "sap/f/FlexibleColumnLayout", "sap/f/library", "sap/base/Log", "sap/ui/core/ComponentContainer", "../../utils/core", "../utils"], function (NavContainer, FlexibleColumnLayout, sap_f_library, Log, ComponentContainer, ____utils_core, ___utils) {
4
4
  "use strict";
5
5
 
6
6
  const LayoutType = sap_f_library["LayoutType"];
@@ -34,7 +34,10 @@ sap.ui.define(["sap/m/NavContainer", "sap/f/FlexibleColumnLayout", "sap/f/librar
34
34
  * @returns ComponentContainer control.
35
35
  */
36
36
  getComponentContainerFromPage(page) {
37
- return page;
37
+ if (page instanceof ComponentContainer) {
38
+ return page;
39
+ }
40
+ return undefined;
38
41
  }
39
42
 
40
43
  /**
@@ -73,11 +76,9 @@ sap.ui.define(["sap/m/NavContainer", "sap/f/FlexibleColumnLayout", "sap/f/librar
73
76
  for (const page of pages) {
74
77
  if (page) {
75
78
  const container = this.getComponentContainerFromPage(page);
76
- if (container) {
77
- const rootControl = getRootControlFromComponentContainer(container);
78
- if (rootControl) {
79
- views.push(rootControl);
80
- }
79
+ const rootControl = getRootControlFromComponentContainer(container);
80
+ if (rootControl) {
81
+ views.push(rootControl);
81
82
  }
82
83
  }
83
84
  }
@@ -110,7 +111,6 @@ sap.ui.define(["sap/m/NavContainer", "sap/f/FlexibleColumnLayout", "sap/f/librar
110
111
 
111
112
  /**
112
113
  * Finds the visible Flexible Column Layout pages.
113
- *
114
114
  * @param control - Flexible Column Layout control.
115
115
  * @returns A list of visible pages.
116
116
  */
@@ -4,6 +4,7 @@ import { LayoutType } from 'sap/f/library';
4
4
  import Control from 'sap/ui/core/Control';
5
5
  import XMLView from 'sap/ui/core/mvc/XMLView';
6
6
  import Log from 'sap/base/Log';
7
+ import ComponentContainer from 'sap/ui/core/ComponentContainer';
7
8
 
8
9
  import { QuickActionActivationContext, QuickActionDefinitionGroup } from './quick-action-definition';
9
10
 
@@ -44,8 +45,11 @@ export abstract class QuickActionDefinitionRegistry<T extends string> {
44
45
  * @param page - Page control provided by containers.
45
46
  * @returns ComponentContainer control.
46
47
  */
47
- protected getComponentContainerFromPage(page: Control): Control | undefined {
48
- return page;
48
+ protected getComponentContainerFromPage(page: Control): ComponentContainer | undefined {
49
+ if (page instanceof ComponentContainer) {
50
+ return page;
51
+ }
52
+ return undefined;
49
53
  }
50
54
 
51
55
  /**
@@ -85,11 +89,9 @@ export abstract class QuickActionDefinitionRegistry<T extends string> {
85
89
  for (const page of pages) {
86
90
  if (page) {
87
91
  const container = this.getComponentContainerFromPage(page);
88
- if (container) {
89
- const rootControl = getRootControlFromComponentContainer(container);
90
- if (rootControl) {
91
- views.push(rootControl);
92
- }
92
+ const rootControl = getRootControlFromComponentContainer(container);
93
+ if (rootControl) {
94
+ views.push(rootControl);
93
95
  }
94
96
  }
95
97
  }
@@ -124,7 +126,6 @@ export abstract class QuickActionDefinitionRegistry<T extends string> {
124
126
 
125
127
  /**
126
128
  * Finds the visible Flexible Column Layout pages.
127
- *
128
129
  * @param control - Flexible Column Layout control.
129
130
  * @returns A list of visible pages.
130
131
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/ui/core/ComponentContainer", "sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/core", "../utils/version"], function (ComponentContainer, XMLView, UIComponent, ___utils_core, ___utils_version) {
3
+ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/core", "../utils/version"], function (XMLView, UIComponent, ___utils_core, ___utils_version) {
4
4
  "use strict";
5
5
 
6
6
  const getComponent = ___utils_core["getComponent"];
@@ -75,7 +75,7 @@ sap.ui.define(["sap/ui/core/ComponentContainer", "sap/ui/core/mvc/XMLView", "sap
75
75
  * @returns XMLView which is the root control of the component if it exists.
76
76
  */
77
77
  function getRootControlFromComponentContainer(container) {
78
- if (container instanceof ComponentContainer) {
78
+ if (container) {
79
79
  const componentId = container.getComponent();
80
80
  const component = getComponent(componentId);
81
81
  if (component instanceof UIComponent) {
@@ -7,7 +7,6 @@ import ComponentContainer from 'sap/ui/core/ComponentContainer';
7
7
  import XMLView from 'sap/ui/core/mvc/XMLView';
8
8
  import UIComponent from 'sap/ui/core/UIComponent';
9
9
 
10
-
11
10
  import { getComponent } from '../utils/core';
12
11
  import { isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
13
12
 
@@ -22,7 +21,6 @@ export interface Properties {
22
21
  [key: string]: PropertiesInfo;
23
22
  }
24
23
 
25
-
26
24
  export interface ManagedObjectMetadataProperties {
27
25
  name: string;
28
26
  defaultValue: string | null;
@@ -101,8 +99,8 @@ export function isReuseComponent(controlId: string, ui5VersionInfo: Ui5VersionIn
101
99
  * @param container ComponentContainer control.
102
100
  * @returns XMLView which is the root control of the component if it exists.
103
101
  */
104
- export function getRootControlFromComponentContainer(container: Control): XMLView | undefined {
105
- if (container instanceof ComponentContainer) {
102
+ export function getRootControlFromComponentContainer(container?: ComponentContainer): XMLView | undefined {
103
+ if (container) {
106
104
  const componentId = container.getComponent();
107
105
  const component = getComponent(componentId);
108
106
  if (component instanceof UIComponent) {
@@ -1,17 +1,17 @@
1
- QUICK_ACTION_ADD_PAGE_CONTROLLER=Add controller to page
2
- QUICK_ACTION_SHOW_PAGE_CONTROLLER=Show page controller
1
+ QUICK_ACTION_ADD_PAGE_CONTROLLER=Add Controller to Page
2
+ QUICK_ACTION_SHOW_PAGE_CONTROLLER=Show Page Controller
3
3
  QUICK_ACTION_OP_ADD_HEADER_FIELD=Add Header Field
4
4
 
5
- V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change table columns
5
+ V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
6
6
 
7
- V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable clear filterbar button
8
- V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable clear filterbar button
7
+ V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
8
+ V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
9
9
 
10
10
 
11
- V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change table columns
11
+ V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
12
12
 
13
- V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable clear filterbar button
14
- V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable clear filterbar button
13
+ V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
14
+ V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR=Disable "Clear" Button in Filter Bar
15
15
 
16
16
  ADP_SYNC_VIEWS_MESSAGE = Have in mind that synchronous views are detected for this application and controller extensions are not supported for such views. Controller extension functionality on these views will be disabled.
17
17
  ADP_REUSE_COMPONENTS_MESSAGE = Have in mind that reuse components are detected for some views in this application and controller extensions and adding fragments are not supported for such views. Controller extension and adding fragment functionality on these views will be disabled.
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.16.60",
12
+ "version": "0.16.62",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,10 +25,10 @@
25
25
  "ejs": "3.1.10",
26
26
  "mem-fs": "2.1.0",
27
27
  "mem-fs-editor": "9.4.0",
28
+ "@sap-ux/logger": "0.6.0",
28
29
  "@sap-ux/btp-utils": "0.15.2",
29
- "@sap-ux/adp-tooling": "0.12.45",
30
+ "@sap-ux/adp-tooling": "0.12.46",
30
31
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.5.1",
31
- "@sap-ux/logger": "0.6.0",
32
32
  "@sap-ux/project-access": "1.27.1"
33
33
  },
34
34
  "devDependencies": {
@@ -45,8 +45,8 @@
45
45
  "supertest": "6.3.3",
46
46
  "@sap-ux-private/playwright": "0.1.0",
47
47
  "dotenv": "16.3.1",
48
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.0",
49
- "@sap-ux/axios-extension": "1.16.5",
48
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.11.2",
49
+ "@sap-ux/axios-extension": "1.16.6",
50
50
  "@sap-ux/store": "0.9.1",
51
51
  "@sap-ux/ui5-info": "0.8.1",
52
52
  "@sap-ux/i18n": "0.2.0"