@sap-ux/preview-middleware 0.19.7 → 0.19.9
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/controllers/AddSubpage.controller.js +49 -40
- package/dist/client/adp/controllers/AddSubpage.controller.ts +79 -62
- package/dist/client/adp/init-dialogs.js +52 -21
- package/dist/client/adp/init-dialogs.ts +53 -21
- package/dist/client/adp/init.js +1 -1
- package/dist/client/adp/init.ts +2 -1
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +98 -0
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +138 -0
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +4 -2
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -8
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +83 -0
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +88 -0
- package/dist/client/adp/quick-actions/fe-v2/registry.js +2 -2
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +1 -1
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +132 -0
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +170 -0
- package/dist/client/adp/quick-actions/fe-v4/registry.js +4 -3
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +5 -2
- package/dist/client/adp/quick-actions/fe-v4/utils.js +25 -0
- package/dist/client/adp/quick-actions/fe-v4/utils.ts +29 -0
- package/dist/client/adp/quick-actions/supported-ui5versions.md +34 -33
- package/dist/client/adp/utils.js +59 -1
- package/dist/client/adp/utils.ts +65 -0
- package/dist/client/cpe/outline/nodes.js +5 -24
- package/dist/client/cpe/outline/nodes.ts +2 -29
- package/dist/client/cpe/outline/service.js +3 -23
- package/dist/client/cpe/outline/service.ts +6 -25
- package/dist/client/cpe/types.ts +1 -0
- package/dist/client/cpe/utils.js +1 -28
- package/dist/client/cpe/utils.ts +1 -27
- package/dist/client/flp/initRta.js +2 -2
- package/dist/client/flp/initRta.ts +7 -6
- package/dist/client/messagebundle.properties +7 -4
- package/dist/client/utils/fe-v4.js +11 -12
- package/dist/client/utils/fe-v4.ts +12 -10
- package/package.json +7 -7
- package/dist/client/adp/quick-actions/common/add-new-subpage.js +0 -140
- package/dist/client/adp/quick-actions/common/add-new-subpage.ts +0 -168
|
@@ -3,12 +3,11 @@ import type { OutlineViewNode } from 'sap/ui/rta/command/OutlineService';
|
|
|
3
3
|
import type { Scenario } from 'sap/ui/fl/Scenario';
|
|
4
4
|
import Log from 'sap/base/Log';
|
|
5
5
|
|
|
6
|
-
import { getUi5Version, Ui5VersionInfo } from '../../utils/version';
|
|
7
6
|
import { getControlById } from '../../utils/core';
|
|
8
7
|
import { getError } from '../../utils/error';
|
|
9
8
|
|
|
10
9
|
import type { ControlTreeIndex } from '../types';
|
|
11
|
-
import { getOverlay
|
|
10
|
+
import { getOverlay } from '../utils';
|
|
12
11
|
|
|
13
12
|
import { isEditable } from './editable';
|
|
14
13
|
import { ChangeService } from '../changes';
|
|
@@ -127,7 +126,6 @@ function addToPropertyIdMap(node: OutlineNode, propertyIdMap: Map<string, string
|
|
|
127
126
|
*
|
|
128
127
|
* @param input outline view node
|
|
129
128
|
* @param scenario type of project
|
|
130
|
-
* @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
|
|
131
129
|
* @param controlIndex Control tree index
|
|
132
130
|
* @param changeService ChangeService for change stack event handling.
|
|
133
131
|
* @param propertyIdMap ChangeService for change stack event handling.
|
|
@@ -136,14 +134,12 @@ function addToPropertyIdMap(node: OutlineNode, propertyIdMap: Map<string, string
|
|
|
136
134
|
export async function transformNodes(
|
|
137
135
|
input: OutlineViewNode[],
|
|
138
136
|
scenario: Scenario,
|
|
139
|
-
reuseComponentsIds: Set<string>,
|
|
140
137
|
controlIndex: ControlTreeIndex,
|
|
141
138
|
changeService: ChangeService,
|
|
142
139
|
propertyIdMap: Map<string, string[]>
|
|
143
140
|
): Promise<OutlineNode[]> {
|
|
144
141
|
const stack = [...input];
|
|
145
142
|
const items: OutlineNode[] = [];
|
|
146
|
-
const ui5VersionInfo = await getUi5Version();
|
|
147
143
|
while (stack.length) {
|
|
148
144
|
try {
|
|
149
145
|
const current = stack.shift();
|
|
@@ -160,7 +156,6 @@ export async function transformNodes(
|
|
|
160
156
|
? await handleDuplicateNodes(
|
|
161
157
|
children,
|
|
162
158
|
scenario,
|
|
163
|
-
reuseComponentsIds,
|
|
164
159
|
controlIndex,
|
|
165
160
|
changeService,
|
|
166
161
|
propertyIdMap
|
|
@@ -168,7 +163,6 @@ export async function transformNodes(
|
|
|
168
163
|
: await transformNodes(
|
|
169
164
|
children,
|
|
170
165
|
scenario,
|
|
171
|
-
reuseComponentsIds,
|
|
172
166
|
controlIndex,
|
|
173
167
|
changeService,
|
|
174
168
|
propertyIdMap
|
|
@@ -184,7 +178,6 @@ export async function transformNodes(
|
|
|
184
178
|
|
|
185
179
|
indexNode(controlIndex, node);
|
|
186
180
|
addToPropertyIdMap(node, propertyIdMap);
|
|
187
|
-
fillReuseComponents(reuseComponentsIds, current, scenario, ui5VersionInfo);
|
|
188
181
|
|
|
189
182
|
items.push(node);
|
|
190
183
|
}
|
|
@@ -217,31 +210,12 @@ export async function transformNodes(
|
|
|
217
210
|
return items;
|
|
218
211
|
}
|
|
219
212
|
|
|
220
|
-
/**
|
|
221
|
-
* Fill reuse components ids.
|
|
222
|
-
*
|
|
223
|
-
* @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
|
|
224
|
-
* @param node view node
|
|
225
|
-
* @param scenario type of project
|
|
226
|
-
* @param ui5VersionInfo UI5 version information
|
|
227
|
-
*/
|
|
228
|
-
function fillReuseComponents(
|
|
229
|
-
reuseComponentsIds: Set<string>,
|
|
230
|
-
node: OutlineViewNode,
|
|
231
|
-
scenario: Scenario,
|
|
232
|
-
ui5VersionInfo: Ui5VersionInfo
|
|
233
|
-
): void {
|
|
234
|
-
if (scenario === 'ADAPTATION_PROJECT' && node?.component && isReuseComponent(node.id, ui5VersionInfo)) {
|
|
235
|
-
reuseComponentsIds.add(node.id);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
213
|
/**
|
|
239
214
|
* Handles duplicate nodes that are retrieved from extension point default content and created controls,
|
|
240
215
|
* if they exist under an extension point these controls are removed from the children array
|
|
241
216
|
*
|
|
242
217
|
* @param children outline view node children
|
|
243
218
|
* @param scenario type of project
|
|
244
|
-
* @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
|
|
245
219
|
* @param controlIndex Control tree index
|
|
246
220
|
* @param changeService ChangeService for change stack event handling.
|
|
247
221
|
* @param propertyIdMap Map<string, string[]>.
|
|
@@ -250,7 +224,6 @@ function fillReuseComponents(
|
|
|
250
224
|
export async function handleDuplicateNodes(
|
|
251
225
|
children: OutlineViewNode[],
|
|
252
226
|
scenario: Scenario,
|
|
253
|
-
reuseComponentsIds: Set<string>,
|
|
254
227
|
controlIndex: ControlTreeIndex,
|
|
255
228
|
changeService: ChangeService,
|
|
256
229
|
propertyIdMap: Map<string, string[]>
|
|
@@ -266,5 +239,5 @@ export async function handleDuplicateNodes(
|
|
|
266
239
|
|
|
267
240
|
const uniqueChildren = children.filter((child) => !extPointIDs.has(child.id));
|
|
268
241
|
|
|
269
|
-
return transformNodes(uniqueChildren, scenario,
|
|
242
|
+
return transformNodes(uniqueChildren, scenario, controlIndex, changeService, propertyIdMap);
|
|
270
243
|
}
|
|
@@ -3,16 +3,11 @@ sap.ui.define([
|
|
|
3
3
|
'sap/base/Log',
|
|
4
4
|
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
5
5
|
'../../utils/error',
|
|
6
|
-
'../../i18n',
|
|
7
6
|
'./nodes'
|
|
8
|
-
], function (Log, ___sap_ux_private_control_property_editor_common, ____utils_error,
|
|
7
|
+
], function (Log, ___sap_ux_private_control_property_editor_common, ____utils_error, ___nodes) {
|
|
9
8
|
'use strict';
|
|
10
9
|
const outlineChanged = ___sap_ux_private_control_property_editor_common['outlineChanged'];
|
|
11
|
-
const SCENARIO = ___sap_ux_private_control_property_editor_common['SCENARIO'];
|
|
12
|
-
const showInfoCenterMessage = ___sap_ux_private_control_property_editor_common['showInfoCenterMessage'];
|
|
13
|
-
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
14
10
|
const getError = ____utils_error['getError'];
|
|
15
|
-
const getTextBundle = ____i18n['getTextBundle'];
|
|
16
11
|
const transformNodes = ___nodes['transformNodes'];
|
|
17
12
|
const OUTLINE_CHANGE_EVENT = 'OUTLINE_CHANGED';
|
|
18
13
|
class OutlineService extends EventTarget {
|
|
@@ -23,31 +18,16 @@ sap.ui.define([
|
|
|
23
18
|
}
|
|
24
19
|
async init(sendAction) {
|
|
25
20
|
const outline = await this.rta.getService('outline');
|
|
26
|
-
const {scenario
|
|
27
|
-
const resourceBundle = await getTextBundle();
|
|
28
|
-
const titleKey = 'ADP_REUSE_COMPONENTS_MESSAGE_TITLE';
|
|
29
|
-
const descriptionKey = 'ADP_REUSE_COMPONENTS_MESSAGE_DESCRIPTION';
|
|
30
|
-
const title = resourceBundle.getText(titleKey);
|
|
31
|
-
const description = resourceBundle.getText(descriptionKey);
|
|
32
|
-
let hasSentWarning = false;
|
|
33
|
-
const reuseComponentsIds = new Set();
|
|
21
|
+
const {scenario} = this.rta.getFlexSettings();
|
|
34
22
|
const syncOutline = async () => {
|
|
35
23
|
try {
|
|
36
24
|
const viewNodes = await outline.get();
|
|
37
25
|
const controlIndex = {};
|
|
38
26
|
const configPropertyIdMap = new Map();
|
|
39
|
-
const outlineNodes = await transformNodes(viewNodes, scenario,
|
|
27
|
+
const outlineNodes = await transformNodes(viewNodes, scenario, controlIndex, this.changeService, configPropertyIdMap);
|
|
40
28
|
const event = new CustomEvent(OUTLINE_CHANGE_EVENT, { detail: { controlIndex } });
|
|
41
29
|
this.dispatchEvent(event);
|
|
42
30
|
sendAction(outlineChanged(outlineNodes));
|
|
43
|
-
if (reuseComponentsIds.size > 0 && scenario === SCENARIO.AdaptationProject && !hasSentWarning && isCloud) {
|
|
44
|
-
sendAction(showInfoCenterMessage({
|
|
45
|
-
type: MessageBarType.warning,
|
|
46
|
-
title: title,
|
|
47
|
-
description: description
|
|
48
|
-
}));
|
|
49
|
-
hasSentWarning = true;
|
|
50
|
-
}
|
|
51
31
|
await this.changeService.updateConfigurationProps(configPropertyIdMap);
|
|
52
32
|
} catch (error) {
|
|
53
33
|
Log.error('Outline sync failed!', getError(error));
|
|
@@ -4,14 +4,10 @@ import type RTAOutlineService from 'sap/ui/rta/command/OutlineService';
|
|
|
4
4
|
|
|
5
5
|
import type { ExternalAction } from '@sap-ux-private/control-property-editor-common';
|
|
6
6
|
import {
|
|
7
|
-
outlineChanged
|
|
8
|
-
SCENARIO,
|
|
9
|
-
showInfoCenterMessage,
|
|
10
|
-
MessageBarType
|
|
7
|
+
outlineChanged
|
|
11
8
|
} from '@sap-ux-private/control-property-editor-common';
|
|
12
9
|
|
|
13
10
|
import { getError } from '../../utils/error';
|
|
14
|
-
import { getTextBundle } from '../../i18n';
|
|
15
11
|
import { ControlTreeIndex } from '../types';
|
|
16
12
|
import { transformNodes } from './nodes';
|
|
17
13
|
import { ChangeService } from '../changes';
|
|
@@ -25,7 +21,10 @@ export interface OutlineChangedEventDetail {
|
|
|
25
21
|
* A Class of WorkspaceConnectorService
|
|
26
22
|
*/
|
|
27
23
|
export class OutlineService extends EventTarget {
|
|
28
|
-
constructor(
|
|
24
|
+
constructor(
|
|
25
|
+
private readonly rta: RuntimeAuthoring,
|
|
26
|
+
private readonly changeService: ChangeService
|
|
27
|
+
) {
|
|
29
28
|
super();
|
|
30
29
|
}
|
|
31
30
|
|
|
@@ -36,14 +35,7 @@ export class OutlineService extends EventTarget {
|
|
|
36
35
|
*/
|
|
37
36
|
public async init(sendAction: (action: ExternalAction) => void): Promise<void> {
|
|
38
37
|
const outline = await this.rta.getService<RTAOutlineService>('outline');
|
|
39
|
-
const { scenario
|
|
40
|
-
const resourceBundle = await getTextBundle();
|
|
41
|
-
const titleKey = 'ADP_REUSE_COMPONENTS_MESSAGE_TITLE';
|
|
42
|
-
const descriptionKey = 'ADP_REUSE_COMPONENTS_MESSAGE_DESCRIPTION';
|
|
43
|
-
const title = resourceBundle.getText(titleKey);
|
|
44
|
-
const description = resourceBundle.getText(descriptionKey);
|
|
45
|
-
let hasSentWarning = false;
|
|
46
|
-
const reuseComponentsIds = new Set<string>();
|
|
38
|
+
const { scenario } = this.rta.getFlexSettings();
|
|
47
39
|
const syncOutline = async () => {
|
|
48
40
|
try {
|
|
49
41
|
const viewNodes = await outline.get();
|
|
@@ -52,7 +44,6 @@ export class OutlineService extends EventTarget {
|
|
|
52
44
|
const outlineNodes = await transformNodes(
|
|
53
45
|
viewNodes,
|
|
54
46
|
scenario,
|
|
55
|
-
reuseComponentsIds,
|
|
56
47
|
controlIndex,
|
|
57
48
|
this.changeService,
|
|
58
49
|
configPropertyIdMap
|
|
@@ -66,16 +57,6 @@ export class OutlineService extends EventTarget {
|
|
|
66
57
|
|
|
67
58
|
this.dispatchEvent(event);
|
|
68
59
|
sendAction(outlineChanged(outlineNodes));
|
|
69
|
-
if (reuseComponentsIds.size > 0 && scenario === SCENARIO.AdaptationProject && !hasSentWarning && isCloud) {
|
|
70
|
-
sendAction(
|
|
71
|
-
showInfoCenterMessage({
|
|
72
|
-
type: MessageBarType.warning,
|
|
73
|
-
title: title,
|
|
74
|
-
description: description
|
|
75
|
-
})
|
|
76
|
-
);
|
|
77
|
-
hasSentWarning = true;
|
|
78
|
-
}
|
|
79
60
|
await this.changeService.updateConfigurationProps(configPropertyIdMap);
|
|
80
61
|
} catch (error) {
|
|
81
62
|
Log.error('Outline sync failed!', getError(error));
|
package/dist/client/cpe/types.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type ActionHandler = (action: ExternalAction) => void | Promise<void>;
|
|
|
36
36
|
export type ActionSenderFunction = (action: ExternalAction) => void;
|
|
37
37
|
export type SubscribeFunction = (handler: ActionHandler) => void;
|
|
38
38
|
export type UnSubscribeFunction = (handler: ActionHandler) => void;
|
|
39
|
+
export type IsReuseComponentApi = (controlId: string) => boolean;
|
|
39
40
|
|
|
40
41
|
export interface Service {
|
|
41
42
|
init(sendAction: ActionSenderFunction, subscribe: SubscribeFunction): void | Promise<void>;
|
package/dist/client/cpe/utils.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/core", "
|
|
3
|
+
sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/core", "sap/ui/dt/OverlayRegistry", "sap/ui/dt/OverlayUtil"], function (XMLView, UIComponent, ___utils_core, OverlayRegistry, OverlayUtil) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const getComponent = ___utils_core["getComponent"];
|
|
7
|
-
const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
|
|
8
7
|
/**
|
|
9
8
|
* Get runtime control.
|
|
10
9
|
*
|
|
@@ -43,31 +42,6 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/c
|
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
/**
|
|
47
|
-
* Function that checks if control is reuse component
|
|
48
|
-
*
|
|
49
|
-
* @param controlId id control
|
|
50
|
-
* @param ui5VersionInfo UI5 version information
|
|
51
|
-
* @returns boolean if control is from reused component view
|
|
52
|
-
*/
|
|
53
|
-
function isReuseComponent(controlId, ui5VersionInfo) {
|
|
54
|
-
if (isLowerThanMinimalUi5Version(ui5VersionInfo, {
|
|
55
|
-
major: 1,
|
|
56
|
-
minor: 115
|
|
57
|
-
})) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
const component = getComponent(controlId);
|
|
61
|
-
if (!component) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
const manifest = component.getManifest();
|
|
65
|
-
if (!manifest) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return manifest['sap.app']?.type === 'component';
|
|
69
|
-
}
|
|
70
|
-
|
|
71
45
|
/**
|
|
72
46
|
* Gets the root view of component for the provided ComponentContainer control.
|
|
73
47
|
*
|
|
@@ -131,7 +105,6 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/c
|
|
|
131
105
|
};
|
|
132
106
|
__exports.getRuntimeControl = getRuntimeControl;
|
|
133
107
|
__exports.getLibrary = getLibrary;
|
|
134
|
-
__exports.isReuseComponent = isReuseComponent;
|
|
135
108
|
__exports.getRootControlFromComponentContainer = getRootControlFromComponentContainer;
|
|
136
109
|
__exports.getManifestProperties = getManifestProperties;
|
|
137
110
|
__exports.getOverlay = getOverlay;
|
package/dist/client/cpe/utils.ts
CHANGED
|
@@ -2,19 +2,18 @@ import type ManagedObject from 'sap/ui/base/ManagedObject';
|
|
|
2
2
|
import type Control from 'sap/ui/core/Control';
|
|
3
3
|
import type ElementOverlay from 'sap/ui/dt/ElementOverlay';
|
|
4
4
|
import DataType from 'sap/ui/base/DataType';
|
|
5
|
-
import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring';
|
|
6
5
|
import ComponentContainer from 'sap/ui/core/ComponentContainer';
|
|
7
6
|
import XMLView from 'sap/ui/core/mvc/XMLView';
|
|
8
7
|
import UIComponent from 'sap/ui/core/UIComponent';
|
|
9
8
|
|
|
10
9
|
import { getComponent } from '../utils/core';
|
|
11
|
-
import { isLowerThanMinimalUi5Version, Ui5VersionInfo } from '../utils/version';
|
|
12
10
|
import { DesigntimeSetting } from 'sap/ui/dt/DesignTimeMetadata';
|
|
13
11
|
import { ChangeService } from './changes';
|
|
14
12
|
import UI5Element from 'sap/ui/core/Element';
|
|
15
13
|
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
16
14
|
import OverlayUtil from 'sap/ui/dt/OverlayUtil';
|
|
17
15
|
|
|
16
|
+
|
|
18
17
|
export interface PropertiesInfo {
|
|
19
18
|
defaultValue: string;
|
|
20
19
|
description: string;
|
|
@@ -83,31 +82,6 @@ export async function getLibrary(controlName: string): Promise<string> {
|
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
/**
|
|
87
|
-
* Function that checks if control is reuse component
|
|
88
|
-
*
|
|
89
|
-
* @param controlId id control
|
|
90
|
-
* @param ui5VersionInfo UI5 version information
|
|
91
|
-
* @returns boolean if control is from reused component view
|
|
92
|
-
*/
|
|
93
|
-
export function isReuseComponent(controlId: string, ui5VersionInfo: Ui5VersionInfo): boolean {
|
|
94
|
-
if (isLowerThanMinimalUi5Version(ui5VersionInfo, { major: 1, minor: 115 })) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const component = getComponent(controlId);
|
|
99
|
-
if (!component) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const manifest = component.getManifest() as Manifest;
|
|
104
|
-
if (!manifest) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return manifest['sap.app']?.type === 'component';
|
|
109
|
-
}
|
|
110
|
-
|
|
111
85
|
/**
|
|
112
86
|
* Gets the root view of component for the provided ComponentContainer control.
|
|
113
87
|
*
|
|
@@ -44,7 +44,7 @@ sap.ui.define(["sap/base/util/merge", "sap/ui/core/Control", "sap/ui/core/UIComp
|
|
|
44
44
|
/**
|
|
45
45
|
* Checks if the given root control is an instance of Control or UIComponent.
|
|
46
46
|
*
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {Component} rootControl - The root control to be checked.
|
|
48
48
|
* @throws {Error} Throws an error if the root control is not an instance of Control or UIComponent.
|
|
49
49
|
*/
|
|
50
50
|
function checkRootControl(rootControl) {
|
|
@@ -57,7 +57,7 @@ sap.ui.define(["sap/base/util/merge", "sap/ui/core/Control", "sap/ui/core/UIComp
|
|
|
57
57
|
* Checks if key user adaptation is enabled for the specified component.
|
|
58
58
|
* Fiori tools mode is considered a developer scenario where the `flexEnabled` flag should not be evaluated.
|
|
59
59
|
*
|
|
60
|
-
* @param {
|
|
60
|
+
* @param {Component} component - The UI5 control component to check for flex (key user adaptation) enabled status.
|
|
61
61
|
* @throws {Error} Throws an error if key user adaptation is explicitly disabled in the component's manifest.
|
|
62
62
|
*/
|
|
63
63
|
function checkFlexEnabled(component) {
|
|
@@ -3,6 +3,7 @@ import Button from 'sap/m/Button';
|
|
|
3
3
|
import merge from 'sap/base/util/merge';
|
|
4
4
|
|
|
5
5
|
import Control from 'sap/ui/core/Control';
|
|
6
|
+
import Component from 'sap/ui/core/Component';
|
|
6
7
|
import UIComponent from 'sap/ui/core/UIComponent';
|
|
7
8
|
|
|
8
9
|
import Utils from 'sap/ui/fl/Utils';
|
|
@@ -53,10 +54,10 @@ export function checkLayer(layer: string): void {
|
|
|
53
54
|
/**
|
|
54
55
|
* Checks if the given root control is an instance of Control or UIComponent.
|
|
55
56
|
*
|
|
56
|
-
* @param {
|
|
57
|
+
* @param {Component} rootControl - The root control to be checked.
|
|
57
58
|
* @throws {Error} Throws an error if the root control is not an instance of Control or UIComponent.
|
|
58
59
|
*/
|
|
59
|
-
export function checkRootControl(rootControl:
|
|
60
|
+
export function checkRootControl(rootControl: Component): void {
|
|
60
61
|
if (!(rootControl instanceof Control) && !(rootControl instanceof UIComponent)) {
|
|
61
62
|
throw new Error('An invalid root control was passed');
|
|
62
63
|
}
|
|
@@ -66,14 +67,14 @@ export function checkRootControl(rootControl: Control | UIComponent): void {
|
|
|
66
67
|
* Checks if key user adaptation is enabled for the specified component.
|
|
67
68
|
* Fiori tools mode is considered a developer scenario where the `flexEnabled` flag should not be evaluated.
|
|
68
69
|
*
|
|
69
|
-
* @param {
|
|
70
|
+
* @param {Component} component - The UI5 control component to check for flex (key user adaptation) enabled status.
|
|
70
71
|
* @throws {Error} Throws an error if key user adaptation is explicitly disabled in the component's manifest.
|
|
71
72
|
*/
|
|
72
|
-
export function checkFlexEnabled(component:
|
|
73
|
+
export function checkFlexEnabled(component: Component): void {
|
|
73
74
|
// fiori tools is always a developer scenario where the flexEnabled flag should not be evaluated
|
|
74
75
|
const fioriToolsMode = new URLSearchParams(window.location.search).get('fiori-tools-rta-mode');
|
|
75
76
|
if (!fioriToolsMode || fioriToolsMode === 'false') {
|
|
76
|
-
const manifest = (component as
|
|
77
|
+
const manifest = ((component as Component& { getManifest: () => Manifest }).getManifest() || {}) as Manifest;
|
|
77
78
|
const flexEnabled = manifest['sap.ui5']?.flexEnabled;
|
|
78
79
|
|
|
79
80
|
if (flexEnabled === false) {
|
|
@@ -114,7 +115,7 @@ export async function checkKeyUser(layer: string): Promise<void> {
|
|
|
114
115
|
* @returns {Promise<void>} A promise that resolves when all checks pass without errors.
|
|
115
116
|
* @throws {Error} Throws an error if any of the checks fail.
|
|
116
117
|
*/
|
|
117
|
-
async function checkLayerAndControl(rootControl:
|
|
118
|
+
async function checkLayerAndControl(rootControl: Component, layer: string): Promise<void> {
|
|
118
119
|
checkLayer(layer);
|
|
119
120
|
|
|
120
121
|
checkRootControl(rootControl);
|
|
@@ -39,12 +39,15 @@ ADP_ADD_FRAGMENT_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be cr
|
|
|
39
39
|
ADP_ADD_FRAGMENT_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be created once you save the changes.
|
|
40
40
|
ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" and "{1}.fragment.xml" fragments will be created once you save the changes.
|
|
41
41
|
ADP_SYNC_VIEWS_MESSAGE = Synchronous views are detected for this application. Controller extensions are not supported for such views and will be disabled.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE = This action is disabled because a dialog is already open.
|
|
43
|
+
ADP_ADD_FRAGMENT_MENU_ITEM = Add: Fragment
|
|
44
|
+
ADP_ADD_FRAGMENT_MENU_ITEM_REUSE_COMPONENT = Add: Fragment (This action is disabled because the control is a reuse component)
|
|
45
|
+
ADP_ADD_FRAGMENT_MENU_ITEM_UNSTABLE_ID = Add: Fragment (This action is disabled because the control or parent control has an unstable ID)
|
|
46
|
+
ADP_ADD_CONTROLLER_EXTENSION_MENU_ITEM = Extend with Controller
|
|
47
|
+
ADP_ADD_CONTROLLER_EXTENSION_MENU_ITEM_REUSE_COMPONENT = Extend with Controller (This action is disabled because the control is a reuse component)
|
|
45
48
|
CPE_CHANGES_VISIBLE_AFTER_SAVE_AND_RELOAD_MESSAGE = Note: The change will be visible after save and reload.
|
|
46
49
|
|
|
47
|
-
TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN=At least one table row is required to create new custom column. Make sure the table data is loaded and try again.
|
|
50
|
+
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.
|
|
48
51
|
|
|
49
52
|
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.
|
|
50
53
|
|
|
@@ -114,19 +114,18 @@ sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFac
|
|
|
114
114
|
* @returns array with page descriptors
|
|
115
115
|
*/
|
|
116
116
|
function getV4ApplicationPages(manifest) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
return result;
|
|
117
|
+
const result = [];
|
|
118
|
+
const targets = manifest['sap.ui5'].routing?.targets ?? {};
|
|
119
|
+
for (const target of Object.values(targets)) {
|
|
120
|
+
if (target.name === 'sap.fe.templates.ObjectPage') {
|
|
121
|
+
result.push({
|
|
122
|
+
id: target.id,
|
|
123
|
+
entitySet: target.options?.settings?.entitySet,
|
|
124
|
+
contextPath: target.options?.settings?.contextPath
|
|
125
|
+
});
|
|
126
|
+
}
|
|
128
127
|
}
|
|
129
|
-
return
|
|
128
|
+
return result;
|
|
130
129
|
}
|
|
131
130
|
var __exports = {
|
|
132
131
|
__esModule: true
|
|
@@ -138,15 +138,17 @@ export async function createManifestPropertyChange(
|
|
|
138
138
|
* @param manifest - manifest object
|
|
139
139
|
* @returns array with page descriptors
|
|
140
140
|
*/
|
|
141
|
-
export function getV4ApplicationPages(manifest: Manifest): { id: string; entitySet
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
export function getV4ApplicationPages(manifest: Manifest): { id: string; entitySet?: string; contextPath?: string }[] {
|
|
142
|
+
const result: { id: string; entitySet?: string; contextPath?: string }[] = [];
|
|
143
|
+
const targets = manifest['sap.ui5'].routing?.targets ?? {};
|
|
144
|
+
for (const target of Object.values(targets)) {
|
|
145
|
+
if (target.name === 'sap.fe.templates.ObjectPage') {
|
|
146
|
+
result.push({
|
|
147
|
+
id: target.id,
|
|
148
|
+
entitySet: target.options?.settings?.entitySet,
|
|
149
|
+
contextPath: target.options?.settings?.contextPath
|
|
150
|
+
});
|
|
151
|
+
}
|
|
150
152
|
}
|
|
151
|
-
return
|
|
153
|
+
return result;
|
|
152
154
|
}
|
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.19.
|
|
12
|
+
"version": "0.19.9",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"ejs": "3.1.10",
|
|
26
26
|
"mem-fs": "2.1.0",
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
|
-
"@sap-ux/
|
|
28
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.2",
|
|
29
29
|
"@sap-ux/btp-utils": "1.0.2",
|
|
30
|
-
"@sap-ux/
|
|
31
|
-
"@sap-ux/feature-toggle": "0.2.3",
|
|
30
|
+
"@sap-ux/adp-tooling": "0.13.22",
|
|
32
31
|
"@sap-ux/logger": "0.6.0",
|
|
33
32
|
"@sap-ux/project-access": "1.29.18",
|
|
33
|
+
"@sap-ux/feature-toggle": "0.2.3",
|
|
34
34
|
"@sap-ux/system-access": "0.5.34"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"nock": "13.4.0",
|
|
50
50
|
"npm-run-all2": "6.2.0",
|
|
51
51
|
"supertest": "6.3.3",
|
|
52
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.13.
|
|
53
|
-
"@sap-ux/axios-extension": "1.19.2",
|
|
52
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.13.11",
|
|
54
53
|
"@sap-ux/i18n": "0.2.3",
|
|
54
|
+
"@sap-ux/ui5-info": "0.9.1",
|
|
55
55
|
"@sap-ux/store": "1.0.0",
|
|
56
|
-
"@sap-ux/
|
|
56
|
+
"@sap-ux/axios-extension": "1.19.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"express": "4"
|