@gooddata/sdk-ui-catalog 11.49.0-alpha.0 → 11.49.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogDetailContent.d.ts","sourceRoot":"","sources":["../../src/catalogDetail/CatalogDetailContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAgC,MAAM,OAAO,CAAC;AAUtE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAGlF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkBzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASnD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,gBAAgB,CAAC,EAAE,eAAe,GAAG,YAAY,GAAG,IAAI,CAAC;IACzD;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5E;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5E;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAA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AAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EAC1B,EAAE,0BAA0B,2CAkN5B"}
@@ -25,7 +25,7 @@ import { useCatalogItemUpdate } from "./hooks/useCatalogItemUpdate.js";
25
25
  import { CatalogItemAccessRow } from "./share/CatalogItemAccessRow.js";
26
26
  import { CatalogItemShareDialog } from "./share/CatalogItemShareDialog.js";
27
27
  import { CatalogItemShareProvider } from "./share/CatalogItemShareProvider.js";
28
- import { isShareableCatalogItem, toShareTarget } from "./share/guards.js";
28
+ import { isShareableCatalogItem, isSharingEnabledForItem, toShareTarget } from "./share/guards.js";
29
29
  import { useShareableLabels } from "./share/useShareableLabels.js";
30
30
  const Tabs = {
31
31
  METADATA: "metadata",
@@ -49,10 +49,8 @@ export function CatalogDetailContent({ objectId, objectType, objectDefinition, o
49
49
  onError: onCatalogItemUpdateError,
50
50
  });
51
51
  const canEdit = canEditCatalogItem(permissions, item);
52
- // Sharing (object-level permissions) — gated by the column-level-permissions
53
- // flag and limited to shareable item kinds (attributes, facts).
54
52
  const enableColumnLevelPermissions = Boolean(settings?.enableColumnLevelPermissions);
55
- const shareableItem = item && enableColumnLevelPermissions && isShareableCatalogItem(item) ? item : undefined;
53
+ const shareableItem = item && isShareableCatalogItem(item) && isSharingEnabledForItem(item, settings) ? item : undefined;
56
54
  const shareTarget = useMemo(() => (shareableItem ? toShareTarget(shareableItem) : undefined), [shareableItem]);
57
55
  // Labels of the shared attribute drive both the header info row and the per-grantee
58
56
  // label-scope picker; fetched once here and passed to the share provider.
@@ -1,12 +1,19 @@
1
1
  import type { IObjectPermissionsObject } from "@gooddata/sdk-backend-spi";
2
+ import { type ISettings } from "@gooddata/sdk-model";
2
3
  import type { ICatalogItem } from "../../catalogItem/types.js";
3
4
  import type { ShareableCatalogItem } from "./types.js";
4
5
  /**
5
- * Catalog items the share dialog can target: attributes and facts. Labels are
6
- * not first-class catalog items; they appear inside the labels picker when
6
+ * Catalog items the share dialog can target: attributes, facts and measures. Labels
7
+ * are not first-class catalog items; they appear inside the labels picker when
7
8
  * sharing an attribute.
8
9
  */
9
10
  export declare function isShareableCatalogItem(item: ICatalogItem): item is ShareableCatalogItem;
11
+ /**
12
+ * Tests whether sharing is enabled for the item: attributes and facts are gated by
13
+ * the column-level-permissions flag, measures by the metric-permissions flag. The
14
+ * two flags are independent — a workspace may enable either on its own.
15
+ */
16
+ export declare function isSharingEnabledForItem(item: ICatalogItem, settings: ISettings | undefined): boolean;
10
17
  /**
11
18
  * Build the backend target descriptor from a shareable catalog item. The kind
12
19
  * enum matches the catalog item's discriminator, so the mapping is direct.
@@ -1 +1 @@
1
- {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/catalogDetail/share/guards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAI1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,IAAI,oBAAoB,CAEvF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,wBAAwB,CAKlF"}
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/catalogDetail/share/guards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,IAAI,oBAAoB,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAQpG;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,wBAAwB,CAKlF"}
@@ -1,13 +1,27 @@
1
1
  // (C) 2026 GoodData Corporation
2
2
  import { idRef } from "@gooddata/sdk-model";
3
- import { isCatalogItemAttribute, isCatalogItemFact } from "../../catalogItem/guards.js";
3
+ import { isCatalogItemAttribute, isCatalogItemFact, isCatalogItemMeasure } from "../../catalogItem/guards.js";
4
4
  /**
5
- * Catalog items the share dialog can target: attributes and facts. Labels are
6
- * not first-class catalog items; they appear inside the labels picker when
5
+ * Catalog items the share dialog can target: attributes, facts and measures. Labels
6
+ * are not first-class catalog items; they appear inside the labels picker when
7
7
  * sharing an attribute.
8
8
  */
9
9
  export function isShareableCatalogItem(item) {
10
- return isCatalogItemAttribute(item) || isCatalogItemFact(item);
10
+ return isCatalogItemAttribute(item) || isCatalogItemFact(item) || isCatalogItemMeasure(item);
11
+ }
12
+ /**
13
+ * Tests whether sharing is enabled for the item: attributes and facts are gated by
14
+ * the column-level-permissions flag, measures by the metric-permissions flag. The
15
+ * two flags are independent — a workspace may enable either on its own.
16
+ */
17
+ export function isSharingEnabledForItem(item, settings) {
18
+ if (isCatalogItemMeasure(item)) {
19
+ return Boolean(settings?.enableMetricPermissions);
20
+ }
21
+ if (isCatalogItemAttribute(item) || isCatalogItemFact(item)) {
22
+ return Boolean(settings?.enableColumnLevelPermissions);
23
+ }
24
+ return false;
11
25
  }
12
26
  /**
13
27
  * Build the backend target descriptor from a shareable catalog item. The kind
@@ -1,7 +1,7 @@
1
- import type { ICatalogItemAttribute, ICatalogItemFact } from "../../catalogItem/types.js";
1
+ import type { ICatalogItemAttribute, ICatalogItemFact, ICatalogItemMeasure } from "../../catalogItem/types.js";
2
2
  /**
3
- * Catalog items that can be shared: attributes and facts. Labels are sub-selected
4
- * from inside an attribute share, not shared as standalone targets.
3
+ * Catalog items that can be shared: attributes, facts and measures. Labels are
4
+ * sub-selected from inside an attribute share, not shared as standalone targets.
5
5
  */
6
- export type ShareableCatalogItem = ICatalogItemAttribute | ICatalogItemFact;
6
+ export type ShareableCatalogItem = ICatalogItemAttribute | ICatalogItemFact | ICatalogItemMeasure;
7
7
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/catalogDetail/share/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE1F;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/catalogDetail/share/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACtB,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC"}
@@ -4,12 +4,12 @@ import type { ShareableCatalogItem } from "./types.js";
4
4
  * @internal
5
5
  */
6
6
  export interface IShareableLabels {
7
- /** Display forms of the shareable attribute; empty for facts. */
7
+ /** Display forms of the shareable attribute; empty for facts and measures. */
8
8
  labels: IObjectShareLabel[];
9
9
  /**
10
- * True while an attribute's labels are still being fetched. Facts skip the
11
- * fetch and report `false`. Gates the dialog's Add action so a grantee can't
12
- * be added before its labels are known.
10
+ * True while an attribute's labels are still being fetched. Facts and measures
11
+ * skip the fetch and report `false`. Gates the dialog's Add action so a grantee
12
+ * can't be added before its labels are known.
13
13
  */
14
14
  loading: boolean;
15
15
  /**
@@ -22,8 +22,9 @@ export interface IShareableLabels {
22
22
  }
23
23
  /**
24
24
  * Loads the labels (display forms) of a shareable attribute so the share dialog
25
- * can scope a grantee's access per label. Facts have no labels — returns an empty
26
- * list and skips the fetch. The result feeds {@link ObjectShareDialog}'s `labels`.
25
+ * can scope a grantee's access per label. Facts and measures have no labels —
26
+ * returns an empty list and skips the fetch. The result feeds
27
+ * {@link ObjectShareDialog}'s `labels`.
27
28
  *
28
29
  * @internal
29
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useShareableLabels.d.ts","sourceRoot":"","sources":["../../../src/catalogDetail/share/useShareableLabels.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,iEAAiE;IACjE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,SAAS,GAAG,gBAAgB,CAsC3F"}
1
+ {"version":3,"file":"useShareableLabels.d.ts","sourceRoot":"","sources":["../../../src/catalogDetail/share/useShareableLabels.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,8EAA8E;IAC9E,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,SAAS,GAAG,gBAAgB,CAsC3F"}
@@ -4,15 +4,16 @@ import { objRefToString } from "@gooddata/sdk-model";
4
4
  import { useBackendStrict, useCancelablePromise, useWorkspaceStrict } from "@gooddata/sdk-ui";
5
5
  /**
6
6
  * Loads the labels (display forms) of a shareable attribute so the share dialog
7
- * can scope a grantee's access per label. Facts have no labels — returns an empty
8
- * list and skips the fetch. The result feeds {@link ObjectShareDialog}'s `labels`.
7
+ * can scope a grantee's access per label. Facts and measures have no labels —
8
+ * returns an empty list and skips the fetch. The result feeds
9
+ * {@link ObjectShareDialog}'s `labels`.
9
10
  *
10
11
  * @internal
11
12
  */
12
13
  export function useShareableLabels(item) {
13
14
  const backend = useBackendStrict();
14
15
  const workspace = useWorkspaceStrict();
15
- // Only attributes carry labels; facts do not.
16
+ // Only attributes carry labels; facts and measures do not.
16
17
  const attributeRef = item?.type === "attribute" ? item.identifier : undefined;
17
18
  const { result, status } = useCancelablePromise({
18
19
  promise: attributeRef
@@ -29,8 +30,8 @@ export function useShareableLabels(item) {
29
30
  isPrimary: df.isPrimary === true,
30
31
  isDefault: df.isDefault === true,
31
32
  })), [result]);
32
- // A fact has no fetch, so it never "loads". An attribute loads until its
33
- // fetch settles (success or error).
33
+ // Facts and measures have no fetch, so they never "load". An attribute loads
34
+ // until its fetch settles (success or error).
34
35
  const loading = attributeRef !== undefined && status !== "success" && status !== "error";
35
36
  const error = attributeRef !== undefined && status === "error";
36
37
  return { labels, loading, error };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-catalog",
3
- "version": "11.49.0-alpha.0",
3
+ "version": "11.49.0-alpha.1",
4
4
  "description": "GoodData SDK - Analytics Catalog",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -41,15 +41,15 @@
41
41
  "tslib": "2.8.1",
42
42
  "yaml": "2.8.3",
43
43
  "zod": "4.3.6",
44
- "@gooddata/sdk-backend-spi": "11.49.0-alpha.0",
45
- "@gooddata/sdk-code-schemas": "11.49.0-alpha.0",
46
- "@gooddata/sdk-model": "11.49.0-alpha.0",
47
- "@gooddata/sdk-ui": "11.49.0-alpha.0",
48
- "@gooddata/sdk-ui-ext": "11.49.0-alpha.0",
49
- "@gooddata/sdk-ui-kit": "11.49.0-alpha.0",
50
- "@gooddata/sdk-ui-theme-provider": "11.49.0-alpha.0",
51
- "@gooddata/util": "11.49.0-alpha.0",
52
- "@gooddata/sdk-ui-semantic-search": "11.49.0-alpha.0"
44
+ "@gooddata/sdk-backend-spi": "11.49.0-alpha.1",
45
+ "@gooddata/sdk-code-schemas": "11.49.0-alpha.1",
46
+ "@gooddata/sdk-model": "11.49.0-alpha.1",
47
+ "@gooddata/sdk-ui": "11.49.0-alpha.1",
48
+ "@gooddata/sdk-ui-ext": "11.49.0-alpha.1",
49
+ "@gooddata/sdk-ui-kit": "11.49.0-alpha.1",
50
+ "@gooddata/sdk-ui-semantic-search": "11.49.0-alpha.1",
51
+ "@gooddata/sdk-ui-theme-provider": "11.49.0-alpha.1",
52
+ "@gooddata/util": "11.49.0-alpha.1"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@microsoft/api-documenter": "^7.17.0",
@@ -89,11 +89,11 @@
89
89
  "typescript": "5.9.3",
90
90
  "vitest": "4.1.8",
91
91
  "vitest-dom": "0.1.1",
92
- "@gooddata/eslint-config": "11.49.0-alpha.0",
93
- "@gooddata/i18n-toolkit": "11.49.0-alpha.0",
94
- "@gooddata/oxlint-config": "11.49.0-alpha.0",
95
- "@gooddata/sdk-backend-mockingbird": "11.49.0-alpha.0",
96
- "@gooddata/stylelint-config": "11.49.0-alpha.0"
92
+ "@gooddata/eslint-config": "11.49.0-alpha.1",
93
+ "@gooddata/oxlint-config": "11.49.0-alpha.1",
94
+ "@gooddata/i18n-toolkit": "11.49.0-alpha.1",
95
+ "@gooddata/sdk-backend-mockingbird": "11.49.0-alpha.1",
96
+ "@gooddata/stylelint-config": "11.49.0-alpha.1"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "react": "^18.0.0 || ^19.0.0",