@gooddata/sdk-code-convertors 11.51.0-alpha.2 → 11.51.0-alpha.4
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/configs/headlineChart.d.ts.map +1 -1
- package/esm/configs/headlineChart.js +9 -3
- package/esm/configs/types.d.ts +2 -1
- package/esm/configs/types.d.ts.map +1 -1
- package/esm/from/declarativeDashboardToYaml.d.ts.map +1 -1
- package/esm/from/declarativeDashboardToYaml.js +13 -0
- package/esm/from/declarativeVisualisationToYaml.d.ts +2 -27
- package/esm/from/declarativeVisualisationToYaml.d.ts.map +1 -1
- package/esm/from/declarativeVisualisationToYaml.js +132 -556
- package/esm/from/filtersToYaml.d.ts +50 -0
- package/esm/from/filtersToYaml.d.ts.map +1 -0
- package/esm/from/filtersToYaml.js +508 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -1
- package/esm/sdk-code-convertors.d.ts +33 -5
- package/esm/to/yamlDashboardToDeclarative.d.ts +1 -1
- package/esm/to/yamlDashboardToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlDashboardToDeclarative.js +15 -0
- package/esm/to/yamlVisualisationToDeclarative.d.ts +1 -1
- package/esm/to/yamlVisualisationToDeclarative.d.ts.map +1 -1
- package/esm/to/yamlVisualisationToDeclarative.js +41 -28
- package/esm/utils/configUtils.d.ts +5 -1
- package/esm/utils/configUtils.d.ts.map +1 -1
- package/esm/utils/configUtils.js +25 -13
- package/esm/utils/errors.d.ts +3 -0
- package/esm/utils/errors.d.ts.map +1 -1
- package/esm/utils/errors.js +9 -0
- package/package.json +6 -6
|
@@ -818,9 +818,13 @@ export declare interface ChartFill {
|
|
|
818
818
|
/** @internal */
|
|
819
819
|
export declare type ChartFillType = "solid" | "pattern" | "outline";
|
|
820
820
|
|
|
821
|
+
/** @internal Claims a document-unique key, given the name a filter's content suggests. */
|
|
822
|
+
export declare type ClaimFilterKey = (baseKey: string) => string;
|
|
823
|
+
|
|
821
824
|
/** @public */
|
|
822
825
|
export declare type ColorMapping = {
|
|
823
|
-
|
|
826
|
+
/** `null` stands for the attribute's empty element, which is distinct from the empty string. */
|
|
827
|
+
id: string | null;
|
|
824
828
|
color: {
|
|
825
829
|
type: "guid";
|
|
826
830
|
value: string;
|
|
@@ -1238,6 +1242,9 @@ export declare enum CoreErrorCode {
|
|
|
1238
1242
|
OnlyOneAttributeItemAllowed = "core.onlyOneAttributeItemAllowed",
|
|
1239
1243
|
MultipleCommonDateFilters = "core.multipleCommonDateFilters",
|
|
1240
1244
|
DuplicateFilterLocalIdentifier = "core.duplicateFilterLocalIdentifier",
|
|
1245
|
+
DuplicateFieldName = "core.duplicateFieldName",
|
|
1246
|
+
DuplicateFilterName = "core.duplicateFilterName",
|
|
1247
|
+
DuplicateLayerIdentifier = "core.duplicateLayerIdentifier",
|
|
1241
1248
|
DuplicateTabIdentifier = "core.duplicateTabIdentifier",
|
|
1242
1249
|
TabsAndRootContentMutuallyExclusive = "core.tabsAndRootContentMutuallyExclusive"
|
|
1243
1250
|
}
|
|
@@ -1269,7 +1276,7 @@ export declare interface CustomTooltip {
|
|
|
1269
1276
|
export declare type CustomTooltipPlacement = "above" | "below" | "replace";
|
|
1270
1277
|
|
|
1271
1278
|
/** @internal */
|
|
1272
|
-
export declare type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "disablePersistentFiltersAcrossTabs" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
1279
|
+
export declare type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "timezoneConfig" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "disablePersistentFiltersAcrossTabs" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
1273
1280
|
version: string;
|
|
1274
1281
|
};
|
|
1275
1282
|
|
|
@@ -1302,7 +1309,18 @@ export declare const DatasetTypes: string[];
|
|
|
1302
1309
|
export declare const DateDatasetTypes: string[];
|
|
1303
1310
|
|
|
1304
1311
|
/** @internal */
|
|
1305
|
-
export declare
|
|
1312
|
+
export declare type DateFilterEmitOptions = {
|
|
1313
|
+
entities: FromEntities;
|
|
1314
|
+
claimKey: ClaimFilterKey;
|
|
1315
|
+
connectedAttributeFilters?: IFilter[];
|
|
1316
|
+
errorContext?: IErrorContext;
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
/** @internal */
|
|
1320
|
+
export declare function declarativeAbsoluteDateFilterToYaml(absoluteDateFilter: IAbsoluteDateFilter["absoluteDateFilter"], { entities, claimKey, connectedAttributeFilters, errorContext }: DateFilterEmitOptions): {
|
|
1321
|
+
yaml: YAMLMap;
|
|
1322
|
+
carried: WrittenFilter[];
|
|
1323
|
+
};
|
|
1306
1324
|
|
|
1307
1325
|
/** @internal */
|
|
1308
1326
|
export declare function declarativeArithmeticMetricToYaml(def: IMeasureBody, arithmeticDefinition: IArithmeticMeasureDefinition): YAMLMap;
|
|
@@ -1400,7 +1418,10 @@ export declare function declarativePreviousPeriodMetricToYaml(def: IMeasureBody,
|
|
|
1400
1418
|
export declare function declarativeRankingFilterToYaml(rankingFilter: IRankingFilterBody, errorContext?: IErrorContext): YAMLMap;
|
|
1401
1419
|
|
|
1402
1420
|
/** @internal */
|
|
1403
|
-
export declare function declarativeRelativeDateFilterToYaml(relativeDateFilter: IRelativeDateFilter["relativeDateFilter"],
|
|
1421
|
+
export declare function declarativeRelativeDateFilterToYaml(relativeDateFilter: IRelativeDateFilter["relativeDateFilter"], { entities, claimKey, connectedAttributeFilters, errorContext }: DateFilterEmitOptions): {
|
|
1422
|
+
yaml: YAMLMap;
|
|
1423
|
+
carried: WrittenFilter[];
|
|
1424
|
+
};
|
|
1404
1425
|
|
|
1405
1426
|
/** @internal */
|
|
1406
1427
|
export declare function declarativeSectionsToYaml(layout?: IDashboardLayout, entities?: FromEntities, errorContext?: IErrorContext): YAMLSeq<unknown> | undefined;
|
|
@@ -3959,7 +3980,7 @@ export declare type VisualisationConfig<T> = {
|
|
|
3959
3980
|
};
|
|
3960
3981
|
|
|
3961
3982
|
/** @internal */
|
|
3962
|
-
export declare type VisualisationDefinition = Pick<IInsight["insight"], "visualizationUrl" | "properties" | "filters" | "buckets" | "sorts" | "attributeFilterConfigs"> & {
|
|
3983
|
+
export declare type VisualisationDefinition = Pick<IInsight["insight"], "visualizationUrl" | "properties" | "filters" | "buckets" | "sorts" | "attributeFilterConfigs" | "layers"> & {
|
|
3963
3984
|
version: string;
|
|
3964
3985
|
};
|
|
3965
3986
|
|
|
@@ -4132,6 +4153,13 @@ export declare function waterfallChartSave(_fields: Visualisation["query"]["fiel
|
|
|
4132
4153
|
customTooltip: CustomTooltip | undefined;
|
|
4133
4154
|
} | undefined;
|
|
4134
4155
|
|
|
4156
|
+
/** @internal */
|
|
4157
|
+
export declare type WrittenFilter = {
|
|
4158
|
+
key: string;
|
|
4159
|
+
yaml: YAMLMap;
|
|
4160
|
+
filter: IFilter;
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4135
4163
|
/** @public */
|
|
4136
4164
|
export declare function yamlAttributeHierarchyToDeclarative(input: AttributeHierarchy): DeclarativeAttributeHierarchy;
|
|
4137
4165
|
|
|
@@ -4,7 +4,7 @@ import { type IDashboardAttributeFilterConfig, type IDashboardDateFilter, type I
|
|
|
4
4
|
import { type OverrideDashboardDefinition } from "../from/declarativeDashboardToYaml.js";
|
|
5
5
|
import { type ExportEntities } from "../types.js";
|
|
6
6
|
/** @internal */
|
|
7
|
-
export type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "disablePersistentFiltersAcrossTabs" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
7
|
+
export type DashboardDefinition = Pick<OverrideDashboardDefinition, "layout" | "plugins" | "dateFilterConfig" | "dateFilterConfigs" | "timezoneConfig" | "disableCrossFiltering" | "disableUserFilterSave" | "disableUserFilterReset" | "disableFilterViews" | "disablePersistentFiltersAcrossTabs" | "attributeFilterConfigs" | "measureValueFilterConfigs" | "filterContextRef" | "tabs" | "activeTabLocalIdentifier"> & {
|
|
8
8
|
version: string;
|
|
9
9
|
};
|
|
10
10
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yamlDashboardToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlDashboardToDeclarative.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,8BAA8B,EAGnC,KAAK,wBAAwB,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EAGT,gBAAgB,EAMhB,WAAW,EAKX,cAAc,EAId,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIH,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EAEnC,KAAK,4BAA4B,EAEjC,KAAK,kCAAkC,EACvC,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"yamlDashboardToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlDashboardToDeclarative.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,8BAA8B,EAGnC,KAAK,wBAAwB,EAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EAGT,gBAAgB,EAMhB,WAAW,EAKX,cAAc,EAId,mBAAmB,EACnB,2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C5E,kBAAkB,EAAE,4BAA4B,GAAG,SAAS,CAAC;CAChE,CAuVA"}
|
|
@@ -164,12 +164,14 @@ export function yamlDashboardToDeclarative(entities, input) {
|
|
|
164
164
|
? processDashboardWithTabsV2(entities, input)
|
|
165
165
|
: processDashboardWithoutTabsV2(entities, input);
|
|
166
166
|
const plugins = yamlPluginsToDeclarative(input.plugins);
|
|
167
|
+
const timezoneConfig = yamlTimezoneConfigToDeclarative(input.timezone_config);
|
|
167
168
|
const [, permissions] = toDeclarativePermissions(input.permissions);
|
|
168
169
|
const content = yamlVersion === "3"
|
|
169
170
|
? {
|
|
170
171
|
version: "3",
|
|
171
172
|
plugins,
|
|
172
173
|
tabs,
|
|
174
|
+
...(timezoneConfig ? { timezoneConfig } : {}),
|
|
173
175
|
...(input.cross_filtering === false ? { disableCrossFiltering: true } : {}),
|
|
174
176
|
...(input.user_filters_save === false ? { disableUserFilterSave: true } : {}),
|
|
175
177
|
...(input.user_filters_reset === false ? { disableUserFilterReset: true } : {}),
|
|
@@ -186,6 +188,7 @@ export function yamlDashboardToDeclarative(entities, input) {
|
|
|
186
188
|
measureValueFilterConfigs,
|
|
187
189
|
dateFilterConfig,
|
|
188
190
|
dateFilterConfigs,
|
|
191
|
+
...(timezoneConfig ? { timezoneConfig } : {}),
|
|
189
192
|
...(tabs ? { tabs } : {}),
|
|
190
193
|
...(input.cross_filtering === false ? { disableCrossFiltering: true } : {}),
|
|
191
194
|
...(input.user_filters_save === false ? { disableUserFilterSave: true } : {}),
|
|
@@ -603,6 +606,18 @@ function yamlPluginToDeclarative(input) {
|
|
|
603
606
|
parameters: serialiseParameters(input.parameters ?? ""),
|
|
604
607
|
};
|
|
605
608
|
}
|
|
609
|
+
function yamlTimezoneConfigToDeclarative(input) {
|
|
610
|
+
if (!input) {
|
|
611
|
+
return undefined;
|
|
612
|
+
}
|
|
613
|
+
return {
|
|
614
|
+
...(input.timezone_id ? { timezoneId: input.timezone_id } : {}),
|
|
615
|
+
...(input.show_timezone_info === undefined ? {} : { showTimezoneInfo: input.show_timezone_info }),
|
|
616
|
+
...(input.allow_user_override_in_view_mode === undefined
|
|
617
|
+
? {}
|
|
618
|
+
: { allowUserOverrideInViewMode: input.allow_user_override_in_view_mode }),
|
|
619
|
+
};
|
|
620
|
+
}
|
|
606
621
|
function isFilterGroup(filter) {
|
|
607
622
|
return (typeof filter === "object" &&
|
|
608
623
|
filter !== null &&
|
|
@@ -3,7 +3,7 @@ import type { Filter, QueryFilters, Sorts, Total, Visualisation } from "@gooddat
|
|
|
3
3
|
import { type IAttributeFilterConfigs, type IFilter, type IInsight, type ISortItem, type ITotal } from "@gooddata/sdk-model";
|
|
4
4
|
import { type ExportEntities } from "../types.js";
|
|
5
5
|
/** @internal */
|
|
6
|
-
export type VisualisationDefinition = Pick<IInsight["insight"], "visualizationUrl" | "properties" | "filters" | "buckets" | "sorts" | "attributeFilterConfigs"> & {
|
|
6
|
+
export type VisualisationDefinition = Pick<IInsight["insight"], "visualizationUrl" | "properties" | "filters" | "buckets" | "sorts" | "attributeFilterConfigs" | "layers"> & {
|
|
7
7
|
version: string;
|
|
8
8
|
};
|
|
9
9
|
/** @public */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yamlVisualisationToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlVisualisationToDeclarative.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAUR,MAAM,EAMN,YAAY,EAIZ,KAAK,EAEL,KAAK,EACL,aAAa,EAEhB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEH,KAAK,uBAAuB,EAE5B,KAAK,OAAO,EACZ,KAAK,QAAQ,EAIb,KAAK,SAAS,EACd,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"yamlVisualisationToDeclarative.d.ts","sourceRoot":"","sources":["../../src/to/yamlVisualisationToDeclarative.ts"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D,CAmBA;AAuQD,gBAAgB;AAChB,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,KAAK,GAAG,SAAS,EAC1B,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,GACzC,SAAS,EAAE,CA4Bb;AAuhBD,gBAAgB;AAChB,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,cAAc,EACxB,UAAU,EAAE,YAAY,GAAG,MAAM,EAAE,GAAG,SAAS,EAC/C,sBAAsB,GAAE,uBAA4B,EAGpD,mBAAmB,UAAQ,GAC5B;IACC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,sBAAsB,EAAE,uBAAuB,GAAG,SAAS,CAAC;CAC/D,CAsBA;AAID,gBAAgB;AAChB,wBAAgB,4BAA4B,CAAC,MAAM,qBAAc,EAAE,mBAAmB,EAAE,MAAM,GAAG,MAAM,EAAE,CASxG;AAID,gBAAgB;AAChB,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,aAAa,GACrB;IACC,OAAO,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5C,SAAS,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,gBAAgB,EAAE,uBAAuB,CAAC;CAC7C,CAuDA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
|
+
import { filterLocalIdentifier, } from "@gooddata/sdk-model";
|
|
2
3
|
import { areaChart } from "../configs/areaChart.js";
|
|
3
4
|
import { barChart } from "../configs/barChart.js";
|
|
4
5
|
import { bubbleChart } from "../configs/bubbleChart.js";
|
|
@@ -500,7 +501,7 @@ function convertYamlConditionsToSdk(yamlConditions, nullValuesAsZero) {
|
|
|
500
501
|
});
|
|
501
502
|
return sdkConditions;
|
|
502
503
|
}
|
|
503
|
-
function yamlAbsoluteDateFilterToDeclarative(entities, filter) {
|
|
504
|
+
function yamlAbsoluteDateFilterToDeclarative(entities, filter, assignFilterLocalId) {
|
|
504
505
|
let result = {
|
|
505
506
|
filters: [
|
|
506
507
|
{
|
|
@@ -513,7 +514,7 @@ function yamlAbsoluteDateFilterToDeclarative(entities, filter) {
|
|
|
513
514
|
],
|
|
514
515
|
};
|
|
515
516
|
result = mergeDeclarativeResults(result, dateFilterEmptyValuesToDeclarative(filter));
|
|
516
|
-
result = mergeDeclarativeResults(result, dateFilterWithFieldToDeclarative(entities, filter));
|
|
517
|
+
result = mergeDeclarativeResults(result, dateFilterWithFieldToDeclarative(entities, filter, assignFilterLocalId));
|
|
517
518
|
return result;
|
|
518
519
|
}
|
|
519
520
|
function dateFilterEmptyValuesToDeclarative(filter) {
|
|
@@ -553,13 +554,13 @@ function dateFilterEmptyValuesToDeclarative(filter) {
|
|
|
553
554
|
}
|
|
554
555
|
return { filters: [] };
|
|
555
556
|
}
|
|
556
|
-
function dateFilterWithFieldToDeclarative(entities, filter) {
|
|
557
|
+
function dateFilterWithFieldToDeclarative(entities, filter, assignFilterLocalId) {
|
|
557
558
|
if (!filter.with) {
|
|
558
559
|
return { filters: [] };
|
|
559
560
|
}
|
|
560
|
-
return mergeDeclarativeResults(...Object.entries(filter.with).map(([key, withFilter]) => yamlFilterToDeclarative(entities, key, withFilter)));
|
|
561
|
+
return mergeDeclarativeResults(...Object.entries(filter.with).map(([key, withFilter]) => yamlFilterToDeclarative(entities, key, withFilter, assignFilterLocalId)));
|
|
561
562
|
}
|
|
562
|
-
function yamlRelativeDateFilterToDeclarative(entities, filter) {
|
|
563
|
+
function yamlRelativeDateFilterToDeclarative(entities, filter, assignFilterLocalId) {
|
|
563
564
|
const identifier = createIdentifier(filter.using, { forceType: "dataset" });
|
|
564
565
|
if (!identifier) {
|
|
565
566
|
throw new Error(`Could not find dataset ${filter.using} to use in relative date filter`);
|
|
@@ -594,7 +595,7 @@ function yamlRelativeDateFilterToDeclarative(entities, filter) {
|
|
|
594
595
|
});
|
|
595
596
|
}
|
|
596
597
|
result = mergeDeclarativeResults(result, dateFilterEmptyValuesToDeclarative(filter));
|
|
597
|
-
result = mergeDeclarativeResults(result, dateFilterWithFieldToDeclarative(entities, filter));
|
|
598
|
+
result = mergeDeclarativeResults(result, dateFilterWithFieldToDeclarative(entities, filter, assignFilterLocalId));
|
|
598
599
|
return result;
|
|
599
600
|
}
|
|
600
601
|
function yamlPositiveAttributeFilterToDeclarative(entities, key, filter, assignFilterLocalId = false) {
|
|
@@ -777,12 +778,12 @@ function yamlRankingFilterToDeclarative(filter) {
|
|
|
777
778
|
function yamlFilterToDeclarative(entities, key, filter,
|
|
778
779
|
// Only view-level (report/layer) filters need a localIdentifier so their displayAsLabel can be
|
|
779
780
|
// correlated via attributeFilterConfigs. Measure-scoped filters must NOT carry one.
|
|
780
|
-
assignFilterLocalId
|
|
781
|
+
assignFilterLocalId) {
|
|
781
782
|
if (isAbsoluteDateFilter(filter)) {
|
|
782
|
-
return yamlAbsoluteDateFilterToDeclarative(entities, filter);
|
|
783
|
+
return yamlAbsoluteDateFilterToDeclarative(entities, filter, assignFilterLocalId);
|
|
783
784
|
}
|
|
784
785
|
if (isRelativeDateFilter(filter)) {
|
|
785
|
-
return yamlRelativeDateFilterToDeclarative(entities, filter);
|
|
786
|
+
return yamlRelativeDateFilterToDeclarative(entities, filter, assignFilterLocalId);
|
|
786
787
|
}
|
|
787
788
|
if (isPositiveAttributeFilter(filter)) {
|
|
788
789
|
return yamlPositiveAttributeFilterToDeclarative(entities, key, filter, assignFilterLocalId);
|
|
@@ -819,6 +820,23 @@ function mergeDeclarativeResults(...results) {
|
|
|
819
820
|
attributeFilterConfig: Object.assign({}, ...results.map((result) => result.attributeFilterConfig ?? {})),
|
|
820
821
|
};
|
|
821
822
|
}
|
|
823
|
+
/**
|
|
824
|
+
* A filter's key becomes its local identifier, and the whole query shares one namespace for them across
|
|
825
|
+
* nested blocks — a name reused between blocks would leave two filters indistinguishable.
|
|
826
|
+
*/
|
|
827
|
+
function assertDistinctLocalIdentifiers(filters) {
|
|
828
|
+
const seen = new Set();
|
|
829
|
+
for (const filter of filters) {
|
|
830
|
+
const localIdentifier = filterLocalIdentifier(filter);
|
|
831
|
+
if (!localIdentifier) {
|
|
832
|
+
continue;
|
|
833
|
+
}
|
|
834
|
+
if (seen.has(localIdentifier)) {
|
|
835
|
+
throw newError(CoreErrorCode.DuplicateFilterName, [localIdentifier]);
|
|
836
|
+
}
|
|
837
|
+
seen.add(localIdentifier);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
822
840
|
/** @internal */
|
|
823
841
|
export function yamlFiltersToDeclarative(entities, filters_by, attributeFilterConfigs = {},
|
|
824
842
|
// View-level (report/layer) filters set this so their displayAsLabel correlates via localIdentifier;
|
|
@@ -830,6 +848,7 @@ assignFilterLocalId = false) {
|
|
|
830
848
|
: []), ...(filters_by && isArray
|
|
831
849
|
? filters_by.map((filter, i) => yamlFilterToDeclarative(entities, i.toString(), filter, assignFilterLocalId))
|
|
832
850
|
: []));
|
|
851
|
+
assertDistinctLocalIdentifiers(filters);
|
|
833
852
|
return {
|
|
834
853
|
filters,
|
|
835
854
|
attributeFilterConfigs: Object.keys(attributeFilterConfig ?? {}).length > 0 ? attributeFilterConfig : undefined,
|
|
@@ -1032,22 +1051,22 @@ function yamlLayersToDeclarative(entities, input, _positions) {
|
|
|
1032
1051
|
if (!("layers" in input) || !Array.isArray(input.layers) || input.layers.length === 0) {
|
|
1033
1052
|
return [];
|
|
1034
1053
|
}
|
|
1035
|
-
|
|
1054
|
+
const layers = input.layers;
|
|
1055
|
+
// An id is what pairs a layer with the one it was read from, so a repeated one names no single layer.
|
|
1056
|
+
const claimed = new Set();
|
|
1057
|
+
for (const { id } of layers) {
|
|
1058
|
+
if (claimed.has(id)) {
|
|
1059
|
+
throw newError(CoreErrorCode.DuplicateLayerIdentifier, [id]);
|
|
1060
|
+
}
|
|
1061
|
+
claimed.add(id);
|
|
1062
|
+
}
|
|
1063
|
+
return layers.map((layer) => {
|
|
1036
1064
|
if (layer.type !== "pushpin" && layer.type !== "area") {
|
|
1037
1065
|
throw newError(CoreErrorCode.LayerTypeNotSupported, [layer.type ?? "<missing>"]);
|
|
1038
1066
|
}
|
|
1039
1067
|
const layerVisualizationType = layer.type === "pushpin" ? "geo_chart" : "geo_area_chart";
|
|
1040
|
-
const
|
|
1041
|
-
const resolvedQuery = {
|
|
1042
|
-
...input.query,
|
|
1043
|
-
...baseQuery,
|
|
1044
|
-
fields: {
|
|
1045
|
-
...(input.query?.fields ?? {}),
|
|
1046
|
-
...(baseQuery?.fields ?? {}),
|
|
1047
|
-
},
|
|
1048
|
-
};
|
|
1068
|
+
const resolvedQuery = { ...input.query, fields: input.query?.fields ?? {} };
|
|
1049
1069
|
const positions = [];
|
|
1050
|
-
let attrFilterConfig = {};
|
|
1051
1070
|
const visBuckets = layer.type === "pushpin"
|
|
1052
1071
|
? createPushpinBuckets({
|
|
1053
1072
|
viewBy: layer.view_by,
|
|
@@ -1069,13 +1088,10 @@ function yamlLayersToDeclarative(entities, input, _positions) {
|
|
|
1069
1088
|
}
|
|
1070
1089
|
const items = bucket.items
|
|
1071
1090
|
.map((item) => {
|
|
1072
|
-
const { bucketItem, bucketTotals, longitude, latitude
|
|
1091
|
+
const { bucketItem, bucketTotals, longitude, latitude } = yamlBucketItemToDeclarative(entities, resolvedQuery, item, resolvedQuery.fields || {}, localIdentifier);
|
|
1073
1092
|
if (longitude && latitude) {
|
|
1074
1093
|
positions.push({ longitude, latitude });
|
|
1075
1094
|
}
|
|
1076
|
-
if (filterConfig) {
|
|
1077
|
-
attrFilterConfig = { ...attrFilterConfig, ...filterConfig };
|
|
1078
|
-
}
|
|
1079
1095
|
bucketTotals.forEach((total) => totals.push(total));
|
|
1080
1096
|
return bucketItem;
|
|
1081
1097
|
})
|
|
@@ -1087,7 +1103,6 @@ function yamlLayersToDeclarative(entities, input, _positions) {
|
|
|
1087
1103
|
};
|
|
1088
1104
|
})
|
|
1089
1105
|
.filter(Boolean);
|
|
1090
|
-
const { filters: layerFilters, attributeFilterConfigs } = yamlFiltersToDeclarative(entities, baseQuery?.filter_by, attrFilterConfig, true);
|
|
1091
1106
|
const layerProperties = layer.config || (layer.type === "pushpin" && positions.length > 0)
|
|
1092
1107
|
? yamlConfigToDeclarative({
|
|
1093
1108
|
...input,
|
|
@@ -1099,14 +1114,12 @@ function yamlLayersToDeclarative(entities, input, _positions) {
|
|
|
1099
1114
|
config: layer.config,
|
|
1100
1115
|
}, positions)
|
|
1101
1116
|
: undefined;
|
|
1117
|
+
// Unset keeps the layer inheriting the insight's properties; an empty object would pin its own.
|
|
1102
1118
|
return {
|
|
1103
1119
|
id: layer.id,
|
|
1104
1120
|
name: layer.title,
|
|
1105
1121
|
type: layer.type,
|
|
1106
1122
|
buckets,
|
|
1107
|
-
filters: layerFilters,
|
|
1108
|
-
...(attributeFilterConfigs ? { attributeFilterConfigs } : {}),
|
|
1109
|
-
sorts: yamlSortsToDeclarative(baseQuery?.sort_by, baseQuery?.fields ?? resolvedQuery.fields ?? {}),
|
|
1110
1123
|
properties: layerProperties && Object.keys(layerProperties).length > 0 ? layerProperties : undefined,
|
|
1111
1124
|
};
|
|
1112
1125
|
});
|
|
@@ -4,7 +4,11 @@ import { type ColorMapping, type ColumnWidthItem, type IChartFill, type ICustomT
|
|
|
4
4
|
/** @public */
|
|
5
5
|
export declare function loadColorMapping(mappings: Array<ColorMapping>): YAMLMap<keyof ListOfColors, Color>;
|
|
6
6
|
export declare function loadColorDefinitions(mappings: Array<ColorMapping>): YAMLMap<keyof ColorDefinition, Color>;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Only `/^\d+$/` guids resolve against a workspace palette (see `guidEquals` in sdk-ui-vis-commons), and
|
|
9
|
+
* the schema admits no colour string but `rgb(...)`, so anything else has no code form.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadColor(key: string, color: ColorMapping["color"] | undefined, mode?: "number" | "enum"): Pair<string, string> | Pair<string, number> | undefined;
|
|
8
12
|
/** @public */
|
|
9
13
|
export declare function saveColorMapping(mapping: ListOfColors): Array<ColorMapping> | undefined;
|
|
10
14
|
export declare function saveColorDefinitions(mapping: ColorDefinition): Array<ColorMapping> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configUtils.d.ts","sourceRoot":"","sources":["../../src/utils/configUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EACR,KAAK,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,KAAK,EACR,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACH,KAAK,YAAY,EAGjB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACxB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"configUtils.d.ts","sourceRoot":"","sources":["../../src/utils/configUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,KAAK,EACR,KAAK,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,KAAK,EACR,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACH,KAAK,YAAY,EAGjB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACxB,MAAM,qBAAqB,CAAC;AAO7B,cAAc;AACd,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,MAAM,YAAY,EAAE,KAAK,CAAC,CAelG;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,MAAM,eAAe,EAAE,KAAK,CAAC,CAYzG;AAID;;;GAGG;AACH,wBAAgB,SAAS,CACrB,GAAG,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,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,UAAU;;;EAM3F;AAED,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAC;AAEF,KAAK,iBAAiB,GAAG,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAIhF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS;;;;cASlE;AAGD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,cAAc,GAAG,SAAS,CAStF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,wCAY/E"}
|
package/esm/utils/configUtils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2023-2026 GoodData Corporation
|
|
2
2
|
import { Pair, YAMLMap } from "yaml";
|
|
3
3
|
import { getValueOrDefault, saveConfigObject } from "../configs/utils.js";
|
|
4
|
+
import { CoreErrorCode, newError } from "./errors.js";
|
|
4
5
|
import { getFullField } from "./sharedUtils.js";
|
|
5
6
|
import { isAttributeField, isMetricField } from "./typeGuards.js";
|
|
6
7
|
/** @public */
|
|
@@ -8,6 +9,9 @@ export function loadColorMapping(mappings) {
|
|
|
8
9
|
const map = new YAMLMap();
|
|
9
10
|
mappings.forEach((mapping) => {
|
|
10
11
|
const { color, id } = mapping;
|
|
12
|
+
if (id === null) {
|
|
13
|
+
throw newError(CoreErrorCode.ItemNotSupported, ["color mapping of the empty element"]);
|
|
14
|
+
}
|
|
11
15
|
const col = loadColor(id, color);
|
|
12
16
|
if (col) {
|
|
13
17
|
map.add(col);
|
|
@@ -26,25 +30,33 @@ export function loadColorDefinitions(mappings) {
|
|
|
26
30
|
});
|
|
27
31
|
return map;
|
|
28
32
|
}
|
|
29
|
-
|
|
33
|
+
const COMPARISON_GUIDS = { positive: 1, negative: -1, equals: 0 };
|
|
34
|
+
/**
|
|
35
|
+
* Only `/^\d+$/` guids resolve against a workspace palette (see `guidEquals` in sdk-ui-vis-commons), and
|
|
36
|
+
* the schema admits no colour string but `rgb(...)`, so anything else has no code form.
|
|
37
|
+
*/
|
|
38
|
+
export function loadColor(key, color, mode = "number") {
|
|
30
39
|
if (!color) {
|
|
31
40
|
return undefined;
|
|
32
41
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
const { type } = color;
|
|
43
|
+
if (type === "guid") {
|
|
44
|
+
const comparison = COMPARISON_GUIDS[color.value];
|
|
45
|
+
if (mode === "enum") {
|
|
46
|
+
if (comparison === undefined) {
|
|
47
|
+
throw newError(CoreErrorCode.ItemNotSupported, [`comparison color "${color.value}"`]);
|
|
48
|
+
}
|
|
49
|
+
return new Pair(key, comparison);
|
|
50
|
+
}
|
|
51
|
+
if (!/^\d+$/.test(color.value)) {
|
|
52
|
+
throw newError(CoreErrorCode.ItemNotSupported, [`color "${color.value}"`]);
|
|
41
53
|
}
|
|
42
|
-
return new Pair(key, parseInt(color.value, 10));
|
|
54
|
+
return new Pair(key, Number.parseInt(color.value, 10));
|
|
43
55
|
}
|
|
44
|
-
if (
|
|
56
|
+
if (type === "rgb") {
|
|
45
57
|
return new Pair(key, `rgb(${color.value.r},${color.value.g},${color.value.b})`);
|
|
46
58
|
}
|
|
47
|
-
throw
|
|
59
|
+
throw newError(CoreErrorCode.ItemNotSupported, [`color of type "${type}"`]);
|
|
48
60
|
}
|
|
49
61
|
/** @public */
|
|
50
62
|
export function saveColorMapping(mapping) {
|
|
@@ -114,7 +126,7 @@ function getDefById(id) {
|
|
|
114
126
|
case "properties.color.negative":
|
|
115
127
|
return "negative";
|
|
116
128
|
default:
|
|
117
|
-
throw
|
|
129
|
+
throw newError(CoreErrorCode.ItemNotSupported, [`color definition "${id}"`]);
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
132
|
function getIdByDef(def) {
|
package/esm/utils/errors.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export declare enum CoreErrorCode {
|
|
|
13
13
|
OnlyOneAttributeItemAllowed = "core.onlyOneAttributeItemAllowed",
|
|
14
14
|
MultipleCommonDateFilters = "core.multipleCommonDateFilters",
|
|
15
15
|
DuplicateFilterLocalIdentifier = "core.duplicateFilterLocalIdentifier",
|
|
16
|
+
DuplicateFieldName = "core.duplicateFieldName",
|
|
17
|
+
DuplicateFilterName = "core.duplicateFilterName",
|
|
18
|
+
DuplicateLayerIdentifier = "core.duplicateLayerIdentifier",
|
|
16
19
|
DuplicateTabIdentifier = "core.duplicateTabIdentifier",
|
|
17
20
|
TabsAndRootContentMutuallyExclusive = "core.tabsAndRootContentMutuallyExclusive"
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,aAAa;IAErB,0BAA0B,oCAAoC;IAC9D,0BAA0B,oCAAoC;IAC9D,gBAAgB,0BAA0B;IAC1C,yBAAyB,mCAAmC;IAC5D,yBAAyB,mCAAmC;IAC5D,qBAAqB,+BAA+B;IACpD,oBAAoB,8BAA8B;IAClD,yBAAyB,mCAAmC;IAC5D,2BAA2B,qCAAqC;IAChE,yBAAyB,mCAAmC;IAC5D,8BAA8B,wCAAwC;IACtE,sBAAsB,gCAAgC;IACtD,mCAAmC,6CAA6C;CACnF;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,aAAa;IAErB,0BAA0B,oCAAoC;IAC9D,0BAA0B,oCAAoC;IAC9D,gB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U3F"}
|
package/esm/utils/errors.js
CHANGED
|
@@ -17,6 +17,9 @@ var CoreErrorCode;
|
|
|
17
17
|
CoreErrorCode["OnlyOneAttributeItemAllowed"] = "core.onlyOneAttributeItemAllowed";
|
|
18
18
|
CoreErrorCode["MultipleCommonDateFilters"] = "core.multipleCommonDateFilters";
|
|
19
19
|
CoreErrorCode["DuplicateFilterLocalIdentifier"] = "core.duplicateFilterLocalIdentifier";
|
|
20
|
+
CoreErrorCode["DuplicateFieldName"] = "core.duplicateFieldName";
|
|
21
|
+
CoreErrorCode["DuplicateFilterName"] = "core.duplicateFilterName";
|
|
22
|
+
CoreErrorCode["DuplicateLayerIdentifier"] = "core.duplicateLayerIdentifier";
|
|
20
23
|
CoreErrorCode["DuplicateTabIdentifier"] = "core.duplicateTabIdentifier";
|
|
21
24
|
CoreErrorCode["TabsAndRootContentMutuallyExclusive"] = "core.tabsAndRootContentMutuallyExclusive";
|
|
22
25
|
})(CoreErrorCode || (CoreErrorCode = {}));
|
|
@@ -35,6 +38,9 @@ export const CoreErrorMessages = {
|
|
|
35
38
|
[CoreErrorCode.OnlyOneAttributeItemAllowed]: `Dashboard filters contains more filters with same attribute or label "{0}".`,
|
|
36
39
|
[CoreErrorCode.MultipleCommonDateFilters]: `Multiple usage of common date filters in dashboard. Define exactly one date filter that has no date dataset defined.`,
|
|
37
40
|
[CoreErrorCode.DuplicateFilterLocalIdentifier]: `Duplicate filter local identifier "{0}". Each filter must have a unique local identifier across a dashboard tab, including filters in groups.`,
|
|
41
|
+
[CoreErrorCode.DuplicateFieldName]: `Duplicate field name "{0}". Each field a query declares must have a unique name.`,
|
|
42
|
+
[CoreErrorCode.DuplicateFilterName]: `Duplicate filter name "{0}". Each filter in a query must have a unique name, including the filters a date filter carries.`,
|
|
43
|
+
[CoreErrorCode.DuplicateLayerIdentifier]: `Duplicate layer id "{0}". Each layer of a visualisation must have a unique id.`,
|
|
38
44
|
[CoreErrorCode.DuplicateTabIdentifier]: `Duplicate tab identifier "{0}". Each tab must have a unique identifier within the dashboard.`,
|
|
39
45
|
[CoreErrorCode.TabsAndRootContentMutuallyExclusive]: `Dashboard "{0}" defines both "tabs" and root-level "sections" or "filters". These are mutually exclusive — keep all content inside tabs or at the root, not both.`,
|
|
40
46
|
};
|
|
@@ -53,6 +59,9 @@ export const CoreErrorTypes = {
|
|
|
53
59
|
[CoreErrorCode.OnlyOneAttributeItemAllowed]: "OnlyOneAttributeItemAllowed",
|
|
54
60
|
[CoreErrorCode.MultipleCommonDateFilters]: "MultipleCommonDateFilters",
|
|
55
61
|
[CoreErrorCode.DuplicateFilterLocalIdentifier]: "DuplicateFilterLocalIdentifier",
|
|
62
|
+
[CoreErrorCode.DuplicateFieldName]: "DuplicateFieldName",
|
|
63
|
+
[CoreErrorCode.DuplicateFilterName]: "DuplicateFilterName",
|
|
64
|
+
[CoreErrorCode.DuplicateLayerIdentifier]: "DuplicateLayerIdentifier",
|
|
56
65
|
[CoreErrorCode.DuplicateTabIdentifier]: "DuplicateTabIdentifier",
|
|
57
66
|
[CoreErrorCode.TabsAndRootContentMutuallyExclusive]: "TabsAndRootContentMutuallyExclusive",
|
|
58
67
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-code-convertors",
|
|
3
|
-
"version": "11.51.0-alpha.
|
|
3
|
+
"version": "11.51.0-alpha.4",
|
|
4
4
|
"description": "GoodData AAC declarative converters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"uuid": "11.1.1",
|
|
28
28
|
"yaml": "2.8.3",
|
|
29
|
-
"@gooddata/sdk-
|
|
30
|
-
"@gooddata/api-client-tiger": "11.51.0-alpha.
|
|
31
|
-
"@gooddata/sdk-
|
|
29
|
+
"@gooddata/sdk-code-schemas": "11.51.0-alpha.4",
|
|
30
|
+
"@gooddata/api-client-tiger": "11.51.0-alpha.4",
|
|
31
|
+
"@gooddata/sdk-model": "11.51.0-alpha.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@microsoft/api-extractor": "^7.55.2",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"oxlint-tsgolint": "0.15.0",
|
|
51
51
|
"typescript": "5.9.3",
|
|
52
52
|
"vitest": "4.1.8",
|
|
53
|
-
"@gooddata/eslint-config": "11.51.0-alpha.
|
|
54
|
-
"@gooddata/oxlint-config": "11.51.0-alpha.
|
|
53
|
+
"@gooddata/eslint-config": "11.51.0-alpha.4",
|
|
54
|
+
"@gooddata/oxlint-config": "11.51.0-alpha.4"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"_phase:build": "npm run build",
|