@gooddata/sdk-ui-gen-ai 11.43.0-alpha.0 → 11.43.0-alpha.2
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/NOTICE +130 -130
- package/esm/components/messages/AgentChangeItem.js +1 -1
- package/esm/components/messages/ConversationItemContents.d.ts.map +1 -1
- package/esm/components/messages/ConversationItemContents.js +4 -1
- package/esm/components/messages/conversationContents/ConversationAlertProposalContent.d.ts +1 -1
- package/esm/components/messages/conversationContents/ConversationAlertProposalContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationAlertProposalContent.js +171 -26
- package/esm/components/messages/conversationContents/ConversationVisualisation.d.ts +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualisation.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualisation.js +4 -30
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts +11 -2
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/SaveVisualizationDialog.d.ts +11 -2
- package/esm/components/messages/conversationContents/SaveVisualizationDialog.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/useExecution.d.ts +1 -1
- package/esm/components/messages/conversationContents/useExecution.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/utils/changeAnalysisDrills.d.ts +4 -0
- package/esm/components/messages/conversationContents/utils/changeAnalysisDrills.d.ts.map +1 -0
- package/esm/components/messages/conversationContents/utils/changeAnalysisDrills.js +32 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +66 -14
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +87 -35
- package/esm/store/messages/messagesSlice.js +2 -2
- package/esm/store/sideEffects/onUserMessage.d.ts.map +1 -1
- package/esm/store/sideEffects/onUserMessage.js +8 -1
- package/esm/store/sideEffects/onVisualizationSave.d.ts.map +1 -1
- package/esm/store/sideEffects/onVisualizationSave.js +6 -5
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/types.d.ts +1 -1
- package/esm/types.d.ts.map +1 -1
- package/esm/whatIf/whatIfMapping.js +1 -1
- package/package.json +20 -20
- package/styles/css/main.css +18 -0
- package/styles/css/main.css.map +1 -1
- package/styles/css/messages.css +18 -0
- package/styles/css/messages.css.map +1 -1
- package/styles/scss/messages.scss +22 -0
|
@@ -11,6 +11,6 @@ export function AgentChangeItem({ message }) {
|
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
return (_jsxs("div", { className: "gd-gen-ai-chat__messages__agent-change", children: [
|
|
14
|
-
_jsx("div", { className: "gd-gen-ai-chat__messages__agent-change__line" }), _jsx("div", { className: "gd-gen-ai-chat__messages__agent-change__label", children: _jsx(FormattedMessage, { id: "gd.gen-ai.agent.switched", values: { title: agent.title } }) }), _jsx("div", { className: "gd-gen-ai-chat__messages__agent-change__line" })
|
|
14
|
+
_jsx("div", { className: "gd-gen-ai-chat__messages__agent-change__line" }), _jsx("div", { className: "gd-gen-ai-chat__messages__agent-change__label", "data-testid": "agent_change_label", children: _jsx(FormattedMessage, { id: "gd.gen-ai.agent.switched", values: { title: agent.title } }) }), _jsx("div", { className: "gd-gen-ai-chat__messages__agent-change__line" })
|
|
15
15
|
] }));
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationItemContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ConversationItemContents.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConversationItemContents.d.ts","sourceRoot":"","sources":["../../../src/components/messages/ConversationItemContents.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGH,KAAK,0BAA0B,EAE/B,KAAK,iBAAiB,EACzB,MAAM,gBAAgB,CAAC;AAcxB,KAAK,6BAA6B,GAAG;IACjC,OAAO,EAAE,0BAA0B,CAAC;IACpC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,6BAA6B,kDA6HzG"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
2
4
|
import { loadWhatIfScenarios } from "../../whatIf/whatIfMapping.js";
|
|
3
5
|
import { ConversationAlertProposalContent } from "./conversationContents/ConversationAlertProposalContent.js";
|
|
4
6
|
import { ConversationErrorContent } from "./conversationContents/ConversationErrorContent.js";
|
|
@@ -11,6 +13,7 @@ import { ConversationToolResultContent } from "./conversationContents/Conversati
|
|
|
11
13
|
import { ConversationVisualizationContent } from "./conversationContents/ConversationVisualizationContent.js";
|
|
12
14
|
import { ConversationWhatIfContent } from "./conversationContents/ConversationWhatIfContent.js";
|
|
13
15
|
export function ConversationItemContents({ message, references, isLoading }) {
|
|
16
|
+
const intl = useIntl();
|
|
14
17
|
const content = message.content;
|
|
15
18
|
if (content.type === "error") {
|
|
16
19
|
return (_jsx(ConversationErrorContent, { useMarkdown: true, message: content.message, traceId: content.traceId, code: content.code, reason: content.reason, isLoading: isLoading }));
|
|
@@ -31,7 +34,7 @@ export function ConversationItemContents({ message, references, isLoading }) {
|
|
|
31
34
|
return (_jsx(ConversationAlertProposalContent, { message: message, part: part, alertProposal: part.alertProposal, objects: [...(part.objects ?? []), ...references] }, index));
|
|
32
35
|
}
|
|
33
36
|
if (part.type === "visualization" && !whatIf) {
|
|
34
|
-
return (_jsx(ConversationVisualizationContent, { message: message, part: part, visualization: part.visualization }, index));
|
|
37
|
+
return part.visualization ? (_jsx(ConversationVisualizationContent, { message: message, part: part, visualization: part.visualization }, index)) : (_jsx("div", { className: "gd-gen-ai-chat__messages__content--error", children: intl.formatMessage({ id: "gd.gen-ai.visualization.unavailable" }) }, index));
|
|
35
38
|
}
|
|
36
39
|
if (part.type === "searchResults") {
|
|
37
40
|
return (_jsx(ConversationSearchContent, { results: part.searchResults, relationships: part.relationships, keywords: part.keywords }, index));
|
|
@@ -7,5 +7,5 @@ export type ConversationAlertProposalContentProps = {
|
|
|
7
7
|
alertProposal: IAlertProposal | undefined;
|
|
8
8
|
className?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function ConversationAlertProposalContent(
|
|
10
|
+
export declare function ConversationAlertProposalContent(props: ConversationAlertProposalContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
11
|
//# sourceMappingURL=ConversationAlertProposalContent.d.ts.map
|
package/esm/components/messages/conversationContents/ConversationAlertProposalContent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationAlertProposalContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationAlertProposalContent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationAlertProposalContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationAlertProposalContent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAWhE,OAAO,KAAK,EACR,0BAA0B,EAC1B,mCAAmC,EACnC,iBAAiB,EACpB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,MAAM,qCAAqC,GAAG;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,aAAa,EAAE,cAAc,GAAG,SAAS,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,qCAAqC,kDA4C5F"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
3
|
import cx from "classnames";
|
|
4
|
-
import { FormattedMessage, useIntl } from "react-intl";
|
|
4
|
+
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
|
|
5
|
+
import { isIdentifierRef, } from "@gooddata/sdk-model";
|
|
5
6
|
import { Typography, UiIcon, UiTag } from "@gooddata/sdk-ui-kit";
|
|
6
7
|
import { objRefToTextContentObject } from "../../completion/utils.js";
|
|
7
8
|
import { MarkdownComponent } from "../contents/Markdown.js";
|
|
8
|
-
export function ConversationAlertProposalContent(
|
|
9
|
+
export function ConversationAlertProposalContent(props) {
|
|
10
|
+
const { objects, alertProposal, className } = props;
|
|
9
11
|
const intl = useIntl();
|
|
10
12
|
const classNames = cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--alertProposal", className);
|
|
11
13
|
if (!alertProposal) {
|
|
@@ -16,26 +18,168 @@ export function ConversationAlertProposalContent({ className, alertProposal, obj
|
|
|
16
18
|
_jsx(UiIcon, { type: "alert", size: 14, color: "complementary-6", backgroundSize: 26, backgroundColor: "complementary-2" }), _jsx(FormattedMessage, { id: "gd.gen-ai.alert-proposal.title" })
|
|
17
19
|
] }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-frame", children: [
|
|
18
20
|
_jsxs("ul", { children: [
|
|
19
|
-
_jsx(AlertItem, { markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.title" }), description: alertProposal.title, objects: objects }), _jsx(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
id: "gd.gen-ai.alert-proposal.summary.notification-channel",
|
|
23
|
-
}), description: alertProposal.notificationChannel.name, objects: objects })) : null, alertProposal.dashboard ? (_jsx(AlertReference, { title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.dashboard" }), ref: alertProposal.dashboard.id, refTitle: alertProposal.dashboard.title })) : null, alertProposal.operator ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.operator" }), description: alertProposal.operator, objects: objects })) : null, alertProposal.arithmeticOperator ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
24
|
-
id: "gd.gen-ai.alert-proposal.summary.arithmeticOperator",
|
|
25
|
-
}), description: alertProposal.arithmeticOperator, objects: objects })) : null, alertProposal.threshold ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.threshold" }), description: alertProposal.threshold.toString(), objects: objects })) : null, alertProposal.fromValue !== undefined && alertProposal.toValue !== undefined ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.range" }), description: `${alertProposal.fromValue} - ${alertProposal.toValue}`, objects: objects })) : null, alertProposal.fromValue !== undefined && alertProposal.toValue === undefined ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.from" }), description: alertProposal.fromValue.toString(), objects: objects })) : null, alertProposal.fromValue === undefined && alertProposal.toValue !== undefined ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.to" }), description: alertProposal.toValue.toString(), objects: objects })) : null, alertProposal.granularity ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.granularity" }), description: alertProposal.granularity, objects: objects })) : null, alertProposal.sensitivity ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.sensitivity" }), description: alertProposal.sensitivity, objects: objects })) : null] }), alertProposal.trigger ? (_jsxs(_Fragment, { children: [
|
|
26
|
-
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.trigger" }) }), _jsxs("ul", { children: [alertProposal.trigger.trigger ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
27
|
-
id: "gd.gen-ai.alert-proposal.summary.trigger.mode",
|
|
28
|
-
}), description: alertProposal.trigger.trigger, objects: objects })) : null, alertProposal.trigger.interval ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
29
|
-
id: "gd.gen-ai.alert-proposal.summary.trigger.interval",
|
|
30
|
-
}), description: alertProposal.trigger.interval, objects: objects })) : null, alertProposal.trigger.cron ? (_jsx(AlertItem, { markdown: true, type: "code", title: intl.formatMessage({
|
|
31
|
-
id: "gd.gen-ai.alert-proposal.summary.trigger.cron",
|
|
32
|
-
}), description: alertProposal.trigger.cron, objects: objects })) : null, alertProposal.trigger.timezone ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
33
|
-
id: "gd.gen-ai.alert-proposal.summary.trigger.timezone",
|
|
34
|
-
}), description: alertProposal.trigger.timezone, objects: objects })) : null] })
|
|
35
|
-
] })) : null, alertProposal.recipients?.length ? (_jsxs(_Fragment, { children: [
|
|
36
|
-
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.recipients" }) }), alertProposal.recipients.map((recipient, index) => (_jsx(UiTag, { label: recipient.name ?? recipient.id }, index)))] })) : null] })
|
|
21
|
+
_jsx(AlertItem, { markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.title" }), description: alertProposal.title, objects: objects }), _jsx(FiltersPreview, { ...props }), _jsx(NotificationChannelPreview, { ...props }), _jsx(DashboardPreview, { ...props })
|
|
22
|
+
] }), _jsx(AlertAttributes, { attributes: alertProposal.alert?.execution.attributes, objects: objects }), _jsx(ConditionsPreview, { ...props }), _jsx(TriggerPreview, { ...props }), _jsx(RecipientsPreview, { ...props })
|
|
23
|
+
] })
|
|
37
24
|
] }));
|
|
38
25
|
}
|
|
26
|
+
function FiltersPreview({ alertProposal, objects }) {
|
|
27
|
+
const intl = useIntl();
|
|
28
|
+
return (_jsx(_Fragment, { children: alertProposal?.alert?.execution.filters?.length ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.filters" }), description: alertProposal.alert.execution.filters.length.toString(), objects: objects })) : null }));
|
|
29
|
+
}
|
|
30
|
+
function DashboardPreview({ alertProposal }) {
|
|
31
|
+
const intl = useIntl();
|
|
32
|
+
return (_jsx(_Fragment, { children: alertProposal?.dashboard?.id ? (_jsx(AlertReference, { title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.dashboard" }), forceType: "dashboard", ref: { identifier: alertProposal.dashboard.id }, refTitle: alertProposal.dashboard.title ?? "" })) : null }));
|
|
33
|
+
}
|
|
34
|
+
function NotificationChannelPreview({ alertProposal, objects }) {
|
|
35
|
+
const intl = useIntl();
|
|
36
|
+
return (_jsx(_Fragment, { children: alertProposal?.notificationChannel && alertProposal.notificationChannelTitle ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
37
|
+
id: "gd.gen-ai.alert-proposal.summary.notification-channel",
|
|
38
|
+
}), description: alertProposal.notificationChannelTitle, objects: objects })) : null }));
|
|
39
|
+
}
|
|
40
|
+
function TriggerPreview({ alertProposal, objects }) {
|
|
41
|
+
const intl = useIntl();
|
|
42
|
+
return (_jsx(_Fragment, { children: alertProposal?.schedule || alertProposal?.alert ? (_jsxs(_Fragment, { children: [
|
|
43
|
+
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.trigger" }) }), _jsxs("ul", { children: [alertProposal.alert?.trigger.mode ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
44
|
+
id: "gd.gen-ai.alert-proposal.summary.trigger.mode",
|
|
45
|
+
}), description: alertProposal.alert.trigger.mode, objects: objects })) : null, alertProposal.alert?.trigger.interval ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
46
|
+
id: "gd.gen-ai.alert-proposal.summary.trigger.interval",
|
|
47
|
+
}), description: alertProposal.alert.trigger.interval, objects: objects })) : null, alertProposal.schedule?.cron ? (_jsx(AlertItem, { markdown: true, type: "code", title: intl.formatMessage({
|
|
48
|
+
id: "gd.gen-ai.alert-proposal.summary.trigger.cron",
|
|
49
|
+
}), description: alertProposal.schedule.cron, objects: objects })) : null, alertProposal.schedule?.timezone ? (_jsx(AlertItem, { bold: true, markdown: true, title: intl.formatMessage({
|
|
50
|
+
id: "gd.gen-ai.alert-proposal.summary.trigger.timezone",
|
|
51
|
+
}), description: alertProposal.schedule.timezone, objects: objects })) : null] })
|
|
52
|
+
] })) : null }));
|
|
53
|
+
}
|
|
54
|
+
function RecipientsPreview({ alertProposal }) {
|
|
55
|
+
const intl = useIntl();
|
|
56
|
+
return (_jsx(_Fragment, { children: alertProposal?.recipients?.length ? (_jsxs(_Fragment, { children: [
|
|
57
|
+
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.recipients" }) }), alertProposal.recipients.map((recipient, index) => (_jsx(UiTag, { label: recipient.name ?? recipient.id }, index)))] })) : null }));
|
|
58
|
+
}
|
|
59
|
+
function ConditionsPreview(props) {
|
|
60
|
+
const { alertProposal } = props;
|
|
61
|
+
const intl = useIntl();
|
|
62
|
+
if (alertProposal?.alert?.condition.type === "comparison") {
|
|
63
|
+
return (_jsxs(_Fragment, { children: [
|
|
64
|
+
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.condition-comparison" }) }), _jsx(ComparisonConditionPreview, { ...props, condition: alertProposal.alert.condition })
|
|
65
|
+
] }));
|
|
66
|
+
}
|
|
67
|
+
if (alertProposal?.alert?.condition.type === "relative") {
|
|
68
|
+
return (_jsxs(_Fragment, { children: [
|
|
69
|
+
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.condition-relative" }) }), _jsx(RelativeConditionPreview, { ...props, condition: alertProposal.alert.condition })
|
|
70
|
+
] }));
|
|
71
|
+
}
|
|
72
|
+
if (alertProposal?.alert?.condition.type === "anomalyDetection") {
|
|
73
|
+
return (_jsxs(_Fragment, { children: [
|
|
74
|
+
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({
|
|
75
|
+
id: "gd.gen-ai.alert-proposal.summary.condition-anomalyDetection",
|
|
76
|
+
}) }), _jsx(AnomalyConditionPreview, { ...props, condition: alertProposal.alert.condition })
|
|
77
|
+
] }));
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
function ComparisonConditionPreview({ condition, }) {
|
|
82
|
+
const { left, right, operator } = condition;
|
|
83
|
+
return (_jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-condition", children: [
|
|
84
|
+
_jsx(Operand, { item: left }), _jsx(Operator, { operator: operator }), _jsx(Operand, { item: right })
|
|
85
|
+
] }));
|
|
86
|
+
}
|
|
87
|
+
const adMessages = defineMessages({
|
|
88
|
+
["HOUR"]: {
|
|
89
|
+
id: "sdk.ui.genAi.alertProposal.granularity.hour",
|
|
90
|
+
},
|
|
91
|
+
["DAY"]: {
|
|
92
|
+
id: "sdk.ui.genAi.alertProposal.granularity.day",
|
|
93
|
+
},
|
|
94
|
+
["WEEK"]: {
|
|
95
|
+
id: "sdk.ui.genAi.alertProposal.granularity.week",
|
|
96
|
+
},
|
|
97
|
+
["MONTH"]: {
|
|
98
|
+
id: "sdk.ui.genAi.alertProposal.granularity.month",
|
|
99
|
+
},
|
|
100
|
+
["QUARTER"]: {
|
|
101
|
+
id: "sdk.ui.genAi.alertProposal.granularity.quarter",
|
|
102
|
+
},
|
|
103
|
+
["YEAR"]: {
|
|
104
|
+
id: "sdk.ui.genAi.alertProposal.granularity.year",
|
|
105
|
+
},
|
|
106
|
+
["LOW"]: {
|
|
107
|
+
id: "sdk.ui.genAi.alertProposal.senstivity.low",
|
|
108
|
+
},
|
|
109
|
+
["MEDIUM"]: {
|
|
110
|
+
id: "sdk.ui.genAi.alertProposal.senstivity.medium",
|
|
111
|
+
},
|
|
112
|
+
["HIGH"]: {
|
|
113
|
+
id: "sdk.ui.genAi.alertProposal.senstivity.high",
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
function AnomalyConditionPreview({ condition, }) {
|
|
117
|
+
const intl = useIntl();
|
|
118
|
+
const { measure, granularity, sensitivity, dataset } = condition;
|
|
119
|
+
return (_jsxs(_Fragment, { children: [dataset ? (_jsx("ul", { children: _jsx(AlertReference, { title: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.date" }), refTitle: isIdentifierRef(dataset) ? dataset.identifier : dataset.uri, ref: dataset, forceType: "date" }) })) : null, _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-anomaly", children: [
|
|
120
|
+
_jsx(Operand, { item: measure }), " ", _jsx(FormattedMessage, { id: adMessages[granularity].id, values: {
|
|
121
|
+
b: (c) => _jsx("strong", { children: c }),
|
|
122
|
+
} }), " ", _jsx(FormattedMessage, { id: adMessages[sensitivity].id, values: {
|
|
123
|
+
b: (c) => _jsx("strong", { children: c }),
|
|
124
|
+
} })] })
|
|
125
|
+
] }));
|
|
126
|
+
}
|
|
127
|
+
function RelativeConditionPreview({ condition, }) {
|
|
128
|
+
const { measure, threshold, operator } = condition;
|
|
129
|
+
return (_jsxs(_Fragment, { children: [
|
|
130
|
+
_jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-condition", children: [
|
|
131
|
+
_jsx(Operand, { item: measure.left }), _jsx(Operator, { operator: measure.operator }), _jsx(Operand, { item: measure.right })
|
|
132
|
+
] }), _jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-condition", children: [
|
|
133
|
+
_jsx(Operator, { operator: operator }), _jsx(Operand, { item: threshold, suffix: "%" })
|
|
134
|
+
] })
|
|
135
|
+
] }));
|
|
136
|
+
}
|
|
137
|
+
function Operand({ item, suffix, }) {
|
|
138
|
+
if (typeof item === "number") {
|
|
139
|
+
return (_jsxs("div", { className: "alertProposal-operand-number", children: [item, suffix] }));
|
|
140
|
+
}
|
|
141
|
+
const rf = objRefToTextContentObject({ identifier: item.id, type: "measure" }, item.title, "metric");
|
|
142
|
+
if (rf) {
|
|
143
|
+
return (_jsx("div", { className: "alertProposal-operand", children: _jsx(MarkdownComponent, { allowMarkdown: true, references: [rf], children: `{${rf.type}/${rf.id}}` }) }));
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
const operatorMessages = defineMessages({
|
|
148
|
+
["LESS_THAN"]: {
|
|
149
|
+
id: "sdk.ui.genAi.alertProposal.operator.lessThan",
|
|
150
|
+
},
|
|
151
|
+
["LESS_THAN_OR_EQUAL_TO"]: {
|
|
152
|
+
id: "sdk.ui.genAi.alertProposal.operator.lessThanOrEqualTo",
|
|
153
|
+
},
|
|
154
|
+
["GREATER_THAN"]: {
|
|
155
|
+
id: "sdk.ui.genAi.alertProposal.operator.greaterThan",
|
|
156
|
+
},
|
|
157
|
+
["GREATER_THAN_OR_EQUAL_TO"]: {
|
|
158
|
+
id: "sdk.ui.genAi.alertProposal.operator.greaterThanOrEqualTo",
|
|
159
|
+
},
|
|
160
|
+
["EQUAL_TO"]: {
|
|
161
|
+
id: "sdk.ui.genAi.alertProposal.operator.equalTo",
|
|
162
|
+
},
|
|
163
|
+
["INCREASES_BY"]: {
|
|
164
|
+
id: "sdk.ui.genAi.alertProposal.operator.increasesBy",
|
|
165
|
+
},
|
|
166
|
+
["DECREASES_BY"]: {
|
|
167
|
+
id: "sdk.ui.genAi.alertProposal.operator.decreasesBy",
|
|
168
|
+
},
|
|
169
|
+
["CHANGES_BY"]: {
|
|
170
|
+
id: "sdk.ui.genAi.alertProposal.operator.changesBy",
|
|
171
|
+
},
|
|
172
|
+
["DIFFERENCE"]: {
|
|
173
|
+
id: "sdk.ui.genAi.alertProposal.operator.difference",
|
|
174
|
+
},
|
|
175
|
+
["CHANGE"]: {
|
|
176
|
+
id: "sdk.ui.genAi.alertProposal.operator.change",
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
function Operator({ operator, }) {
|
|
180
|
+
const intl = useIntl();
|
|
181
|
+
return _jsx("div", { children: intl.formatMessage(operatorMessages[operator]) });
|
|
182
|
+
}
|
|
39
183
|
function AlertItem({ markdown, title, description, objects, bold, type = "normal" }) {
|
|
40
184
|
return (_jsxs("li", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item", children: [
|
|
41
185
|
_jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item-title", children: [title, ":"] }), _jsxs("div", { className: cx("gd-gen-ai-chat__conversation__item__content-alertProposal-item-description", {
|
|
@@ -51,14 +195,15 @@ function AlertReference({ title, ref, refTitle, format, forceType }) {
|
|
|
51
195
|
return (_jsxs("li", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item", children: [
|
|
52
196
|
_jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item-title", children: [title, ":"] }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item-description", children: _jsx(MarkdownComponent, { allowMarkdown: true, references: [rf], children: `{${rf.type}/${rf.id}}` }) }), format ? (_jsxs("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item-format", children: ["(", format, ")"] })) : null] }));
|
|
53
197
|
}
|
|
54
|
-
function AlertAttributes({
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
198
|
+
function AlertAttributes({ attributes, objects }) {
|
|
199
|
+
const intl = useIntl();
|
|
200
|
+
const rf = (attributes
|
|
201
|
+
?.map((attribute) => objRefToTextContentObject(attribute.attribute.displayForm, attribute.attribute.alias))
|
|
202
|
+
.filter(Boolean) ?? []);
|
|
58
203
|
if (rf.length === 0) {
|
|
59
204
|
return null;
|
|
60
205
|
}
|
|
61
|
-
return (_jsxs(
|
|
62
|
-
|
|
206
|
+
return (_jsxs(_Fragment, { children: [
|
|
207
|
+
_jsx(Typography, { tagName: "p", className: "gd-gen-ai-chat__conversation__item__content-alertProposal-subheader", children: intl.formatMessage({ id: "gd.gen-ai.alert-proposal.summary.attributes" }) }), _jsx("ul", { children: rf.map((rf, i) => (_jsx("li", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item", children: _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content-alertProposal-item-description", children: _jsx(MarkdownComponent, { allowMarkdown: true, references: [...(objects ?? []), rf], children: `{${rf.type}/${rf.id}}` }) }) }, i))) })
|
|
63
208
|
] }));
|
|
64
209
|
}
|
|
@@ -5,7 +5,7 @@ import { type IDashboardKeyDriverCombinationItem } from "@gooddata/sdk-ui-dashbo
|
|
|
5
5
|
import { type IChatConversationLocalItem } from "../../../model.js";
|
|
6
6
|
export type ConversationVisualisationProps = {
|
|
7
7
|
message: IChatConversationLocalItem;
|
|
8
|
-
visualization: IChatConversationVisualisationContent["visualization"]
|
|
8
|
+
visualization: NonNullable<IChatConversationVisualisationContent["visualization"]>;
|
|
9
9
|
colorPalette?: IColorPalette;
|
|
10
10
|
execConfig?: IExecutionConfig;
|
|
11
11
|
agGridToken?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationVisualisation.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualisation.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,
|
|
1
|
+
{"version":3,"file":"ConversationVisualisation.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualisation.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAEH,KAAK,aAAa,EAElB,KAAK,gBAAgB,EAOxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAInB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,4BAA4B,CAAC;AAiBpC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAwBpE,MAAM,MAAM,8BAA8B,GAAG;IACzC,OAAO,EAAE,0BAA0B,CAAC;IACpC,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,YAAY,CAAC,EAAE,CACX,IAAI,EAAE;QACF,aAAa,EAAE,kCAAkC,EAAE,CAAC;QACpD,KAAK,EAAE,WAAW,CAAC;KACtB,GAAG,IAAI,KACP,IAAI,CAAC;IACV,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACtC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,cAAqB,EACrB,oBAA4B,EAC5B,mBAA0B,EAC1B,4BAAoC,EACvC,EAAE,8BAA8B,2CAqPhC"}
|
|
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useMemo } from "react";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { useDispatch } from "react-redux";
|
|
6
|
-
import { isAttribute, isMeasure,
|
|
6
|
+
import { isAttribute, isMeasure, } from "@gooddata/sdk-model";
|
|
7
7
|
import { BarChart, ColumnChart, Headline, LineChart, PieChart, ScatterPlot } from "@gooddata/sdk-ui-charts";
|
|
8
8
|
import { getKdaKeyDriverCombinations, } from "@gooddata/sdk-ui-dashboard";
|
|
9
9
|
import { PivotTable } from "@gooddata/sdk-ui-pivot";
|
|
@@ -15,6 +15,7 @@ import { mapVisualizationForecastToBackendConfig, mapVisualizationForecastToChar
|
|
|
15
15
|
import { saveVisualisationRenderStatusAction, visualizationErrorAction, } from "../../../store/messages/messagesSlice.js";
|
|
16
16
|
import { getHeadlineComparison } from "../../../utils.js";
|
|
17
17
|
import { useExecution } from "./useExecution.js";
|
|
18
|
+
import { changeAnalysisDrills } from "./utils/changeAnalysisDrills.js";
|
|
18
19
|
const VIS_HEIGHT = 250;
|
|
19
20
|
const visualizationTooltipOptions = {
|
|
20
21
|
tooltip: {
|
|
@@ -34,27 +35,8 @@ export function ConversationVisualisation({ message, colorPalette, visualization
|
|
|
34
35
|
const { filters, sorts, buckets } = useExecution(visualization);
|
|
35
36
|
const bucketsData = useBucketData(buckets);
|
|
36
37
|
const drillableItems = useMemo(() => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return visualization.insight.buckets
|
|
40
|
-
.map((bucket) => {
|
|
41
|
-
return bucket.items.map(headerPredicate);
|
|
42
|
-
})
|
|
43
|
-
.flat();
|
|
44
|
-
}
|
|
45
|
-
return visualization.insight.buckets
|
|
46
|
-
.map((bucket) => {
|
|
47
|
-
return bucket.items.map((attr) => {
|
|
48
|
-
if (isAttribute(attr)) {
|
|
49
|
-
return attr.attribute.displayForm;
|
|
50
|
-
}
|
|
51
|
-
return undefined;
|
|
52
|
-
});
|
|
53
|
-
})
|
|
54
|
-
.flat()
|
|
55
|
-
.filter(Boolean);
|
|
56
|
-
}
|
|
57
|
-
return undefined;
|
|
38
|
+
const items = [...changeAnalysisDrills(visualization, enableDrilling, enableChangeAnalysis)];
|
|
39
|
+
return items.length ? items : undefined;
|
|
58
40
|
}, [enableChangeAnalysis, visualization, enableDrilling]);
|
|
59
41
|
const handleSdkError = useCallback((error) => {
|
|
60
42
|
if (!visualization) {
|
|
@@ -264,14 +246,6 @@ const renderHeadline = (locale, theme, buckets, filters, colorPalette, onError,
|
|
|
264
246
|
colorPalette,
|
|
265
247
|
}, drillableItems: props.drillableItems, onDrill: onDrill, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }) }));
|
|
266
248
|
};
|
|
267
|
-
function headerPredicate(m) {
|
|
268
|
-
return (header) => {
|
|
269
|
-
if (isMeasureDescriptor(header) && isMeasure(m)) {
|
|
270
|
-
return header.measureHeaderItem.localIdentifier === m.measure.localIdentifier;
|
|
271
|
-
}
|
|
272
|
-
return false;
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
249
|
function useBucketData(buckets) {
|
|
276
250
|
return useMemo(() => {
|
|
277
251
|
const metrics = buckets.find((b) => b.localIdentifier === "measures")?.items.filter(isMeasure) ?? [];
|
|
@@ -7,7 +7,7 @@ export type ConversationVisualizationContentProps = {
|
|
|
7
7
|
message: IChatConversationLocalItem;
|
|
8
8
|
part: IChatConversationMultipartLocalPart;
|
|
9
9
|
scenario?: IWhatIfRenderableScenario;
|
|
10
|
-
visualization: IChatConversationVisualisationContent["visualization"]
|
|
10
|
+
visualization: NonNullable<IChatConversationVisualisationContent["visualization"]>;
|
|
11
11
|
colorPalette?: IColorPalette;
|
|
12
12
|
className?: string;
|
|
13
13
|
agGridToken?: string;
|
|
@@ -26,7 +26,16 @@ export declare const ConversationVisualizationContent: import("react-redux").Con
|
|
|
26
26
|
message: IChatConversationLocalItem;
|
|
27
27
|
part: IChatConversationMultipartLocalPart;
|
|
28
28
|
scenario?: IWhatIfRenderableScenario | undefined;
|
|
29
|
-
visualization: import("@gooddata/sdk-model").
|
|
29
|
+
visualization: import("@gooddata/sdk-model").IInsightDefinition & {
|
|
30
|
+
insight: import("@gooddata/sdk-model").IAuditableDates & import("@gooddata/sdk-model").IAuditableUsers & {
|
|
31
|
+
identifier: string;
|
|
32
|
+
uri: string;
|
|
33
|
+
ref: import("@gooddata/sdk-model").ObjRef;
|
|
34
|
+
isLocked?: boolean | undefined;
|
|
35
|
+
isHidden?: boolean | undefined;
|
|
36
|
+
certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
30
39
|
className?: string | undefined;
|
|
31
40
|
}>;
|
|
32
41
|
export {};
|
package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,KAAK,aAAa,EAAgD,MAAM,qBAAqB,CAAC;AAwBvG,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAM9G,OAAO,EAEH,0BAA0B,EAC7B,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAwBlF,MAAM,MAAM,qCAAqC,GAAG;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,aAAa,EAAE,qCAAqC,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,KAAK,aAAa,EAAgD,MAAM,qBAAqB,CAAC;AAwBvG,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAM9G,OAAO,EAEH,0BAA0B,EAC7B,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAwBlF,MAAM,MAAM,qCAAqC,GAAG;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,oBAAoB,CAAC,EAAE,OAAO,0BAA0B,CAAC;IACzD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,iBAAS,oCAAoC,CAAC,EAC1C,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,4BAA4B,EAC/B,EAAE,qCAAqC,2CAmGvC;AAmlBD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;EAGN,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { saveVisualizationAction, savedVisualizationAction } from "../../../stor
|
|
|
4
4
|
export type SaveVisualizationDialogProps = {
|
|
5
5
|
message: IChatConversationLocalItem;
|
|
6
6
|
part: IChatConversationMultipartLocalPart;
|
|
7
|
-
visualization: IChatConversationVisualisationContent["visualization"]
|
|
7
|
+
visualization: NonNullable<IChatConversationVisualisationContent["visualization"]>;
|
|
8
8
|
type: "save" | "explore";
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
};
|
|
@@ -18,7 +18,16 @@ export declare const SaveVisualizationDialog: import("react-redux").ConnectedCom
|
|
|
18
18
|
store?: import("redux").Store<any, import("redux").UnknownAction, unknown> | undefined;
|
|
19
19
|
message: IChatConversationLocalItem;
|
|
20
20
|
part: IChatConversationMultipartLocalPart;
|
|
21
|
-
visualization: import("@gooddata/sdk-model").
|
|
21
|
+
visualization: import("@gooddata/sdk-model").IInsightDefinition & {
|
|
22
|
+
insight: import("@gooddata/sdk-model").IAuditableDates & import("@gooddata/sdk-model").IAuditableUsers & {
|
|
23
|
+
identifier: string;
|
|
24
|
+
uri: string;
|
|
25
|
+
ref: import("@gooddata/sdk-model").ObjRef;
|
|
26
|
+
isLocked?: boolean | undefined;
|
|
27
|
+
isHidden?: boolean | undefined;
|
|
28
|
+
certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
22
31
|
type: "explore" | "save";
|
|
23
32
|
onClose: () => void;
|
|
24
33
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveVisualizationDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/SaveVisualizationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAE7G,MAAM,MAAM,4BAA4B,GAAG;IACvC,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,aAAa,EAAE,qCAAqC,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SaveVisualizationDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/SaveVisualizationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAE7G,MAAM,MAAM,4BAA4B,GAAG;IACvC,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IAC/C,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;CAC7D,CAAC;AAEF,iBAAS,2BAA2B,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EAC3B,EAAE,4BAA4B,GAAG,oCAAoC,2CAkDrE;AA8DD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;EAAiE,CAAC"}
|
|
@@ -4,5 +4,5 @@ export interface IExecution {
|
|
|
4
4
|
filters: IFilter[];
|
|
5
5
|
sorts: ISortItem[];
|
|
6
6
|
}
|
|
7
|
-
export declare const useExecution: (visualisation?: import("@gooddata/sdk-model").IInsight | undefined) => IExecution;
|
|
7
|
+
export declare const useExecution: (visualisation?: import("@gooddata/sdk-model").IInsight | null | undefined) => IExecution;
|
|
8
8
|
//# sourceMappingURL=useExecution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExecution.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/useExecution.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEjF,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"useExecution.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/useExecution.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEjF,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,2FAiBxB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type IChatConversationVisualisationContent } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type IHeaderPredicate } from "@gooddata/sdk-ui";
|
|
3
|
+
export declare function changeAnalysisDrills(visualization: IChatConversationVisualisationContent["visualization"] | undefined, enableDrilling: boolean, enableChangeAnalysis: boolean): IHeaderPredicate[];
|
|
4
|
+
//# sourceMappingURL=changeAnalysisDrills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeAnalysisDrills.d.ts","sourceRoot":"","sources":["../../../../../src/components/messages/conversationContents/utils/changeAnalysisDrills.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAEvF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,wBAAgB,oBAAoB,CAChC,aAAa,EAAE,qCAAqC,CAAC,eAAe,CAAC,GAAG,SAAS,EACjF,cAAc,EAAE,OAAO,EACvB,oBAAoB,EAAE,OAAO,sBAuBhC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { isMeasure, isMeasureDescriptor } from "@gooddata/sdk-model";
|
|
3
|
+
export function changeAnalysisDrills(visualization, enableDrilling, enableChangeAnalysis) {
|
|
4
|
+
if (visualization?.insight && enableChangeAnalysis && enableDrilling) {
|
|
5
|
+
const disableKeyDriveAnalysisOn = (visualization.insight.properties?.["controls"]
|
|
6
|
+
?.disableKeyDriveAnalysisOn ?? {});
|
|
7
|
+
return visualization.insight.buckets
|
|
8
|
+
.flatMap((bucket) => {
|
|
9
|
+
return bucket.items.map((item) => {
|
|
10
|
+
if (isMeasure(item)) {
|
|
11
|
+
//NOTE: If KDA is disabled for this measure
|
|
12
|
+
// do not return a drill predicate to disable drilling
|
|
13
|
+
if (disableKeyDriveAnalysisOn[item.measure.localIdentifier]) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return headerPredicate(item);
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
});
|
|
20
|
+
})
|
|
21
|
+
.filter((p) => !!p);
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
function headerPredicate(m) {
|
|
26
|
+
return (header) => {
|
|
27
|
+
if (isMeasureDescriptor(header) && isMeasure(m)) {
|
|
28
|
+
return header.measureHeaderItem.localIdentifier === m.measure.localIdentifier;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
}
|