@sap-ux/preview-middleware 0.16.156 → 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/controllers/AddFragment.controller.js +0 -1
- package/dist/client/adp/controllers/AddFragment.controller.ts +0 -1
- 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.ts +0 -4
- 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 +5 -62
- package/dist/client/adp/init-dialogs.ts +5 -77
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +6 -5
- 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 +7 -6
- 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 +6 -5
- 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 +7 -6
- package/dist/client/adp/quick-actions/common/op-add-header-field.ts +7 -4
- 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 +3 -2
- 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 +6 -5
- 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 +6 -5
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +25 -13
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +6 -2
- 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 +19 -9
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +36 -15
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +3 -2
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +4 -1
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +6 -5
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.ts +16 -7
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +6 -5
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +8 -5
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.js +8 -14
- package/dist/client/adp/quick-actions/fe-v4/table-quick-action-base.ts +10 -14
- 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 +7 -9
- package/dist/client/adp/quick-actions/table-quick-action-base.ts +10 -14
- package/dist/client/cpe/changes/service.js +30 -0
- package/dist/client/cpe/changes/service.ts +46 -0
- 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/messagebundle.properties +1 -0
- package/package.json +5 -5
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../dialog-factory", "../simple-quick-action-base", "../../../utils/application", "../../../utils/version", "../dialog-enablement-validator"], function (OverlayRegistry, ____dialog_factory, ___simple_quick_action_base, _____utils_application, _____utils_version, ___dialog_enablement_validator) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
8
|
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
9
9
|
const getApplicationType = _____utils_application["getApplicationType"];
|
|
10
10
|
const getUi5Version = _____utils_version["getUi5Version"];
|
|
11
11
|
const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
|
|
12
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
12
13
|
const ADD_PAGE_ACTION = 'add-page-action';
|
|
13
14
|
const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 'sap.uxap.ObjectPageDynamicHeaderTitle'];
|
|
14
15
|
|
|
@@ -17,7 +18,7 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../simple-qui
|
|
|
17
18
|
*/
|
|
18
19
|
class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
19
20
|
constructor(context) {
|
|
20
|
-
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context);
|
|
21
|
+
super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
21
22
|
}
|
|
22
23
|
async initialize() {
|
|
23
24
|
const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest());
|
|
@@ -28,12 +29,12 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../simple-qui
|
|
|
28
29
|
})) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
super.initialize();
|
|
32
33
|
}
|
|
33
34
|
async execute() {
|
|
34
35
|
if (this.control) {
|
|
35
36
|
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
36
|
-
await
|
|
37
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
37
38
|
aggregation: 'actions',
|
|
38
39
|
title: 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION'
|
|
39
40
|
});
|
|
@@ -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,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../
|
|
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
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
8
|
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
9
|
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
10
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
10
11
|
const OP_ADD_CUSTOM_SECTION = 'op-add-custom-section';
|
|
11
12
|
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
12
13
|
|
|
@@ -15,12 +16,12 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../../../cpe/
|
|
|
15
16
|
*/
|
|
16
17
|
class AddCustomSectionQuickAction extends SimpleQuickActionDefinitionBase {
|
|
17
18
|
constructor(context) {
|
|
18
|
-
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context);
|
|
19
|
+
super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
19
20
|
}
|
|
20
21
|
async execute() {
|
|
21
22
|
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
22
23
|
const overlay = OverlayRegistry.getOverlay(objectPageLayout) || [];
|
|
23
|
-
await
|
|
24
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
24
25
|
aggregation: 'sections',
|
|
25
26
|
title: 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION'
|
|
26
27
|
});
|
|
@@ -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,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "
|
|
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
4
|
"use strict";
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
7
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
8
8
|
const getRelevantControlFromActivePage = _____cpe_quick_actions_utils["getRelevantControlFromActivePage"];
|
|
9
9
|
const isA = _____utils_core["isA"];
|
|
10
10
|
const SimpleQuickActionDefinitionBase = ___simple_quick_action_base["SimpleQuickActionDefinitionBase"];
|
|
11
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
12
|
const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field';
|
|
12
13
|
const CONTROL_TYPES = ['sap.uxap.ObjectPageLayout'];
|
|
13
14
|
|
|
@@ -16,7 +17,7 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../adp/init-dialogs", "../../
|
|
|
16
17
|
*/
|
|
17
18
|
class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase {
|
|
18
19
|
constructor(context) {
|
|
19
|
-
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context);
|
|
20
|
+
super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
21
|
}
|
|
21
22
|
async execute() {
|
|
22
23
|
const objectPageLayout = getRelevantControlFromActivePage(this.context.controlIndex, this.context.view, CONTROL_TYPES)[0];
|
|
@@ -25,13 +26,13 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../adp/init-dialogs", "../../
|
|
|
25
26
|
// check if only flex box exist in the headerContent.
|
|
26
27
|
if (headerContent.length === 1 && isA('sap.m.FlexBox', headerContent[0])) {
|
|
27
28
|
const overlay = OverlayRegistry.getOverlay(headerContent[0]) || [];
|
|
28
|
-
await
|
|
29
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
29
30
|
aggregation: 'items',
|
|
30
31
|
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
31
32
|
});
|
|
32
33
|
} else if (this.control) {
|
|
33
34
|
const overlay = OverlayRegistry.getOverlay(this.control) || [];
|
|
34
|
-
await
|
|
35
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
35
36
|
aggregation: 'headerContent',
|
|
36
37
|
title: 'QUICK_ACTION_OP_ADD_HEADER_FIELD'
|
|
37
38
|
});
|
|
@@ -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,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,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["../../../utils/core", "../table-quick-action-base"], function (_____utils_core, ___table_quick_action_base) {
|
|
3
|
+
sap.ui.define(["../../../utils/core", "../table-quick-action-base", "../dialog-enablement-validator"], function (_____utils_core, ___table_quick_action_base, ___dialog_enablement_validator) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const getControlById = _____utils_core["getControlById"];
|
|
7
7
|
const isA = _____utils_core["isA"];
|
|
8
8
|
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
9
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
9
10
|
const CHANGE_TABLE_COLUMNS = 'change-table-columns';
|
|
10
11
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
11
12
|
const M_TABLE_TYPE = 'sap.m.Table';
|
|
@@ -15,7 +16,7 @@ sap.ui.define(["../../../utils/core", "../table-quick-action-base"], function (_
|
|
|
15
16
|
constructor(context) {
|
|
16
17
|
super(CHANGE_TABLE_COLUMNS, CONTROL_TYPES, 'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, {
|
|
17
18
|
includeServiceAction: true
|
|
18
|
-
});
|
|
19
|
+
}, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
19
20
|
}
|
|
20
21
|
async execute(path) {
|
|
21
22
|
const {
|
|
@@ -6,6 +6,7 @@ import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
|
6
6
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
7
7
|
import { getControlById, isA } from '../../../utils/core';
|
|
8
8
|
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
9
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
9
10
|
|
|
10
11
|
export const CHANGE_TABLE_COLUMNS = 'change-table-columns';
|
|
11
12
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
@@ -18,9 +19,16 @@ export class ChangeTableColumnsQuickAction
|
|
|
18
19
|
implements NestedQuickActionDefinition
|
|
19
20
|
{
|
|
20
21
|
constructor(context: QuickActionContext) {
|
|
21
|
-
super(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
super(
|
|
23
|
+
CHANGE_TABLE_COLUMNS,
|
|
24
|
+
CONTROL_TYPES,
|
|
25
|
+
'V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS',
|
|
26
|
+
context,
|
|
27
|
+
{
|
|
28
|
+
includeServiceAction: true
|
|
29
|
+
},
|
|
30
|
+
[DIALOG_ENABLEMENT_VALIDATOR]
|
|
31
|
+
);
|
|
24
32
|
}
|
|
25
33
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
26
34
|
const { table, iconTabBarFilterKey, changeColumnActionId, sectionInfo } = this.tableMap[path];
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../dialog-factory", "../table-quick-action-base", "../dialog-enablement-validator"], function (OverlayRegistry, _____utils_core, ____dialog_factory, ___table_quick_action_base, ___dialog_enablement_validator) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const getControlById = _____utils_core["getControlById"];
|
|
7
7
|
const isA = _____utils_core["isA"];
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
9
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
10
10
|
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
11
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
11
12
|
const CREATE_TABLE_ACTION = 'create-table-action';
|
|
12
13
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
13
14
|
const M_TABLE_TYPE = 'sap.m.Table';
|
|
@@ -16,7 +17,7 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../init-d
|
|
|
16
17
|
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable', 'sap.ui.table.Table'];
|
|
17
18
|
class AddTableActionQuickAction extends TableQuickActionDefinitionBase {
|
|
18
19
|
constructor(context) {
|
|
19
|
-
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context);
|
|
20
|
+
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
20
21
|
}
|
|
21
22
|
async execute(path) {
|
|
22
23
|
const {
|
|
@@ -53,7 +54,7 @@ sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../../utils/core", "../../init-d
|
|
|
53
54
|
// open dialogBox to add, and content is selected ByDefault
|
|
54
55
|
if (headerToolbar) {
|
|
55
56
|
const overlay = OverlayRegistry.getOverlay(headerToolbar) || [];
|
|
56
|
-
await
|
|
57
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
57
58
|
aggregation: 'content',
|
|
58
59
|
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
59
60
|
});
|
|
@@ -7,8 +7,9 @@ import UI5Element from 'sap/ui/core/Element';
|
|
|
7
7
|
|
|
8
8
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
9
9
|
import { getControlById, isA } from '../../../utils/core';
|
|
10
|
-
import {
|
|
10
|
+
import { DialogFactory, DialogNames } from '../../dialog-factory';
|
|
11
11
|
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
12
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
12
13
|
|
|
13
14
|
export const CREATE_TABLE_ACTION = 'create-table-action';
|
|
14
15
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
@@ -19,7 +20,9 @@ const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, 'sap.ui.table.TreeTable',
|
|
|
19
20
|
|
|
20
21
|
export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition {
|
|
21
22
|
constructor(context: QuickActionContext) {
|
|
22
|
-
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context
|
|
23
|
+
super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [
|
|
24
|
+
DIALOG_ENABLEMENT_VALIDATOR
|
|
25
|
+
]);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
@@ -52,7 +55,7 @@ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase im
|
|
|
52
55
|
// open dialogBox to add, and content is selected ByDefault
|
|
53
56
|
if (headerToolbar) {
|
|
54
57
|
const overlay = OverlayRegistry.getOverlay(headerToolbar as UI5Element) || [];
|
|
55
|
-
await
|
|
58
|
+
await DialogFactory.createDialog(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
56
59
|
aggregation: 'content',
|
|
57
60
|
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION'
|
|
58
61
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
sap.ui.define(["
|
|
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
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const getControlById = _____utils_core["getControlById"];
|
|
7
7
|
const isA = _____utils_core["isA"];
|
|
8
|
-
const DialogNames =
|
|
9
|
-
const
|
|
8
|
+
const DialogNames = ____dialog_factory["DialogNames"];
|
|
9
|
+
const DialogFactory = ____dialog_factory["DialogFactory"];
|
|
10
10
|
const ANALYTICAL_TABLE_TYPE = ___control_types["ANALYTICAL_TABLE_TYPE"];
|
|
11
11
|
const GRID_TABLE_TYPE = ___control_types["GRID_TABLE_TYPE"];
|
|
12
12
|
const M_TABLE_TYPE = ___control_types["M_TABLE_TYPE"];
|
|
@@ -15,6 +15,7 @@ sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-d
|
|
|
15
15
|
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
16
16
|
const notifyUser = ____utils["notifyUser"];
|
|
17
17
|
const getTextBundle = _____i18n["getTextBundle"];
|
|
18
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
18
19
|
const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
19
20
|
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
20
21
|
|
|
@@ -46,7 +47,7 @@ sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-d
|
|
|
46
47
|
constructor(context) {
|
|
47
48
|
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, {
|
|
48
49
|
areTableRowsRequired: true
|
|
49
|
-
});
|
|
50
|
+
}, [DIALOG_ENABLEMENT_VALIDATOR]);
|
|
50
51
|
}
|
|
51
52
|
async execute(path) {
|
|
52
53
|
const {
|
|
@@ -79,7 +80,7 @@ sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-d
|
|
|
79
80
|
return [];
|
|
80
81
|
}
|
|
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;
|
|
82
|
-
await
|
|
83
|
+
await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
|
|
83
84
|
aggregation: 'columns',
|
|
84
85
|
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
85
86
|
});
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
2
|
+
import UI5Element from 'sap/ui/core/Element';
|
|
3
|
+
|
|
4
|
+
import type FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
5
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
6
|
+
|
|
7
|
+
import ObjectPageSection from 'sap/uxap/ObjectPageSection';
|
|
8
|
+
import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
|
|
9
|
+
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
10
|
+
|
|
11
|
+
import IconTabBar from 'sap/m/IconTabBar';
|
|
12
|
+
|
|
2
13
|
import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
|
|
3
14
|
|
|
4
15
|
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
5
16
|
import { getControlById, isA } from '../../../utils/core';
|
|
6
|
-
import
|
|
7
|
-
import { DialogNames, handler } from '../../init-dialogs';
|
|
17
|
+
import { DialogNames, DialogFactory } from '../../dialog-factory';
|
|
8
18
|
import { ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types';
|
|
9
19
|
import { TableQuickActionDefinitionBase } from '../table-quick-action-base';
|
|
10
|
-
import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
11
|
-
import UI5Element from 'sap/ui/core/Element';
|
|
12
20
|
import { notifyUser } from '../../utils';
|
|
13
21
|
import { getTextBundle } from '../../../i18n';
|
|
14
|
-
import
|
|
15
|
-
import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
|
|
16
|
-
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
17
|
-
import IconTabBar from 'sap/m/IconTabBar';
|
|
22
|
+
import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator';
|
|
18
23
|
|
|
19
24
|
export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
20
25
|
|
|
@@ -58,9 +63,16 @@ export class AddTableCustomColumnQuickAction
|
|
|
58
63
|
implements NestedQuickActionDefinition
|
|
59
64
|
{
|
|
60
65
|
constructor(context: QuickActionContext) {
|
|
61
|
-
super(
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
super(
|
|
67
|
+
CREATE_TABLE_CUSTOM_COLUMN,
|
|
68
|
+
CONTROL_TYPES,
|
|
69
|
+
'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN',
|
|
70
|
+
context,
|
|
71
|
+
{
|
|
72
|
+
areTableRowsRequired: true
|
|
73
|
+
},
|
|
74
|
+
[DIALOG_ENABLEMENT_VALIDATOR]
|
|
75
|
+
);
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
async execute(path: string): Promise<FlexCommand[]> {
|
|
@@ -103,7 +115,7 @@ export class AddTableCustomColumnQuickAction
|
|
|
103
115
|
)
|
|
104
116
|
? DialogNames.ADD_FRAGMENT
|
|
105
117
|
: DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
106
|
-
await
|
|
118
|
+
await DialogFactory.createDialog(overlay, this.context.rta, dialog, undefined, {
|
|
107
119
|
aggregation: 'columns',
|
|
108
120
|
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
109
121
|
});
|
|
@@ -31,8 +31,13 @@ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../si
|
|
|
31
31
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
32
32
|
const modifiedControl = getControlById(control.controlId);
|
|
33
33
|
if (isActionApplicable && modifiedControl) {
|
|
34
|
-
this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
|
|
35
34
|
this.control = modifiedControl;
|
|
35
|
+
const id = this.control.getProperty('persistencyKey') ?? this.control.getId();
|
|
36
|
+
if (typeof id !== 'string') {
|
|
37
|
+
throw new Error('Could not retrieve configuration property because control id is not valid!');
|
|
38
|
+
}
|
|
39
|
+
const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
|
|
40
|
+
this.isUseDateRangeTypeEnabled = value === undefined ? this.control.data('useDateRangeType') : value;
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
}
|
|
@@ -44,7 +49,6 @@ sap.ui.define(["../../../cpe/quick-actions/utils", "../../../utils/core", "../si
|
|
|
44
49
|
const command = await prepareManifestChange(this.context, 'component/settings/filterSettings/dateSettings', this.control, COMPONENT, entitySet, {
|
|
45
50
|
useDateRange: !this.isUseDateRangeTypeEnabled
|
|
46
51
|
});
|
|
47
|
-
this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
|
|
48
52
|
return command;
|
|
49
53
|
}
|
|
50
54
|
}
|
|
@@ -33,8 +33,15 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
33
33
|
const isActionApplicable = pageHasControlId(this.context.view, control.controlId);
|
|
34
34
|
const modifiedControl = getControlById<FilterBar>(control.controlId);
|
|
35
35
|
if (isActionApplicable && modifiedControl) {
|
|
36
|
-
this.isUseDateRangeTypeEnabled = modifiedControl.getProperty('useDateRangeType');
|
|
37
36
|
this.control = modifiedControl;
|
|
37
|
+
|
|
38
|
+
const id = (this.control.getProperty('persistencyKey') as unknown) ?? this.control.getId();
|
|
39
|
+
if (typeof id !== 'string') {
|
|
40
|
+
throw new Error('Could not retrieve configuration property because control id is not valid!');
|
|
41
|
+
}
|
|
42
|
+
const value = this.context.changeService.getConfigurationPropertyValue(id, 'useDateRange');
|
|
43
|
+
this.isUseDateRangeTypeEnabled =
|
|
44
|
+
value === undefined ? (this.control.data('useDateRangeType') as boolean) : (value as boolean);
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
}
|
|
@@ -58,8 +65,6 @@ export class ToggleSemanticDateRangeFilterBar
|
|
|
58
65
|
}
|
|
59
66
|
);
|
|
60
67
|
|
|
61
|
-
this.isUseDateRangeTypeEnabled = !this.isUseDateRangeTypeEnabled;
|
|
62
|
-
|
|
63
68
|
return command;
|
|
64
69
|
}
|
|
65
70
|
}
|