@sap-ux/preview-middleware 0.16.155 → 0.16.157
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/api-handler.js +142 -142
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +5 -6
- package/dist/client/adp/controllers/AddFragment.controller.ts +1 -2
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +0 -1
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +0 -1
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
- package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -4
- package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/dialog-factory.js +115 -0
- package/dist/client/adp/dialog-factory.ts +134 -0
- package/dist/client/adp/extension-point.js +6 -6
- package/dist/client/adp/extension-point.ts +2 -2
- package/dist/client/adp/init-dialogs.js +100 -157
- package/dist/client/adp/init-dialogs.ts +5 -77
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -54
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +5 -3
- package/dist/client/adp/quick-actions/common/create-page-action.js +50 -49
- package/dist/client/adp/quick-actions/common/create-page-action.ts +7 -4
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -35
- package/dist/client/adp/quick-actions/common/op-add-custom-section.ts +6 -3
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -47
- package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
- package/dist/client/adp/quick-actions/common/utils.js +20 -0
- package/dist/client/adp/quick-actions/common/utils.ts +7 -0
- package/dist/client/adp/quick-actions/control-types.js +23 -0
- package/dist/client/adp/quick-actions/control-types.ts +6 -0
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
- package/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
- package/dist/client/adp/quick-actions/enablement-validator.js +6 -0
- package/dist/client/adp/quick-actions/enablement-validator.ts +18 -0
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -100
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +11 -3
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -69
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +6 -3
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -95
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +27 -21
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -56
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +8 -3
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -67
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +37 -16
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +99 -0
- package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -71
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -86
- package/dist/client/adp/quick-actions/fe-v2/utils.ts +14 -4
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -47
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +5 -1
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -45
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +17 -7
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -45
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +11 -12
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +4 -4
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +85 -0
- package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -55
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +3 -1
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +11 -17
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +17 -18
- package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +55 -0
- package/dist/client/adp/quick-actions/quick-action-base.ts +55 -0
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +8 -13
- package/dist/client/adp/quick-actions/simple-quick-action-base.ts +10 -18
- package/dist/client/adp/quick-actions/table-quick-action-base.js +24 -29
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +39 -28
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/service.js +30 -0
- package/dist/client/cpe/changes/service.ts +46 -0
- package/dist/client/cpe/changes/validator.js +34 -34
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +217 -217
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/quick-action-definition.ts +5 -1
- package/dist/client/cpe/quick-actions/quick-action-service.js +10 -4
- package/dist/client/cpe/quick-actions/quick-action-service.ts +9 -3
- package/dist/client/cpe/quick-actions/registry.js +143 -143
- package/dist/client/cpe/quick-actions/utils.js +92 -92
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +33 -33
- package/dist/client/cpe/utils.js +138 -138
- package/dist/client/flp/WorkspaceConnector.js +86 -86
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +83 -83
- package/dist/client/flp/initConnectors.js +30 -30
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/messagebundle.properties +5 -3
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +68 -68
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v4.js +118 -114
- package/dist/client/utils/fe-v4.ts +19 -11
- package/dist/client/utils/version.js +102 -102
- package/package.json +4 -4
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
2
2
|
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
5
5
|
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
6
6
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
7
7
|
import { getApplicationType } from '../../../utils/application';
|
|
8
8
|
import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
|
|
9
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
10
|
|
|
10
11
|
export const ADD_PAGE_ACTION = 'add-page-action';
|
|
11
12
|
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'];
|
|
@@ -15,7 +16,9 @@ const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 's
|
|
|
15
16
|
*/
|
|
16
17
|
export class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition {
|
|
17
18
|
constructor(context: QuickActionContext) {
|
|
18
|
-
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context
|
|
19
|
+
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [
|
|
20
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
21
|
+
]);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
async initialize(): Promise<void> {
|
|
@@ -24,13 +27,13 @@ export class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase im
|
|
|
24
27
|
if (appType === 'fe-v4' && isLowerThanMinimalUi5Version(version, { major: 1, minor: 130 })) {
|
|
25
28
|
return;
|
|
26
29
|
}
|
|
27
|
-
|
|
30
|
+
super.initialize();
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
async execute(): Promise<FlexCommand[]> {
|
|
31
34
|
if (this.control) {
|
|
32
35
|
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
33
|
-
await
|
|
36
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
34
37
|
aggregation: 'actions',
|
|
35
38
|
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION'
|
|
36
39
|
});
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
__exports.
|
|
35
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
|
+
const OP_ADD_CUSTOM_SECTION = 'op-add-custom-section';
|
|
12
|
+
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Quick Action for adding a Header Field to an Object Page.
|
|
16
|
+
*/
|
|
17
|
+
class AddCustomSectionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
18
|
+
constructor(context) {
|
|
19
|
+
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
|
+
}
|
|
21
|
+
async execute() {
|
|
22
|
+
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
23
|
+
const overlay = OverlayRegistry.getOverlay(objectPageLayout) || [];
|
|
24
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
25
|
+
aggregation: 'sections',
|
|
26
|
+
title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION'
|
|
27
|
+
});
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var __exports = {
|
|
32
|
+
__esModule: true
|
|
33
|
+
};
|
|
34
|
+
__exports.OP_ADD_CUSTOM_SECTION = OP_ADD_CUSTOM_SECTION;
|
|
35
|
+
__exports.AddCustomSectionQuickAction = AddCustomSectionQuickAction;
|
|
36
|
+
return __exports;
|
|
36
37
|
});
|
|
37
38
|
//# sourceMappingURL=op-add-custom-section.js.map
|
|
@@ -2,10 +2,11 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
|
2
2
|
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
3
3
|
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
6
6
|
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
7
7
|
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
8
8
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
9
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
10
|
|
|
10
11
|
export const OP_ADD_CUSTOM_SECTION = 'op-add-custom-section';
|
|
11
12
|
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
@@ -18,7 +19,9 @@ export class AddCustomSectionQuickAction
|
|
|
18
19
|
implements SimpleQuickActionDefinition
|
|
19
20
|
{
|
|
20
21
|
constructor(context: QuickActionContext) {
|
|
21
|
-
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context
|
|
22
|
+
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [
|
|
23
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
24
|
+
]);
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
async execute(): Promise<FlexCommand[]> {
|
|
@@ -29,7 +32,7 @@ export class AddCustomSectionQuickAction
|
|
|
29
32
|
)[0] as ObjectPageLayout;
|
|
30
33
|
|
|
31
34
|
const overlay = OverlayRegistry.getOverlay(objectPageLayout) || [];
|
|
32
|
-
await
|
|
35
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
33
36
|
aggregation: 'sections',
|
|
34
37
|
title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION'
|
|
35
38
|
});
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
-
const isA = _____utils_core["isA"];
|
|
10
|
-
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
__exports.
|
|
47
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../../../cpe/quick-actions/utils", "../../../utils/core", "../simple-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, _____cpe_quick_actions_utils, _____utils_core, ___simple_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
|
+
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
|
+
const isA = _____utils_core["isA"];
|
|
10
|
+
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
11
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
12
|
+
const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
|
|
13
|
+
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Quick Action for adding a Header Field to an Object Page.
|
|
17
|
+
*/
|
|
18
|
+
class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
|
|
19
|
+
constructor(context) {
|
|
20
|
+
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
21
|
+
}
|
|
22
|
+
async execute() {
|
|
23
|
+
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
24
|
+
const headerContent = objectPageLayout.getHeaderContent();
|
|
25
|
+
|
|
26
|
+
// check if only flex box exist in the headerContent.
|
|
27
|
+
if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
|
|
28
|
+
const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
|
|
29
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
30
|
+
aggregation: 'items',
|
|
31
|
+
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
32
|
+
});
|
|
33
|
+
} else if (this.control) {
|
|
34
|
+
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
35
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
36
|
+
aggregation: 'headerContent',
|
|
37
|
+
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var __exports = {
|
|
44
|
+
__esModule: true
|
|
45
|
+
};
|
|
46
|
+
__exports.OP_ADD_HEADER_FIELD_TYPE = OP_ADD_HEADER_FIELD_TYPE;
|
|
47
|
+
__exports.AddHeaderFieldQuickAction = AddHeaderFieldQuickAction;
|
|
48
|
+
return __exports;
|
|
48
49
|
});
|
|
49
50
|
//# sourceMappingURL=op-add-header-field.js.map
|
|
@@ -3,11 +3,12 @@ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
|
3
3
|
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
4
4
|
import FlexBox from 'sap/m/FlexBox';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
7
7
|
import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils';
|
|
8
8
|
import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
9
9
|
import { isA } from '../../../utils/core';
|
|
10
10
|
import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base';
|
|
11
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
11
12
|
|
|
12
13
|
export const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
|
|
13
14
|
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
@@ -17,7 +18,9 @@ const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
|
17
18
|
*/
|
|
18
19
|
export class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition {
|
|
19
20
|
constructor(context: QuickActionContext) {
|
|
20
|
-
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context
|
|
21
|
+
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [
|
|
22
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
23
|
+
]);
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
async execute(): Promise<FlexCommand[]> {
|
|
@@ -32,13 +35,13 @@ export class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase i
|
|
|
32
35
|
// check if only flex box exist in the headerContent.
|
|
33
36
|
if (headerContent.length === 1 && isA<FlexBox>('sap.m.FlexBox', headerContent[0])) {
|
|
34
37
|
const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
|
|
35
|
-
await
|
|
38
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
36
39
|
aggregation: 'items',
|
|
37
40
|
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
38
41
|
});
|
|
39
42
|
} else if (this.control) {
|
|
40
43
|
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
41
|
-
await
|
|
44
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
42
45
|
aggregation: 'headerContent',
|
|
43
46
|
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
44
47
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function getTooltipsForTableEmptyRowModeAction(resourceBundle) {
|
|
7
|
+
const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED');
|
|
8
|
+
const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED');
|
|
9
|
+
return {
|
|
10
|
+
alreadyEnabledTooltip,
|
|
11
|
+
unsupportedCreationRowsTooltip
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
var __exports = {
|
|
15
|
+
__esModule: true
|
|
16
|
+
};
|
|
17
|
+
__exports.getTooltipsForTableEmptyRowModeAction = getTooltipsForTableEmptyRowModeAction;
|
|
18
|
+
return __exports;
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextBundle } from '../../../i18n';
|
|
2
|
+
|
|
3
|
+
export function getTooltipsForTableEmptyRowModeAction(resourceBundle: TextBundle) {
|
|
4
|
+
const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED');
|
|
5
|
+
const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED');
|
|
6
|
+
return { alreadyEnabledTooltip, unsupportedCreationRowsTooltip };
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
7
|
+
const M_TABLE_TYPE = 'sap.m.Table';
|
|
8
|
+
const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
|
|
9
|
+
const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
|
|
10
|
+
const GRID_TABLE_TYPE = 'sap.ui.table.Table';
|
|
11
|
+
const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
|
|
12
|
+
var __exports = {
|
|
13
|
+
__esModule: true
|
|
14
|
+
};
|
|
15
|
+
__exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
|
|
16
|
+
__exports.M_TABLE_TYPE = M_TABLE_TYPE;
|
|
17
|
+
__exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
|
|
18
|
+
__exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
|
|
19
|
+
__exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
|
|
20
|
+
__exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
|
|
21
|
+
return __exports;
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=control-types.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
2
|
+
export const M_TABLE_TYPE = 'sap.m.Table';
|
|
3
|
+
export const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
|
|
4
|
+
export const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
|
|
5
|
+
export const GRID_TABLE_TYPE = 'sap.ui.table.Table';
|
|
6
|
+
export const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../i18n", "../dialog-factory"], function (____i18n, ___dialog_factory) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getTextBundle = ____i18n["getTextBundle"];
|
|
7
|
+
const DialogFactory = ___dialog_factory["DialogFactory"];
|
|
8
|
+
const DIALOG_ENABLEMENT_VALIDATOR = {
|
|
9
|
+
run: async () => {
|
|
10
|
+
const i18n = await getTextBundle();
|
|
11
|
+
if (!DialogFactory.canOpenDialog) {
|
|
12
|
+
return {
|
|
13
|
+
type: 'error',
|
|
14
|
+
message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var __exports = {
|
|
21
|
+
__esModule: true
|
|
22
|
+
};
|
|
23
|
+
__exports.DIALOG_ENABLEMENT_VALIDATOR = DIALOG_ENABLEMENT_VALIDATOR;
|
|
24
|
+
return __exports;
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=dialog-enablement-validator.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getTextBundle } from '../../i18n';
|
|
2
|
+
|
|
3
|
+
import { DialogFactory } from '../dialog-factory';
|
|
4
|
+
|
|
5
|
+
import type { EnablementValidator, EnablementValidatorResult } from './enablement-validator';
|
|
6
|
+
|
|
7
|
+
export const DIALOG_ENABLEMENT_VALIDATOR: EnablementValidator = {
|
|
8
|
+
run: async (): Promise<EnablementValidatorResult> => {
|
|
9
|
+
const i18n = await getTextBundle();
|
|
10
|
+
if (!DialogFactory.canOpenDialog) {
|
|
11
|
+
return {
|
|
12
|
+
type: 'error',
|
|
13
|
+
message: i18n.getText('ADP_QUICK_ACTION_DIALOG_OPEN_MESSAGE')
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface EnablementValidatorSuccess {
|
|
2
|
+
type: 'success';
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface EnablementValidatorError {
|
|
6
|
+
type: 'error';
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type EnablementValidatorResult = undefined | EnablementValidatorError;
|
|
11
|
+
|
|
12
|
+
export interface EnablementValidator {
|
|
13
|
+
/**
|
|
14
|
+
* Checks if action can be executed.
|
|
15
|
+
* @returns Validation result.
|
|
16
|
+
*/
|
|
17
|
+
run: () => EnablementValidatorResult | Promise<EnablementValidatorResult>;
|
|
18
|
+
}
|
|
@@ -1,102 +1,103 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../../utils/core", "../table-quick-action-base"], function (_____utils_core, ___table_quick_action_base) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getControlById = _____utils_core["getControlById"];
|
|
7
|
-
const isA = _____utils_core["isA"];
|
|
8
|
-
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
section
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// to
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
__exports.
|
|
100
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../dialog-enablement-validator"], function (_____utils_core, ___table_quick_action_base, ___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const isA = _____utils_core["isA"];
|
|
8
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
9
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
10
|
+
const CHANGE_TABLE_COLUMNS = 'change-table-columns';
|
|
11
|
+
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
12
|
+
const M_TABLE_TYPE = 'sap.m.Table';
|
|
13
|
+
// maintain order if action id
|
|
14
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
|
|
15
|
+
class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase {
|
|
16
|
+
constructor(context) {
|
|
17
|
+
super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
|
|
18
|
+
includeServiceAction: true
|
|
19
|
+
}, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
|
+
}
|
|
21
|
+
async execute(path) {
|
|
22
|
+
const {
|
|
23
|
+
table,
|
|
24
|
+
iconTabBarFilterKey,
|
|
25
|
+
changeColumnActionId,
|
|
26
|
+
sectionInfo
|
|
27
|
+
} = this.tableMap[path];
|
|
28
|
+
if (!table) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
if (sectionInfo) {
|
|
32
|
+
const {
|
|
33
|
+
layout,
|
|
34
|
+
section,
|
|
35
|
+
subSection
|
|
36
|
+
} = sectionInfo;
|
|
37
|
+
layout?.setSelectedSection(section);
|
|
38
|
+
section.setSelectedSubSection(subSection);
|
|
39
|
+
this.selectOverlay(table);
|
|
40
|
+
} else {
|
|
41
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
42
|
+
this.selectOverlay(table);
|
|
43
|
+
}
|
|
44
|
+
if (this.iconTabBar && iconTabBarFilterKey) {
|
|
45
|
+
this.iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
46
|
+
}
|
|
47
|
+
if (changeColumnActionId) {
|
|
48
|
+
const executeAction = async () => await this.context.actionService.execute(table.getId(), changeColumnActionId);
|
|
49
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
50
|
+
await executeAction();
|
|
51
|
+
} else if (isA(M_TABLE_TYPE, table)) {
|
|
52
|
+
// if table is busy, i.e. lazy loading, then we subscribe to 'updateFinished' event and call action service when loading is done
|
|
53
|
+
// to avoid reopening the dialog after close
|
|
54
|
+
if (this.isTableLoaded(table)) {
|
|
55
|
+
await executeAction();
|
|
56
|
+
} else {
|
|
57
|
+
table.attachEventOnce('updateFinished', executeAction, this);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
isAbsoluteAggregationBinding(element, aggregationName) {
|
|
64
|
+
const mBindingInfo = element.getBindingInfo(aggregationName);
|
|
65
|
+
const path = mBindingInfo?.path;
|
|
66
|
+
if (!path) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return path.indexOf('/') === 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Checks if table is loaded and has binding context available.
|
|
74
|
+
* This is needed to properly render change columns dialog.
|
|
75
|
+
* Based on {@link https://github.com/SAP/openui5/blob/rel-1.127/src/sap.ui.fl/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js#L269-L271| ODataV2ReadDelegate.getPropertyInfo}.
|
|
76
|
+
*
|
|
77
|
+
* @param element - Table control.
|
|
78
|
+
* @returns True if binding context is available.
|
|
79
|
+
*/
|
|
80
|
+
isTableLoaded(element) {
|
|
81
|
+
const aggregationName = 'items';
|
|
82
|
+
if (this.isAbsoluteAggregationBinding(element, aggregationName)) {
|
|
83
|
+
const bindingInfo = element.getBindingInfo(aggregationName);
|
|
84
|
+
// check to be default model binding otherwise return undefined
|
|
85
|
+
if (typeof bindingInfo.model === 'string' && bindingInfo.model !== '') {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return bindingInfo.path !== undefined;
|
|
89
|
+
} else {
|
|
90
|
+
// here we explicitly request the default models binding context
|
|
91
|
+
const bindingContext = element.getBindingContext();
|
|
92
|
+
return !!bindingContext;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
var __exports = {
|
|
97
|
+
__esModule: true
|
|
98
|
+
};
|
|
99
|
+
__exports.CHANGE_TABLE_COLUMNS = CHANGE_TABLE_COLUMNS;
|
|
100
|
+
__exports.ChangeTableColumnsQuickAction = ChangeTableColumnsQuickAction;
|
|
101
|
+
return __exports;
|
|
101
102
|
});
|
|
102
103
|
//# sourceMappingURL=change-table-columns.js.map
|