@gooddata/sdk-ui-catalog 11.61.0-alpha.4 → 11.61.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 +4 -2
- package/esm/asCode/AsCodeDeleteDialog.d.ts.map +1 -1
- package/esm/asCode/AsCodeDeleteDialog.js +40 -23
- package/esm/asCode/AsCodeDetailActions.d.ts +2 -1
- package/esm/asCode/AsCodeDetailActions.d.ts.map +1 -1
- package/esm/asCode/AsCodeDetailActions.js +2 -2
- package/esm/asCode/UsageNotice.d.ts +17 -0
- package/esm/asCode/UsageNotice.d.ts.map +1 -0
- package/esm/asCode/UsageNotice.js +67 -0
- package/esm/asCode/descriptor.d.ts +20 -13
- package/esm/asCode/descriptor.d.ts.map +1 -1
- package/esm/catalogDetail/CatalogDetailActions.d.ts +2 -1
- package/esm/catalogDetail/CatalogDetailActions.d.ts.map +1 -1
- package/esm/catalogDetail/CatalogDetailActions.js +2 -2
- package/esm/catalogDetail/CatalogDetailContent.d.ts.map +1 -1
- package/esm/catalogDetail/CatalogDetailContent.js +1 -1
- package/esm/computedAttribute/computedAttributeDescriptor.js +4 -4
- package/esm/computedAttribute/computedAttributeMutationPort.d.ts +3 -3
- package/esm/computedAttribute/computedAttributeMutationPort.d.ts.map +1 -1
- package/esm/computedAttribute/computedAttributeMutationPort.js +12 -7
- package/esm/insight/insightDescriptor.d.ts.map +1 -1
- package/esm/insight/insightDescriptor.js +3 -2
- package/esm/insight/insightMutationPort.d.ts +3 -3
- package/esm/insight/insightMutationPort.d.ts.map +1 -1
- package/esm/insight/insightMutationPort.js +5 -2
- package/esm/lineage/Lineage.d.ts.map +1 -1
- package/esm/lineage/Lineage.js +2 -2
- package/esm/lineage/const.d.ts +1 -0
- package/esm/lineage/const.d.ts.map +1 -1
- package/esm/lineage/const.js +1 -1
- package/esm/lineage/gate.d.ts.map +1 -1
- package/esm/lineage/gate.js +1 -0
- package/esm/lineage/graph/createIcon.d.ts.map +1 -1
- package/esm/lineage/graph/createIcon.js +1 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +36 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +39 -3
- package/esm/metric/metricDescriptor.d.ts.map +1 -1
- package/esm/metric/metricDescriptor.js +3 -2
- package/esm/metric/metricMutationPort.d.ts +3 -3
- package/esm/metric/metricMutationPort.d.ts.map +1 -1
- package/esm/metric/metricMutationPort.js +2 -2
- package/esm/objectType/constants.d.ts +3 -0
- package/esm/objectType/constants.d.ts.map +1 -1
- package/esm/objectType/constants.js +4 -0
- package/esm/parameter/parameterDescriptor.d.ts.map +1 -1
- package/esm/parameter/parameterDescriptor.js +6 -3
- package/esm/parameter/parameterMutationPort.d.ts +3 -3
- package/esm/parameter/parameterMutationPort.d.ts.map +1 -1
- package/esm/parameter/parameterMutationPort.js +12 -5
- package/package.json +15 -15
- package/styles/css/codeDialog.css +27 -1
- package/styles/css/codeDialog.css.map +1 -1
- package/styles/css/detail.css +27 -1
- package/styles/css/detail.css.map +1 -1
- package/styles/css/main.css +27 -1
- package/styles/css/main.css.map +1 -1
- package/styles/scss/codeDialog.scss +32 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type MouseEvent } from "react";
|
|
2
|
+
import type { ICatalogItem, ICatalogItemRef } from "../catalogItem/types.js";
|
|
2
3
|
import type { IAsCodeDescriptor } from "./descriptor.js";
|
|
3
4
|
type Props = {
|
|
4
5
|
descriptor: IAsCodeDescriptor;
|
|
5
6
|
item: ICatalogItem;
|
|
6
7
|
onClose: () => void;
|
|
7
8
|
onDeleted: () => void;
|
|
9
|
+
onCatalogItemNavigation?: (event: MouseEvent, ref: ICatalogItemRef) => void;
|
|
8
10
|
};
|
|
9
11
|
/** @internal */
|
|
10
|
-
export declare function AsCodeDeleteDialog({ descriptor, item, onClose, onDeleted }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function AsCodeDeleteDialog({ descriptor, item, onClose, onDeleted, onCatalogItemNavigation }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=AsCodeDeleteDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsCodeDeleteDialog.d.ts","sourceRoot":"","sources":["../../src/asCode/AsCodeDeleteDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsCodeDeleteDialog.d.ts","sourceRoot":"","sources":["../../src/asCode/AsCodeDeleteDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAyC,MAAM,OAAO,CAAC;AAY/E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE7E,OAAO,KAAK,EAAoB,iBAAiB,EAAoB,MAAM,iBAAiB,CAAC;AAS7F,KAAK,KAAK,GAAG;IACT,UAAU,EAAE,iBAAiB,CAAC;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/E,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,EAAE,KAAK,2CA+E1G"}
|
|
@@ -2,31 +2,26 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
4
|
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
|
|
5
|
-
import { useBackendStrict, useCancelablePromise, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
6
|
-
import { ConfirmDialog,
|
|
5
|
+
import { useBackendStrict, useCancelablePromise, useWorkspaceStrict, } from "@gooddata/sdk-ui";
|
|
6
|
+
import { ConfirmDialog, LoadingSpinner, useToastMessage } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { UsageError, UsageWarning } from "./UsageNotice.js";
|
|
7
8
|
import { useMutationPort } from "./useMutationPort.js";
|
|
8
9
|
const messages = defineMessages({
|
|
9
10
|
cancel: { id: "analyticsCatalog.asCode.dialog.cancel" },
|
|
10
|
-
|
|
11
|
-
showLess: { id: "analyticsCatalog.asCode.dialog.delete.showLess" },
|
|
11
|
+
checkingUsage: { id: "analyticsCatalog.asCode.dialog.delete.checkingUsage" },
|
|
12
12
|
});
|
|
13
13
|
/** @internal */
|
|
14
|
-
export function AsCodeDeleteDialog({ descriptor, item, onClose, onDeleted }) {
|
|
14
|
+
export function AsCodeDeleteDialog({ descriptor, item, onClose, onDeleted, onCatalogItemNavigation }) {
|
|
15
15
|
const intl = useIntl();
|
|
16
16
|
const { addSuccess, addError } = useToastMessage();
|
|
17
17
|
const backend = useBackendStrict();
|
|
18
18
|
const workspace = useWorkspaceStrict();
|
|
19
19
|
const port = useMutationPort(descriptor);
|
|
20
|
-
const { messages: msg,
|
|
20
|
+
const { messages: msg, usageCheck } = descriptor;
|
|
21
21
|
const [isDeleting, setIsDeleting] = useState(false);
|
|
22
|
-
const [
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const references = !referenceCounted || status === "error" ? [] : result;
|
|
26
|
-
const referencingCount = references?.length;
|
|
27
|
-
// A failed lookup leaves the count at zero, so a blocking type stays deletable rather than
|
|
28
|
-
// becoming permanently undeletable on a transient error; the backend refuses it either way.
|
|
29
|
-
const isBlocked = Boolean(referenceCounted?.blockedBody) && Boolean(referencingCount);
|
|
22
|
+
const [lookupAttempt, setLookupAttempt] = useState(0);
|
|
23
|
+
const lookup = useCancelablePromise({ promise: usageCheck ? () => usageCheck.load(backend, workspace, item) : undefined }, [item, backend, workspace, lookupAttempt]);
|
|
24
|
+
const usage = getUsageView(usageCheck, lookup, msg.deleteBody, () => setLookupAttempt((attempt) => attempt + 1), onCatalogItemNavigation);
|
|
30
25
|
const displayName = item.title || item.identifier;
|
|
31
26
|
const handleDelete = useCallback(async () => {
|
|
32
27
|
setIsDeleting(true);
|
|
@@ -46,13 +41,35 @@ export function AsCodeDeleteDialog({ descriptor, item, onClose, onDeleted }) {
|
|
|
46
41
|
onClose();
|
|
47
42
|
}
|
|
48
43
|
}, [isDeleting, onClose]);
|
|
49
|
-
return (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
return (_jsx(ConfirmDialog, { className: "gd-analytics-catalog__as-code-dialog", headline: intl.formatMessage(msg.deleteTitle), cancelButtonText: intl.formatMessage(messages.cancel), submitButtonText: intl.formatMessage(msg.deleteSubmit), isPositive: false, isSubmitDisabled: isDeleting || usage.isChecking || usage.isBlocked, isCancelDisabled: isDeleting, showProgressIndicator: isDeleting, onCancel: handleClose, onClose: handleClose, onSubmit: handleDelete, displayCloseButton: !isDeleting, children: usage.isChecking ? (_jsxs("div", { className: "gd-analytics-catalog__as-code-dialog__checking", children: [_jsx(LoadingSpinner, { className: "small" }), intl.formatMessage(messages.checkingUsage)] })) : (_jsxs(_Fragment, { children: [_jsx(FormattedMessage, { ...usage.body, values: {
|
|
45
|
+
name: displayName,
|
|
46
|
+
b: (chunks) => _jsx("b", { children: chunks }),
|
|
47
|
+
} }), usage.notice ? (_jsx("div", { className: "gd-analytics-catalog__as-code-dialog__usage", children: usage.notice })) : null] })) }));
|
|
48
|
+
}
|
|
49
|
+
function getUsageView(usageCheck, lookup, deleteBody, onRetry, onCatalogItemNavigation) {
|
|
50
|
+
const unused = { isChecking: false, isBlocked: false, body: deleteBody };
|
|
51
|
+
if (!usageCheck) {
|
|
52
|
+
return unused;
|
|
53
|
+
}
|
|
54
|
+
switch (lookup.status) {
|
|
55
|
+
case "pending":
|
|
56
|
+
case "loading":
|
|
57
|
+
return { ...unused, isChecking: true };
|
|
58
|
+
case "error":
|
|
59
|
+
return {
|
|
60
|
+
...unused,
|
|
61
|
+
isBlocked: usageCheck.mode === "block",
|
|
62
|
+
notice: _jsx(UsageError, { onRetry: onRetry }),
|
|
63
|
+
};
|
|
64
|
+
case "success":
|
|
65
|
+
if (lookup.result.length === 0) {
|
|
66
|
+
return unused;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
...unused,
|
|
70
|
+
isBlocked: usageCheck.mode === "block",
|
|
71
|
+
body: usageCheck.mode === "block" ? usageCheck.blockedMessage : deleteBody,
|
|
72
|
+
notice: (_jsx(UsageWarning, { usageCheck: usageCheck, references: lookup.result, onCatalogItemNavigation: onCatalogItemNavigation })),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
58
75
|
}
|
|
@@ -12,7 +12,8 @@ export interface IAsCodeDetailActionsProps {
|
|
|
12
12
|
onCatalogItemCreate?: (item: ICatalogItem) => void;
|
|
13
13
|
onCatalogItemUpdate?: (item: ICatalogItem) => void;
|
|
14
14
|
onCatalogItemDelete?: (ref: ICatalogItemRef) => void;
|
|
15
|
+
onCatalogItemNavigation?: (event: MouseEvent, ref: ICatalogItemRef) => void;
|
|
15
16
|
}
|
|
16
17
|
/** @internal */
|
|
17
|
-
export declare function AsCodeDetailActions({ descriptor, item, onOpen, onShare, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, }: IAsCodeDetailActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function AsCodeDetailActions({ descriptor, item, onOpen, onShare, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, onCatalogItemNavigation, }: IAsCodeDetailActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
//# sourceMappingURL=AsCodeDetailActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsCodeDetailActions.d.ts","sourceRoot":"","sources":["../../src/asCode/AsCodeDetailActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,UAAU,EAAkC,MAAM,OAAO,CAAC;AAU5F,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAUzD,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClE,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AsCodeDetailActions.d.ts","sourceRoot":"","sources":["../../src/asCode/AsCodeDetailActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,UAAU,EAAkC,MAAM,OAAO,CAAC;AAU5F,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAUzD,gBAAgB;AAChB,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClE,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACrD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/E;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,EAChC,UAAU,EACV,IAAI,EACJ,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GAC1B,EAAE,yBAAyB,2CAkG3B"}
|
|
@@ -12,7 +12,7 @@ import { AsCodeDeleteDialog } from "./AsCodeDeleteDialog.js";
|
|
|
12
12
|
import { AsCodeEditDialog } from "./AsCodeEditDialog.js";
|
|
13
13
|
const OPEN_ACTION_ID = "open";
|
|
14
14
|
/** @internal */
|
|
15
|
-
export function AsCodeDetailActions({ descriptor, item, onOpen, onShare, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, }) {
|
|
15
|
+
export function AsCodeDetailActions({ descriptor, item, onOpen, onShare, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, onCatalogItemNavigation, }) {
|
|
16
16
|
const intl = useIntl();
|
|
17
17
|
const workspaceId = useWorkspaceStrict();
|
|
18
18
|
// When false, edit and duplicate are withheld (both need the codec); delete, share, and open remain.
|
|
@@ -61,5 +61,5 @@ export function AsCodeDetailActions({ descriptor, item, onOpen, onShare, onCatal
|
|
|
61
61
|
const handleEditDuplicate = useCallback((source) => {
|
|
62
62
|
setDialog({ kind: "duplicate", duplicateSource: source });
|
|
63
63
|
}, []);
|
|
64
|
-
return (_jsxs(_Fragment, { children: [_jsx(CatalogDetailActionBar, { item: item, workspaceId: workspaceId, actionGroups: actionGroups, leadingActions: onShare ? _jsx(ShareButton, { onClick: onShare }) : null, onEditClick: canEditAsCode ? handleEditOpen : undefined, onActionsMenuSelect: handleActionsMenuSelect }), dialog?.kind === "edit" ? (_jsx(AsCodeEditDialog, { descriptor: descriptor, item: dialog.item, mode: "edit", onClose: closeDialog, onSaved: onCatalogItemUpdate, onDuplicate: handleEditDuplicate })) : null, dialog?.kind === "duplicate" ? (_jsx(AsCodeCreateDialog, { descriptor: descriptor, duplicateOf: dialog.duplicateOf, duplicateSource: dialog.duplicateSource, onClose: closeDialog, onCreated: onCatalogItemCreate })) : null, dialog?.kind === "delete" ? (_jsx(AsCodeDeleteDialog, { descriptor: descriptor, item: dialog.item, onClose: closeDialog, onDeleted: () => onCatalogItemDelete?.(dialog.item) })) : null] }));
|
|
64
|
+
return (_jsxs(_Fragment, { children: [_jsx(CatalogDetailActionBar, { item: item, workspaceId: workspaceId, actionGroups: actionGroups, leadingActions: onShare ? _jsx(ShareButton, { onClick: onShare }) : null, onEditClick: canEditAsCode ? handleEditOpen : undefined, onActionsMenuSelect: handleActionsMenuSelect }), dialog?.kind === "edit" ? (_jsx(AsCodeEditDialog, { descriptor: descriptor, item: dialog.item, mode: "edit", onClose: closeDialog, onSaved: onCatalogItemUpdate, onDuplicate: handleEditDuplicate })) : null, dialog?.kind === "duplicate" ? (_jsx(AsCodeCreateDialog, { descriptor: descriptor, duplicateOf: dialog.duplicateOf, duplicateSource: dialog.duplicateSource, onClose: closeDialog, onCreated: onCatalogItemCreate })) : null, dialog?.kind === "delete" ? (_jsx(AsCodeDeleteDialog, { descriptor: descriptor, item: dialog.item, onClose: closeDialog, onDeleted: () => onCatalogItemDelete?.(dialog.item), onCatalogItemNavigation: onCatalogItemNavigation })) : null] }));
|
|
65
65
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type MouseEvent } from "react";
|
|
2
|
+
import type { ICatalogItem, ICatalogItemRef } from "../catalogItem/types.js";
|
|
3
|
+
import type { AsCodeUsageCheck, IAsCodeReference } from "./descriptor.js";
|
|
4
|
+
interface IUsageErrorProps {
|
|
5
|
+
onRetry: () => void;
|
|
6
|
+
}
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare function UsageError({ onRetry }: IUsageErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface IUsageWarningProps {
|
|
10
|
+
usageCheck: AsCodeUsageCheck<ICatalogItem>;
|
|
11
|
+
references: IAsCodeReference[];
|
|
12
|
+
onCatalogItemNavigation?: (event: MouseEvent, ref: ICatalogItemRef) => void;
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare function UsageWarning({ usageCheck, references, onCatalogItemNavigation }: IUsageWarningProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=UsageNotice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsageNotice.d.ts","sourceRoot":"","sources":["../../src/asCode/UsageNotice.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,OAAO,CAAC;AAOlD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+B1E,UAAU,gBAAgB;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,gBAAgB,2CAUvD;AAED,UAAU,kBAAkB;IACxB,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/E;AAED,gBAAgB;AAChB,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,EAAE,EAAE,kBAAkB,2CAiCnG"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
|
|
5
|
+
import { serializeObjRef } from "@gooddata/sdk-model";
|
|
6
|
+
import { Message, UiButton } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { FILTER_GROUPS, isCatalogObjectType } from "../objectType/constants.js";
|
|
8
|
+
const messages = defineMessages({
|
|
9
|
+
usageUnknown: { id: "analyticsCatalog.asCode.dialog.delete.usageUnknown" },
|
|
10
|
+
tryAgain: { id: "analyticsCatalog.asCode.dialog.delete.tryAgain" },
|
|
11
|
+
showMore: { id: "analyticsCatalog.asCode.dialog.delete.showMore" },
|
|
12
|
+
showLess: { id: "analyticsCatalog.asCode.dialog.delete.showLess" },
|
|
13
|
+
visualizations: { id: "analyticsCatalog.asCode.dialog.delete.usageGroup.visualizations" },
|
|
14
|
+
dashboards: { id: "analyticsCatalog.asCode.dialog.delete.usageGroup.dashboards" },
|
|
15
|
+
metrics: { id: "analyticsCatalog.asCode.dialog.delete.usageGroup.metrics" },
|
|
16
|
+
attributes: { id: "analyticsCatalog.asCode.dialog.delete.usageGroup.attributes" },
|
|
17
|
+
otherObjects: { id: "analyticsCatalog.asCode.dialog.delete.usageGroup.otherObjects" },
|
|
18
|
+
});
|
|
19
|
+
const usageGroupLabels = {
|
|
20
|
+
analyticalDashboard: messages.dashboards,
|
|
21
|
+
insight: messages.visualizations,
|
|
22
|
+
measure: messages.metrics,
|
|
23
|
+
attribute: messages.attributes,
|
|
24
|
+
};
|
|
25
|
+
// The usage groups and their order follow the catalog filter bar on purpose.
|
|
26
|
+
const usageGroupLabelByType = new Map(FILTER_GROUPS.flatMap(({ id, types }) => {
|
|
27
|
+
const label = usageGroupLabels[id];
|
|
28
|
+
return label ? types.map((type) => [type, label]) : [];
|
|
29
|
+
}));
|
|
30
|
+
const usageGroupOrder = [...new Set(usageGroupLabelByType.values()), messages.otherObjects];
|
|
31
|
+
/** @internal */
|
|
32
|
+
export function UsageError({ onRetry }) {
|
|
33
|
+
const intl = useIntl();
|
|
34
|
+
return (_jsx(Message, { type: "error", children: _jsxs("span", { role: "alert", children: [intl.formatMessage(messages.usageUnknown), " ", _jsx(UiButton, { variant: "link", label: intl.formatMessage(messages.tryAgain), onClick: onRetry })] }) }));
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
export function UsageWarning({ usageCheck, references, onCatalogItemNavigation }) {
|
|
38
|
+
const intl = useIntl();
|
|
39
|
+
const [areReferencesShown, setAreReferencesShown] = useState(false);
|
|
40
|
+
return (_jsxs(Message, { type: "warning", children: [_jsxs("span", { role: "status", children: [_jsx(FormattedMessage, { ...usageCheck.warningMessage, values: {
|
|
41
|
+
count: references.length,
|
|
42
|
+
b: (chunks) => _jsx("b", { children: chunks }),
|
|
43
|
+
} }), usageCheck.mode === "block" ? (_jsxs(_Fragment, { children: [" ", _jsx(UiButton, { variant: "link", label: intl.formatMessage(areReferencesShown ? messages.showLess : messages.showMore), onClick: () => setAreReferencesShown(!areReferencesShown), accessibilityConfig: { ariaExpanded: areReferencesShown } })] })) : null] }), usageCheck.mode === "block" && areReferencesShown ? (_jsx(UsageGroups, { references: references, onCatalogItemNavigation: onCatalogItemNavigation })) : null] }));
|
|
44
|
+
}
|
|
45
|
+
function UsageGroups({ references, onCatalogItemNavigation }) {
|
|
46
|
+
return (_jsx("div", { className: "gd-analytics-catalog__as-code-dialog__usage-groups", children: groupReferences(references).map((group) => (_jsxs("div", { className: "gd-analytics-catalog__as-code-dialog__usage-group", children: [_jsx("b", { children: _jsx(FormattedMessage, { ...group.label, values: { count: group.references.length } }) }), _jsx("ul", { className: "gd-analytics-catalog__as-code-dialog__usage-list", children: group.references.map((reference) => (_jsx("li", { children: _jsx(UsageReference, { reference: reference, onCatalogItemNavigation: onCatalogItemNavigation }) }, serializeObjRef(reference)))) })] }, group.label.id))) }));
|
|
47
|
+
}
|
|
48
|
+
function UsageReference({ reference, onCatalogItemNavigation }) {
|
|
49
|
+
const { identifier, type, title } = reference;
|
|
50
|
+
if (!onCatalogItemNavigation || !isCatalogObjectType(type)) {
|
|
51
|
+
return title;
|
|
52
|
+
}
|
|
53
|
+
return (_jsx(UiButton, { variant: "link", label: title, onClick: (event) => onCatalogItemNavigation(event, { identifier, type }) }));
|
|
54
|
+
}
|
|
55
|
+
function groupReferences(references) {
|
|
56
|
+
const referencesByLabel = new Map();
|
|
57
|
+
for (const reference of references) {
|
|
58
|
+
const label = (reference.type && usageGroupLabelByType.get(reference.type)) ?? messages.otherObjects;
|
|
59
|
+
const labelReferences = referencesByLabel.get(label) ?? [];
|
|
60
|
+
labelReferences.push(reference);
|
|
61
|
+
referencesByLabel.set(label, labelReferences);
|
|
62
|
+
}
|
|
63
|
+
return usageGroupOrder.flatMap((label) => {
|
|
64
|
+
const labelReferences = referencesByLabel.get(label);
|
|
65
|
+
return labelReferences ? [{ label, references: labelReferences }] : [];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MessageDescriptor } from "react-intl";
|
|
2
2
|
import type { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
3
|
-
import type { ISettings } from "@gooddata/sdk-model";
|
|
3
|
+
import type { ISettings, IdentifierRef } from "@gooddata/sdk-model";
|
|
4
4
|
import type { YamlCompletionSource } from "@gooddata/sdk-ui-kit";
|
|
5
5
|
import type { ICatalogItem, ICatalogItemRef } from "../catalogItem/types.js";
|
|
6
6
|
import type { ObjectTypes } from "../objectType/constants.js";
|
|
@@ -98,17 +98,24 @@ export declare function isLoadSeed<TDef, TItem extends ICatalogItem>(seed: AsCod
|
|
|
98
98
|
/** @internal */
|
|
99
99
|
export declare function loadErrorOf(descriptor: IAsCodeDescriptor): MessageDescriptor | undefined;
|
|
100
100
|
/** @internal */
|
|
101
|
-
export
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
export interface IAsCodeReference extends IdentifierRef {
|
|
102
|
+
title: string;
|
|
103
|
+
}
|
|
104
|
+
/** @internal */
|
|
105
|
+
export type AsCodeUsageCheck<TItem extends ICatalogItem> = ({
|
|
106
|
+
mode: "warn";
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Refuses the deletion while any reference exists or the lookup fails, replaces the delete body with
|
|
110
|
+
* `blockedMessage`, and lists the referencing titles behind a Show more/Show less toggle.
|
|
111
|
+
*/
|
|
112
|
+
| {
|
|
113
|
+
mode: "block";
|
|
114
|
+
blockedMessage: MessageDescriptor;
|
|
115
|
+
}) & {
|
|
116
|
+
load(backend: IAnalyticalBackend, workspace: string, item: TItem): Promise<IAsCodeReference[]>;
|
|
117
|
+
/** Gets `{count}`, the number of objects that `load` returns. */
|
|
118
|
+
warningMessage: MessageDescriptor;
|
|
112
119
|
};
|
|
113
120
|
/**
|
|
114
121
|
* Duplicate-collision retry: the create dialog retries without the id when a copy's derived id
|
|
@@ -143,7 +150,7 @@ export interface IAsCodeDescriptor<TDef = unknown, TItem extends ICatalogItem =
|
|
|
143
150
|
createMutationPort(backend: IAnalyticalBackend, workspace: string, settings: ISettings | undefined): IAsCodeMutationPort<TDef, TItem>;
|
|
144
151
|
emptyDefinition(defaultTitle: string): TDef;
|
|
145
152
|
seed: AsCodeSeed<TDef, TItem>;
|
|
146
|
-
|
|
153
|
+
usageCheck?: AsCodeUsageCheck<TItem>;
|
|
147
154
|
identity?: AsCodeIdentity<TDef>;
|
|
148
155
|
toCopy(source: TDef): TDef;
|
|
149
156
|
/** Presence signals the type has a standalone editor; its label opens it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../src/asCode/descriptor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../src/asCode/descriptor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAErE,MAAM,MAAM,gBAAgB,GACtB,OAAO,WAAW,CAAC,MAAM,GACzB,OAAO,WAAW,CAAC,SAAS,GAC5B,OAAO,WAAW,CAAC,kB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,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1C;;;;OAIG;IACH,iBAAiB,CAAC,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,iBAAiB,CAAC,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IACzC,yFAAyF;IACzF,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,kBAAkB,CACd,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,SAAS,GAAG,SAAS,GAChC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEpC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,KAAK,SAAS,YAAY,EACnE,UAAU,EAAE,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,GAC3C,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAEhC"}
|
|
@@ -11,6 +11,7 @@ export interface ICatalogDetailActionsProps {
|
|
|
11
11
|
onCatalogItemCreate?: (item: ICatalogItem) => void;
|
|
12
12
|
onCatalogItemUpdate?: (item: ICatalogItem) => void;
|
|
13
13
|
onCatalogItemDelete?: (ref: ICatalogItemRef) => void;
|
|
14
|
+
onCatalogItemNavigation?: (event: MouseEvent, ref: ICatalogItemRef) => void;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Detail-panel actions for a catalog item. An as-code-editable type — whose in-catalog editor is
|
|
@@ -18,5 +19,5 @@ export interface ICatalogDetailActionsProps {
|
|
|
18
19
|
* {@link AsCodeDetailActions}; every other type gets the Open (+ Share) fallback.
|
|
19
20
|
* @internal
|
|
20
21
|
*/
|
|
21
|
-
export declare function CatalogDetailActions({ item, canEdit, onOpen, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, }: ICatalogDetailActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export declare function CatalogDetailActions({ item, canEdit, onOpen, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, onCatalogItemNavigation, }: ICatalogDetailActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
23
|
//# sourceMappingURL=CatalogDetailActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogDetailActions.d.ts","sourceRoot":"","sources":["../../src/catalogDetail/CatalogDetailActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAUxC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClE,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CatalogDetailActions.d.ts","sourceRoot":"","sources":["../../src/catalogDetail/CatalogDetailActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAUxC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAClE,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACrD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GAC1B,EAAE,0BAA0B,kDA2D5B"}
|
|
@@ -16,7 +16,7 @@ import { ShareButton } from "./share/ShareButton.js";
|
|
|
16
16
|
* {@link AsCodeDetailActions}; every other type gets the Open (+ Share) fallback.
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export function CatalogDetailActions({ item, canEdit, onOpen, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, }) {
|
|
19
|
+
export function CatalogDetailActions({ item, canEdit, onOpen, onCatalogItemCreate, onCatalogItemUpdate, onCatalogItemDelete, onCatalogItemNavigation, }) {
|
|
20
20
|
const intl = useIntl();
|
|
21
21
|
const workspaceId = useWorkspaceStrict();
|
|
22
22
|
// The Share button reads the share context directly (actions only), so it never
|
|
@@ -28,7 +28,7 @@ export function CatalogDetailActions({ item, canEdit, onOpen, onCatalogItemCreat
|
|
|
28
28
|
// catalog shows their definition itself.
|
|
29
29
|
const hasOwnEditor = descriptor?.openAction !== undefined;
|
|
30
30
|
if (descriptor && canEdit && isTypeEditable) {
|
|
31
|
-
return (_jsx(AsCodeDetailActions, { descriptor: descriptor, item: item, onOpen: onOpen, onShare: share.active ? share.open : undefined, onCatalogItemCreate: onCatalogItemCreate, onCatalogItemUpdate: onCatalogItemUpdate, onCatalogItemDelete: onCatalogItemDelete }, descriptor.objectType));
|
|
31
|
+
return (_jsx(AsCodeDetailActions, { descriptor: descriptor, item: item, onOpen: onOpen, onShare: share.active ? share.open : undefined, onCatalogItemCreate: onCatalogItemCreate, onCatalogItemUpdate: onCatalogItemUpdate, onCatalogItemDelete: onCatalogItemDelete, onCatalogItemNavigation: onCatalogItemNavigation }, descriptor.objectType));
|
|
32
32
|
}
|
|
33
33
|
if (descriptor && isTypeEditable && !hasOwnEditor) {
|
|
34
34
|
return (_jsx(AsCodeDetailViewActions, { descriptor: descriptor, item: item, onShare: share.active ? share.open : undefined }, descriptor.objectType));
|
|
@@ -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;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Definition, o
|
|
|
112
112
|
const [selectedTabId, setSelectedTabId] = useSelectedTabId(tabs);
|
|
113
113
|
return (_jsx(CatalogItemShareProvider, { shareableItem: shareableItem, target: shareTarget, labels: shareLabels, children: _jsxs("div", { className: "gd-analytics-catalog-detail", children: [_jsx(CatalogDetailStatus, { status: status, error: error, children: item ? (_jsxs("div", { className: cx("gd-analytics-catalog-detail__content", {
|
|
114
114
|
lineage: selectedTabId === Tabs.LINEAGE,
|
|
115
|
-
}), children: [_jsx(CatalogDetailHeader, { item: item, canEdit: canEdit, updateItemTitle: updateItemTitle, updateItemDescription: updateItemDescription, isDescriptionGenerationEnabled: isDescriptionGenerationEnabled, headerRef: headerRef, labels: shareableItem ? shareLabels.labels : undefined, labelsLoading: shareableItem ? shareLabels.loading : false, showInfoRow: enableColumnLevelPermissions, actions: _jsx(CatalogDetailActions, { item: item, canEdit: canEdit, onOpen: onOpenClick, onCatalogItemCreate: onCatalogItemCreate, onCatalogItemUpdate: applyItemUpdate, onCatalogItemDelete: applyItemDelete }) }), _jsx(UiTabs, { size: "large", tabs: tabs, onTabSelect: (tab) => setSelectedTabId(tab.id), selectedTabId: selectedTabId }), selectedTabId === Tabs.METADATA && (_jsx(CatalogDetailTabMetadata, { item: item, canEdit: canEdit,
|
|
115
|
+
}), children: [_jsx(CatalogDetailHeader, { item: item, canEdit: canEdit, updateItemTitle: updateItemTitle, updateItemDescription: updateItemDescription, isDescriptionGenerationEnabled: isDescriptionGenerationEnabled, headerRef: headerRef, labels: shareableItem ? shareLabels.labels : undefined, labelsLoading: shareableItem ? shareLabels.loading : false, showInfoRow: enableColumnLevelPermissions, actions: _jsx(CatalogDetailActions, { item: item, canEdit: canEdit, onOpen: onOpenClick, onCatalogItemCreate: onCatalogItemCreate, onCatalogItemUpdate: applyItemUpdate, onCatalogItemDelete: applyItemDelete, onCatalogItemNavigation: onCatalogItemNavigation }) }), _jsx(UiTabs, { size: "large", tabs: tabs, onTabSelect: (tab) => setSelectedTabId(tab.id), selectedTabId: selectedTabId }), selectedTabId === Tabs.METADATA && (_jsx(CatalogDetailTabMetadata, { item: item, canEdit: canEdit,
|
|
116
116
|
// With OLP off the dataset isn't relocated to the header,
|
|
117
117
|
// so keep the Dataset row in the metadata tab.
|
|
118
118
|
showDatasetRow: !enableColumnLevelPermissions, onTagClick: (tag) => {
|
|
@@ -93,11 +93,11 @@ export const computedAttributeDescriptor = defineAsCodeDescriptor({
|
|
|
93
93
|
// Refuses the deletion while a visualization, metric, dashboard, computed
|
|
94
94
|
// attribute, or data filter still references it, and names those objects. The backend
|
|
95
95
|
// currently allows the delete (it would break the dependents silently), so the catalog is the guard.
|
|
96
|
-
|
|
96
|
+
usageCheck: {
|
|
97
|
+
mode: "block",
|
|
97
98
|
load: listComputedAttributeReferences,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
blockedBody: capabilityMessages.deleteBlocked,
|
|
99
|
+
warningMessage: capabilityMessages.deleteUsageWarning,
|
|
100
|
+
blockedMessage: capabilityMessages.deleteBlocked,
|
|
101
101
|
},
|
|
102
102
|
// A copied computed attribute derives a human-readable id that can collide on create; identity lets the dialog retry without it.
|
|
103
103
|
identity: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type IComputedAttributeMetadataObjectDefinition } from "@gooddata/sdk-model";
|
|
3
|
-
import type { IAsCodeMutationPort } from "../asCode/descriptor.js";
|
|
3
|
+
import type { IAsCodeMutationPort, IAsCodeReference } from "../asCode/descriptor.js";
|
|
4
4
|
import type { ICatalogItemComputedAttribute } from "../catalogItem/types.js";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -8,8 +8,8 @@ import type { ICatalogItemComputedAttribute } from "../catalogItem/types.js";
|
|
|
8
8
|
export type IComputedAttributeMutationPort = IAsCodeMutationPort<IComputedAttributeMetadataObjectDefinition, ICatalogItemComputedAttribute>;
|
|
9
9
|
/** Fetches the full computed attribute for editing (the catalog item carries no MAQL). @internal */
|
|
10
10
|
export declare function loadComputedAttribute(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemComputedAttribute): Promise<IComputedAttributeMetadataObjectDefinition>;
|
|
11
|
-
/**
|
|
12
|
-
export declare function listComputedAttributeReferences(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemComputedAttribute): Promise<
|
|
11
|
+
/** Insights, metrics, dashboards, computed attributes, and data filters referencing a computed attribute. @internal */
|
|
12
|
+
export declare function listComputedAttributeReferences(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemComputedAttribute): Promise<IAsCodeReference[]>;
|
|
13
13
|
/**
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computedAttributeMutationPort.d.ts","sourceRoot":"","sources":["../../src/computedAttribute/computedAttributeMutationPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEH,KAAK,0CAA0C,
|
|
1
|
+
{"version":3,"file":"computedAttributeMutationPort.d.ts","sourceRoot":"","sources":["../../src/computedAttribute/computedAttributeMutationPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEH,KAAK,0CAA0C,EAKlD,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGrF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,mBAAmB,CAC5D,0CAA0C,EAC1C,6BAA6B,CAChC,CAAC;AAYF,oGAAoG;AACpG,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,6BAA6B,GACpC,OAAO,CAAC,0CAA0C,CAAC,CAKrD;AAED,uHAAuH;AACvH,wBAAsB,+BAA+B,CACjD,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,6BAA6B,GACpC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAiB7B;AAED;;GAEG;AACH,wBAAgB,sCAAsC,CAClD,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAClB,8BAA8B,CAyBhC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2026 GoodData Corporation
|
|
2
|
-
import { idRef, insightTitle, isComputedAttributeMetadataObject, } from "@gooddata/sdk-model";
|
|
2
|
+
import { idRef, insightId, insightTitle, isComputedAttributeMetadataObject, } from "@gooddata/sdk-model";
|
|
3
3
|
import { convertComputedAttributeToCatalogItem } from "../catalogItem/converter.js";
|
|
4
4
|
// `id` is definition-expressible yet server-owned: the update targets by it, so a hand-edited id must not retarget it.
|
|
5
5
|
function pickComputedAttributeIdentity(computedAttribute) {
|
|
@@ -13,18 +13,23 @@ export function loadComputedAttribute(backend, workspace, item) {
|
|
|
13
13
|
.computedAttributes()
|
|
14
14
|
.getComputedAttribute(idRef(item.identifier, "computedAttribute"));
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/** Insights, metrics, dashboards, computed attributes, and data filters referencing a computed attribute. @internal */
|
|
17
17
|
export async function listComputedAttributeReferences(backend, workspace, item) {
|
|
18
18
|
const referencing = await backend
|
|
19
19
|
.workspace(workspace)
|
|
20
20
|
.computedAttributes()
|
|
21
21
|
.getComputedAttributeReferencingObjects(idRef(item.identifier, "computedAttribute"));
|
|
22
22
|
return [
|
|
23
|
-
...(referencing.insights ?? []).map((insight) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...
|
|
23
|
+
...(referencing.insights ?? []).map((insight) => ({
|
|
24
|
+
...idRef(insightId(insight), "insight"),
|
|
25
|
+
title: insightTitle(insight),
|
|
26
|
+
})),
|
|
27
|
+
...[
|
|
28
|
+
...(referencing.measures ?? []),
|
|
29
|
+
...(referencing.analyticalDashboards ?? []),
|
|
30
|
+
...(referencing.computedAttributes ?? []),
|
|
31
|
+
...(referencing.userDataFilters ?? []),
|
|
32
|
+
].map(({ id, type, title }) => ({ ...idRef(id, type), title })),
|
|
28
33
|
];
|
|
29
34
|
}
|
|
30
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insightDescriptor.d.ts","sourceRoot":"","sources":["../../src/insight/insightDescriptor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAyDnE;;GAEG;AACH,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"insightDescriptor.d.ts","sourceRoot":"","sources":["../../src/insight/insightDescriptor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAyDnE;;GAEG;AACH,eAAO,MAAM,uBAAuB,8FA6BlC,CAAC"}
|
|
@@ -66,9 +66,10 @@ export const visualizationDescriptor = defineAsCodeDescriptor({
|
|
|
66
66
|
},
|
|
67
67
|
}),
|
|
68
68
|
seed: { load: loadInsight, loadError: capabilityMessages.loadError },
|
|
69
|
-
|
|
69
|
+
usageCheck: {
|
|
70
|
+
mode: "warn",
|
|
70
71
|
load: listInsightReferences,
|
|
71
|
-
|
|
72
|
+
warningMessage: capabilityMessages.deleteUsageWarning,
|
|
72
73
|
},
|
|
73
74
|
// No identity: an insight definition has no id field, and creates never carry one (backend-assigned).
|
|
74
75
|
toCopy: createCopiedInsight,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type IInsightDefinition } from "@gooddata/sdk-model";
|
|
3
|
-
import type { IAsCodeMutationPort } from "../asCode/descriptor.js";
|
|
3
|
+
import type { IAsCodeMutationPort, IAsCodeReference } from "../asCode/descriptor.js";
|
|
4
4
|
import type { ICatalogItemInsight } from "../catalogItem/types.js";
|
|
5
5
|
/** @internal */
|
|
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 listInsightReferences(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemInsight): Promise<
|
|
9
|
+
/** Dashboards referencing an insight. @internal */
|
|
10
|
+
export declare function listInsightReferences(backend: IAnalyticalBackend, workspace: string, item: ICatalogItemInsight): Promise<IAsCodeReference[]>;
|
|
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;
|
|
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,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGrF,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,mDAAmD;AACnD,wBAAsB,qBAAqB,CACvC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAS7B;AAoBD,gBAAgB;AAChB,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,GAClB,oBAAoB,CAsBtB"}
|
|
@@ -10,13 +10,16 @@ export function loadInsight(backend, workspace, item) {
|
|
|
10
10
|
.insights()
|
|
11
11
|
.getInsight(idRef(item.identifier, "insight"), { loadUserData: true });
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/** Dashboards referencing an insight. @internal */
|
|
14
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 ?? []).map((
|
|
19
|
+
return (referencing.analyticalDashboards ?? []).map(({ id, type, title }) => ({
|
|
20
|
+
...idRef(id, type),
|
|
21
|
+
title,
|
|
22
|
+
}));
|
|
20
23
|
}
|
|
21
24
|
function pickInsightIdentity(insight) {
|
|
22
25
|
const { identifier, uri, ref, isLocked, certification } = insight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lineage.d.ts","sourceRoot":"","sources":["../../src/lineage/Lineage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,OAAO,CAAC;AAc3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAWlF,KAAK,KAAK,GAAG;IACT,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"Lineage.d.ts","sourceRoot":"","sources":["../../src/lineage/Lineage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,OAAO,CAAC;AAc3D,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAWlF,KAAK,KAAK,GAAG;IACT,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,2CA4InD"}
|
package/esm/lineage/Lineage.js
CHANGED
|
@@ -6,7 +6,7 @@ import {} from "@gooddata/sdk-backend-spi";
|
|
|
6
6
|
import { ErrorComponent, LoadingComponent, useBackendStrict, useCancelablePromise, useWorkspaceStrict, } from "@gooddata/sdk-ui";
|
|
7
7
|
import { UiIconButton, UiTooltip, useElementSize } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import {} from "../catalogItem/types.js";
|
|
9
|
-
import { HIDDEN_ITEMS, LEAF_TYPES } from "./const.js";
|
|
9
|
+
import { HIDDEN_ITEMS, LEAF_TYPES, UPSTREAM_DEFAULT_TYPES } from "./const.js";
|
|
10
10
|
import { useLineageGraph } from "./useLineageGraph.js";
|
|
11
11
|
const messages = defineMessages({
|
|
12
12
|
up: { id: "analyticsCatalog.lineage.direction.up" },
|
|
@@ -17,7 +17,7 @@ export function Lineage({ item, onItemClick }) {
|
|
|
17
17
|
const backend = useBackendStrict();
|
|
18
18
|
const workspace = useWorkspaceStrict();
|
|
19
19
|
const intl = useIntl();
|
|
20
|
-
const [direction, setDirection] = useState("down");
|
|
20
|
+
const [direction, setDirection] = useState(UPSTREAM_DEFAULT_TYPES.includes(item.type) ? "up" : "down");
|
|
21
21
|
const objRef = useMemo(() => ({ identifier: item.identifier, type: item.type }), [item]);
|
|
22
22
|
const { result, status, error } = useCancelablePromise({
|
|
23
23
|
promise: () => {
|
package/esm/lineage/const.d.ts
CHANGED
|
@@ -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,EAoBpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAAgB,CAAC;AAEpD,eAAO,MAAM,sBAAsB,EAAE,UAAU,EAAkB,CAAC"}
|
package/esm/lineage/const.js
CHANGED
|
@@ -16,10 +16,10 @@ export const HIDDEN_ITEMS = [
|
|
|
16
16
|
"exportDefinition",
|
|
17
17
|
"memoryItem",
|
|
18
18
|
"notificationChannel",
|
|
19
|
-
"parameter",
|
|
20
19
|
"theme",
|
|
21
20
|
"userGroup",
|
|
22
21
|
"variable",
|
|
23
22
|
"workspaceDataFilterSetting",
|
|
24
23
|
];
|
|
25
24
|
export const LEAF_TYPES = ["dataSet"];
|
|
25
|
+
export const UPSTREAM_DEFAULT_TYPES = ["parameter"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/lineage/gate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/lineage/gate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAczD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAOpE"}
|