@gooddata/sdk-ui-ext 11.53.0-alpha.5 → 11.53.0-alpha.7
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/esm/internal/components/dialogs/userManagementDialogs/AddWorkspaceToSubjects.d.ts +1 -0
- package/esm/internal/components/dialogs/userManagementDialogs/AddWorkspaceToSubjects.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/AddWorkspaceToSubjects.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/UserEditDialog.d.ts +1 -0
- package/esm/internal/components/dialogs/userManagementDialogs/UserEditDialog.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/UserEditDialog.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/UserGroupEditDialog.d.ts +1 -0
- package/esm/internal/components/dialogs/userManagementDialogs/UserGroupEditDialog.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/UserGroupEditDialog.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddSingleWorkspaceSelect.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddSingleWorkspaceSelect.js +1 -3
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddWorkspace.d.ts +2 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddWorkspace.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/AddWorkspace.js +2 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/GranularPermissions.d.ts +2 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/GranularPermissions.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/GranularPermissions.js +5 -2
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/granularPermissionUtils.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/granularPermissionUtils.js +9 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/locales.d.ts +6 -0
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/locales.d.ts.map +1 -1
- package/esm/internal/components/dialogs/userManagementDialogs/Workspace/WorkspaceItem/locales.js +4 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts +8 -0
- package/esm/internal/translations/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/internal/translations/en-US.localization-bundle.js +8 -0
- package/esm/sdk-ui-ext.d.ts +3 -0
- package/esm/share/ObjectShareDialog.js +6 -4
- package/esm/share/messages.d.ts +11 -0
- package/esm/share/messages.d.ts.map +1 -1
- package/esm/share/messages.js +7 -0
- package/esm/share/objectShareController.types.d.ts +10 -8
- package/esm/share/objectShareController.types.d.ts.map +1 -1
- package/esm/share/useAccessList.d.ts +19 -1
- package/esm/share/useAccessList.d.ts.map +1 -1
- package/esm/share/useAccessList.js +20 -3
- package/esm/share/useObjectShareController.d.ts.map +1 -1
- package/esm/share/useObjectShareController.js +15 -10
- package/esm/share/useObjectShareDialog.d.ts +6 -2
- package/esm/share/useObjectShareDialog.d.ts.map +1 -1
- package/esm/share/useObjectShareDialog.js +33 -6
- package/package.json +21 -21
- package/esm/internal/components/pluggableVisualizations/geoChartNext/geoConfigBuilder.test.d.ts +0 -2
- package/esm/internal/components/pluggableVisualizations/geoChartNext/geoConfigBuilder.test.d.ts.map +0 -1
- package/esm/internal/components/pluggableVisualizations/geoChartNext/geoConfigBuilder.test.js +0 -415
package/esm/internal/components/pluggableVisualizations/geoChartNext/geoConfigBuilder.test.js
DELETED
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
// (C) 2025-2026 GoodData Corporation
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
import { idRef, newAttribute, newBucket, newInsightDefinition } from "@gooddata/sdk-model";
|
|
4
|
-
import { BucketNames } from "@gooddata/sdk-ui";
|
|
5
|
-
import { ANALYTICAL_ENVIRONMENT, DASHBOARDS_ENVIRONMENT } from "../../../constants/properties.js";
|
|
6
|
-
import { buildAreaVisualizationConfig } from "../geoAreaChart/geoAreaConfigBuilder.js";
|
|
7
|
-
import { buildGeoVisualizationConfig, geoConfigFromInsight, geoInsightConversion, } from "./geoConfigBuilder.js";
|
|
8
|
-
describe("geoConfigFromInsight", () => {
|
|
9
|
-
it("keeps mapStyle configuration", () => {
|
|
10
|
-
const areaAttribute = newAttribute(idRef("label.area", "displayForm"), (attribute) => attribute.localId("area_df"));
|
|
11
|
-
const insight = newInsightDefinition("local:geoArea", (builder) => builder.buckets([newBucket(BucketNames.AREA, areaAttribute)]).properties({
|
|
12
|
-
controls: {
|
|
13
|
-
mapStyle: "gd://custom-style",
|
|
14
|
-
},
|
|
15
|
-
}));
|
|
16
|
-
const config = geoConfigFromInsight(insight);
|
|
17
|
-
expect(config.mapStyle).toBe("gd://custom-style");
|
|
18
|
-
});
|
|
19
|
-
it("keeps zoom configuration", () => {
|
|
20
|
-
const areaAttribute = newAttribute(idRef("label.area", "displayForm"), (attribute) => attribute.localId("area_df"));
|
|
21
|
-
const insight = newInsightDefinition("local:geoArea", (builder) => builder.buckets([newBucket(BucketNames.AREA, areaAttribute)]).properties({
|
|
22
|
-
controls: {
|
|
23
|
-
zoom: 4,
|
|
24
|
-
},
|
|
25
|
-
}));
|
|
26
|
-
const config = geoConfigFromInsight(insight);
|
|
27
|
-
expect(config.zoom).toBe(4);
|
|
28
|
-
});
|
|
29
|
-
it("normalizes legacy legend positions from insight properties", () => {
|
|
30
|
-
const locationAttribute = newAttribute(idRef("nm_location", "displayForm"), (attribute) => attribute.localId("location_id"));
|
|
31
|
-
const insight = newInsightDefinition("local:geoPushpin", (builder) => builder.buckets([newBucket(BucketNames.LOCATION, locationAttribute)]).properties({
|
|
32
|
-
controls: {
|
|
33
|
-
legend: {
|
|
34
|
-
position: "top",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
}));
|
|
38
|
-
const config = geoConfigFromInsight(insight);
|
|
39
|
-
expect(config.legend?.position).toBe("top-right");
|
|
40
|
-
});
|
|
41
|
-
it("maps legacy tileset visualization properties to basemap", () => {
|
|
42
|
-
const locationAttribute = newAttribute(idRef("nm_location", "displayForm"), (attribute) => attribute.localId("location_id"));
|
|
43
|
-
const insight = newInsightDefinition("local:geoPushpin", (builder) => builder.buckets([newBucket(BucketNames.LOCATION, locationAttribute)]).properties({
|
|
44
|
-
controls: {
|
|
45
|
-
tileset: "satellite",
|
|
46
|
-
viewport: {
|
|
47
|
-
area: "continent_na",
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
}));
|
|
51
|
-
const config = geoConfigFromInsight(insight);
|
|
52
|
-
expect(config.basemap).toBe("satellite");
|
|
53
|
-
expect(config.viewport?.area).toBe("continent_na");
|
|
54
|
-
});
|
|
55
|
-
it("keeps explicit basemap values unchanged", () => {
|
|
56
|
-
const locationAttribute = newAttribute(idRef("nm_location", "displayForm"), (attribute) => attribute.localId("location_id"));
|
|
57
|
-
const insight = newInsightDefinition("local:geoPushpin", (builder) => builder.buckets([newBucket(BucketNames.LOCATION, locationAttribute)]).properties({
|
|
58
|
-
controls: {
|
|
59
|
-
basemap: "monochrome",
|
|
60
|
-
tileset: "satellite",
|
|
61
|
-
},
|
|
62
|
-
}));
|
|
63
|
-
const config = geoConfigFromInsight(insight);
|
|
64
|
-
expect(config.basemap).toBe("monochrome");
|
|
65
|
-
});
|
|
66
|
-
it("keeps oneIcon points configuration", () => {
|
|
67
|
-
const locationAttribute = newAttribute(idRef("nm_location", "displayForm"), (attribute) => attribute.localId("location_id"));
|
|
68
|
-
const insight = newInsightDefinition("local:geoPushpin", (builder) => builder.buckets([newBucket(BucketNames.LOCATION, locationAttribute)]).properties({
|
|
69
|
-
controls: {
|
|
70
|
-
points: {
|
|
71
|
-
shapeType: "oneIcon",
|
|
72
|
-
icon: "airport",
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
}));
|
|
76
|
-
const config = geoConfigFromInsight(insight);
|
|
77
|
-
expect(config.points).toEqual({
|
|
78
|
-
shapeType: "oneIcon",
|
|
79
|
-
icon: "airport",
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
describe("geoInsightConversion", () => {
|
|
84
|
-
it("returns area bucket attribute when converting AREA bucket", () => {
|
|
85
|
-
const areaAttribute = newAttribute(idRef("label.area", "displayForm"), (attribute) => attribute.localId("area_df"));
|
|
86
|
-
const insight = newInsightDefinition("local:geoArea", (builder) => builder.buckets([newBucket(BucketNames.AREA, areaAttribute)]));
|
|
87
|
-
const conversion = geoInsightConversion("area", BucketNames.AREA);
|
|
88
|
-
const ctx = {};
|
|
89
|
-
const attribute = conversion.itemAccessor(insight, ctx);
|
|
90
|
-
expect(attribute?.attribute?.localIdentifier).toBe("area_df");
|
|
91
|
-
});
|
|
92
|
-
it("uses clean localId for latitude without a_ prefix", () => {
|
|
93
|
-
const locationAttribute = newAttribute(idRef("nm_location", "displayForm"), (attribute) => attribute.localId("location_id"));
|
|
94
|
-
const insight = newInsightDefinition("local:geoPushpin", (builder) => builder.buckets([newBucket(BucketNames.LOCATION, locationAttribute)]).properties({
|
|
95
|
-
controls: {
|
|
96
|
-
latitude: "nm_latitude",
|
|
97
|
-
longitude: "nm_longitude",
|
|
98
|
-
},
|
|
99
|
-
}));
|
|
100
|
-
const conversion = geoInsightConversion("latitude", BucketNames.LATITUDE);
|
|
101
|
-
const ctx = {
|
|
102
|
-
backend: { capabilities: { supportsSeparateLatitudeLongitudeLabels: true } },
|
|
103
|
-
};
|
|
104
|
-
const attribute = conversion.itemAccessor(insight, ctx);
|
|
105
|
-
expect(attribute?.attribute?.localIdentifier).toBe("latitude_df");
|
|
106
|
-
expect(attribute?.attribute?.displayForm).toEqual(idRef("nm_latitude", "displayForm"));
|
|
107
|
-
});
|
|
108
|
-
it("uses clean localId for longitude without a_ prefix", () => {
|
|
109
|
-
const locationAttribute = newAttribute(idRef("nm_location", "displayForm"), (attribute) => attribute.localId("location_id"));
|
|
110
|
-
const insight = newInsightDefinition("local:geoPushpin", (builder) => builder.buckets([newBucket(BucketNames.LOCATION, locationAttribute)]).properties({
|
|
111
|
-
controls: {
|
|
112
|
-
latitude: "nm_latitude",
|
|
113
|
-
longitude: "nm_longitude",
|
|
114
|
-
},
|
|
115
|
-
}));
|
|
116
|
-
const conversion = geoInsightConversion("longitude", BucketNames.LONGITUDE);
|
|
117
|
-
const ctx = {
|
|
118
|
-
backend: { capabilities: { supportsSeparateLatitudeLongitudeLabels: true } },
|
|
119
|
-
};
|
|
120
|
-
const attribute = conversion.itemAccessor(insight, ctx);
|
|
121
|
-
expect(attribute?.attribute?.localIdentifier).toBe("longitude_df");
|
|
122
|
-
expect(attribute?.attribute?.displayForm).toEqual(idRef("nm_longitude", "displayForm"));
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
describe("buildGeoVisualizationConfig", () => {
|
|
126
|
-
const options = {
|
|
127
|
-
messages: {},
|
|
128
|
-
};
|
|
129
|
-
it("applies viewport navigation in dashboards, leaves embedded unset, and disables in AD", () => {
|
|
130
|
-
const dashboardWidgetConfig = buildGeoVisualizationConfig({
|
|
131
|
-
options: {
|
|
132
|
-
...options,
|
|
133
|
-
config: {
|
|
134
|
-
isInEditMode: false,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
supportedControls: {},
|
|
138
|
-
colorMapping: undefined,
|
|
139
|
-
environment: DASHBOARDS_ENVIRONMENT,
|
|
140
|
-
});
|
|
141
|
-
const embeddedConfig = buildGeoVisualizationConfig({
|
|
142
|
-
options: {
|
|
143
|
-
...options,
|
|
144
|
-
config: {},
|
|
145
|
-
},
|
|
146
|
-
supportedControls: {},
|
|
147
|
-
colorMapping: undefined,
|
|
148
|
-
environment: "",
|
|
149
|
-
});
|
|
150
|
-
const adConfig = buildGeoVisualizationConfig({
|
|
151
|
-
options: {
|
|
152
|
-
...options,
|
|
153
|
-
config: {
|
|
154
|
-
isInEditMode: true,
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
supportedControls: {},
|
|
158
|
-
colorMapping: undefined,
|
|
159
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
160
|
-
});
|
|
161
|
-
expect(dashboardWidgetConfig.applyViewportNavigation).toBe(true);
|
|
162
|
-
expect(embeddedConfig.applyViewportNavigation).toBeUndefined();
|
|
163
|
-
expect(adConfig.applyViewportNavigation).toBe(false);
|
|
164
|
-
});
|
|
165
|
-
it("normalizes legacy legend positions and keeps new corner values", () => {
|
|
166
|
-
const config = buildGeoVisualizationConfig({
|
|
167
|
-
options,
|
|
168
|
-
supportedControls: {
|
|
169
|
-
legend: {
|
|
170
|
-
position: "bottom",
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
colorMapping: undefined,
|
|
174
|
-
environment: "",
|
|
175
|
-
});
|
|
176
|
-
const configWithCorner = buildGeoVisualizationConfig({
|
|
177
|
-
options,
|
|
178
|
-
supportedControls: {
|
|
179
|
-
legend: {
|
|
180
|
-
position: "bottom-left",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
colorMapping: undefined,
|
|
184
|
-
environment: "",
|
|
185
|
-
});
|
|
186
|
-
expect(config.legend?.position).toBe("bottom-right");
|
|
187
|
-
expect(configWithCorner.legend?.position).toBe("bottom-left");
|
|
188
|
-
});
|
|
189
|
-
it("preserves basemap even when the broad basemap FF is disabled", () => {
|
|
190
|
-
const supportedControls = {
|
|
191
|
-
basemap: "none",
|
|
192
|
-
};
|
|
193
|
-
const disabledConfig = buildGeoVisualizationConfig({
|
|
194
|
-
options,
|
|
195
|
-
supportedControls,
|
|
196
|
-
colorMapping: undefined,
|
|
197
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
198
|
-
});
|
|
199
|
-
const enabledConfig = buildGeoVisualizationConfig({
|
|
200
|
-
options,
|
|
201
|
-
supportedControls,
|
|
202
|
-
colorMapping: undefined,
|
|
203
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
204
|
-
featureFlags: { enableGeoBasemapConfig: true },
|
|
205
|
-
});
|
|
206
|
-
expect(disabledConfig.enableGeoBasemapConfig).toBe(false);
|
|
207
|
-
expect(disabledConfig.basemap).toBe("none");
|
|
208
|
-
expect(enabledConfig.enableGeoBasemapConfig).toBe(true);
|
|
209
|
-
expect(enabledConfig.basemap).toBe("none");
|
|
210
|
-
});
|
|
211
|
-
it("does not let raw config or custom visualization config override sanitized supported controls", () => {
|
|
212
|
-
const rawGeoStyleConfig = {
|
|
213
|
-
basemap: "none",
|
|
214
|
-
};
|
|
215
|
-
const config = buildGeoVisualizationConfig({
|
|
216
|
-
options: {
|
|
217
|
-
...options,
|
|
218
|
-
config: {
|
|
219
|
-
isInEditMode: false,
|
|
220
|
-
...rawGeoStyleConfig,
|
|
221
|
-
},
|
|
222
|
-
customVisualizationConfig: {
|
|
223
|
-
...rawGeoStyleConfig,
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
supportedControls: {
|
|
227
|
-
basemap: "monochrome",
|
|
228
|
-
},
|
|
229
|
-
colorMapping: undefined,
|
|
230
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
231
|
-
});
|
|
232
|
-
expect(config.basemap).toBe("monochrome");
|
|
233
|
-
});
|
|
234
|
-
it("maps legacy tileset supported controls to basemap", () => {
|
|
235
|
-
const config = buildGeoVisualizationConfig({
|
|
236
|
-
options: {
|
|
237
|
-
...options,
|
|
238
|
-
config: {
|
|
239
|
-
isInEditMode: false,
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
supportedControls: {
|
|
243
|
-
tileset: "satellite",
|
|
244
|
-
},
|
|
245
|
-
colorMapping: undefined,
|
|
246
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
247
|
-
});
|
|
248
|
-
expect(config.basemap).toBe("satellite");
|
|
249
|
-
});
|
|
250
|
-
it("does not forward bounds when viewport config is disabled", () => {
|
|
251
|
-
const config = buildGeoVisualizationConfig({
|
|
252
|
-
options,
|
|
253
|
-
supportedControls: {
|
|
254
|
-
center: { lat: 40, lng: -74 },
|
|
255
|
-
zoom: 3,
|
|
256
|
-
bounds: {
|
|
257
|
-
southWest: { lat: 35, lng: -80 },
|
|
258
|
-
northEast: { lat: 45, lng: -68 },
|
|
259
|
-
},
|
|
260
|
-
viewport: { area: "custom" },
|
|
261
|
-
},
|
|
262
|
-
colorMapping: undefined,
|
|
263
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
264
|
-
featureFlags: {
|
|
265
|
-
enableGeoChartsViewportConfig: false,
|
|
266
|
-
},
|
|
267
|
-
});
|
|
268
|
-
expect(config.enableGeoChartsViewportConfig).toBe(false);
|
|
269
|
-
expect(config.bounds).toBeUndefined();
|
|
270
|
-
expect(config.center).toEqual({ lat: 40, lng: -74 });
|
|
271
|
-
expect(config.zoom).toBe(3);
|
|
272
|
-
});
|
|
273
|
-
it("propagates customTooltip from supportedControls into the rendered config", () => {
|
|
274
|
-
const customTooltip = {
|
|
275
|
-
enabled: true,
|
|
276
|
-
content: "**{label/region}** — Revenue: {metric/revenue}",
|
|
277
|
-
placement: "above",
|
|
278
|
-
};
|
|
279
|
-
const config = buildGeoVisualizationConfig({
|
|
280
|
-
options,
|
|
281
|
-
supportedControls: { customTooltip },
|
|
282
|
-
colorMapping: undefined,
|
|
283
|
-
environment: DASHBOARDS_ENVIRONMENT,
|
|
284
|
-
});
|
|
285
|
-
expect(config.customTooltip).toEqual(customTooltip);
|
|
286
|
-
});
|
|
287
|
-
it("surfaces enableCustomTooltip=false from feature flags so the render gate can fire", () => {
|
|
288
|
-
const config = buildGeoVisualizationConfig({
|
|
289
|
-
options,
|
|
290
|
-
supportedControls: {},
|
|
291
|
-
colorMapping: undefined,
|
|
292
|
-
environment: DASHBOARDS_ENVIRONMENT,
|
|
293
|
-
featureFlags: { enableCustomTooltip: false },
|
|
294
|
-
});
|
|
295
|
-
expect(config.enableCustomTooltip).toBe(false);
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
describe("buildAreaVisualizationConfig", () => {
|
|
299
|
-
const options = {
|
|
300
|
-
messages: {},
|
|
301
|
-
};
|
|
302
|
-
it("applies viewport navigation in dashboards, leaves embedded unset, and disables in AD", () => {
|
|
303
|
-
const dashboardWidgetConfig = buildAreaVisualizationConfig({
|
|
304
|
-
options: {
|
|
305
|
-
...options,
|
|
306
|
-
config: {
|
|
307
|
-
isInEditMode: false,
|
|
308
|
-
},
|
|
309
|
-
},
|
|
310
|
-
supportedControls: {},
|
|
311
|
-
colorMapping: undefined,
|
|
312
|
-
environment: DASHBOARDS_ENVIRONMENT,
|
|
313
|
-
});
|
|
314
|
-
const embeddedConfig = buildAreaVisualizationConfig({
|
|
315
|
-
options: {
|
|
316
|
-
...options,
|
|
317
|
-
config: {},
|
|
318
|
-
},
|
|
319
|
-
supportedControls: {},
|
|
320
|
-
colorMapping: undefined,
|
|
321
|
-
environment: "",
|
|
322
|
-
});
|
|
323
|
-
const adConfig = buildAreaVisualizationConfig({
|
|
324
|
-
options: {
|
|
325
|
-
...options,
|
|
326
|
-
config: {
|
|
327
|
-
isInEditMode: true,
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
supportedControls: {},
|
|
331
|
-
colorMapping: undefined,
|
|
332
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
333
|
-
});
|
|
334
|
-
expect(dashboardWidgetConfig.applyViewportNavigation).toBe(true);
|
|
335
|
-
expect(embeddedConfig.applyViewportNavigation).toBeUndefined();
|
|
336
|
-
expect(adConfig.applyViewportNavigation).toBe(false);
|
|
337
|
-
});
|
|
338
|
-
it("normalizes legacy legend positions for geo area charts", () => {
|
|
339
|
-
const config = buildAreaVisualizationConfig({
|
|
340
|
-
options,
|
|
341
|
-
supportedControls: {
|
|
342
|
-
legend: {
|
|
343
|
-
position: "left",
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
colorMapping: undefined,
|
|
347
|
-
environment: "",
|
|
348
|
-
});
|
|
349
|
-
expect(config.legend?.position).toBe("top-left");
|
|
350
|
-
});
|
|
351
|
-
it("preserves sanitized basemap config even when the broad basemap FF is disabled", () => {
|
|
352
|
-
const supportedControls = {
|
|
353
|
-
basemap: "monochrome",
|
|
354
|
-
};
|
|
355
|
-
const disabledConfig = buildAreaVisualizationConfig({
|
|
356
|
-
options,
|
|
357
|
-
supportedControls,
|
|
358
|
-
colorMapping: undefined,
|
|
359
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
360
|
-
});
|
|
361
|
-
const enabledConfig = buildAreaVisualizationConfig({
|
|
362
|
-
options,
|
|
363
|
-
supportedControls,
|
|
364
|
-
colorMapping: undefined,
|
|
365
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
366
|
-
featureFlags: { enableGeoBasemapConfig: true },
|
|
367
|
-
});
|
|
368
|
-
expect(disabledConfig.enableGeoBasemapConfig).toBe(false);
|
|
369
|
-
expect(disabledConfig.basemap).toBe("monochrome");
|
|
370
|
-
expect(enabledConfig.enableGeoBasemapConfig).toBe(true);
|
|
371
|
-
expect(enabledConfig.basemap).toBe("monochrome");
|
|
372
|
-
});
|
|
373
|
-
it("maps legacy tileset controls to basemap", () => {
|
|
374
|
-
const config = buildAreaVisualizationConfig({
|
|
375
|
-
options: {
|
|
376
|
-
...options,
|
|
377
|
-
config: {
|
|
378
|
-
isInEditMode: false,
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
supportedControls: {
|
|
382
|
-
controls: {
|
|
383
|
-
tileset: "satellite",
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
colorMapping: undefined,
|
|
387
|
-
environment: ANALYTICAL_ENVIRONMENT,
|
|
388
|
-
});
|
|
389
|
-
expect(config.basemap).toBe("satellite");
|
|
390
|
-
});
|
|
391
|
-
it("propagates customTooltip from supportedControls into the rendered config", () => {
|
|
392
|
-
const customTooltip = {
|
|
393
|
-
enabled: true,
|
|
394
|
-
content: "# {label/state}\n{metric/population}",
|
|
395
|
-
placement: "above",
|
|
396
|
-
};
|
|
397
|
-
const config = buildAreaVisualizationConfig({
|
|
398
|
-
options,
|
|
399
|
-
supportedControls: { customTooltip },
|
|
400
|
-
colorMapping: undefined,
|
|
401
|
-
environment: DASHBOARDS_ENVIRONMENT,
|
|
402
|
-
});
|
|
403
|
-
expect(config.customTooltip).toEqual(customTooltip);
|
|
404
|
-
});
|
|
405
|
-
it("surfaces enableCustomTooltip=false from feature flags so the render gate can fire", () => {
|
|
406
|
-
const config = buildAreaVisualizationConfig({
|
|
407
|
-
options,
|
|
408
|
-
supportedControls: {},
|
|
409
|
-
colorMapping: undefined,
|
|
410
|
-
environment: DASHBOARDS_ENVIRONMENT,
|
|
411
|
-
featureFlags: { enableCustomTooltip: false },
|
|
412
|
-
});
|
|
413
|
-
expect(config.enableCustomTooltip).toBe(false);
|
|
414
|
-
});
|
|
415
|
-
});
|