@gooddata/sdk-ui-catalog 11.54.0-alpha.6 → 11.54.0
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/asCode/AsCodeDeleteDialog.d.ts.map +1 -1
- package/esm/asCode/AsCodeDeleteDialog.js +19 -6
- package/esm/asCode/descriptor.d.ts +10 -2
- package/esm/asCode/descriptor.d.ts.map +1 -1
- package/esm/asCodeRegistry.d.ts.map +1 -1
- package/esm/asCodeRegistry.js +6 -1
- package/esm/catalogDetail/hooks/useCatalogItemLoad.d.ts.map +1 -1
- package/esm/catalogDetail/hooks/useCatalogItemLoad.js +11 -1
- package/esm/catalogItem/catalogBackend.test.utils.d.ts.map +1 -1
- package/esm/catalogItem/catalogBackend.test.utils.js +5 -0
- package/esm/catalogItem/converter.d.ts +4 -3
- package/esm/catalogItem/converter.d.ts.map +1 -1
- package/esm/catalogItem/converter.js +20 -1
- package/esm/catalogItem/guards.d.ts +5 -1
- package/esm/catalogItem/guards.d.ts.map +1 -1
- package/esm/catalogItem/guards.js +6 -0
- package/esm/catalogItem/query.d.ts +2 -1
- package/esm/catalogItem/query.d.ts.map +1 -1
- package/esm/catalogItem/query.js +34 -0
- package/esm/catalogItem/types.d.ts +13 -1
- package/esm/catalogItem/types.d.ts.map +1 -1
- package/esm/catalogItem/useCatalogEndpoints.d.ts +3 -2
- package/esm/catalogItem/useCatalogEndpoints.d.ts.map +1 -1
- package/esm/catalogItem/useCatalogEndpoints.js +17 -2
- package/esm/catalogItem/useCatalogItemFeed.d.ts +1 -0
- package/esm/catalogItem/useCatalogItemFeed.d.ts.map +1 -1
- package/esm/catalogItem/useCatalogItemFeed.js +1 -0
- package/esm/catalogItem/useCatalogItemSemanticSearch.js +2 -1
- package/esm/computedAttribute/computedAttributeCompletions.d.ts +8 -0
- package/esm/computedAttribute/computedAttributeCompletions.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeCompletions.js +21 -0
- package/esm/computedAttribute/computedAttributeConverter.d.ts +38 -0
- package/esm/computedAttribute/computedAttributeConverter.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeConverter.js +71 -0
- package/esm/computedAttribute/computedAttributeCopy.d.ts +3 -0
- package/esm/computedAttribute/computedAttributeCopy.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeCopy.js +20 -0
- package/esm/computedAttribute/computedAttributeDescriptor.d.ts +7 -0
- package/esm/computedAttribute/computedAttributeDescriptor.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeDescriptor.js +101 -0
- package/esm/computedAttribute/computedAttributeMutationPort.d.ts +17 -0
- package/esm/computedAttribute/computedAttributeMutationPort.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeMutationPort.js +53 -0
- package/esm/computedAttribute/computedAttributeMutationPort.test.utils.d.ts +4 -0
- package/esm/computedAttribute/computedAttributeMutationPort.test.utils.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeMutationPort.test.utils.js +24 -0
- package/esm/computedAttribute/computedAttributeSchema.d.ts +27 -0
- package/esm/computedAttribute/computedAttributeSchema.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeSchema.js +27 -0
- package/esm/computedAttribute/computedAttributeSerialization.d.ts +15 -0
- package/esm/computedAttribute/computedAttributeSerialization.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeSerialization.js +29 -0
- package/esm/computedAttribute/computedAttributeValidation.d.ts +15 -0
- package/esm/computedAttribute/computedAttributeValidation.d.ts.map +1 -0
- package/esm/computedAttribute/computedAttributeValidation.js +37 -0
- package/esm/computedAttribute/gate.d.ts +4 -0
- package/esm/computedAttribute/gate.d.ts.map +1 -0
- package/esm/computedAttribute/gate.js +4 -0
- package/esm/filter/FilterObjectType.js +3 -3
- package/esm/header/CreateObjectButton.d.ts.map +1 -1
- package/esm/header/CreateObjectButton.js +1 -0
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/insight/insightDescriptor.js +2 -2
- package/esm/insight/insightMutationPort.d.ts +2 -2
- package/esm/insight/insightMutationPort.d.ts.map +1 -1
- package/esm/insight/insightMutationPort.js +3 -3
- package/esm/lineage/const.d.ts.map +1 -1
- package/esm/lineage/const.js +1 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +108 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +108 -0
- package/esm/metric/metricDescriptor.js +2 -2
- package/esm/metric/metricMutationPort.d.ts +2 -2
- package/esm/metric/metricMutationPort.d.ts.map +1 -1
- package/esm/metric/metricMutationPort.js +7 -4
- package/esm/objectType/ObjectTypeIcon.js +1 -1
- package/esm/objectType/ObjectTypeSelect.d.ts +2 -2
- package/esm/objectType/ObjectTypeSelect.d.ts.map +1 -1
- package/esm/objectType/ObjectTypeSelect.js +13 -14
- package/esm/objectType/constants.d.ts +28 -3
- package/esm/objectType/constants.d.ts.map +1 -1
- package/esm/objectType/constants.js +10 -9
- package/esm/objectType/labels.d.ts.map +1 -1
- package/esm/objectType/labels.js +1 -0
- package/esm/objectType/mapping.d.ts +1 -1
- package/esm/objectType/mapping.d.ts.map +1 -1
- package/esm/objectType/types.d.ts +2 -2
- package/esm/objectType/types.d.ts.map +1 -1
- package/esm/sdk-ui-catalog.d.ts +21 -3
- package/package.json +17 -17
- package/styles/css/codeDialog.css +8 -0
- package/styles/css/codeDialog.css.map +1 -1
- package/styles/css/detail.css +9 -1
- package/styles/css/detail.css.map +1 -1
- package/styles/css/main.css +9 -1
- package/styles/css/main.css.map +1 -1
- package/styles/css/objectType.css +1 -1
- package/styles/css/objectType.css.map +1 -1
- package/styles/scss/codeDialog.scss +9 -0
- package/styles/scss/objectType.scss +3 -2
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EACH,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,6BAA6B,EAC7B,KAAK,mCAAmC,GAC3C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAMxG,OAAO,EACH,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,0BAA0B,GAClC,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACR,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,YAAY,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACjF,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACzB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EACH,sBAAsB,EACtB,KAAK,4BAA4B,EACjC,6BAA6B,EAC7B,KAAK,mCAAmC,GAC3C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAMxG,OAAO,EACH,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,0BAA0B,GAClC,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EACR,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnF,YAAY,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACjF,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,6BAA6B,EAC7B,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,GACzB,MAAM,yBAAyB,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -11,4 +11,4 @@ export { AnalyticsCatalogFilter } from "./AnalyticsCatalogFilter.js";
|
|
|
11
11
|
* stays backend-agnostic; without it, visualizations fall back to Analytical Designer.
|
|
12
12
|
*/
|
|
13
13
|
export { InsightCodecProvider, } from "./insight/insightCodecContext.js";
|
|
14
|
-
export { isCatalogItemAttribute, isCatalogItemDashboard, isCatalogItemDataSet, isCatalogItemFact, isCatalogItemInsight, isCatalogItemMeasure, isCatalogItemParameter, } from "./catalogItem/guards.js";
|
|
14
|
+
export { isCatalogItemAttribute, isCatalogItemComputedAttribute, isCatalogItemDashboard, isCatalogItemDataSet, isCatalogItemFact, isCatalogItemInsight, isCatalogItemMeasure, isCatalogItemParameter, } from "./catalogItem/guards.js";
|
|
@@ -5,7 +5,7 @@ import { ObjectTypes } from "../objectType/constants.js";
|
|
|
5
5
|
import { VISUALIZATION_EDITOR_FEATURE_FLAG } from "./gate.js";
|
|
6
6
|
import { useHasInsightCodecHost, useInsightCodec, useIsVisualizationTypeEditable, useRequestInsightCodec, } from "./insightCodecContext.js";
|
|
7
7
|
import { createCopiedInsight } from "./insightCopy.js";
|
|
8
|
-
import {
|
|
8
|
+
import { createInsightMutationAdapter, listInsightReferences, loadInsight } from "./insightMutationPort.js";
|
|
9
9
|
const VISUALIZATION_DOCS_URL = "https://www.gooddata.ai/docs/cloud/api-and-sdk/vs-code-extension/structures/#visualisation";
|
|
10
10
|
const messages = defineMessages({
|
|
11
11
|
createTitle: { id: "analyticsCatalog.visualization.dialog.create.title" },
|
|
@@ -60,7 +60,7 @@ export const visualizationDescriptor = defineAsCodeDescriptor({
|
|
|
60
60
|
}),
|
|
61
61
|
seed: { load: loadInsight, loadError: capabilityMessages.loadError },
|
|
62
62
|
referenceCounted: {
|
|
63
|
-
|
|
63
|
+
load: listInsightReferences,
|
|
64
64
|
usageWarning: capabilityMessages.deleteUsageWarning,
|
|
65
65
|
},
|
|
66
66
|
// No identity: an insight definition has no id field, and creates never carry one (backend-assigned).
|
|
@@ -6,8 +6,8 @@ import type { ICatalogItemInsight } from "../catalogItem/types.js";
|
|
|
6
6
|
export type IInsightMutationPort = IAsCodeMutationPort<IInsightDefinition, ICatalogItemInsight>;
|
|
7
7
|
/** Fetches the full insight for editing (the catalog item carries only metadata). @internal */
|
|
8
8
|
export declare function loadInsight(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemInsight): Promise<IInsightDefinition>;
|
|
9
|
-
/**
|
|
10
|
-
export declare function
|
|
9
|
+
/** Titles of the dashboards referencing an insight. @internal */
|
|
10
|
+
export declare function listInsightReferences(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemInsight): Promise<string[]>;
|
|
11
11
|
/** @internal */
|
|
12
12
|
export declare function createInsightMutationAdapter(backend: IAnalyticalBackend, workspace: string): IInsightMutationPort;
|
|
13
13
|
//# sourceMappingURL=insightMutationPort.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insightMutationPort.d.ts","sourceRoot":"","sources":["../../src/insight/insightMutationPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAiB,KAAK,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAE/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAEhG,+FAA+F;AAC/F,wBAAgB,WAAW,CACvB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAO7B;AAED,
|
|
1
|
+
{"version":3,"file":"insightMutationPort.d.ts","sourceRoot":"","sources":["../../src/insight/insightMutationPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAiB,KAAK,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAE/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAEhG,+FAA+F;AAC/F,wBAAgB,WAAW,CACvB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAO7B;AAED,iEAAiE;AACjE,wBAAsB,qBAAqB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;AAoBD,gBAAgB;AAChB,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAClB,oBAAoB,CAsBtB"}
|
|
@@ -10,13 +10,13 @@ export function loadInsight(backend, workspace, item) {
|
|
|
10
10
|
.insights()
|
|
11
11
|
.getInsight(idRef(item.identifier, "insight"), { loadUserData: true });
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
export async function
|
|
13
|
+
/** Titles of the dashboards referencing an insight. @internal */
|
|
14
|
+
export async function listInsightReferences(backend, workspace, item) {
|
|
15
15
|
const referencing = await backend
|
|
16
16
|
.workspace(workspace)
|
|
17
17
|
.insights()
|
|
18
18
|
.getInsightReferencingObjects(idRef(item.identifier, "insight"));
|
|
19
|
-
return referencing.analyticalDashboards
|
|
19
|
+
return (referencing.analyticalDashboards ?? []).map((dashboard) => dashboard.title);
|
|
20
20
|
}
|
|
21
21
|
function pickInsightIdentity(insight) {
|
|
22
22
|
const { identifier, uri, ref, isLocked, certification } = insight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/lineage/const.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,YAAY,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/lineage/const.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,YAAY,EAAE,UAAU,EAsBpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAAgB,CAAC"}
|
package/esm/lineage/const.js
CHANGED
|
@@ -71,6 +71,10 @@ export declare const en_US: {
|
|
|
71
71
|
text: string;
|
|
72
72
|
crowdinContext: string;
|
|
73
73
|
};
|
|
74
|
+
"analyticsCatalog.objectType.computedAttribute.name": {
|
|
75
|
+
text: string;
|
|
76
|
+
crowdinContext: string;
|
|
77
|
+
};
|
|
74
78
|
"analyticsCatalog.visualizationType.table.tooltip": {
|
|
75
79
|
text: string;
|
|
76
80
|
crowdinContext: string;
|
|
@@ -775,6 +779,102 @@ export declare const en_US: {
|
|
|
775
779
|
text: string;
|
|
776
780
|
crowdinContext: string;
|
|
777
781
|
};
|
|
782
|
+
"analyticsCatalog.computedAttribute.dialog.create.title": {
|
|
783
|
+
text: string;
|
|
784
|
+
crowdinContext: string;
|
|
785
|
+
};
|
|
786
|
+
"analyticsCatalog.computedAttribute.dialog.edit.title": {
|
|
787
|
+
text: string;
|
|
788
|
+
crowdinContext: string;
|
|
789
|
+
};
|
|
790
|
+
"analyticsCatalog.computedAttribute.dialog.edit.duplicate": {
|
|
791
|
+
text: string;
|
|
792
|
+
crowdinContext: string;
|
|
793
|
+
};
|
|
794
|
+
"analyticsCatalog.computedAttribute.dialog.edit.idImmutable": {
|
|
795
|
+
text: string;
|
|
796
|
+
crowdinContext: string;
|
|
797
|
+
};
|
|
798
|
+
"analyticsCatalog.computedAttribute.dialog.sectionHeader": {
|
|
799
|
+
text: string;
|
|
800
|
+
crowdinContext: string;
|
|
801
|
+
};
|
|
802
|
+
"analyticsCatalog.computedAttribute.dialog.sectionHeader.tooltip": {
|
|
803
|
+
text: string;
|
|
804
|
+
crowdinContext: string;
|
|
805
|
+
};
|
|
806
|
+
"analyticsCatalog.computedAttribute.dialog.help": {
|
|
807
|
+
text: string;
|
|
808
|
+
crowdinContext: string;
|
|
809
|
+
};
|
|
810
|
+
"analyticsCatalog.computedAttribute.dialog.submit.error": {
|
|
811
|
+
text: string;
|
|
812
|
+
crowdinContext: string;
|
|
813
|
+
};
|
|
814
|
+
"analyticsCatalog.computedAttribute.validation.empty": {
|
|
815
|
+
text: string;
|
|
816
|
+
crowdinContext: string;
|
|
817
|
+
};
|
|
818
|
+
"analyticsCatalog.computedAttribute.validation.syntax": {
|
|
819
|
+
text: string;
|
|
820
|
+
crowdinContext: string;
|
|
821
|
+
};
|
|
822
|
+
"analyticsCatalog.computedAttribute.validation.invalidStructure": {
|
|
823
|
+
text: string;
|
|
824
|
+
crowdinContext: string;
|
|
825
|
+
};
|
|
826
|
+
"analyticsCatalog.computedAttribute.validation.missingMaql": {
|
|
827
|
+
text: string;
|
|
828
|
+
crowdinContext: string;
|
|
829
|
+
};
|
|
830
|
+
"analyticsCatalog.computedAttribute.validation.invalidTags": {
|
|
831
|
+
text: string;
|
|
832
|
+
crowdinContext: string;
|
|
833
|
+
};
|
|
834
|
+
"analyticsCatalog.computedAttribute.create.defaultTitle": {
|
|
835
|
+
text: string;
|
|
836
|
+
crowdinContext: string;
|
|
837
|
+
};
|
|
838
|
+
"analyticsCatalog.computedAttribute.create.success": {
|
|
839
|
+
text: string;
|
|
840
|
+
crowdinContext: string;
|
|
841
|
+
};
|
|
842
|
+
"analyticsCatalog.computedAttribute.update.success": {
|
|
843
|
+
text: string;
|
|
844
|
+
crowdinContext: string;
|
|
845
|
+
};
|
|
846
|
+
"analyticsCatalog.computedAttribute.load.error": {
|
|
847
|
+
text: string;
|
|
848
|
+
crowdinContext: string;
|
|
849
|
+
};
|
|
850
|
+
"analyticsCatalog.computedAttribute.dialog.delete.title": {
|
|
851
|
+
text: string;
|
|
852
|
+
crowdinContext: string;
|
|
853
|
+
};
|
|
854
|
+
"analyticsCatalog.computedAttribute.dialog.delete.body": {
|
|
855
|
+
text: string;
|
|
856
|
+
crowdinContext: string;
|
|
857
|
+
};
|
|
858
|
+
"analyticsCatalog.computedAttribute.dialog.delete.usageWarning": {
|
|
859
|
+
text: string;
|
|
860
|
+
crowdinContext: string;
|
|
861
|
+
};
|
|
862
|
+
"analyticsCatalog.computedAttribute.dialog.delete.blocked": {
|
|
863
|
+
text: string;
|
|
864
|
+
crowdinContext: string;
|
|
865
|
+
};
|
|
866
|
+
"analyticsCatalog.computedAttribute.dialog.delete.submit": {
|
|
867
|
+
text: string;
|
|
868
|
+
crowdinContext: string;
|
|
869
|
+
};
|
|
870
|
+
"analyticsCatalog.computedAttribute.delete.success": {
|
|
871
|
+
text: string;
|
|
872
|
+
crowdinContext: string;
|
|
873
|
+
};
|
|
874
|
+
"analyticsCatalog.computedAttribute.delete.error": {
|
|
875
|
+
text: string;
|
|
876
|
+
crowdinContext: string;
|
|
877
|
+
};
|
|
778
878
|
"analyticsCatalog.metric.dialog.create.title": {
|
|
779
879
|
text: string;
|
|
780
880
|
crowdinContext: string;
|
|
@@ -851,6 +951,14 @@ export declare const en_US: {
|
|
|
851
951
|
text: string;
|
|
852
952
|
crowdinContext: string;
|
|
853
953
|
};
|
|
954
|
+
"analyticsCatalog.asCode.dialog.delete.showMore": {
|
|
955
|
+
text: string;
|
|
956
|
+
crowdinContext: string;
|
|
957
|
+
};
|
|
958
|
+
"analyticsCatalog.asCode.dialog.delete.showLess": {
|
|
959
|
+
text: string;
|
|
960
|
+
crowdinContext: string;
|
|
961
|
+
};
|
|
854
962
|
"analyticsCatalog.asCode.dialog.autoFormat": {
|
|
855
963
|
text: string;
|
|
856
964
|
crowdinContext: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.localization-bundle.d.ts","sourceRoot":"","sources":["../../../src/localization/bundles/en-US.localization-bundle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"en-US.localization-bundle.d.ts","sourceRoot":"","sources":["../../../src/localization/bundles/en-US.localization-bundle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqmCjB,CAAC"}
|
|
@@ -73,6 +73,10 @@ export const en_US = {
|
|
|
73
73
|
"text": "Parameter",
|
|
74
74
|
"crowdinContext": "Canonical display name for the Parameter object type, used in tooltips, menus, and labels."
|
|
75
75
|
},
|
|
76
|
+
"analyticsCatalog.objectType.computedAttribute.name": {
|
|
77
|
+
"text": "Computed attribute",
|
|
78
|
+
"crowdinContext": "Canonical display name for the Computed attribute object type, used in tooltips, menus, and labels."
|
|
79
|
+
},
|
|
76
80
|
"analyticsCatalog.visualizationType.table.tooltip": {
|
|
77
81
|
"text": "Table",
|
|
78
82
|
"crowdinContext": "Tooltip label shown when hovering a visualization item for insights of type table."
|
|
@@ -777,6 +781,102 @@ export const en_US = {
|
|
|
777
781
|
"text": "Parameter could not be deleted.",
|
|
778
782
|
"crowdinContext": "Error toast shown when parameter deletion fails."
|
|
779
783
|
},
|
|
784
|
+
"analyticsCatalog.computedAttribute.dialog.create.title": {
|
|
785
|
+
"text": "Create computed attribute",
|
|
786
|
+
"crowdinContext": "Title of the dialog for creating a new computed attribute as code."
|
|
787
|
+
},
|
|
788
|
+
"analyticsCatalog.computedAttribute.dialog.edit.title": {
|
|
789
|
+
"text": "Edit computed attribute",
|
|
790
|
+
"crowdinContext": "Title of the dialog for editing an existing computed attribute."
|
|
791
|
+
},
|
|
792
|
+
"analyticsCatalog.computedAttribute.dialog.edit.duplicate": {
|
|
793
|
+
"text": "Save as new",
|
|
794
|
+
"crowdinContext": "Label for the duplicate action button in the edit computed attribute dialog."
|
|
795
|
+
},
|
|
796
|
+
"analyticsCatalog.computedAttribute.dialog.edit.idImmutable": {
|
|
797
|
+
"text": "Computed attribute id cannot be changed when saving an existing computed attribute. Use Save as new instead.",
|
|
798
|
+
"crowdinContext": "Error shown when the user tries to change the computed attribute id while saving an existing computed attribute."
|
|
799
|
+
},
|
|
800
|
+
"analyticsCatalog.computedAttribute.dialog.sectionHeader": {
|
|
801
|
+
"text": "Computed attribute definition",
|
|
802
|
+
"crowdinContext": "Header above the as-code editor in the computed attribute dialog."
|
|
803
|
+
},
|
|
804
|
+
"analyticsCatalog.computedAttribute.dialog.sectionHeader.tooltip": {
|
|
805
|
+
"text": "Write a MAQL expression that assigns each row a value, using CASE WHEN branches over a metric or a fact.",
|
|
806
|
+
"crowdinContext": "Tooltip shown for the help icon next to the computed attribute definition section header."
|
|
807
|
+
},
|
|
808
|
+
"analyticsCatalog.computedAttribute.dialog.help": {
|
|
809
|
+
"text": "How to create a computed attribute?",
|
|
810
|
+
"crowdinContext": "Label for the help link in the computed attribute dialog footer."
|
|
811
|
+
},
|
|
812
|
+
"analyticsCatalog.computedAttribute.dialog.submit.error": {
|
|
813
|
+
"text": "Computed attribute could not be saved.",
|
|
814
|
+
"crowdinContext": "Fallback error shown in the computed attribute dialog when saving fails without a specific backend error message."
|
|
815
|
+
},
|
|
816
|
+
"analyticsCatalog.computedAttribute.validation.empty": {
|
|
817
|
+
"text": "Computed attribute definition cannot be empty.",
|
|
818
|
+
"crowdinContext": "Error message shown when attempting to save an empty computed attribute definition."
|
|
819
|
+
},
|
|
820
|
+
"analyticsCatalog.computedAttribute.validation.syntax": {
|
|
821
|
+
"text": "YAML syntax error",
|
|
822
|
+
"crowdinContext": "Inline error tooltip shown in the YAML editor when the syntax is invalid."
|
|
823
|
+
},
|
|
824
|
+
"analyticsCatalog.computedAttribute.validation.invalidStructure": {
|
|
825
|
+
"text": "The computed attribute definition has an invalid structure.",
|
|
826
|
+
"crowdinContext": "Validation error shown when the computed attribute YAML does not match the expected structure."
|
|
827
|
+
},
|
|
828
|
+
"analyticsCatalog.computedAttribute.validation.missingMaql": {
|
|
829
|
+
"text": "The computed attribute must define a MAQL expression.",
|
|
830
|
+
"crowdinContext": "Validation error shown when the computed attribute YAML is missing the maql field."
|
|
831
|
+
},
|
|
832
|
+
"analyticsCatalog.computedAttribute.validation.invalidTags": {
|
|
833
|
+
"text": "Tags must be a list of text values.",
|
|
834
|
+
"crowdinContext": "Validation error shown when the computed attribute tags are not a list of strings."
|
|
835
|
+
},
|
|
836
|
+
"analyticsCatalog.computedAttribute.create.defaultTitle": {
|
|
837
|
+
"text": "My computed attribute",
|
|
838
|
+
"crowdinContext": "Default placeholder title seeded into the new computed attribute as-code editor before the user types their own."
|
|
839
|
+
},
|
|
840
|
+
"analyticsCatalog.computedAttribute.create.success": {
|
|
841
|
+
"text": "Computed attribute created.",
|
|
842
|
+
"crowdinContext": "Toast shown after a computed attribute is created successfully from the Analytics Catalog."
|
|
843
|
+
},
|
|
844
|
+
"analyticsCatalog.computedAttribute.update.success": {
|
|
845
|
+
"text": "Computed attribute saved.",
|
|
846
|
+
"crowdinContext": "Toast shown after a computed attribute is updated successfully from the Analytics Catalog."
|
|
847
|
+
},
|
|
848
|
+
"analyticsCatalog.computedAttribute.load.error": {
|
|
849
|
+
"text": "The computed attribute could not be loaded.",
|
|
850
|
+
"crowdinContext": "Error toast shown when loading a computed attribute for editing or duplication fails."
|
|
851
|
+
},
|
|
852
|
+
"analyticsCatalog.computedAttribute.dialog.delete.title": {
|
|
853
|
+
"text": "Delete computed attribute?",
|
|
854
|
+
"crowdinContext": "Title of the confirmation dialog shown when deleting a computed attribute."
|
|
855
|
+
},
|
|
856
|
+
"analyticsCatalog.computedAttribute.dialog.delete.body": {
|
|
857
|
+
"text": "Are you sure you want to delete <b>{name}</b>?",
|
|
858
|
+
"crowdinContext": "Body text of the computed attribute delete confirmation dialog. {name} is the computed attribute title or fallback ID. <b>...</b> wraps the name in bold."
|
|
859
|
+
},
|
|
860
|
+
"analyticsCatalog.computedAttribute.dialog.delete.usageWarning": {
|
|
861
|
+
"text": "This attribute is used in <b>{count, plural, one {# visualization} other {# visualizations}}</b>",
|
|
862
|
+
"crowdinContext": "Warning banner in the computed attribute delete dialog when visualizations still reference it. {count} is the number of referencing visualizations, wrapped in <b>. Followed by a Show more toggle that lists their titles."
|
|
863
|
+
},
|
|
864
|
+
"analyticsCatalog.computedAttribute.dialog.delete.blocked": {
|
|
865
|
+
"text": "The computed attribute <b>{name}</b> cannot be deleted because it is used in some visualizations. To delete this attribute, remove it from all visualizations first.",
|
|
866
|
+
"crowdinContext": "Body of the computed attribute delete dialog when visualizations still reference it, so deletion is refused. {name} is the computed attribute title or fallback ID. <b>...</b> wraps the name in bold."
|
|
867
|
+
},
|
|
868
|
+
"analyticsCatalog.computedAttribute.dialog.delete.submit": {
|
|
869
|
+
"text": "Delete",
|
|
870
|
+
"crowdinContext": "Label for the Delete button in the computed attribute delete confirmation dialog."
|
|
871
|
+
},
|
|
872
|
+
"analyticsCatalog.computedAttribute.delete.success": {
|
|
873
|
+
"text": "Computed attribute deleted.",
|
|
874
|
+
"crowdinContext": "Toast shown after a computed attribute is deleted successfully from the Analytics Catalog."
|
|
875
|
+
},
|
|
876
|
+
"analyticsCatalog.computedAttribute.delete.error": {
|
|
877
|
+
"text": "Computed attribute could not be deleted.",
|
|
878
|
+
"crowdinContext": "Error toast shown when computed attribute deletion fails."
|
|
879
|
+
},
|
|
780
880
|
"analyticsCatalog.metric.dialog.create.title": {
|
|
781
881
|
"text": "Create metric",
|
|
782
882
|
"crowdinContext": "Title of the dialog for creating a new metric as code."
|
|
@@ -853,6 +953,14 @@ export const en_US = {
|
|
|
853
953
|
"text": "This object uses content that cannot be represented as code. It is shown read-only; use the standard editor to change it.",
|
|
854
954
|
"crowdinContext": "Notice shown above the as-code editor when the object's stored content has no code representation, so the editor is read-only and saving is unavailable."
|
|
855
955
|
},
|
|
956
|
+
"analyticsCatalog.asCode.dialog.delete.showMore": {
|
|
957
|
+
"text": "Show more",
|
|
958
|
+
"crowdinContext": "Toggle in the as-code delete dialog that reveals the list of objects referencing the one being deleted."
|
|
959
|
+
},
|
|
960
|
+
"analyticsCatalog.asCode.dialog.delete.showLess": {
|
|
961
|
+
"text": "Show less",
|
|
962
|
+
"crowdinContext": "Toggle in the as-code delete dialog that hides the list of objects referencing the one being deleted."
|
|
963
|
+
},
|
|
856
964
|
"analyticsCatalog.asCode.dialog.autoFormat": {
|
|
857
965
|
"text": "Auto-format",
|
|
858
966
|
"crowdinContext": "Toolbar action of the as-code editor dialog that re-formats the YAML document (normalizes indentation) while keeping its comments."
|
|
@@ -7,7 +7,7 @@ import { METRIC_EDITOR_FEATURE_FLAG } from "./gate.js";
|
|
|
7
7
|
import { metricCompletions } from "./metricCompletions.js";
|
|
8
8
|
import { definitionToMetricYaml, metricYamlToDefinition, reconcileMetricDefinition, } from "./metricConverter.js";
|
|
9
9
|
import { createCopiedMetric } from "./metricCopy.js";
|
|
10
|
-
import {
|
|
10
|
+
import { createMetricMutationAdapter, listMetricReferences, loadMetric } from "./metricMutationPort.js";
|
|
11
11
|
import { serializeMetricToYaml } from "./metricSerialization.js";
|
|
12
12
|
import { validateMetricYaml } from "./metricValidation.js";
|
|
13
13
|
const METRIC_DOCS_URL = "https://www.gooddata.ai/docs/cloud/api-and-sdk/vs-code-extension/structures/#metric";
|
|
@@ -76,7 +76,7 @@ export const metricDescriptor = defineAsCodeDescriptor({
|
|
|
76
76
|
emptyDefinition: (defaultTitle) => metricYamlToDefinition({ type: "metric", title: defaultTitle, maql: "SELECT 1" }),
|
|
77
77
|
seed: { load: loadMetric, loadError: capabilityMessages.loadError },
|
|
78
78
|
referenceCounted: {
|
|
79
|
-
|
|
79
|
+
load: listMetricReferences,
|
|
80
80
|
usageWarning: capabilityMessages.deleteUsageWarning,
|
|
81
81
|
},
|
|
82
82
|
// A copied metric derives a human-readable id that can collide on create; identity lets the dialog retry without it.
|
|
@@ -8,8 +8,8 @@ import type { ICatalogItemMeasure } from "../catalogItem/types.js";
|
|
|
8
8
|
export type IMetricMutationPort = IAsCodeMutationPort<IMeasureMetadataObjectDefinition, ICatalogItemMeasure>;
|
|
9
9
|
/** Fetches the full measure for editing (the catalog item carries no MAQL). @internal */
|
|
10
10
|
export declare function loadMetric(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemMeasure): Promise<IMeasureMetadataObjectDefinition>;
|
|
11
|
-
/**
|
|
12
|
-
export declare function
|
|
11
|
+
/** Titles of the insights and measures referencing a measure. @internal */
|
|
12
|
+
export declare function listMetricReferences(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemMeasure): Promise<string[]>;
|
|
13
13
|
/**
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metricMutationPort.d.ts","sourceRoot":"","sources":["../../src/metric/metricMutationPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEH,KAAK,gCAAgC,
|
|
1
|
+
{"version":3,"file":"metricMutationPort.d.ts","sourceRoot":"","sources":["../../src/metric/metricMutationPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEH,KAAK,gCAAgC,EAIxC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAUnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,gCAAgC,EAAE,mBAAmB,CAAC,CAAC;AAW7G,yFAAyF;AACzF,wBAAgB,UAAU,CACtB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,gCAAgC,CAAC,CAE3C;AAED,2EAA2E;AAC3E,wBAAsB,oBAAoB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,MAAM,EAAE,CAAC,CAUnB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAClB,mBAAmB,CAsBrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { idRef, isMeasureMetadataObject, } from "@gooddata/sdk-model";
|
|
2
|
+
import { idRef, insightTitle, isMeasureMetadataObject, } from "@gooddata/sdk-model";
|
|
3
3
|
import { convertMeasureToCatalogItem } from "../catalogItem/converter.js";
|
|
4
4
|
import { createMeasureCatalogItem, deleteMeasureCatalogItem, getMeasureCatalogItem, getMeasureReferencingObjectsCatalogItem, updateMeasureCatalogItem, } from "../catalogItem/query.js";
|
|
5
5
|
// `id` is definition-expressible yet server-owned: the update targets by it, so a hand-edited id must not retarget it.
|
|
@@ -11,10 +11,13 @@ function pickMetricIdentity(measure) {
|
|
|
11
11
|
export function loadMetric(backend, workspace, item) {
|
|
12
12
|
return getMeasureCatalogItem(backend, workspace, idRef(item.identifier, "measure"));
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
export async function
|
|
14
|
+
/** Titles of the insights and measures referencing a measure. @internal */
|
|
15
|
+
export async function listMetricReferences(backend, workspace, item) {
|
|
16
16
|
const referencing = await getMeasureReferencingObjectsCatalogItem(backend, workspace, idRef(item.identifier, "measure"));
|
|
17
|
-
return
|
|
17
|
+
return [
|
|
18
|
+
...(referencing.insights ?? []).map((insight) => insightTitle(insight)),
|
|
19
|
+
...(referencing.measures ?? []).map((measure) => measure.title),
|
|
20
|
+
];
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* @internal
|
|
@@ -7,7 +7,7 @@ import { getObjectTypeLabel } from "./labels.js";
|
|
|
7
7
|
export function ObjectTypeIcon({ intl, type, size = 14, backgroundSize, visualizationType, className, ...htmlProps }) {
|
|
8
8
|
const sizes = { size, backgroundSize };
|
|
9
9
|
const label = getObjectTypeLabel(intl, type, visualizationType);
|
|
10
|
-
return (_jsxs("span", { ...htmlProps, className: cx("gd-analytics-catalog__object-type", className), "data-object-type": type, children: [type === "attribute" ? (_jsx(UiIcon, { type: "ldmAttribute", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "fact" ? (_jsx(UiIcon, { type: "fact", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "measure" ? (_jsx(UiIcon, { type: "metric", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "parameter" ? (_jsx(UiIcon, { type: "parameter", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "analyticalDashboard" ? (_jsx(UiIcon, { type: "dashboard", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "dataSet" ? (_jsx(UiIcon, { type: "date", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "insight" ? (_jsx(UiIcon, { type: (visualizationType && visualizationIconMap[visualizationType]) ?? "visualization", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null] }));
|
|
10
|
+
return (_jsxs("span", { ...htmlProps, className: cx("gd-analytics-catalog__object-type", className), "data-object-type": type, children: [type === "attribute" || type === "computedAttribute" ? (_jsx(UiIcon, { type: "ldmAttribute", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "fact" ? (_jsx(UiIcon, { type: "fact", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "measure" ? (_jsx(UiIcon, { type: "metric", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "parameter" ? (_jsx(UiIcon, { type: "parameter", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "analyticalDashboard" ? (_jsx(UiIcon, { type: "dashboard", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "dataSet" ? (_jsx(UiIcon, { type: "date", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null, type === "insight" ? (_jsx(UiIcon, { type: (visualizationType && visualizationIconMap[visualizationType]) ?? "visualization", accessibilityConfig: { ariaLabel: label }, ...sizes })) : null] }));
|
|
11
11
|
}
|
|
12
12
|
const visualizationIconMap = {
|
|
13
13
|
table: "visualizationTable",
|
|
@@ -2,11 +2,11 @@ import type { ObjectType } from "./types.js";
|
|
|
2
2
|
type Props = {
|
|
3
3
|
counter: Record<ObjectType, number>;
|
|
4
4
|
selectedTypes: ObjectType[];
|
|
5
|
+
enabledObjectTypes: readonly ObjectType[];
|
|
5
6
|
onSelect: (selectedTypes: ObjectType[]) => void;
|
|
6
|
-
showParameter?: boolean;
|
|
7
7
|
ariaLabelledBy?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function ObjectTypeSelect({ selectedTypes, onSelect, counter,
|
|
9
|
+
export declare function ObjectTypeSelect({ selectedTypes, enabledObjectTypes, onSelect, counter, ariaLabelledBy }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare const ObjectTypeSelectMemo: import("react").MemoExoticComponent<typeof ObjectTypeSelect>;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=ObjectTypeSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectTypeSelect.d.ts","sourceRoot":"","sources":["../../src/objectType/ObjectTypeSelect.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAsB7C,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpC,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,QAAQ,EAAE,CAAC,aAAa,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,
|
|
1
|
+
{"version":3,"file":"ObjectTypeSelect.d.ts","sourceRoot":"","sources":["../../src/objectType/ObjectTypeSelect.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAsB7C,KAAK,KAAK,GAAG;IACT,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpC,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,kBAAkB,EAAE,SAAS,UAAU,EAAE,CAAC;IAC1C,QAAQ,EAAE,CAAC,aAAa,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC7B,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,cAAc,EACjB,EAAE,KAAK,2CAgDP;AAED,eAAO,MAAM,oBAAoB,8DAAyB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { memo } from "react";
|
|
|
4
4
|
import { defineMessages, useIntl } from "react-intl";
|
|
5
5
|
import { UiButtonSegmentedControl, UiIconButton, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { objectType } from "../automation/testIds.js";
|
|
7
|
-
import {
|
|
7
|
+
import { FILTER_GROUPS, ObjectTypes } from "./constants.js";
|
|
8
8
|
const icons = {
|
|
9
9
|
[ObjectTypes.DASHBOARD]: "dashboard",
|
|
10
10
|
[ObjectTypes.VISUALIZATION]: "visualization",
|
|
@@ -23,25 +23,24 @@ const messages = defineMessages({
|
|
|
23
23
|
[ObjectTypes.ATTRIBUTE]: { id: "analyticsCatalog.objectType.attribute.button.ariaLabel" },
|
|
24
24
|
[ObjectTypes.DATASET]: { id: "analyticsCatalog.objectType.dateDataset.button.ariaLabel" },
|
|
25
25
|
});
|
|
26
|
-
export function ObjectTypeSelect({ selectedTypes, onSelect, counter,
|
|
26
|
+
export function ObjectTypeSelect({ selectedTypes, enabledObjectTypes, onSelect, counter, ariaLabelledBy, }) {
|
|
27
27
|
const intl = useIntl();
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (selectedTypes.includes(type)) {
|
|
33
|
-
onSelect(selectedTypes.filter((selectedType) => selectedType !== type));
|
|
28
|
+
const visibleGroups = FILTER_GROUPS.filter(({ types }) => types.some((type) => enabledObjectTypes.includes(type)));
|
|
29
|
+
const handleSelect = (types) => {
|
|
30
|
+
if (types.every((type) => selectedTypes.includes(type))) {
|
|
31
|
+
onSelect(selectedTypes.filter((selectedType) => !types.includes(selectedType)));
|
|
34
32
|
}
|
|
35
33
|
else {
|
|
36
|
-
onSelect([...selectedTypes,
|
|
34
|
+
onSelect([...new Set([...selectedTypes, ...types])]);
|
|
37
35
|
}
|
|
38
36
|
};
|
|
39
|
-
return (_jsx(UiButtonSegmentedControl, { role: "group", "aria-labelledby": ariaLabelledBy, children:
|
|
40
|
-
const isSelected = selectedTypes.includes(type);
|
|
41
|
-
const
|
|
42
|
-
|
|
37
|
+
return (_jsx(UiButtonSegmentedControl, { role: "group", "aria-labelledby": ariaLabelledBy, children: visibleGroups.map(({ id, types }) => {
|
|
38
|
+
const isSelected = types.every((type) => selectedTypes.includes(type));
|
|
39
|
+
const count = types.reduce((sum, type) => sum + counter[type], 0);
|
|
40
|
+
const ariaLabel = intl.formatMessage(messages[id], { count });
|
|
41
|
+
return (_jsx("div", { className: "gd-analytics-catalog__object-type", "data-testid": objectType, "data-object-type": id, children: _jsx(UiTooltip, { triggerBy: ["hover", "focus"], anchor: _jsx(UiIconButton, { size: "small", variant: "secondary", icon: icons[id], isActive: isSelected, accessibilityConfig: { ariaLabel, ariaPressed: isSelected }, onClick: () => handleSelect(types),
|
|
43
42
|
// Since object types are stable, dynamic testing ID is acceptable.
|
|
44
|
-
dataTestId: `${objectType}/${
|
|
43
|
+
dataTestId: `${objectType}/${id}` }), content: ariaLabel }) }, id));
|
|
45
44
|
}) }));
|
|
46
45
|
}
|
|
47
46
|
export const ObjectTypeSelectMemo = memo(ObjectTypeSelect);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ObjectType } from "./types.js";
|
|
2
1
|
/**
|
|
3
2
|
* Analytics Catalog object type enum.
|
|
4
3
|
*/
|
|
@@ -7,12 +6,38 @@ export declare const ObjectTypes: {
|
|
|
7
6
|
readonly VISUALIZATION: "insight";
|
|
8
7
|
readonly METRIC: "measure";
|
|
9
8
|
readonly PARAMETER: "parameter";
|
|
9
|
+
readonly COMPUTED_ATTRIBUTE: "computedAttribute";
|
|
10
10
|
readonly ATTRIBUTE: "attribute";
|
|
11
11
|
readonly FACT: "fact";
|
|
12
12
|
readonly DATASET: "dataSet";
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Analytics Catalog
|
|
15
|
+
* Analytics Catalog object type filter groups in display order.
|
|
16
16
|
*/
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const FILTER_GROUPS: readonly [{
|
|
18
|
+
readonly id: "analyticalDashboard";
|
|
19
|
+
readonly types: readonly ["analyticalDashboard"];
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "insight";
|
|
22
|
+
readonly types: readonly ["insight"];
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "measure";
|
|
25
|
+
readonly types: readonly ["measure"];
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "parameter";
|
|
28
|
+
readonly types: readonly ["parameter"];
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "attribute";
|
|
31
|
+
readonly types: readonly ["attribute", "computedAttribute"];
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "fact";
|
|
34
|
+
readonly types: readonly ["fact"];
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "dataSet";
|
|
37
|
+
readonly types: readonly ["dataSet"];
|
|
38
|
+
}];
|
|
39
|
+
/**
|
|
40
|
+
* Object types offered as filter group buttons.
|
|
41
|
+
*/
|
|
42
|
+
export type FilterableObjectType = (typeof FILTER_GROUPS)[number]["id"];
|
|
18
43
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/objectType/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/objectType/constants.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;CASuB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAQsD,CAAC;AAEjF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -7,19 +7,20 @@ export const ObjectTypes = {
|
|
|
7
7
|
VISUALIZATION: "insight",
|
|
8
8
|
METRIC: "measure",
|
|
9
9
|
PARAMETER: "parameter",
|
|
10
|
+
COMPUTED_ATTRIBUTE: "computedAttribute",
|
|
10
11
|
ATTRIBUTE: "attribute",
|
|
11
12
|
FACT: "fact",
|
|
12
13
|
DATASET: "dataSet",
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
15
|
-
* Analytics Catalog
|
|
16
|
+
* Analytics Catalog object type filter groups in display order.
|
|
16
17
|
*/
|
|
17
|
-
export const
|
|
18
|
-
ObjectTypes.DASHBOARD,
|
|
19
|
-
ObjectTypes.VISUALIZATION,
|
|
20
|
-
ObjectTypes.METRIC,
|
|
21
|
-
ObjectTypes.PARAMETER,
|
|
22
|
-
ObjectTypes.ATTRIBUTE,
|
|
23
|
-
ObjectTypes.FACT,
|
|
24
|
-
ObjectTypes.DATASET,
|
|
18
|
+
export const FILTER_GROUPS = [
|
|
19
|
+
{ id: ObjectTypes.DASHBOARD, types: [ObjectTypes.DASHBOARD] },
|
|
20
|
+
{ id: ObjectTypes.VISUALIZATION, types: [ObjectTypes.VISUALIZATION] },
|
|
21
|
+
{ id: ObjectTypes.METRIC, types: [ObjectTypes.METRIC] },
|
|
22
|
+
{ id: ObjectTypes.PARAMETER, types: [ObjectTypes.PARAMETER] },
|
|
23
|
+
{ id: ObjectTypes.ATTRIBUTE, types: [ObjectTypes.ATTRIBUTE, ObjectTypes.COMPUTED_ATTRIBUTE] },
|
|
24
|
+
{ id: ObjectTypes.FACT, types: [ObjectTypes.FACT] },
|
|
25
|
+
{ id: ObjectTypes.DATASET, types: [ObjectTypes.DATASET] },
|
|
25
26
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/objectType/labels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,YAAY,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/objectType/labels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,YAAY,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqC7C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,UAAU,EAChB,iBAAiB,CAAC,EAAE,iBAAiB,GACtC,MAAM,CASR"}
|
package/esm/objectType/labels.js
CHANGED
|
@@ -6,6 +6,7 @@ const objectTypeMessages = defineMessages({
|
|
|
6
6
|
[ObjectTypes.VISUALIZATION]: { id: "analyticsCatalog.objectType.visualization.name" },
|
|
7
7
|
[ObjectTypes.METRIC]: { id: "analyticsCatalog.objectType.metric.name" },
|
|
8
8
|
[ObjectTypes.PARAMETER]: { id: "analyticsCatalog.objectType.parameter.name" },
|
|
9
|
+
[ObjectTypes.COMPUTED_ATTRIBUTE]: { id: "analyticsCatalog.objectType.computedAttribute.name" },
|
|
9
10
|
[ObjectTypes.ATTRIBUTE]: { id: "analyticsCatalog.objectType.attribute.name" },
|
|
10
11
|
[ObjectTypes.FACT]: { id: "analyticsCatalog.objectType.fact.name" },
|
|
11
12
|
[ObjectTypes.DATASET]: { id: "analyticsCatalog.objectType.dateDataset.name" },
|
|
@@ -3,7 +3,7 @@ import type { ObjectType } from "./types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Maps the catalog ObjectType to the GenAIObjectType.
|
|
5
5
|
*/
|
|
6
|
-
export declare function mapGenAIObjectType(type: Exclude<ObjectType, "parameter">): GenAIObjectType;
|
|
6
|
+
export declare function mapGenAIObjectType(type: Exclude<ObjectType, "parameter" | "computedAttribute">): GenAIObjectType;
|
|
7
7
|
/**
|
|
8
8
|
* Maps the GenAIObjectType to the catalog ObjectType.
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/objectType/mapping.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/objectType/mapping.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,GAAG,mBAAmB,CAAC,GAC7D,eAAe,CAcjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU,CAiB/D"}
|