@sap-ux/preview-middleware 0.18.16 → 0.18.18
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/quick-actions/common/op-add-header-field.js +18 -5
- package/dist/client/adp/quick-actions/common/op-add-header-field.ts +23 -10
- package/dist/client/flp/init.js +1 -1
- package/dist/client/flp/init.ts +1 -1
- package/dist/client/messagebundle.properties +1 -1
- package/package.json +5 -5
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator", "../../../i18n"], function (OverlayRegistry, ____dialog_factory, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator, _____i18n) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
7
|
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
8
|
const isA = _____utils_core["isA"];
|
|
10
9
|
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
11
10
|
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
+
const getTextBundle = _____i18n["getTextBundle"];
|
|
12
12
|
const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
|
|
13
13
|
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
14
14
|
|
|
@@ -17,11 +17,24 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cp
|
|
|
17
17
|
*/
|
|
18
18
|
class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
|
|
19
19
|
constructor(context) {
|
|
20
|
-
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR
|
|
20
|
+
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR, {
|
|
21
|
+
run: async () => {
|
|
22
|
+
const i18n = await getTextBundle();
|
|
23
|
+
if (!this.control?.getShowHeaderContent()) {
|
|
24
|
+
return {
|
|
25
|
+
type: 'error',
|
|
26
|
+
message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}]);
|
|
21
32
|
}
|
|
22
33
|
async execute() {
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
if (!this.control) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
const headerContent = this.control.getHeaderContent();
|
|
25
38
|
|
|
26
39
|
// check if only flex box exist in the headerContent.
|
|
27
40
|
if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
|
|
@@ -4,11 +4,12 @@ import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
|
4
4
|
import FlexBox from 'sap/m/FlexBox';
|
|
5
5
|
|
|
6
6
|
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
7
|
-
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
8
7
|
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
9
8
|
import { isA } from '../../../utils/core';
|
|
10
9
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
11
10
|
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
11
|
+
import { EnablementValidatorResult } from '../enablement-validator';
|
|
12
|
+
import { getTextBundle } from '../../../i18n';
|
|
12
13
|
|
|
13
14
|
export const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
|
|
14
15
|
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
@@ -16,21 +17,33 @@ const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
|
16
17
|
/**
|
|
17
18
|
* Quick Action for adding a Header Field to an Object Page.
|
|
18
19
|
*/
|
|
19
|
-
export class AddHeaderFieldQuickAction
|
|
20
|
+
export class AddHeaderFieldQuickAction
|
|
21
|
+
extends SimpleQuickActionDefinitionBase<ObjectPageLayout>
|
|
22
|
+
implements SimpleQuickActionDefinition
|
|
23
|
+
{
|
|
20
24
|
constructor(context: QuickActionContext) {
|
|
21
25
|
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [
|
|
22
|
-
DIALOG_ENABLEMENT_VALIDATOR
|
|
26
|
+
DIALOG_ENABLEMENT_VALIDATOR,
|
|
27
|
+
{
|
|
28
|
+
run: async (): Promise<EnablementValidatorResult> => {
|
|
29
|
+
const i18n = await getTextBundle();
|
|
30
|
+
if (!this.control?.getShowHeaderContent()) {
|
|
31
|
+
return {
|
|
32
|
+
type: 'error',
|
|
33
|
+
message: i18n.getText('DISABLE_SHOW_HEADER_CONTENT')
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
23
39
|
]);
|
|
24
40
|
}
|
|
25
41
|
|
|
26
42
|
async execute(): Promise<FlexCommand[]> {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)[0] as ObjectPageLayout;
|
|
32
|
-
|
|
33
|
-
const headerContent = objectPageLayout.getHeaderContent();
|
|
43
|
+
if (!this.control) {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
const headerContent = this.control.getHeaderContent();
|
|
34
47
|
|
|
35
48
|
// check if only flex box exist in the headerContent.
|
|
36
49
|
if (headerContent.length === 1 && isA<FlexBox>('sap.m.FlexBox', headerContent[0])) {
|
package/dist/client/flp/init.js
CHANGED
|
@@ -229,7 +229,7 @@ sap.ui.define([
|
|
|
229
229
|
const resourceBundle = await loadI18nResourceBundle(scenario);
|
|
230
230
|
setI18nTitle(resourceBundle);
|
|
231
231
|
registerSAPFonts();
|
|
232
|
-
const renderer = ui5VersionInfo.major < 2 ? await container.createRenderer(undefined, true) : await container.createRendererInternal(undefined, true);
|
|
232
|
+
const renderer = ui5VersionInfo.major < 2 && !ui5VersionInfo.label?.includes('legacy-free') ? await container.createRenderer(undefined, true) : await container.createRendererInternal(undefined, true);
|
|
233
233
|
renderer.placeAt('content');
|
|
234
234
|
}
|
|
235
235
|
const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
|
package/dist/client/flp/init.ts
CHANGED
|
@@ -341,7 +341,7 @@ export async function init({
|
|
|
341
341
|
registerSAPFonts();
|
|
342
342
|
|
|
343
343
|
const renderer =
|
|
344
|
-
ui5VersionInfo.major < 2
|
|
344
|
+
(ui5VersionInfo.major < 2 && !ui5VersionInfo.label?.includes('legacy-free'))
|
|
345
345
|
? await container.createRenderer(undefined, true)
|
|
346
346
|
: await container.createRendererInternal(undefined, true);
|
|
347
347
|
renderer.placeAt('content');
|
|
@@ -52,7 +52,7 @@ VARIANT_MANAGEMENT_FOR_PAGE_CONTROLS_IS_ALREADY_ENABLED=This option has been dis
|
|
|
52
52
|
VARIANT_MANAGEMENT_FOR_TABLE_CONTROLS_IS_ALREADY_ENABLED=This option has been disabled because variant management is already enabled for the ''{0}''
|
|
53
53
|
VARIANT_MANAGEMENT_FOR_CUSTOM_TABLES_NOT_SUPPORTED=Variant management cannot be set for custom table ''{0}''
|
|
54
54
|
NO_TABLE_HEADER_TOOLBAR=This option has been disabled because the table does not have a header toolbar.
|
|
55
|
-
|
|
55
|
+
DISABLE_SHOW_HEADER_CONTENT=This option has been disabled because the "Show Header Content" page property is set to false.
|
|
56
56
|
ADD_ANNOTATION_FILE=Add Annotation File for ''{0}''
|
|
57
57
|
SHOW_ANNOTATION_FILE=Show Annotation File for ''{0}''
|
|
58
58
|
EXTEND_WITH_ANNOTATION=Extend With Annotation
|
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.18.
|
|
12
|
+
"version": "0.18.18",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"@sap-ux/adp-tooling": "0.13.14",
|
|
29
29
|
"@sap-ux/btp-utils": "1.0.2",
|
|
30
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.1",
|
|
30
31
|
"@sap-ux/feature-toggle": "0.2.3",
|
|
31
32
|
"@sap-ux/logger": "0.6.0",
|
|
32
|
-
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.1",
|
|
33
33
|
"@sap-ux/system-access": "0.5.33",
|
|
34
34
|
"@sap-ux/project-access": "1.29.16"
|
|
35
35
|
},
|
|
@@ -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.
|
|
52
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.13.4",
|
|
53
53
|
"@sap-ux/axios-extension": "1.19.1",
|
|
54
54
|
"@sap-ux/i18n": "0.2.3",
|
|
55
|
-
"@sap-ux/
|
|
56
|
-
"@sap-ux/
|
|
55
|
+
"@sap-ux/ui5-info": "0.9.1",
|
|
56
|
+
"@sap-ux/store": "1.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"express": "4"
|