@gooddata/sdk-ui-ext 11.54.0-alpha.4 → 11.54.0-alpha.5
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/NOTICE +92923 -17333
- package/esm/dataLoaders/dataLoaders.mock.d.ts +4 -0
- package/esm/dataLoaders/dataLoaders.mock.d.ts.map +1 -0
- package/esm/dataLoaders/dataLoaders.mock.js +52 -0
- package/esm/internal/components/pluggableVisualizations/areaChart/getInsightWithDrillDownAppliedMock.d.ts +8 -0
- package/esm/internal/components/pluggableVisualizations/areaChart/getInsightWithDrillDownAppliedMock.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/areaChart/getInsightWithDrillDownAppliedMock.js +119 -0
- package/esm/internal/components/pluggableVisualizations/baseChart/getInsightWithDrillDownAppliedMock.d.ts +7 -0
- package/esm/internal/components/pluggableVisualizations/baseChart/getInsightWithDrillDownAppliedMock.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/baseChart/getInsightWithDrillDownAppliedMock.js +98 -0
- package/esm/internal/components/pluggableVisualizations/bulletChart/getInsightWithDrillDownAppliedMock.d.ts +8 -0
- package/esm/internal/components/pluggableVisualizations/bulletChart/getInsightWithDrillDownAppliedMock.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/bulletChart/getInsightWithDrillDownAppliedMock.js +110 -0
- package/esm/internal/components/pluggableVisualizations/geoCommon/viewportSync.test.helpers.d.ts +45 -0
- package/esm/internal/components/pluggableVisualizations/geoCommon/viewportSync.test.helpers.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/geoCommon/viewportSync.test.helpers.js +48 -0
- package/esm/internal/components/pluggableVisualizations/getInsightWithDrillDownAppliedMock.d.ts +13 -0
- package/esm/internal/components/pluggableVisualizations/getInsightWithDrillDownAppliedMock.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/getInsightWithDrillDownAppliedMock.js +132 -0
- package/esm/internal/components/pluggableVisualizations/pluggableVisualizations.test.helpers.d.ts +16 -0
- package/esm/internal/components/pluggableVisualizations/pluggableVisualizations.test.helpers.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/pluggableVisualizations.test.helpers.js +39 -0
- package/esm/internal/components/pluggableVisualizations/reverseAndTrimIntersectionMock.d.ts +10 -0
- package/esm/internal/components/pluggableVisualizations/reverseAndTrimIntersectionMock.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/reverseAndTrimIntersectionMock.js +94 -0
- package/esm/internal/components/pluggableVisualizations/treeMap/getInsightWithDrillDownAppliedMock.d.ts +8 -0
- package/esm/internal/components/pluggableVisualizations/treeMap/getInsightWithDrillDownAppliedMock.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/treeMap/getInsightWithDrillDownAppliedMock.js +119 -0
- package/esm/internal/components/pluggableVisualizations/visConstruct.fixture.d.ts +17 -0
- package/esm/internal/components/pluggableVisualizations/visConstruct.fixture.d.ts.map +1 -0
- package/esm/internal/components/pluggableVisualizations/visConstruct.fixture.js +18 -0
- package/esm/internal/index.d.ts +1 -1
- package/esm/internal/index.d.ts.map +1 -1
- package/esm/internal/index.js +1 -1
- package/esm/internal/mocks/referencePointMocks.d.ts +187 -0
- package/esm/internal/mocks/referencePointMocks.d.ts.map +1 -0
- package/esm/internal/mocks/referencePointMocks.js +4045 -0
- package/esm/internal/mocks/testColorHelper.d.ts +19 -0
- package/esm/internal/mocks/testColorHelper.d.ts.map +1 -0
- package/esm/internal/mocks/testColorHelper.js +65 -0
- package/esm/internal/mocks/testMocks.d.ts +24 -0
- package/esm/internal/mocks/testMocks.d.ts.map +1 -0
- package/esm/internal/mocks/testMocks.js +739 -0
- package/esm/internal/mocks/uiConfigMocks.d.ts +17 -0
- package/esm/internal/mocks/uiConfigMocks.d.ts.map +1 -0
- package/esm/internal/mocks/uiConfigMocks.js +125 -0
- package/esm/internal/mocks/visualizationObjectMocks.d.ts +7 -0
- package/esm/internal/mocks/visualizationObjectMocks.d.ts.map +1 -0
- package/esm/internal/mocks/visualizationObjectMocks.js +49 -0
- package/esm/internal/testDataProvider.d.ts +16 -0
- package/esm/internal/testDataProvider.d.ts.map +1 -0
- package/esm/internal/testDataProvider.js +36 -0
- package/esm/internal/testIntlProvider.d.ts.map +1 -0
- package/esm/internal/{tests/testIntlProvider.js → testIntlProvider.js} +2 -2
- package/package.json +21 -21
- package/esm/internal/tests/testIntlProvider.d.ts.map +0 -1
- /package/esm/internal/{tests/testIntlProvider.d.ts → testIntlProvider.d.ts} +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// (C) 2020-2026 GoodData Corporation
|
|
2
|
+
import { ReferenceData, ReferenceMd } from "@gooddata/reference-workspace";
|
|
3
|
+
import { modifyAttribute, newAttribute, newBucket, newInsightDefinition, newNegativeAttributeFilter, newPositiveAttributeFilter, uriRef, } from "@gooddata/sdk-model";
|
|
4
|
+
const { Department, Region, Won } = ReferenceMd;
|
|
5
|
+
export const targetUri = "target-uri";
|
|
6
|
+
export const insightDefinitionWithStackBy = newInsightDefinition("visualizationClass-url", (b) => {
|
|
7
|
+
return b
|
|
8
|
+
.title("sourceInsight")
|
|
9
|
+
.buckets([
|
|
10
|
+
newBucket("measure", Won),
|
|
11
|
+
newBucket("stack", Region.Default),
|
|
12
|
+
newBucket("view", Department.Default),
|
|
13
|
+
])
|
|
14
|
+
.filters([newNegativeAttributeFilter(Department.Default, [])]);
|
|
15
|
+
});
|
|
16
|
+
export const insightDefinition = newInsightDefinition("visualizationClass-url", (b) => {
|
|
17
|
+
return b
|
|
18
|
+
.title("sourceInsight")
|
|
19
|
+
.buckets([newBucket("measure", Won), newBucket("view", Department.Default, Region.Default)])
|
|
20
|
+
.filters([newNegativeAttributeFilter(Department.Default, [])]);
|
|
21
|
+
});
|
|
22
|
+
const departmentUri = "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/1027";
|
|
23
|
+
const regionUri = "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/1024";
|
|
24
|
+
const westCoastUri = ReferenceData.Region.WestCoast.uri;
|
|
25
|
+
const directSalesUri = ReferenceData.Department.DirectSales.uri;
|
|
26
|
+
export const expectedInsightDefinitionWithStackByDrillToDepartment = newInsightDefinition("visualizationClass-url", (b) => {
|
|
27
|
+
return b
|
|
28
|
+
.title("sourceInsight")
|
|
29
|
+
.buckets([
|
|
30
|
+
newBucket("measure", Won),
|
|
31
|
+
newBucket("stack", Region.Default),
|
|
32
|
+
newBucket("view", newAttribute(uriRef(targetUri), (b) => b.localId(Department.Default.attribute.localIdentifier))),
|
|
33
|
+
])
|
|
34
|
+
.filters([
|
|
35
|
+
newNegativeAttributeFilter(Department.Default, []),
|
|
36
|
+
newPositiveAttributeFilter(modifyAttribute(Department.Default, (a) => a.displayForm(uriRef(departmentUri))), { uris: [directSalesUri] }),
|
|
37
|
+
]);
|
|
38
|
+
});
|
|
39
|
+
export const expectedInsightDefinitionWithStackByDrillToRegion = newInsightDefinition("visualizationClass-url", (b) => {
|
|
40
|
+
return b
|
|
41
|
+
.title("sourceInsight")
|
|
42
|
+
.buckets([
|
|
43
|
+
newBucket("measure", Won),
|
|
44
|
+
newBucket("stack", newAttribute(uriRef(targetUri), (b) => b.localId(Region.Default.attribute.localIdentifier))),
|
|
45
|
+
newBucket("view", Department.Default),
|
|
46
|
+
])
|
|
47
|
+
.filters([
|
|
48
|
+
newNegativeAttributeFilter(Department.Default, []),
|
|
49
|
+
newPositiveAttributeFilter(modifyAttribute(Region.Default, (a) => a.displayForm(uriRef(regionUri))), { uris: [westCoastUri] }),
|
|
50
|
+
newPositiveAttributeFilter(modifyAttribute(Department.Default, (a) => a.displayForm(uriRef(departmentUri))), { uris: [directSalesUri] }),
|
|
51
|
+
]);
|
|
52
|
+
});
|
|
53
|
+
export const expectedInsightDefinitionDrillToRegion = newInsightDefinition("visualizationClass-url", (b) => {
|
|
54
|
+
return b
|
|
55
|
+
.title("sourceInsight")
|
|
56
|
+
.buckets([
|
|
57
|
+
newBucket("measure", Won),
|
|
58
|
+
newBucket("view", newAttribute(uriRef(targetUri), (b) => b.localId(Region.Default.attribute.localIdentifier))),
|
|
59
|
+
])
|
|
60
|
+
.filters([
|
|
61
|
+
newNegativeAttributeFilter(Department.Default, []),
|
|
62
|
+
newPositiveAttributeFilter(modifyAttribute(Region.Default, (a) => a.displayForm(uriRef(regionUri))), { uris: [westCoastUri] }),
|
|
63
|
+
]);
|
|
64
|
+
});
|
|
65
|
+
export const measureHeader = {
|
|
66
|
+
measureHeaderItem: {
|
|
67
|
+
name: Won.measure.title,
|
|
68
|
+
format: "#,##0.00",
|
|
69
|
+
localIdentifier: Won.measure.localIdentifier,
|
|
70
|
+
uri: "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/9203",
|
|
71
|
+
identifier: undefined,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export const westCoastHeader = {
|
|
75
|
+
attributeHeaderItem: {
|
|
76
|
+
name: "West Coast",
|
|
77
|
+
uri: westCoastUri,
|
|
78
|
+
},
|
|
79
|
+
attributeHeader: {
|
|
80
|
+
name: Region.Default.attribute.alias,
|
|
81
|
+
localIdentifier: Region.Default.attribute.localIdentifier,
|
|
82
|
+
uri: regionUri,
|
|
83
|
+
ref: {
|
|
84
|
+
uri: regionUri,
|
|
85
|
+
},
|
|
86
|
+
identifier: "mock-identifier",
|
|
87
|
+
formOf: {
|
|
88
|
+
identifier: "mock-attribute",
|
|
89
|
+
name: "Mock Attribute",
|
|
90
|
+
ref: { uri: regionUri },
|
|
91
|
+
uri: regionUri,
|
|
92
|
+
},
|
|
93
|
+
primaryLabel: {
|
|
94
|
+
uri: regionUri,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
export const directSalesHeader = {
|
|
99
|
+
attributeHeaderItem: {
|
|
100
|
+
name: "Direct Sales",
|
|
101
|
+
uri: directSalesUri,
|
|
102
|
+
},
|
|
103
|
+
attributeHeader: {
|
|
104
|
+
name: Department.Default.attribute.alias,
|
|
105
|
+
localIdentifier: Department.Default.attribute.localIdentifier,
|
|
106
|
+
uri: departmentUri,
|
|
107
|
+
ref: {
|
|
108
|
+
uri: departmentUri,
|
|
109
|
+
},
|
|
110
|
+
identifier: "mock-identifier",
|
|
111
|
+
formOf: {
|
|
112
|
+
identifier: "mock-attribute",
|
|
113
|
+
name: "Mock Attribute",
|
|
114
|
+
ref: { uri: departmentUri },
|
|
115
|
+
uri: departmentUri,
|
|
116
|
+
},
|
|
117
|
+
primaryLabel: {
|
|
118
|
+
uri: departmentUri,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
export const intersection = [
|
|
123
|
+
{
|
|
124
|
+
header: measureHeader,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
header: directSalesHeader,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
header: westCoastHeader,
|
|
131
|
+
},
|
|
132
|
+
];
|
package/esm/internal/components/pluggableVisualizations/pluggableVisualizations.test.helpers.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type Mock } from "vitest";
|
|
3
|
+
import { type IAttribute, type IInsight, type IInsightDefinition } from "@gooddata/sdk-model";
|
|
4
|
+
import { type IDrillEvent, type IDrillEventIntersectionElement, type VisType } from "@gooddata/sdk-ui";
|
|
5
|
+
import { type IDrillDownDefinition } from "../../interfaces/Visualization.js";
|
|
6
|
+
export declare function createDrillDefinition(fromAttribute: IAttribute, targetUri: string): IDrillDownDefinition;
|
|
7
|
+
export declare function insightDefinitionToInsight(insightDefinition: IInsightDefinition, uri: string, identifier: string): IInsight;
|
|
8
|
+
export declare function createDrillEvent(type: VisType, intersection: IDrillEventIntersectionElement[]): IDrillEvent;
|
|
9
|
+
/**
|
|
10
|
+
* Find the last call to a render function in the mock calls that matches given mounting point
|
|
11
|
+
* This is useful when need to separate between `renderVisualization` and `renderConfigurationPanel`
|
|
12
|
+
* Using second parameter - mounting point - as a differentiator
|
|
13
|
+
* @returns a React element passed to render function
|
|
14
|
+
*/
|
|
15
|
+
export declare function getLastRenderEl<T = any>(func: Mock, element: HTMLElement): ReactElement<T> | undefined;
|
|
16
|
+
//# sourceMappingURL=pluggableVisualizations.test.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluggableVisualizations.test.helpers.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/pluggableVisualizations/pluggableVisualizations.test.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,OAAO,EACH,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAG1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,8BAA8B,EAEnC,KAAK,OAAO,EACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,oBAAoB,CAMxG;AAED,wBAAgB,0BAA0B,CACtC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACnB,QAAQ,CAUV;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,8BAA8B,EAAE,GAAG,WAAW,CAS3G;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAEtG"}
|
package/esm/internal/components/pluggableVisualizations/pluggableVisualizations.test.helpers.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// (C) 2020-2026 GoodData Corporation
|
|
2
|
+
import { localIdRef, uriRef, } from "@gooddata/sdk-model";
|
|
3
|
+
export function createDrillDefinition(fromAttribute, targetUri) {
|
|
4
|
+
return {
|
|
5
|
+
type: "drillDown",
|
|
6
|
+
origin: localIdRef(fromAttribute.attribute.localIdentifier),
|
|
7
|
+
target: uriRef(targetUri),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function insightDefinitionToInsight(insightDefinition, uri, identifier) {
|
|
11
|
+
return {
|
|
12
|
+
...insightDefinition,
|
|
13
|
+
insight: {
|
|
14
|
+
...insightDefinition.insight,
|
|
15
|
+
identifier,
|
|
16
|
+
uri,
|
|
17
|
+
ref: uriRef(uri),
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createDrillEvent(type, intersection) {
|
|
22
|
+
return {
|
|
23
|
+
dataView: null,
|
|
24
|
+
drillContext: {
|
|
25
|
+
type,
|
|
26
|
+
intersection,
|
|
27
|
+
element: null,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Find the last call to a render function in the mock calls that matches given mounting point
|
|
33
|
+
* This is useful when need to separate between `renderVisualization` and `renderConfigurationPanel`
|
|
34
|
+
* Using second parameter - mounting point - as a differentiator
|
|
35
|
+
* @returns a React element passed to render function
|
|
36
|
+
*/
|
|
37
|
+
export function getLastRenderEl(func, element) {
|
|
38
|
+
return [...func.mock.calls].reverse().find((call) => call[1] === element)?.[0];
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IDrillEventIntersectionElement } from "@gooddata/sdk-ui";
|
|
2
|
+
import { type IDrillDownDefinition } from "../../interfaces/Visualization.js";
|
|
3
|
+
export declare const reverseAndTrimIntersectionMock: {
|
|
4
|
+
drillConfigRegion: IDrillDownDefinition;
|
|
5
|
+
intersectionWithOuterDepartment: IDrillEventIntersectionElement[];
|
|
6
|
+
intersectionWithOuterRegion: IDrillEventIntersectionElement[];
|
|
7
|
+
intersectionWithOuterDepartmentResult: IDrillEventIntersectionElement[];
|
|
8
|
+
intersectionWithOuterRegionResult: IDrillEventIntersectionElement[];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=reverseAndTrimIntersectionMock.d.ts.map
|
package/esm/internal/components/pluggableVisualizations/reverseAndTrimIntersectionMock.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reverseAndTrimIntersectionMock.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/pluggableVisualizations/reverseAndTrimIntersectionMock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AA+F9E,eAAO,MAAM,8BAA8B;;;;;;CAM1C,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// (C) 2020-2026 GoodData Corporation
|
|
2
|
+
import { ReferenceData, ReferenceMd } from "@gooddata/reference-workspace";
|
|
3
|
+
import { localIdRef } from "@gooddata/sdk-model";
|
|
4
|
+
const { Department, Region, Won } = ReferenceMd;
|
|
5
|
+
const drillConfigRegion = {
|
|
6
|
+
type: "drillDown",
|
|
7
|
+
origin: localIdRef(Region.Default.attribute.localIdentifier),
|
|
8
|
+
target: Department.Default.attribute.displayForm,
|
|
9
|
+
};
|
|
10
|
+
const regionUri = "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/1024";
|
|
11
|
+
const departmentUri = "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/1027";
|
|
12
|
+
const westCoastUri = ReferenceData.Region.WestCoast.uri;
|
|
13
|
+
const directSalesUri = ReferenceData.Department.DirectSales.uri;
|
|
14
|
+
const directSalesHeader = {
|
|
15
|
+
header: {
|
|
16
|
+
attributeHeaderItem: {
|
|
17
|
+
name: "Direct Sales",
|
|
18
|
+
uri: directSalesUri,
|
|
19
|
+
},
|
|
20
|
+
attributeHeader: {
|
|
21
|
+
name: Department.Default.attribute.alias,
|
|
22
|
+
localIdentifier: Department.Default.attribute.localIdentifier,
|
|
23
|
+
uri: departmentUri,
|
|
24
|
+
ref: {
|
|
25
|
+
uri: departmentUri,
|
|
26
|
+
},
|
|
27
|
+
identifier: "mock-identifier",
|
|
28
|
+
formOf: {
|
|
29
|
+
identifier: "mock-attribute",
|
|
30
|
+
name: "Mock Attribute",
|
|
31
|
+
ref: { uri: departmentUri },
|
|
32
|
+
uri: departmentUri,
|
|
33
|
+
},
|
|
34
|
+
primaryLabel: { uri: departmentUri },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const westCoastHeader = {
|
|
39
|
+
header: {
|
|
40
|
+
attributeHeaderItem: {
|
|
41
|
+
name: "West Coast",
|
|
42
|
+
uri: westCoastUri,
|
|
43
|
+
},
|
|
44
|
+
attributeHeader: {
|
|
45
|
+
name: Region.Default.attribute.alias,
|
|
46
|
+
localIdentifier: Region.Default.attribute.localIdentifier,
|
|
47
|
+
uri: regionUri,
|
|
48
|
+
ref: {
|
|
49
|
+
uri: regionUri,
|
|
50
|
+
},
|
|
51
|
+
identifier: "mock-identifier",
|
|
52
|
+
formOf: {
|
|
53
|
+
identifier: "mock-attribute",
|
|
54
|
+
name: "Mock Attribute",
|
|
55
|
+
ref: { uri: regionUri },
|
|
56
|
+
uri: regionUri,
|
|
57
|
+
},
|
|
58
|
+
primaryLabel: { uri: regionUri },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const measureHeader = {
|
|
63
|
+
header: {
|
|
64
|
+
measureHeaderItem: {
|
|
65
|
+
name: Won.measure.title,
|
|
66
|
+
format: "#,##0.00",
|
|
67
|
+
localIdentifier: Won.measure.localIdentifier,
|
|
68
|
+
uri: "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/9203",
|
|
69
|
+
identifier: undefined,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
const intersectionWithOuterDepartment = [
|
|
74
|
+
directSalesHeader,
|
|
75
|
+
westCoastHeader,
|
|
76
|
+
measureHeader,
|
|
77
|
+
];
|
|
78
|
+
const intersectionWithOuterRegion = [
|
|
79
|
+
westCoastHeader,
|
|
80
|
+
directSalesHeader,
|
|
81
|
+
measureHeader,
|
|
82
|
+
];
|
|
83
|
+
const intersectionWithOuterDepartmentResult = [
|
|
84
|
+
westCoastHeader,
|
|
85
|
+
directSalesHeader,
|
|
86
|
+
];
|
|
87
|
+
const intersectionWithOuterRegionResult = [westCoastHeader];
|
|
88
|
+
export const reverseAndTrimIntersectionMock = {
|
|
89
|
+
drillConfigRegion,
|
|
90
|
+
intersectionWithOuterDepartment,
|
|
91
|
+
intersectionWithOuterRegion,
|
|
92
|
+
intersectionWithOuterDepartmentResult,
|
|
93
|
+
intersectionWithOuterRegionResult,
|
|
94
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IInsightDefinition } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IDrillEventIntersectionElement } from "@gooddata/sdk-ui";
|
|
3
|
+
export declare const targetUri = "target-uri";
|
|
4
|
+
export declare const intersection: IDrillEventIntersectionElement[];
|
|
5
|
+
export declare const sourceInsightDef: IInsightDefinition;
|
|
6
|
+
export declare const expectedInsightDefRegion: IInsightDefinition;
|
|
7
|
+
export declare const expectedInsightDefDepartment: IInsightDefinition;
|
|
8
|
+
//# sourceMappingURL=getInsightWithDrillDownAppliedMock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInsightWithDrillDownAppliedMock.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/pluggableVisualizations/treeMap/getInsightWithDrillDownAppliedMock.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,KAAK,kBAAkB,EAO1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAQvE,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,eAAO,MAAM,YAAY,EAAE,8BAA8B,EAgExD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,kBAS7B,CAAC;AAUH,eAAO,MAAM,wBAAwB,EAAE,kBAoBtC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,kBAiB1C,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// (C) 2020-2026 GoodData Corporation
|
|
2
|
+
import { ReferenceData, ReferenceMd } from "@gooddata/reference-workspace";
|
|
3
|
+
import { newAttribute, newBucket, newInsightDefinition, newNegativeAttributeFilter, newPositiveAttributeFilter, uriRef, } from "@gooddata/sdk-model";
|
|
4
|
+
const { Department, Region, Won } = ReferenceMd;
|
|
5
|
+
const regionUri = "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/1024";
|
|
6
|
+
const departmentUri = "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/1027";
|
|
7
|
+
const westCoastUri = ReferenceData.Region.WestCoast.uri;
|
|
8
|
+
const directSalesUri = ReferenceData.Department.DirectSales.uri;
|
|
9
|
+
export const targetUri = "target-uri";
|
|
10
|
+
export const intersection = [
|
|
11
|
+
{
|
|
12
|
+
header: {
|
|
13
|
+
attributeHeaderItem: {
|
|
14
|
+
name: "Direct Sales",
|
|
15
|
+
uri: directSalesUri,
|
|
16
|
+
},
|
|
17
|
+
attributeHeader: {
|
|
18
|
+
name: Department.Default.attribute.alias,
|
|
19
|
+
localIdentifier: Department.Default.attribute.localIdentifier,
|
|
20
|
+
uri: departmentUri,
|
|
21
|
+
ref: {
|
|
22
|
+
uri: departmentUri,
|
|
23
|
+
},
|
|
24
|
+
identifier: "mock-identifier",
|
|
25
|
+
formOf: {
|
|
26
|
+
identifier: "mock-attribute",
|
|
27
|
+
name: "Mock Attribute",
|
|
28
|
+
ref: { uri: departmentUri },
|
|
29
|
+
uri: departmentUri,
|
|
30
|
+
},
|
|
31
|
+
primaryLabel: {
|
|
32
|
+
uri: departmentUri,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
header: {
|
|
39
|
+
attributeHeaderItem: {
|
|
40
|
+
name: "West Coast",
|
|
41
|
+
uri: westCoastUri,
|
|
42
|
+
},
|
|
43
|
+
attributeHeader: {
|
|
44
|
+
name: Region.Default.attribute.alias,
|
|
45
|
+
localIdentifier: Region.Default.attribute.localIdentifier,
|
|
46
|
+
uri: regionUri,
|
|
47
|
+
ref: {
|
|
48
|
+
uri: regionUri,
|
|
49
|
+
},
|
|
50
|
+
identifier: "mock-identifier",
|
|
51
|
+
formOf: {
|
|
52
|
+
identifier: "mock-attribute",
|
|
53
|
+
name: "Mock Attribute",
|
|
54
|
+
ref: { uri: regionUri },
|
|
55
|
+
uri: regionUri,
|
|
56
|
+
},
|
|
57
|
+
primaryLabel: {
|
|
58
|
+
uri: regionUri,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
header: {
|
|
65
|
+
measureHeaderItem: {
|
|
66
|
+
name: Won.measure.title,
|
|
67
|
+
format: "#,##0.00",
|
|
68
|
+
localIdentifier: Won.measure.localIdentifier,
|
|
69
|
+
uri: "/gdc/md/lmnivlu3sowt63jvr2mo1wlse5fyv203/obj/9203",
|
|
70
|
+
identifier: undefined,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
export const sourceInsightDef = newInsightDefinition("visualizationClass-url", (b) => {
|
|
76
|
+
return b
|
|
77
|
+
.title("sourceInsight")
|
|
78
|
+
.buckets([
|
|
79
|
+
newBucket("measure", Won),
|
|
80
|
+
newBucket("view", Department.Default),
|
|
81
|
+
newBucket("segment", Region.Default),
|
|
82
|
+
])
|
|
83
|
+
.filters([newNegativeAttributeFilter(Department.Default, [])]);
|
|
84
|
+
});
|
|
85
|
+
const replacedAttributeRegion = newAttribute(uriRef(targetUri), (b) => b.localId(Region.Default.attribute.localIdentifier));
|
|
86
|
+
const replacedAttributeDepartment = newAttribute(uriRef(targetUri), (b) => b.localId(Department.Default.attribute.localIdentifier));
|
|
87
|
+
export const expectedInsightDefRegion = newInsightDefinition("visualizationClass-url", (b) => {
|
|
88
|
+
return b
|
|
89
|
+
.title("sourceInsight")
|
|
90
|
+
.buckets([
|
|
91
|
+
newBucket("measure", Won),
|
|
92
|
+
newBucket("view", Department.Default),
|
|
93
|
+
newBucket("segment", replacedAttributeRegion),
|
|
94
|
+
])
|
|
95
|
+
.filters([
|
|
96
|
+
newNegativeAttributeFilter(Department.Default, []),
|
|
97
|
+
newPositiveAttributeFilter(newAttribute(uriRef(regionUri)), {
|
|
98
|
+
uris: [westCoastUri],
|
|
99
|
+
}),
|
|
100
|
+
newPositiveAttributeFilter(newAttribute(uriRef(departmentUri)), {
|
|
101
|
+
uris: [directSalesUri],
|
|
102
|
+
}),
|
|
103
|
+
]);
|
|
104
|
+
});
|
|
105
|
+
export const expectedInsightDefDepartment = newInsightDefinition("visualizationClass-url", (b) => {
|
|
106
|
+
return b
|
|
107
|
+
.title("sourceInsight")
|
|
108
|
+
.buckets([
|
|
109
|
+
newBucket("measure", Won),
|
|
110
|
+
newBucket("view", replacedAttributeDepartment),
|
|
111
|
+
newBucket("segment", Region.Default),
|
|
112
|
+
])
|
|
113
|
+
.filters([
|
|
114
|
+
newNegativeAttributeFilter(Department.Default, []),
|
|
115
|
+
newPositiveAttributeFilter(newAttribute(uriRef(departmentUri)), {
|
|
116
|
+
uris: [directSalesUri],
|
|
117
|
+
}),
|
|
118
|
+
]);
|
|
119
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DummyVisConstruct: {
|
|
2
|
+
projectId: string;
|
|
3
|
+
backend: import("@gooddata/sdk-backend-spi").IAnalyticalBackend;
|
|
4
|
+
element: () => null;
|
|
5
|
+
configPanelElement: () => null;
|
|
6
|
+
callbacks: {
|
|
7
|
+
onError: () => void;
|
|
8
|
+
afterRender: () => void;
|
|
9
|
+
onDrill: () => void;
|
|
10
|
+
onExportReady: () => void;
|
|
11
|
+
onLoadingChanged: () => void;
|
|
12
|
+
pushData: () => void;
|
|
13
|
+
};
|
|
14
|
+
renderFun: () => void;
|
|
15
|
+
visualizationProperties: {};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=visConstruct.fixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visConstruct.fixture.d.ts","sourceRoot":"","sources":["../../../../src/internal/components/pluggableVisualizations/visConstruct.fixture.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;CAe7B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// (C) 2019-2026 GoodData Corporation
|
|
2
|
+
import { dummyBackend } from "@gooddata/sdk-backend-mockingbird";
|
|
3
|
+
export const DummyVisConstruct = {
|
|
4
|
+
projectId: "testWorkspace",
|
|
5
|
+
backend: dummyBackend(),
|
|
6
|
+
element: () => null,
|
|
7
|
+
configPanelElement: () => null,
|
|
8
|
+
callbacks: {
|
|
9
|
+
onError: () => { },
|
|
10
|
+
afterRender: () => { },
|
|
11
|
+
onDrill: () => { },
|
|
12
|
+
onExportReady: () => { },
|
|
13
|
+
onLoadingChanged: () => { },
|
|
14
|
+
pushData: () => { },
|
|
15
|
+
},
|
|
16
|
+
renderFun: () => { },
|
|
17
|
+
visualizationProperties: {},
|
|
18
|
+
};
|
package/esm/internal/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { MinMaxControl } from "./components/configurationControls/MinMaxControl.
|
|
|
11
11
|
export { BaseVisualization, type IBaseVisualizationApi, type IBaseVisualizationProps, } from "./components/BaseVisualization.js";
|
|
12
12
|
export { DefaultVisualizationCatalog, FullVisualizationCatalog, type IVisualizationCatalog, } from "./components/VisualizationCatalog.js";
|
|
13
13
|
export { resolveMessages, DEFAULT_LANGUAGE, DEFAULT_MESSAGES } from "./utils/translations.js";
|
|
14
|
-
export { createIntlMock } from "./
|
|
14
|
+
export { createIntlMock } from "./testIntlProvider.js";
|
|
15
15
|
export { type IVisualization, type IVisConstruct, type IVisCallbacks, type IVisProps, type IVisualizationProperties, type IVisualizationOptions, type IGdcConfig, type PluggableVisualizationErrorType, type PluggableVisualizationError, type IExtendedReferencePoint, type IBucketItem, type IReferencePoint, type IFilters, type IFiltersBucketItem, type IMeasureValueFilter, type IRankingFilter, type IAttributeFilter, type IArbitraryFilterData, type IMatchFilterData, type TextModeFilterData, type IDateFilter, type IDrillDownContext, type IDrillDownDefinition, type ICustomProps, type IConfigurationPanelRenderers, ConfigPanelClassName, PluggableVisualizationErrorCodes, InvalidBucketsSdkError, EmptyAfmSdkError, isPluggableVisualizationError, isEmptyAfm, isInvalidBuckets, isDrillDownDefinition, InvalidColumnsSdkError, isInvalidColumns, } from "./interfaces/Visualization.js";
|
|
16
16
|
export { isDateFilter, isMeasureValueFilter, isAttributeFilter, isRankingFilter, } from "./utils/bucketHelper.js";
|
|
17
17
|
export { createInternalIntl, InternalIntlWrapper } from "./utils/internalIntlProvider.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gEAAgE,CAAC;AACrG,OAAO,E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AAC;AACjD,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9G,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,uDAAuD,CAAC;AACxG,OAAO,EACH,sCAAsC,EACtC,wBAAwB,EACxB,4BAA4B,EAC5B,wCAAwC,EACxC,uDAAuD,EACvD,2BAA2B,EAC3B,2CAA2C,EAC3C,uBAAuB,EACvB,mBAAmB,EACnB,gCAAgC,EAChC,oCAAoC,EACpC,kCAAkC,EAClC,sCAAsC,EACtC,+CAA+C,EAC/C,mDAAmD,EACnD,yCAAyC,EACzC,4BAA4B,EAC5B,iCAAiC,GACpC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAEnG,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EACH,kBAAkB,EAClB,KAAK,wBAAwB,GAChC,MAAM,+DAA+D,CAAC;AAEvE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEzF,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,mBAAmB,GACtB,MAAM,iDAAiD,CAAC"}
|
package/esm/internal/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { MinMaxControl } from "./components/configurationControls/MinMaxControl.
|
|
|
13
13
|
export { BaseVisualization, } from "./components/BaseVisualization.js";
|
|
14
14
|
export { DefaultVisualizationCatalog, FullVisualizationCatalog, } from "./components/VisualizationCatalog.js";
|
|
15
15
|
export { resolveMessages, DEFAULT_LANGUAGE, DEFAULT_MESSAGES } from "./utils/translations.js";
|
|
16
|
-
export { createIntlMock } from "./
|
|
16
|
+
export { createIntlMock } from "./testIntlProvider.js";
|
|
17
17
|
export { ConfigPanelClassName, PluggableVisualizationErrorCodes, InvalidBucketsSdkError, EmptyAfmSdkError, isPluggableVisualizationError, isEmptyAfm, isInvalidBuckets, isDrillDownDefinition, InvalidColumnsSdkError, isInvalidColumns, } from "./interfaces/Visualization.js";
|
|
18
18
|
export { isDateFilter, isMeasureValueFilter, isAttributeFilter, isRankingFilter, } from "./utils/bucketHelper.js";
|
|
19
19
|
export { createInternalIntl, InternalIntlWrapper } from "./utils/internalIntlProvider.js";
|