@sap-ux/fiori-mcp-server 0.0.1
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/LICENSE +201 -0
- package/README.md +99 -0
- package/dist/constant.d.ts +5 -0
- package/dist/constant.js +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/page-editor-api/api.d.ts +48 -0
- package/dist/page-editor-api/api.js +93 -0
- package/dist/page-editor-api/index.d.ts +5 -0
- package/dist/page-editor-api/index.js +24 -0
- package/dist/page-editor-api/json-helper.d.ts +11 -0
- package/dist/page-editor-api/json-helper.js +64 -0
- package/dist/page-editor-api/parser/annotations.d.ts +9 -0
- package/dist/page-editor-api/parser/annotations.js +13 -0
- package/dist/page-editor-api/parser/index.d.ts +3 -0
- package/dist/page-editor-api/parser/index.js +19 -0
- package/dist/page-editor-api/parser/model/AggregationValidator.d.ts +64 -0
- package/dist/page-editor-api/parser/model/AggregationValidator.js +209 -0
- package/dist/page-editor-api/parser/model/ArrayAggregation.d.ts +49 -0
- package/dist/page-editor-api/parser/model/ArrayAggregation.js +122 -0
- package/dist/page-editor-api/parser/model/ObjectAggregation.d.ts +374 -0
- package/dist/page-editor-api/parser/model/ObjectAggregation.js +802 -0
- package/dist/page-editor-api/parser/model/PageEditModel.d.ts +223 -0
- package/dist/page-editor-api/parser/model/PageEditModel.js +954 -0
- package/dist/page-editor-api/parser/model/PageEditProperty.d.ts +38 -0
- package/dist/page-editor-api/parser/model/PageEditProperty.js +49 -0
- package/dist/page-editor-api/parser/model/RootAggregation.d.ts +24 -0
- package/dist/page-editor-api/parser/model/RootAggregation.js +54 -0
- package/dist/page-editor-api/parser/model/actions/ActionAggregation.d.ts +34 -0
- package/dist/page-editor-api/parser/model/actions/ActionAggregation.js +92 -0
- package/dist/page-editor-api/parser/model/actions/ActionsAggregation.d.ts +96 -0
- package/dist/page-editor-api/parser/model/actions/ActionsAggregation.js +252 -0
- package/dist/page-editor-api/parser/model/actions/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/actions/index.js +19 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectAggregation.d.ts +17 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectAggregation.js +26 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectsAggregation.d.ts +46 -0
- package/dist/page-editor-api/parser/model/additionalObjects/AdditionalObjectsAggregation.js +66 -0
- package/dist/page-editor-api/parser/model/additionalObjects/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/additionalObjects/index.js +19 -0
- package/dist/page-editor-api/parser/model/chart/ChartAggregation.d.ts +41 -0
- package/dist/page-editor-api/parser/model/chart/ChartAggregation.js +94 -0
- package/dist/page-editor-api/parser/model/chart/index.d.ts +2 -0
- package/dist/page-editor-api/parser/model/chart/index.js +18 -0
- package/dist/page-editor-api/parser/model/fields/ConnectedFieldsAggregation.d.ts +9 -0
- package/dist/page-editor-api/parser/model/fields/ConnectedFieldsAggregation.js +13 -0
- package/dist/page-editor-api/parser/model/fields/FieldAggregation.d.ts +25 -0
- package/dist/page-editor-api/parser/model/fields/FieldAggregation.js +42 -0
- package/dist/page-editor-api/parser/model/fields/FieldsAggregation.d.ts +22 -0
- package/dist/page-editor-api/parser/model/fields/FieldsAggregation.js +34 -0
- package/dist/page-editor-api/parser/model/fields/index.d.ts +4 -0
- package/dist/page-editor-api/parser/model/fields/index.js +20 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldAggregation.d.ts +39 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldAggregation.js +94 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldsAggregation.d.ts +36 -0
- package/dist/page-editor-api/parser/model/filter-fields/FilterFieldsAggregation.js +59 -0
- package/dist/page-editor-api/parser/model/filter-fields/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/filter-fields/index.js +19 -0
- package/dist/page-editor-api/parser/model/index.d.ts +19 -0
- package/dist/page-editor-api/parser/model/index.js +35 -0
- package/dist/page-editor-api/parser/model/macros/MacrosRoot.d.ts +48 -0
- package/dist/page-editor-api/parser/model/macros/MacrosRoot.js +114 -0
- package/dist/page-editor-api/parser/model/macros/index.d.ts +2 -0
- package/dist/page-editor-api/parser/model/macros/index.js +18 -0
- package/dist/page-editor-api/parser/model/sections/HeaderSectionsAggregation.d.ts +31 -0
- package/dist/page-editor-api/parser/model/sections/HeaderSectionsAggregation.js +82 -0
- package/dist/page-editor-api/parser/model/sections/SectionAggregation.d.ts +78 -0
- package/dist/page-editor-api/parser/model/sections/SectionAggregation.js +131 -0
- package/dist/page-editor-api/parser/model/sections/SectionsAggregation.d.ts +135 -0
- package/dist/page-editor-api/parser/model/sections/SectionsAggregation.js +402 -0
- package/dist/page-editor-api/parser/model/sections/SectionsObjectAggregation.d.ts +50 -0
- package/dist/page-editor-api/parser/model/sections/SectionsObjectAggregation.js +119 -0
- package/dist/page-editor-api/parser/model/sections/SubSectionsAggregation.d.ts +39 -0
- package/dist/page-editor-api/parser/model/sections/SubSectionsAggregation.js +70 -0
- package/dist/page-editor-api/parser/model/sections/index.d.ts +6 -0
- package/dist/page-editor-api/parser/model/sections/index.js +22 -0
- package/dist/page-editor-api/parser/model/table/ColumnAggregation.d.ts +89 -0
- package/dist/page-editor-api/parser/model/table/ColumnAggregation.js +175 -0
- package/dist/page-editor-api/parser/model/table/ColumnsAggregation.d.ts +113 -0
- package/dist/page-editor-api/parser/model/table/ColumnsAggregation.js +293 -0
- package/dist/page-editor-api/parser/model/table/TableAggregation.d.ts +13 -0
- package/dist/page-editor-api/parser/model/table/TableAggregation.js +21 -0
- package/dist/page-editor-api/parser/model/table/ToolbarAggregation.d.ts +15 -0
- package/dist/page-editor-api/parser/model/table/ToolbarAggregation.js +22 -0
- package/dist/page-editor-api/parser/model/table/index.d.ts +5 -0
- package/dist/page-editor-api/parser/model/table/index.js +21 -0
- package/dist/page-editor-api/parser/model/table/utils.d.ts +12 -0
- package/dist/page-editor-api/parser/model/table/utils.js +44 -0
- package/dist/page-editor-api/parser/model/types/annotations.d.ts +63 -0
- package/dist/page-editor-api/parser/model/types/annotations.js +29 -0
- package/dist/page-editor-api/parser/model/types/common.d.ts +13 -0
- package/dist/page-editor-api/parser/model/types/common.js +3 -0
- package/dist/page-editor-api/parser/model/types/index.d.ts +220 -0
- package/dist/page-editor-api/parser/model/types/index.js +149 -0
- package/dist/page-editor-api/parser/model/utils/annotations.d.ts +38 -0
- package/dist/page-editor-api/parser/model/utils/annotations.js +120 -0
- package/dist/page-editor-api/parser/model/utils/i18n.d.ts +33 -0
- package/dist/page-editor-api/parser/model/utils/i18n.js +69 -0
- package/dist/page-editor-api/parser/model/utils/index.d.ts +6 -0
- package/dist/page-editor-api/parser/model/utils/index.js +22 -0
- package/dist/page-editor-api/parser/model/utils/object.d.ts +25 -0
- package/dist/page-editor-api/parser/model/utils/object.js +68 -0
- package/dist/page-editor-api/parser/model/utils/sort.d.ts +31 -0
- package/dist/page-editor-api/parser/model/utils/sort.js +18 -0
- package/dist/page-editor-api/parser/model/utils/utils.d.ts +94 -0
- package/dist/page-editor-api/parser/model/utils/utils.js +267 -0
- package/dist/page-editor-api/parser/model/views/ViewAggregation.d.ts +62 -0
- package/dist/page-editor-api/parser/model/views/ViewAggregation.js +112 -0
- package/dist/page-editor-api/parser/model/views/ViewsAggregation.d.ts +54 -0
- package/dist/page-editor-api/parser/model/views/ViewsAggregation.js +141 -0
- package/dist/page-editor-api/parser/model/views/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/views/index.js +19 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFilterAggregation.d.ts +11 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFilterAggregation.js +15 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFiltersAggregation.d.ts +11 -0
- package/dist/page-editor-api/parser/model/visual-filters/VisualFiltersAggregation.js +15 -0
- package/dist/page-editor-api/parser/model/visual-filters/index.d.ts +3 -0
- package/dist/page-editor-api/parser/model/visual-filters/index.js +19 -0
- package/dist/page-editor-api/parser/tree.d.ts +135 -0
- package/dist/page-editor-api/parser/tree.js +464 -0
- package/dist/page-editor-api/project.d.ts +40 -0
- package/dist/page-editor-api/project.js +124 -0
- package/dist/page-editor-api/sapuxFtfsFileIO.d.ts +84 -0
- package/dist/page-editor-api/sapuxFtfsFileIO.js +195 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.js +120 -0
- package/dist/tools/execute-functionality.d.ts +19 -0
- package/dist/tools/execute-functionality.js +175 -0
- package/dist/tools/functionalities/controller-extension/index.d.ts +4 -0
- package/dist/tools/functionalities/controller-extension/index.js +136 -0
- package/dist/tools/functionalities/functionalities.d.ts +4 -0
- package/dist/tools/functionalities/functionalities.js +19 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/command.d.ts +9 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/command.js +158 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.d.ts +4 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/generate-fiori-ui-app.js +240 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/index.d.ts +2 -0
- package/dist/tools/functionalities/generate-fiori-ui-app/index.js +7 -0
- package/dist/tools/functionalities/index.d.ts +2 -0
- package/dist/tools/functionalities/index.js +18 -0
- package/dist/tools/functionalities/page/add-page.d.ts +5 -0
- package/dist/tools/functionalities/page/add-page.js +89 -0
- package/dist/tools/functionalities/page/application.d.ts +212 -0
- package/dist/tools/functionalities/page/application.js +616 -0
- package/dist/tools/functionalities/page/delete-page.d.ts +4 -0
- package/dist/tools/functionalities/page/delete-page.js +71 -0
- package/dist/tools/functionalities/page/index.d.ts +3 -0
- package/dist/tools/functionalities/page/index.js +10 -0
- package/dist/tools/functionalities/page/service.d.ts +82 -0
- package/dist/tools/functionalities/page/service.js +114 -0
- package/dist/tools/functionalities/page/serviceStore.d.ts +17 -0
- package/dist/tools/functionalities/page/serviceStore.js +34 -0
- package/dist/tools/functionalities/page/types.d.ts +42 -0
- package/dist/tools/functionalities/page/types.js +11 -0
- package/dist/tools/functionalities/page/utils.d.ts +12 -0
- package/dist/tools/functionalities/page/utils.js +63 -0
- package/dist/tools/get-functionality-details.d.ts +24 -0
- package/dist/tools/get-functionality-details.js +142 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.js +55 -0
- package/dist/tools/input-schema/execute-functionality.json +28 -0
- package/dist/tools/input-schema/get-functionality-details.json +24 -0
- package/dist/tools/input-schema/index.d.ts +5 -0
- package/dist/tools/input-schema/index.js +15 -0
- package/dist/tools/input-schema/list-fiori-apps.json +12 -0
- package/dist/tools/input-schema/list-functionality.json +10 -0
- package/dist/tools/list-fiori-apps.d.ts +10 -0
- package/dist/tools/list-fiori-apps.js +33 -0
- package/dist/tools/list-functionalities.d.ts +10 -0
- package/dist/tools/list-functionalities.js +145 -0
- package/dist/tools/output-schema/execute-functionality.json +39 -0
- package/dist/tools/output-schema/get-functionality-details.json +142 -0
- package/dist/tools/output-schema/index.d.ts +5 -0
- package/dist/tools/output-schema/index.js +15 -0
- package/dist/tools/output-schema/list-fiori-apps.json +41 -0
- package/dist/tools/output-schema/list-functionality.json +37 -0
- package/dist/tools/utils.d.ts +16 -0
- package/dist/tools/utils.js +74 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.js +3 -0
- package/package.json +63 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ViewAggregation = void 0;
|
|
7
|
+
const i18next_1 = __importDefault(require("i18next"));
|
|
8
|
+
const ObjectAggregation_1 = require("../ObjectAggregation");
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
/**
|
|
11
|
+
* Represents an aggregation for view objects.
|
|
12
|
+
*/
|
|
13
|
+
class ViewAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
14
|
+
title;
|
|
15
|
+
actions = [];
|
|
16
|
+
sortableItem = types_1.SortingOptions.Enabled;
|
|
17
|
+
sortableCollection = 'views';
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of `ViewAggregation`.
|
|
20
|
+
*
|
|
21
|
+
* @param data Optional aggregation data object used to initialize properties.
|
|
22
|
+
* @param schema Optional JSON schema fragment associated with this aggregation.
|
|
23
|
+
*/
|
|
24
|
+
constructor(data, schema) {
|
|
25
|
+
super(data, schema);
|
|
26
|
+
if (schema?.key && !schema.annotationPath && !schema.properties?.['annotationPath']) {
|
|
27
|
+
// Custom view - generate annotation path, because it is not provided by schema
|
|
28
|
+
schema.annotationPath = `${types_1.CUSTOM_VIEW_PREFIX}${schema.key})`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Method returns display name of aggregation without applying i18n translation.
|
|
33
|
+
* Overwritten for column handling.
|
|
34
|
+
*
|
|
35
|
+
* @returns Display name of aggregation.
|
|
36
|
+
*/
|
|
37
|
+
getRawDisplayName() {
|
|
38
|
+
return this.title || super.getRawDisplayName();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Public method to mark view as custom action.
|
|
42
|
+
*/
|
|
43
|
+
markAsCustomView() {
|
|
44
|
+
this.custom = true;
|
|
45
|
+
this.actions = [types_1.AggregationActions.Delete, types_1.AggregationActions.OpenSource];
|
|
46
|
+
this.sortableItem = types_1.SortingOptions.Enabled;
|
|
47
|
+
this.additionalText = i18next_1.default.t('PAGE_EDITOR_OUTLINE_NODE_DESC_CUSTOM_VIEW');
|
|
48
|
+
this.i18nKey = this.parent?.i18nKey;
|
|
49
|
+
if (this.properties.label?.value) {
|
|
50
|
+
this.title = this.properties.label.value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Overwritten method for data update of list report view.
|
|
55
|
+
*
|
|
56
|
+
* @param data Data which should be used for value population.
|
|
57
|
+
* @param page Page config data.
|
|
58
|
+
* @param pageType Page type.
|
|
59
|
+
* @param path Aggregation path.
|
|
60
|
+
* @param annotations Annotations data.
|
|
61
|
+
*/
|
|
62
|
+
updatePropertiesValues(data, page, pageType, path, annotations) {
|
|
63
|
+
super.updatePropertiesValues(data, page, pageType, path, annotations);
|
|
64
|
+
// Update icon
|
|
65
|
+
if (this.isTableView()) {
|
|
66
|
+
this.icon = 'Table';
|
|
67
|
+
}
|
|
68
|
+
else if (this.isChartView()) {
|
|
69
|
+
this.icon = 'Chart';
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.icon = 'Sections';
|
|
73
|
+
}
|
|
74
|
+
// validate annotation path property
|
|
75
|
+
if (this.isAnnotationView() && !this.schema?.['annotationPath'] && this.properties['annotationPath']) {
|
|
76
|
+
// set warning for annotation path property
|
|
77
|
+
this.properties['annotationPath'].messages = [
|
|
78
|
+
{
|
|
79
|
+
type: types_1.PropertyMessageType.Warning,
|
|
80
|
+
text: i18next_1.default.t('PAGE_EDITOR_PROPERTIES_VIEW_NO_ANNOTATION_PATH')
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Method returns true if view aggregation is table view.
|
|
87
|
+
*
|
|
88
|
+
* @returns True if view is table view.
|
|
89
|
+
*/
|
|
90
|
+
isTableView() {
|
|
91
|
+
return 'columns' in this.aggregations;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Method returns true if view aggregation is chart view.
|
|
95
|
+
*
|
|
96
|
+
* @returns True if view is chart view.
|
|
97
|
+
*/
|
|
98
|
+
isChartView() {
|
|
99
|
+
return !('columns' in this.aggregations) && 'toolBar' in this.aggregations;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Method returns true if aggregation is annotation view.
|
|
103
|
+
*
|
|
104
|
+
* @returns True if view is annotation view.
|
|
105
|
+
*/
|
|
106
|
+
isAnnotationView() {
|
|
107
|
+
return ((!this.custom && 'annotationPath' in this.properties) ||
|
|
108
|
+
(!this.custom && this.schema?.annotationPath && !this.schema?.annotationPath.startsWith(types_1.CUSTOM_VIEW_PREFIX)));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.ViewAggregation = ViewAggregation;
|
|
112
|
+
//# sourceMappingURL=ViewAggregation.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ObjectAggregation } from '../ObjectAggregation';
|
|
2
|
+
import type { PageData, PageAnnotations, PropertyPath } from '../types';
|
|
3
|
+
import { AggregationCreationForm } from '../types';
|
|
4
|
+
import { ViewAggregation } from './ViewAggregation';
|
|
5
|
+
import type { PageConfig, PageType } from '@sap/ux-specification/dist/types/src';
|
|
6
|
+
/**
|
|
7
|
+
* Represents an aggregation for views objects.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ViewsAggregation extends ObjectAggregation {
|
|
10
|
+
sortableList: boolean;
|
|
11
|
+
childClass: typeof ViewAggregation;
|
|
12
|
+
allowedAnnotationCreationForms: AggregationCreationForm[];
|
|
13
|
+
sortableCollection: string | undefined;
|
|
14
|
+
sortableConfigOnly: boolean;
|
|
15
|
+
i18nKey: string;
|
|
16
|
+
/**
|
|
17
|
+
* Refreshes internal data based on latest annotation node data.
|
|
18
|
+
*
|
|
19
|
+
* @param annotations
|
|
20
|
+
*/
|
|
21
|
+
updateAnnotationData(annotations: PageAnnotations | undefined): void;
|
|
22
|
+
/**
|
|
23
|
+
* Overwritten method for data update of list report views container node.
|
|
24
|
+
*
|
|
25
|
+
* @param data Data which should be used for value population.
|
|
26
|
+
* @param page Page config data.
|
|
27
|
+
* @param pageType Page type.
|
|
28
|
+
* @param path Aggregation path.
|
|
29
|
+
* @param annotations Annotations data.
|
|
30
|
+
*/
|
|
31
|
+
updatePropertiesValues(data: PageData, page: PageConfig, pageType: PageType, path: PropertyPath, annotations: PageAnnotations | undefined): void;
|
|
32
|
+
/**
|
|
33
|
+
* Determines the delete action configuration for a given view aggregation.
|
|
34
|
+
*
|
|
35
|
+
* @param viewAggregation - The view aggregation to evaluate.
|
|
36
|
+
* @param annotations - The current page annotations context.
|
|
37
|
+
* @returns The delete action configuration for the view.
|
|
38
|
+
*/
|
|
39
|
+
private getViewDeleteAction;
|
|
40
|
+
/**
|
|
41
|
+
* Enables/Disables the chart form based on the annotations.
|
|
42
|
+
*
|
|
43
|
+
* @param forms Array of creation forms
|
|
44
|
+
* @param annotations Page annotations
|
|
45
|
+
*/
|
|
46
|
+
private toggleChartForm;
|
|
47
|
+
/**
|
|
48
|
+
* Method returns count of annotations views.
|
|
49
|
+
*
|
|
50
|
+
* @returns Count of annotations views.
|
|
51
|
+
*/
|
|
52
|
+
private getAnnotationViewCount;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ViewsAggregation.d.ts.map
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ViewsAggregation = void 0;
|
|
7
|
+
const ObjectAggregation_1 = require("../ObjectAggregation");
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
const ViewAggregation_1 = require("./ViewAggregation");
|
|
10
|
+
const i18next_1 = __importDefault(require("i18next"));
|
|
11
|
+
const utils_1 = require("../utils");
|
|
12
|
+
/**
|
|
13
|
+
* Represents an aggregation for views objects.
|
|
14
|
+
*/
|
|
15
|
+
class ViewsAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
16
|
+
sortableList = true;
|
|
17
|
+
childClass = ViewAggregation_1.ViewAggregation;
|
|
18
|
+
allowedAnnotationCreationForms = [
|
|
19
|
+
types_1.AggregationCreationForm.TableView,
|
|
20
|
+
types_1.AggregationCreationForm.AnalyticalChartView,
|
|
21
|
+
types_1.AggregationCreationForm.CustomViewV4
|
|
22
|
+
];
|
|
23
|
+
sortableCollection = 'views';
|
|
24
|
+
sortableConfigOnly = true;
|
|
25
|
+
// i18n key
|
|
26
|
+
i18nKey = 'VIEWS';
|
|
27
|
+
/**
|
|
28
|
+
* Refreshes internal data based on latest annotation node data.
|
|
29
|
+
*
|
|
30
|
+
* @param annotations
|
|
31
|
+
*/
|
|
32
|
+
updateAnnotationData(annotations) {
|
|
33
|
+
super.updateAnnotationData(annotations);
|
|
34
|
+
if (annotations) {
|
|
35
|
+
this.toggleChartForm(this.annotationCreationForms, annotations);
|
|
36
|
+
for (const view in this.aggregations) {
|
|
37
|
+
const viewAggregation = this.aggregations[view];
|
|
38
|
+
const deleteAction = this.getViewDeleteAction(viewAggregation, annotations);
|
|
39
|
+
const actions = viewAggregation.actions || [];
|
|
40
|
+
actions.push(deleteAction);
|
|
41
|
+
viewAggregation.actions = actions;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Overwritten method for data update of list report views container node.
|
|
47
|
+
*
|
|
48
|
+
* @param data Data which should be used for value population.
|
|
49
|
+
* @param page Page config data.
|
|
50
|
+
* @param pageType Page type.
|
|
51
|
+
* @param path Aggregation path.
|
|
52
|
+
* @param annotations Annotations data.
|
|
53
|
+
*/
|
|
54
|
+
updatePropertiesValues(data, page, pageType, path, annotations) {
|
|
55
|
+
super.updatePropertiesValues(data, page, pageType, path, annotations);
|
|
56
|
+
this.formSchema = this.additionalProperties?.aggregations['views'];
|
|
57
|
+
// Custom creation form - check schema if supported
|
|
58
|
+
if (this.formSchema?.properties?.template) {
|
|
59
|
+
this.schemaCreationForms = [
|
|
60
|
+
{
|
|
61
|
+
name: types_1.AggregationCreationForm.CustomViewV4,
|
|
62
|
+
kind: types_1.SCHEMA_CREATION_FORM,
|
|
63
|
+
title: 'PAGE_EDITOR_OUTLINE_ADD_CUSTOM_VIEW_TITLE',
|
|
64
|
+
disabled: false
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
const views = data || {};
|
|
69
|
+
if (Object.keys(views).length !== 0) {
|
|
70
|
+
for (const id in views) {
|
|
71
|
+
const viewAggregation = this.aggregations[id];
|
|
72
|
+
if (viewAggregation?.schema &&
|
|
73
|
+
!viewAggregation?.schema.properties?.['annotationPath'] &&
|
|
74
|
+
(!viewAggregation.schema.annotationPath ||
|
|
75
|
+
viewAggregation.schema.annotationPath.startsWith(types_1.CUSTOM_VIEW_PREFIX))) {
|
|
76
|
+
viewAggregation.markAsCustomView();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Determines the delete action configuration for a given view aggregation.
|
|
83
|
+
*
|
|
84
|
+
* @param viewAggregation - The view aggregation to evaluate.
|
|
85
|
+
* @param annotations - The current page annotations context.
|
|
86
|
+
* @returns The delete action configuration for the view.
|
|
87
|
+
*/
|
|
88
|
+
getViewDeleteAction(viewAggregation, annotations) {
|
|
89
|
+
const id = viewAggregation.annotationNodeId;
|
|
90
|
+
let disableViewDeletion = true;
|
|
91
|
+
const annotationViewsCount = this.getAnnotationViewCount();
|
|
92
|
+
if (id) {
|
|
93
|
+
disableViewDeletion = (0, utils_1.isArrayEqual)(annotations.dialogsContext?.suppressTableViewDeletionNodeId || [], id);
|
|
94
|
+
}
|
|
95
|
+
else if (annotationViewsCount > 1 || (annotationViewsCount === 1 && viewAggregation.custom)) {
|
|
96
|
+
// Allow annotation view deletion if there are at least two annotation views, else deletion only available for custom views
|
|
97
|
+
disableViewDeletion = false;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
type: types_1.AggregationActions.Delete,
|
|
101
|
+
disabled: disableViewDeletion,
|
|
102
|
+
title: i18next_1.default.t(disableViewDeletion ? 'TABLE_VIEW_DELETE_DISABLED_TOOLTIP' : 'PAGE_EDITOR_OUTLINE_DELETE_TOOLTIP')
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Enables/Disables the chart form based on the annotations.
|
|
107
|
+
*
|
|
108
|
+
* @param forms Array of creation forms
|
|
109
|
+
* @param annotations Page annotations
|
|
110
|
+
*/
|
|
111
|
+
toggleChartForm(forms, annotations) {
|
|
112
|
+
const chartForm = forms.find((form) => form.name === types_1.AggregationCreationForm.AnalyticalChartView);
|
|
113
|
+
if (chartForm && annotations.dialogsContext?.analyticalChartSupport) {
|
|
114
|
+
if (!annotations.dialogsContext.analyticalChartSupport.addToMultiViewEnabled) {
|
|
115
|
+
chartForm.disabled = true;
|
|
116
|
+
chartForm.disabledTitle = annotations.dialogsContext.analyticalChartSupport.addToMultiViewTooltip;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
chartForm.disabled = false;
|
|
120
|
+
delete chartForm.disabledTitle;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Method returns count of annotations views.
|
|
126
|
+
*
|
|
127
|
+
* @returns Count of annotations views.
|
|
128
|
+
*/
|
|
129
|
+
getAnnotationViewCount() {
|
|
130
|
+
let count = 0;
|
|
131
|
+
for (const view in this.aggregations) {
|
|
132
|
+
const aggregation = this.aggregations[view];
|
|
133
|
+
if (aggregation instanceof ViewAggregation_1.ViewAggregation && aggregation.isAnnotationView()) {
|
|
134
|
+
count++;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return count;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.ViewsAggregation = ViewsAggregation;
|
|
141
|
+
//# sourceMappingURL=ViewsAggregation.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ViewAggregation"), exports);
|
|
18
|
+
__exportStar(require("./ViewsAggregation"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ObjectAggregation } from '../ObjectAggregation';
|
|
2
|
+
import { AggregationActions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an aggregation for visual filter objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class VisualFilterAggregation extends ObjectAggregation {
|
|
7
|
+
sortableCollection: string | undefined;
|
|
8
|
+
actions: AggregationActions[];
|
|
9
|
+
isViewNode: boolean;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=VisualFilterAggregation.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VisualFilterAggregation = void 0;
|
|
4
|
+
const ObjectAggregation_1 = require("../ObjectAggregation");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
/**
|
|
7
|
+
* Represents an aggregation for visual filter objects.
|
|
8
|
+
*/
|
|
9
|
+
class VisualFilterAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
10
|
+
sortableCollection = 'visualFilters';
|
|
11
|
+
actions = [types_1.AggregationActions.Delete];
|
|
12
|
+
isViewNode = true;
|
|
13
|
+
}
|
|
14
|
+
exports.VisualFilterAggregation = VisualFilterAggregation;
|
|
15
|
+
//# sourceMappingURL=VisualFilterAggregation.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ObjectAggregation } from '../ObjectAggregation';
|
|
2
|
+
import { VisualFilterAggregation } from './VisualFilterAggregation';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an aggregation for visual filters objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class VisualFiltersAggregation extends ObjectAggregation {
|
|
7
|
+
sortableList: boolean;
|
|
8
|
+
childClass: typeof VisualFilterAggregation;
|
|
9
|
+
i18nKey: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=VisualFiltersAggregation.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VisualFiltersAggregation = void 0;
|
|
4
|
+
const ObjectAggregation_1 = require("../ObjectAggregation");
|
|
5
|
+
const VisualFilterAggregation_1 = require("./VisualFilterAggregation");
|
|
6
|
+
/**
|
|
7
|
+
* Represents an aggregation for visual filters objects.
|
|
8
|
+
*/
|
|
9
|
+
class VisualFiltersAggregation extends ObjectAggregation_1.ObjectAggregation {
|
|
10
|
+
sortableList = true;
|
|
11
|
+
childClass = VisualFilterAggregation_1.VisualFilterAggregation;
|
|
12
|
+
i18nKey = 'VISUAL_FILTERS';
|
|
13
|
+
}
|
|
14
|
+
exports.VisualFiltersAggregation = VisualFiltersAggregation;
|
|
15
|
+
//# sourceMappingURL=VisualFiltersAggregation.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./VisualFilterAggregation"), exports);
|
|
18
|
+
__exportStar(require("./VisualFiltersAggregation"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { ArtifactType, PageConfig } from '@sap/ux-specification/dist/types/src';
|
|
2
|
+
import { PageTypeV4 } from '@sap/ux-specification/dist/types/src';
|
|
3
|
+
import type { AllowedMoveRange, ObjectAggregation, PageAnnotations, PropertyPath, SettingOption } from './model';
|
|
4
|
+
import { PageEditModel, AggregationNodeType } from './model';
|
|
5
|
+
interface TraverseNodeData {
|
|
6
|
+
text: string;
|
|
7
|
+
level: number;
|
|
8
|
+
path: string;
|
|
9
|
+
model: PageEditModel;
|
|
10
|
+
}
|
|
11
|
+
export interface TreeNode {
|
|
12
|
+
path: PropertyPath;
|
|
13
|
+
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* Property to set tooltip to node. If title is not passed then value of "text" will be applied as tooltip.
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
children: TreeNode[];
|
|
19
|
+
root?: boolean;
|
|
20
|
+
locations?: Location[];
|
|
21
|
+
id?: string;
|
|
22
|
+
hidden?: boolean;
|
|
23
|
+
additionalText?: string;
|
|
24
|
+
moveProps?: NodeMoveProps;
|
|
25
|
+
properties: TreeNodeProperty[];
|
|
26
|
+
annotationNodeId?: number[];
|
|
27
|
+
type?: AggregationNodeType;
|
|
28
|
+
value?: unknown;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Use cases:
|
|
32
|
+
* 1. Drag enabled - drop validity are checked bassed on allowedParents or allowedChildTypes;
|
|
33
|
+
* Properties should be used "movable" + ("allowedParents" or ("type" + "allowedChildTypes")
|
|
34
|
+
* 2. Drag disabled - move buttons are hidden
|
|
35
|
+
* movable = false and moveBtn = undefined
|
|
36
|
+
* 3. Drag disabled - move buttons are visible, but disabled
|
|
37
|
+
* movable = false and moveBtn defined with "disabled" property
|
|
38
|
+
* 4. Item is restricted to drop - use case when we need mark some nodes as restricted.
|
|
39
|
+
* undroppable = true
|
|
40
|
+
*/
|
|
41
|
+
export interface NodeMoveProps {
|
|
42
|
+
movable: boolean;
|
|
43
|
+
dropRestricted?: boolean;
|
|
44
|
+
type?: string;
|
|
45
|
+
allowedChildTypes?: string[];
|
|
46
|
+
allowedParents?: AllowedParent[];
|
|
47
|
+
}
|
|
48
|
+
export interface AllowedParent {
|
|
49
|
+
path: PropertyPath;
|
|
50
|
+
allowedRanges?: AllowedMoveRange[];
|
|
51
|
+
}
|
|
52
|
+
export interface NodePropertyOptions {
|
|
53
|
+
key: boolean | string | number | undefined;
|
|
54
|
+
text: string;
|
|
55
|
+
reset?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface TreeNodeProperty {
|
|
58
|
+
name: string;
|
|
59
|
+
value?: unknown;
|
|
60
|
+
description?: string;
|
|
61
|
+
displayName?: string;
|
|
62
|
+
artifactType?: ArtifactType;
|
|
63
|
+
schemaPath: PropertyPath;
|
|
64
|
+
type: 'string' | 'number' | 'boolean' | 'object';
|
|
65
|
+
options?: NodePropertyOptions[];
|
|
66
|
+
properties?: TreeNodeProperty[];
|
|
67
|
+
}
|
|
68
|
+
export declare const BOOLEAN_DISPLAY_TRUE = "True";
|
|
69
|
+
export declare const BOOLEAN_DISPLAY_FALSE = "False";
|
|
70
|
+
/**
|
|
71
|
+
* Method returns dom id for node.
|
|
72
|
+
*
|
|
73
|
+
* @param path Node path.
|
|
74
|
+
* @returns Outline node id.
|
|
75
|
+
*/
|
|
76
|
+
export declare function getNodeId(path: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Creates a generic `TreeNodeProperty` object from a property or aggregation.
|
|
79
|
+
*
|
|
80
|
+
* @param name - The name of the property.
|
|
81
|
+
* @param displayName - The display name of the property.
|
|
82
|
+
* @param property - The source property or aggregation.
|
|
83
|
+
* @param schemaPath - The schema path for the property.
|
|
84
|
+
* @returns The generated tree node property.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getGenericBase(name: string, displayName: string, property: SettingOption | ObjectAggregation, schemaPath: PropertyPath): TreeNodeProperty;
|
|
87
|
+
/**
|
|
88
|
+
* Generates a `TreeNodeProperty` with type-specific configurations based on a `SettingOption`.
|
|
89
|
+
*
|
|
90
|
+
* @param name - The name of the property.
|
|
91
|
+
* @param displayName - The display name of the property.
|
|
92
|
+
* @param property - The source property.
|
|
93
|
+
* @param schemaPath - The schema path for the property.
|
|
94
|
+
* @returns The configured tree node property, or `undefined` if unhandled.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getPropertyData(name: string, displayName: string, property: SettingOption, schemaPath: PropertyPath): undefined | TreeNodeProperty;
|
|
97
|
+
/**
|
|
98
|
+
* Recursive method goes through aggregation tree and creates tree node.
|
|
99
|
+
*
|
|
100
|
+
* @param aggregation Start Aggregation.
|
|
101
|
+
* @param traverseNodeData Traverse data contains traverse context information.
|
|
102
|
+
* @returns Outline tree node.
|
|
103
|
+
*/
|
|
104
|
+
export declare function traverseTree(aggregation: ObjectAggregation, traverseNodeData: TraverseNodeData): TreeNode;
|
|
105
|
+
/**
|
|
106
|
+
* Method creates tree for passed edit model.
|
|
107
|
+
*
|
|
108
|
+
* @param schema Page or application schema.
|
|
109
|
+
* @param data Configuration file mapped to schema.
|
|
110
|
+
* @param pageType Page type. If pageType is not passed, then considered as application.
|
|
111
|
+
* @param annotation Page annotations.
|
|
112
|
+
* @returns Outline tree.
|
|
113
|
+
*/
|
|
114
|
+
export declare function getTree(schema: string, data: PageConfig, pageType: PageTypeV4, annotation?: PageAnnotations): TreeNode;
|
|
115
|
+
/**
|
|
116
|
+
* Method finds node by passed annotation nodeId.
|
|
117
|
+
*
|
|
118
|
+
* @param tree Nodes tree to lookup.
|
|
119
|
+
* @param nodeId Annotation node id.
|
|
120
|
+
* @returns Found node information.
|
|
121
|
+
*/
|
|
122
|
+
export declare function findNodeByAnnotationNodeId(tree: TreeNode[], nodeId: number[]): TreeNode | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Finds a node or property in a tree by its property path.
|
|
125
|
+
*
|
|
126
|
+
* @param tree - The tree of nodes to search.
|
|
127
|
+
* @param propertyPath - The path of the property to find.
|
|
128
|
+
* @returns The matching node or property if found, otherwise `undefined`.
|
|
129
|
+
*/
|
|
130
|
+
export declare function findByPath(tree: TreeNode[], propertyPath: PropertyPath): {
|
|
131
|
+
node?: TreeNode;
|
|
132
|
+
property?: TreeNodeProperty;
|
|
133
|
+
} | undefined;
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=tree.d.ts.map
|