@gooddata/sdk-ui-gen-ai 11.61.0-alpha.0 → 11.61.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/esm/components/GenAIChat.d.ts.map +1 -1
- package/esm/components/GenAIChat.js +3 -2
- package/esm/components/GenAIChatContextIndicator.d.ts +3 -3
- package/esm/components/GenAIChatContextIndicator.d.ts.map +1 -1
- package/esm/components/GenAIChatContextIndicator.js +8 -4
- package/esm/components/GenAIStandaloneInput.d.ts.map +1 -1
- package/esm/components/GenAIStandaloneInput.js +3 -2
- package/esm/components/GenAiConversations.d.ts.map +1 -1
- package/esm/components/GenAiConversations.js +2 -0
- package/esm/components/GenAiStore.d.ts +0 -6
- package/esm/components/GenAiStore.d.ts.map +1 -1
- package/esm/components/GenAiStore.js +1 -2
- package/esm/components/hooks/useContextChangeAnnouncement.d.ts.map +1 -1
- package/esm/components/hooks/useContextChangeAnnouncement.js +1 -0
- package/esm/components/hooks/useContextItems.d.ts +2 -2
- package/esm/components/hooks/useDataLoad.d.ts +2 -0
- package/esm/components/hooks/useDataLoad.d.ts.map +1 -0
- package/esm/components/hooks/useDataLoad.js +14 -0
- package/esm/components/messages/contents/CustomHyperlink.js +2 -2
- package/esm/components/messages/conversationContents/ConversationVisualisation.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualisation.js +7 -4
- package/esm/components/messages/conversationContents/useSaveCheck.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/useSaveCheck.js +13 -7
- package/esm/components/utils/icons.d.ts.map +1 -1
- package/esm/components/utils/icons.js +10 -0
- package/esm/context/addContextReference.d.ts.map +1 -1
- package/esm/context/addContextReference.js +13 -0
- package/esm/context/build.d.ts.map +1 -1
- package/esm/context/build.js +11 -1
- package/esm/context/collectContextReferences.d.ts.map +1 -1
- package/esm/context/collectContextReferences.js +17 -0
- package/esm/context/removeContextReference.d.ts.map +1 -1
- package/esm/context/removeContextReference.js +4 -0
- package/esm/context/selectContextReferences.d.ts.map +1 -1
- package/esm/context/selectContextReferences.js +28 -29
- package/esm/hooks/useGenAIStore.d.ts +0 -2
- package/esm/hooks/useGenAIStore.d.ts.map +1 -1
- package/esm/hooks/useGenAIStore.js +3 -11
- package/esm/index.d.ts +0 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +4 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +5 -1
- package/esm/sdk-ui-gen-ai.d.ts +0 -10
- package/esm/store/chatWindow/chatWindowSelectors.d.ts.map +1 -1
- package/esm/store/chatWindow/chatWindowSelectors.js +3 -1
- package/esm/store/chatWindow/chatWindowSlice.d.ts +1 -1
- package/esm/store/chatWindow/chatWindowSlice.d.ts.map +1 -1
- package/esm/store/chatWindow/chatWindowSlice.js +2 -1
- package/esm/store/sideEffects/converters/toLocalContent.d.ts.map +1 -1
- package/esm/store/sideEffects/converters/toLocalContent.js +14 -0
- package/esm/store/sideEffects/index.d.ts +1 -2
- package/esm/store/sideEffects/index.d.ts.map +1 -1
- package/esm/store/sideEffects/index.js +4 -11
- package/esm/store/store.d.ts +1 -2
- package/esm/store/store.d.ts.map +1 -1
- package/esm/store/store.js +2 -2
- package/esm/types.d.ts +6 -6
- package/esm/types.d.ts.map +1 -1
- package/package.json +20 -20
- package/styles/css/input.css +1 -1
- package/styles/css/main.css +10702 -1
- package/styles/css/main.css.map +1 -1
- package/styles/scss/input.scss +1 -1
- package/styles/scss/main.scss +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAO7E,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IAEvE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAEtD;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAyDxD;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { ConfigProvider } from "./ConfigContext.js";
|
|
|
9
9
|
import { CustomizationProvider } from "./CustomizationProvider.js";
|
|
10
10
|
import { GenAIChatWrapper } from "./GenAIChatWrapper.js";
|
|
11
11
|
import { GenAiStore } from "./GenAiStore.js";
|
|
12
|
-
|
|
12
|
+
import { useDataLoad } from "./hooks/useDataLoad.js";
|
|
13
13
|
/**
|
|
14
14
|
* UI component that renders the Gen AI assistant.
|
|
15
15
|
* @public
|
|
@@ -18,7 +18,7 @@ export function GenAIAssistant(props) {
|
|
|
18
18
|
const { backend, workspace, locale, colorPalette, eventHandlers, settings, objectTypes, catalogItems, dashboards, visualizations, includeTags, excludeTags, isPreview, allowInteractionIntelligence, providedStore, onDispatcher, onLinkClick, mode, allowNativeLinks, } = props;
|
|
19
19
|
const effectiveBackend = useBackendStrict(backend);
|
|
20
20
|
const effectiveWorkspace = useWorkspaceStrict(workspace);
|
|
21
|
-
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, colorPalette: colorPalette, mode: mode, eventHandlers: eventHandlers, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, dashboards: dashboards, visualizations: visualizations, isPreview: isPreview, allowInteractionIntelligence: allowInteractionIntelligence, providedStore: providedStore,
|
|
21
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, colorPalette: colorPalette, mode: mode, eventHandlers: eventHandlers, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, dashboards: dashboards, visualizations: visualizations, isPreview: isPreview, allowInteractionIntelligence: allowInteractionIntelligence, providedStore: providedStore, children: _jsx(BackendProvider, { backend: effectiveBackend, children: _jsx(WorkspaceProvider, { workspace: effectiveWorkspace, children: _jsx(PermissionsProvider, { children: _jsx(GenAIContent, { ...props }) }) }) }) }) }));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* UI component that renders the Gen AI chat.
|
|
@@ -30,5 +30,6 @@ function GenAIContent(props) {
|
|
|
30
30
|
const { slots, dashboardSelector, className, catalogItems } = props;
|
|
31
31
|
const { permissions, loading } = usePermissions();
|
|
32
32
|
useDashboardAmbientContext(dashboardSelector);
|
|
33
|
+
useDataLoad();
|
|
33
34
|
return (_jsx(ConfigProvider, { catalogItems: catalogItems, canFullControl: props.disableFullControl ? false : (permissions.canManageProject ?? false), canManage: props.disableManage ? false : (permissions.canManageProject ?? false), canAnalyze: props.disableAnalyze ? false : (permissions.canAnalyzeWorkspace ?? false), children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(GenAIChatWrapper, { initializing: loading, className: className }) }) }));
|
|
34
35
|
}
|
|
@@ -3,9 +3,9 @@ type GenAIChatContextIndicatorOwnProps = {
|
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
5
|
* Shows what ambient context the assistant is answering about — the open dashboard and its live
|
|
6
|
-
* filters (e.g. "Answering about: Revenue Dashboard · Region: Europe · Q1 2026")
|
|
7
|
-
* when no ambient dashboard context is present. Re-renders whenever
|
|
8
|
-
* so filter changes on the dashboard are reflected immediately.
|
|
6
|
+
* filters (e.g. "Answering about: Revenue Dashboard · Region: Europe · Q1 2026"), or the open
|
|
7
|
+
* report. Renders nothing when no ambient dashboard or report context is present. Re-renders whenever
|
|
8
|
+
* the host re-syncs the context, so filter changes on the dashboard are reflected immediately.
|
|
9
9
|
*
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatContextIndicator.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatContextIndicator.tsx"],"names":[],"mappings":"AAoDA,KAAK,iCAAiC,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE,iCAAiC,
|
|
1
|
+
{"version":3,"file":"GenAIChatContextIndicator.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatContextIndicator.tsx"],"names":[],"mappings":"AAoDA,KAAK,iCAAiC,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,QAAQ,EAAE,EAAE,iCAAiC,kDAkMxF"}
|
|
@@ -36,9 +36,9 @@ const msgs = defineMessages({
|
|
|
36
36
|
});
|
|
37
37
|
/**
|
|
38
38
|
* Shows what ambient context the assistant is answering about — the open dashboard and its live
|
|
39
|
-
* filters (e.g. "Answering about: Revenue Dashboard · Region: Europe · Q1 2026")
|
|
40
|
-
* when no ambient dashboard context is present. Re-renders whenever
|
|
41
|
-
* so filter changes on the dashboard are reflected immediately.
|
|
39
|
+
* filters (e.g. "Answering about: Revenue Dashboard · Region: Europe · Q1 2026"), or the open
|
|
40
|
+
* report. Renders nothing when no ambient dashboard or report context is present. Re-renders whenever
|
|
41
|
+
* the host re-syncs the context, so filter changes on the dashboard are reflected immediately.
|
|
42
42
|
*
|
|
43
43
|
* @internal
|
|
44
44
|
*/
|
|
@@ -76,6 +76,7 @@ export function GenAIChatContextIndicator({ onUpdate }) {
|
|
|
76
76
|
setSearch("");
|
|
77
77
|
}, [setSearch]);
|
|
78
78
|
const isSelected = Boolean(selectedContext || references.length > 0);
|
|
79
|
+
const ambientToggleLabel = intl.formatMessage(selectedContext?.activated ? msgs.stopUsingContext : msgs.startUsingContext);
|
|
79
80
|
const announcement = useContextChangeAnnouncement(selectedContext, references);
|
|
80
81
|
if (!isContextSetupEnabled || !isSelected) {
|
|
81
82
|
return null;
|
|
@@ -114,7 +115,10 @@ export function GenAIChatContextIndicator({ onUpdate }) {
|
|
|
114
115
|
activated: true,
|
|
115
116
|
}));
|
|
116
117
|
onUpdate?.();
|
|
117
|
-
} })) })) :
|
|
118
|
+
} })) })) : selectedContext?.report ? (_jsx(UiChip, { isActionable: true, isExpandable: false, ...getIconByObject(selectedContext.report), label: selectedContext.report.title || emptyReferenceLabel, iconAction: selectedContext.activated ? "visible" : "invisible", actionIconTooltip: ambientToggleLabel, tooltip: intl.formatMessage(msgs.context), variant: selectedContext.activated ? "normal" : "inactive", onClick: onAmbientToggleHandler(), onAction: onAmbientToggleHandler(), accessibilityConfig: {
|
|
119
|
+
iconBeforeAriaLabel: getTypeLabel(selectedContext.report.type, intl),
|
|
120
|
+
actionAriaLabel: ambientToggleLabel,
|
|
121
|
+
} })) : null, references.length > 0
|
|
118
122
|
? references.map((reference, index) => (_jsx(UiChip, { isDisabled: true, isDeletable: true, ...getIconByObject(reference), label: reference.title, isExpandable: false, onDelete: onDeleteHandler(reference), accessibilityConfig: {
|
|
119
123
|
deleteAriaLabel: intl.formatMessage(msgs.remove, {
|
|
120
124
|
title: reference.title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIStandaloneInput.d.ts","sourceRoot":"","sources":["../../src/components/GenAIStandaloneInput.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAIStandaloneInput.d.ts","sourceRoot":"","sources":["../../src/components/GenAIStandaloneInput.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAYnE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACxE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACvC,CAAC;AAsGF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAcpE"}
|
|
@@ -12,6 +12,7 @@ import { CustomizationProvider } from "./CustomizationProvider.js";
|
|
|
12
12
|
import { GenAiChatAgentSwitching } from "./GenAiChatAgentSwitching.js";
|
|
13
13
|
import { GenAiStore } from "./GenAiStore.js";
|
|
14
14
|
import { useHighlight } from "./highlight/useHighlight.js";
|
|
15
|
+
import { useDataLoad } from "./hooks/useDataLoad.js";
|
|
15
16
|
import { useFullscreenCheck } from "./hooks/useFullscreenCheck.js";
|
|
16
17
|
import { useInputAutofocus } from "./hooks/useInputAutofocus.js";
|
|
17
18
|
const msgs = defineMessages({
|
|
@@ -24,6 +25,7 @@ function StandaloneInputContent({ onStart, onAgentSet, onAgentsLoaded, className
|
|
|
24
25
|
const [value, setValue] = useState("");
|
|
25
26
|
const [editorApi, setApi] = useState(null);
|
|
26
27
|
const { selectedAgentId, agentSwitchingEnabled, agents } = useGenAIStandaloneInputData(requiredSkills);
|
|
28
|
+
useDataLoad();
|
|
27
29
|
useEffect(() => {
|
|
28
30
|
if (selectedAgentId) {
|
|
29
31
|
onAgentSet?.(selectedAgentId);
|
|
@@ -67,7 +69,6 @@ function StandaloneInputContent({ onStart, onAgentSet, onAgentsLoaded, className
|
|
|
67
69
|
"gd-gen-ai-chat__input--agent-switching": agentSwitchingEnabled,
|
|
68
70
|
}), children: _jsx("div", { className: "gd-gen-ai-chat__input__content", children: _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(SyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: placeholder ?? intl.formatMessage(msgs.placeholder), value: value, onApi: setApi, onChange: setValue, onKeyDown: handleKeyDown, beforeExtensions: beforeExtensions, extensions: extensions, onCompletion: onCompletion }) }), _jsx(GenAiChatAgentSwitching, { agentsOverride: agents, disabled: !value.trim(), agentDropdownDisabled: false, isAssistantLoading: false, isConversationsLoading: false, handleSubmit: handleSubmit })] }) }) }));
|
|
69
71
|
}
|
|
70
|
-
const DEPENDENCIES_TO_LOAD = ["catalogItems", "agents"];
|
|
71
72
|
/**
|
|
72
73
|
* @internal
|
|
73
74
|
*/
|
|
@@ -75,5 +76,5 @@ export function GenAIStandaloneInput(props) {
|
|
|
75
76
|
const { backend, workspace, locale, slots, ...rest } = props;
|
|
76
77
|
const effectiveBackend = useBackendStrict(backend);
|
|
77
78
|
const effectiveWorkspace = useWorkspaceStrict(workspace);
|
|
78
|
-
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { ...props, backend: effectiveBackend, workspace: effectiveWorkspace,
|
|
79
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { ...props, backend: effectiveBackend, workspace: effectiveWorkspace, children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(StandaloneInputContent, { ...rest }) }) }) }));
|
|
79
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAiConversations.d.ts","sourceRoot":"","sources":["../../src/components/GenAiConversations.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAY1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAiConversations.d.ts","sourceRoot":"","sources":["../../src/components/GenAiConversations.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAY1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAInE;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACtE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACtE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAiDhE"}
|
|
@@ -14,6 +14,7 @@ import { ConfigProvider } from "./ConfigContext.js";
|
|
|
14
14
|
import { CustomizationProvider } from "./CustomizationProvider.js";
|
|
15
15
|
import { GenAIChatConversations } from "./GenAIChatConversations.js";
|
|
16
16
|
import { GenAiStore } from "./GenAiStore.js";
|
|
17
|
+
import { useDataLoad } from "./hooks/useDataLoad.js";
|
|
17
18
|
import { useThreadLoading } from "./hooks/useThreadLoading.js";
|
|
18
19
|
/**
|
|
19
20
|
* UI component that renders the Gen AI assistant.
|
|
@@ -30,6 +31,7 @@ function GenAIConversationsContent(props) {
|
|
|
30
31
|
const dispatch = useDispatch();
|
|
31
32
|
const settings = useSelector(settingsSelector);
|
|
32
33
|
const { loading } = usePermissions();
|
|
34
|
+
useDataLoad();
|
|
33
35
|
const classNames = cx("gd-gen-ai-chat__embed__conversations", className);
|
|
34
36
|
const loadThread = useCallback(() => {
|
|
35
37
|
dispatch(loadThreadAction());
|
|
@@ -3,7 +3,6 @@ import { type EnhancedStore, type Store } from "@reduxjs/toolkit";
|
|
|
3
3
|
import { type IAnalyticalBackend, type IUserWorkspaceSettings } from "@gooddata/sdk-backend-spi";
|
|
4
4
|
import { type CatalogItem, type GenAIObjectType, type IColorPalette, type IInsight, type IListedDashboard } from "@gooddata/sdk-model";
|
|
5
5
|
import { type ChatEventHandler } from "../store/events.js";
|
|
6
|
-
import { type GenAIInitializeOnStart } from "../types.js";
|
|
7
6
|
import { type GenAIAssistantDisplayMode, type GenAIAssistantMode, type LinkHandlerEvent } from "./ConfigContext.js";
|
|
8
7
|
/**
|
|
9
8
|
* Props for the GenAiStore component.
|
|
@@ -110,11 +109,6 @@ export type GenAiStoreProps = {
|
|
|
110
109
|
* @internal
|
|
111
110
|
*/
|
|
112
111
|
allowInteractionIntelligence?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* @internal
|
|
115
|
-
* Whether to load the Gen AI store on start.
|
|
116
|
-
*/
|
|
117
|
-
initializeOnStart?: GenAIInitializeOnStart;
|
|
118
112
|
};
|
|
119
113
|
/**
|
|
120
114
|
* Provides the Gen AI store to the application.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAiStore.d.ts","sourceRoot":"","sources":["../../src/components/GenAiStore.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAiStore.d.ts","sourceRoot":"","sources":["../../src/components/GenAiStore.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,OAAO,EAEH,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACxB,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC;IAEjE;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAmDhD"}
|
|
@@ -75,7 +75,7 @@ function InjectedStore({ onDispatcher, children, currentStore, onLinkClick, }) {
|
|
|
75
75
|
const content = typeof children === "function" ? children(currentStore) : children;
|
|
76
76
|
return _jsx(StoreProvider, { store: currentStore, children: content });
|
|
77
77
|
}
|
|
78
|
-
function InternalStore({ backend, workspace, onDispatcher, children, eventHandlers, settings, catalogItems, dashboards, visualizations, includeTags, excludeTags, objectTypes, allowNativeLinks, onLinkClick, mode, isPreview, allowInteractionIntelligence, colorPalette,
|
|
78
|
+
function InternalStore({ backend, workspace, onDispatcher, children, eventHandlers, settings, catalogItems, dashboards, visualizations, includeTags, excludeTags, objectTypes, allowNativeLinks, onLinkClick, mode, isPreview, allowInteractionIntelligence, colorPalette, }) {
|
|
79
79
|
const effectiveBackend = useBackendStrict(backend);
|
|
80
80
|
const effectiveWorkspace = useWorkspaceStrict(workspace);
|
|
81
81
|
const genAIStore = useGenAIStore(effectiveBackend, effectiveWorkspace, {
|
|
@@ -89,7 +89,6 @@ function InternalStore({ backend, workspace, onDispatcher, children, eventHandle
|
|
|
89
89
|
dashboards,
|
|
90
90
|
visualizations,
|
|
91
91
|
isPreview,
|
|
92
|
-
initializeOnStart,
|
|
93
92
|
allowInteractionIntelligence,
|
|
94
93
|
allowNativeLinks,
|
|
95
94
|
onLinkClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextChangeAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextChangeAnnouncement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAmBhF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CACxC,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,UAAU,EAAE,mBAAmB,EAAE,GAClC,MAAM,
|
|
1
|
+
{"version":3,"file":"useContextChangeAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useContextChangeAnnouncement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAmBhF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CACxC,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,UAAU,EAAE,mBAAmB,EAAE,GAClC,MAAM,CA8BR"}
|
|
@@ -30,6 +30,7 @@ export function useContextChangeAnnouncement(selected, references) {
|
|
|
30
30
|
const previous = previousReferences.current;
|
|
31
31
|
const all = [
|
|
32
32
|
...(selected?.activated && selected.dashboard ? [selected.dashboard] : []),
|
|
33
|
+
...(selected?.activated && selected.report ? [selected.report] : []),
|
|
33
34
|
...(selected?.activated && selected.visualization ? [selected.visualization] : []),
|
|
34
35
|
...references,
|
|
35
36
|
];
|
|
@@ -14,8 +14,8 @@ export declare function useAmbientContextItems(ambientContext: IGenAIUserContext
|
|
|
14
14
|
ref: ObjRef;
|
|
15
15
|
title: string;
|
|
16
16
|
nesting: number;
|
|
17
|
-
type: import("@gooddata/sdk-model").GenAIObjectType | "widget";
|
|
18
|
-
where: "view.dashboard" | "referencedObjects";
|
|
17
|
+
type: import("@gooddata/sdk-model").GenAIObjectType | "widget" | "report";
|
|
18
|
+
where: "view.dashboard" | "view.report" | "referencedObjects";
|
|
19
19
|
context?: import("@gooddata/sdk-model").IGenAIObjectReference;
|
|
20
20
|
insightRef?: ObjRef;
|
|
21
21
|
visualizationUrl?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDataLoad.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useDataLoad.ts"],"names":[],"mappings":"AASA,wBAAgB,WAAW,SAS1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
4
|
+
import { settingsSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
5
|
+
import { loadDataAction } from "../../store/chatWindow/chatWindowSlice.js";
|
|
6
|
+
export function useDataLoad() {
|
|
7
|
+
const dispatch = useDispatch();
|
|
8
|
+
const settings = useSelector(settingsSelector);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (settings) {
|
|
11
|
+
dispatch(loadDataAction());
|
|
12
|
+
}
|
|
13
|
+
}, [dispatch, settings]);
|
|
14
|
+
}
|
|
@@ -90,8 +90,8 @@ const getItemUrl = (workspaceId, id, objectType, enableShellApplication_dashboar
|
|
|
90
90
|
case "metric":
|
|
91
91
|
return `/workspace/${workspaceId}/metrics/metric/${id}`;
|
|
92
92
|
case "report":
|
|
93
|
-
// Encoded like the
|
|
94
|
-
return `/workspace/${workspaceId}/
|
|
93
|
+
// Encoded like the Publisher app's own route builder, so an id with a slash stays one segment.
|
|
94
|
+
return `/workspace/${workspaceId}/publisher/report/${encodeURIComponent(id)}`;
|
|
95
95
|
default:
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
@@ -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,EAGH,KAAK,aAAa,EAElB,KAAK,gBAAgB,EAGrB,KAAK,WAAW,EASnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAInB,MAAM,kBAAkB,CAAC;AAwB1B,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AA2CpE,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,WAAW,CAAC;IACzB,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,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACtC,OAAO,EACP,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,cAAqB,EACrB,oBAA4B,EAC5B,yBAAiC,EACjC,mBAA0B,EAC1B,4BAAoC,GACvC,EAAE,8BAA8B,
|
|
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,EAGH,KAAK,aAAa,EAElB,KAAK,gBAAgB,EAGrB,KAAK,WAAW,EASnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAInB,MAAM,kBAAkB,CAAC;AAwB1B,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AA2CpE,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,WAAW,CAAC;IACzB,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,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EACtC,OAAO,EACP,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,cAAqB,EACrB,oBAA4B,EAC5B,yBAAiC,EACjC,mBAA0B,EAC1B,4BAAoC,GACvC,EAAE,8BAA8B,2CAmdhC"}
|
|
@@ -119,7 +119,7 @@ export function ConversationVisualisation({ message, colorPalette, separators, v
|
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
121
|
if (isTable) {
|
|
122
|
-
return renderTable(intl.locale, bucketsData, filters, sorts, handleSdkError, handleSuccess, handlerDrill, {
|
|
122
|
+
return renderTable(intl.locale, visualization, bucketsData, filters, sorts, handleSdkError, handleSuccess, handlerDrill, {
|
|
123
123
|
drillableItems,
|
|
124
124
|
enableChangeAnalysis,
|
|
125
125
|
enableNewPivotTable,
|
|
@@ -208,7 +208,7 @@ export function ConversationVisualisation({ message, colorPalette, separators, v
|
|
|
208
208
|
separators,
|
|
209
209
|
});
|
|
210
210
|
case "local:table":
|
|
211
|
-
return renderTable(intl.locale, bucketsData, filters, sorts, handleSdkError, handleSuccess, handlerDrill, {
|
|
211
|
+
return renderTable(intl.locale, visualization, bucketsData, filters, sorts, handleSdkError, handleSuccess, handlerDrill, {
|
|
212
212
|
drillableItems,
|
|
213
213
|
enableChangeAnalysis,
|
|
214
214
|
enableNewPivotTable,
|
|
@@ -514,12 +514,15 @@ const renderChoroplethChart = (locale, buckets, filters, sortBy, colorPalette, o
|
|
|
514
514
|
cooperativeGestures: true,
|
|
515
515
|
}, drillableItems: props.drillableItems, onDrill: onDrill, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }) }));
|
|
516
516
|
};
|
|
517
|
-
const renderTable = (locale, buckets, filters, sortBy, onError, onSuccess, onDrill, props) => {
|
|
517
|
+
const renderTable = (locale, visualization, buckets, filters, sortBy, onError, onSuccess, onDrill, props) => {
|
|
518
518
|
const TableComponent = props.enableNewPivotTable ? PivotTableNext : PivotTable;
|
|
519
519
|
const { metrics, attribute, trend, view, stack, segment, columns, location, area, size, color } = buckets;
|
|
520
520
|
const geoMeasures = [...size, ...color].filter(isMeasure);
|
|
521
521
|
const geoAttributes = [...size, ...color].filter(isAttribute);
|
|
522
|
-
|
|
522
|
+
const isRepeater = visualization.insight.visualizationUrl === "local:repeater";
|
|
523
|
+
const repeaterMeasures = isRepeater ? columns.filter(isMeasure) : [];
|
|
524
|
+
const columnAttributes = isRepeater ? [] : columns.filter(isAttribute);
|
|
525
|
+
return (_jsx(TableComponent, { locale: locale, measures: [...metrics, ...repeaterMeasures, ...geoMeasures], filters: filters, sortBy: sortBy, columns: [...columnAttributes, ...stack, ...segment].filter(Boolean), rows: [...attribute, ...trend, ...view, ...location, ...area, ...geoAttributes].filter(Boolean), config: props.enableNewPivotTable
|
|
523
526
|
? { agGridToken: props.agGridToken, separators: props.separators }
|
|
524
527
|
: { separators: props.separators }, drillableItems: props.drillableItems, onDrill: onDrill, onError: onError, onExportReady: onSuccess, execConfig: props.execConfig }));
|
|
525
528
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSaveCheck.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/useSaveCheck.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAE7E,wBAAgB,YAAY,CACxB,IAAI,EAAE,mCAAmC,EACzC,aAAa,EAAE,QAAQ,GAAG,SAAS,EACnC,GAAG,EAAE,OAAO;;;
|
|
1
|
+
{"version":3,"file":"useSaveCheck.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/useSaveCheck.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAE7E,wBAAgB,YAAY,CACxB,IAAI,EAAE,mCAAmC,EACzC,aAAa,EAAE,QAAQ,GAAG,SAAS,EACnC,GAAG,EAAE,OAAO;;;EA+Bf"}
|
|
@@ -5,16 +5,22 @@ export function useSaveCheck(part, visualization, run) {
|
|
|
5
5
|
const workspaceId = useWorkspaceStrict();
|
|
6
6
|
const { result, status, error } = useCancelablePromise({
|
|
7
7
|
promise: async () => {
|
|
8
|
-
|
|
8
|
+
const saveInProgress = part.saving?.started && !part.saving?.completed;
|
|
9
|
+
if (!workspaceId || !visualization || !run || saveInProgress) {
|
|
9
10
|
return false;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
// A chart the user has not saved yet does not exist in metadata. The filtered list
|
|
13
|
+
// answers that with an empty result instead of a 404, which the backend would log
|
|
14
|
+
// to the console as an error.
|
|
15
|
+
const res = await backend
|
|
16
|
+
.workspace(workspaceId)
|
|
17
|
+
.insights()
|
|
18
|
+
.getInsightsQuery()
|
|
19
|
+
.withFilter({ id: [visualization.insight.identifier] })
|
|
20
|
+
.query();
|
|
21
|
+
return res.items.length > 0;
|
|
16
22
|
},
|
|
17
|
-
}, [workspaceId, visualization?.insight.identifier, part.saving?.completed, run]);
|
|
23
|
+
}, [workspaceId, visualization?.insight.identifier, part.saving?.started, part.saving?.completed, run]);
|
|
18
24
|
const visualisationSaved = Boolean(result && !error);
|
|
19
25
|
const visualisationCheckLoading = status === "loading";
|
|
20
26
|
return { visualisationSaved, visualisationCheckLoading };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/utils/icons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/utils/icons.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AA0C1D,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,kBAAkB,CAAC,GAAG;IAC7F,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;CAC1B,CAqBA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAYnG"}
|
|
@@ -7,6 +7,9 @@ const msgs = defineMessages({
|
|
|
7
7
|
typeVisualization: {
|
|
8
8
|
id: "gd.gen-ai.context.type.visualization",
|
|
9
9
|
},
|
|
10
|
+
typeReport: {
|
|
11
|
+
id: "gd.gen-ai.context.type.report",
|
|
12
|
+
},
|
|
10
13
|
});
|
|
11
14
|
const VISUALIZATION_TYPE_ICONS = {
|
|
12
15
|
area: "visualizationArea",
|
|
@@ -48,6 +51,11 @@ export function getIconByObject(object) {
|
|
|
48
51
|
iconBefore: getVisualizationIcon(object.visualizationUrl),
|
|
49
52
|
iconColor: "complementary-6",
|
|
50
53
|
};
|
|
54
|
+
case "report":
|
|
55
|
+
return {
|
|
56
|
+
iconBefore: "file",
|
|
57
|
+
iconColor: "complementary-6",
|
|
58
|
+
};
|
|
51
59
|
default:
|
|
52
60
|
return {};
|
|
53
61
|
}
|
|
@@ -59,6 +67,8 @@ export function getTypeLabel(type, intl) {
|
|
|
59
67
|
case "visualization":
|
|
60
68
|
case "widget":
|
|
61
69
|
return intl.formatMessage(msgs.typeVisualization);
|
|
70
|
+
case "report":
|
|
71
|
+
return intl.formatMessage(msgs.typeReport);
|
|
62
72
|
default:
|
|
63
73
|
return undefined;
|
|
64
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"addContextReference.d.ts","sourceRoot":"","sources":["../../src/context/addContextReference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG1E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA2ExG"}
|
|
@@ -18,6 +18,18 @@ export function addContextReference(context, reference) {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
if (reference.where === "view.report") {
|
|
22
|
+
return {
|
|
23
|
+
...context,
|
|
24
|
+
active: {
|
|
25
|
+
...active,
|
|
26
|
+
view: {
|
|
27
|
+
...active?.view,
|
|
28
|
+
report: context.ambient?.view?.report,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
21
33
|
if (reference.where === "referencedObjects") {
|
|
22
34
|
const refContext = reference.context;
|
|
23
35
|
const referencedObjects = (active?.referencedObjects ?? []).slice();
|
|
@@ -43,6 +55,7 @@ export function addContextReference(context, reference) {
|
|
|
43
55
|
ref: reference.ref,
|
|
44
56
|
title: reference.title,
|
|
45
57
|
type: convertGenAiTypeToReferenceType(reference.type),
|
|
58
|
+
visualizationUrl: reference.visualizationUrl,
|
|
46
59
|
});
|
|
47
60
|
return {
|
|
48
61
|
...context,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/context/build.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/context/build.ts"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,iBAAiB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAIjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,GAAG,iBAAiB,GAAG,SAAS,CAwB3G"}
|
package/esm/context/build.js
CHANGED
|
@@ -20,7 +20,11 @@ export function mergeContexts(...contexts) {
|
|
|
20
20
|
return acc;
|
|
21
21
|
}
|
|
22
22
|
const dashboard = mergeDashboard(context.view?.dashboard, acc.view?.dashboard);
|
|
23
|
-
const
|
|
23
|
+
const report = mergeReport(context.view?.report, acc.view?.report);
|
|
24
|
+
const view = {
|
|
25
|
+
...(dashboard ? { dashboard } : {}),
|
|
26
|
+
...(report ? { report } : {}),
|
|
27
|
+
};
|
|
24
28
|
const activeObject = mergeActiveObject(context.activeObject, acc.activeObject);
|
|
25
29
|
const referencedObjects = [...(acc?.referencedObjects ?? []), ...(context?.referencedObjects ?? [])];
|
|
26
30
|
return {
|
|
@@ -41,6 +45,12 @@ function mergeDashboard(dashboard, existingDashboard) {
|
|
|
41
45
|
}
|
|
42
46
|
return dashboard ?? existingDashboard;
|
|
43
47
|
}
|
|
48
|
+
function mergeReport(report, existingReport) {
|
|
49
|
+
if (report && existingReport && areObjRefsEqual(report.ref, existingReport.ref)) {
|
|
50
|
+
return { ...existingReport, ...report };
|
|
51
|
+
}
|
|
52
|
+
return report ?? existingReport;
|
|
53
|
+
}
|
|
44
54
|
function mergeActiveObject(activeObject, existingActiveObject) {
|
|
45
55
|
if (areObjRefsEqual(activeObject?.ref, existingActiveObject?.ref)) {
|
|
46
56
|
const merged = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG7E,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,iBAAiB,GAAG,SAAS,EAC1C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"collectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/collectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG7E,wBAAgB,wBAAwB,CACpC,WAAW,EAAE,iBAAiB,GAAG,SAAS,EAC1C,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CA6DvB;AAED,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,gBAAgB,CAAC,EAAE,MAAM,GAC1B,mBAAmB,EAAE,CAuFvB"}
|
|
@@ -19,6 +19,22 @@ export function collectContextReferences(userContext, selectedContext, placehold
|
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
// report
|
|
23
|
+
const userReport = userContext?.view?.report;
|
|
24
|
+
if (userReport) {
|
|
25
|
+
const ref = userReport.ref;
|
|
26
|
+
const id = isIdentifierRef(ref) ? ref.identifier : ref.uri;
|
|
27
|
+
if (!areObjRefsEqual(ref, selectedContext?.report?.ref)) {
|
|
28
|
+
userReferences.push({
|
|
29
|
+
id,
|
|
30
|
+
ref,
|
|
31
|
+
nesting: 0,
|
|
32
|
+
type: "report",
|
|
33
|
+
where: "view.report",
|
|
34
|
+
title: userReport.title || placeholderTitle || id,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
22
38
|
// references
|
|
23
39
|
userContext?.referencedObjects?.forEach((obj) => {
|
|
24
40
|
if (obj.context && areObjRefsEqual(obj.context?.ref, selectedContext?.dashboard?.ref)) {
|
|
@@ -34,6 +50,7 @@ export function collectContextReferences(userContext, selectedContext, placehold
|
|
|
34
50
|
where: "referencedObjects",
|
|
35
51
|
title: item.title || placeholderTitle || id,
|
|
36
52
|
type: convertReferenceTypeToGenAiType(item.type),
|
|
53
|
+
visualizationUrl: item.visualizationUrl,
|
|
37
54
|
});
|
|
38
55
|
});
|
|
39
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAI1E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"removeContextReference.d.ts","sourceRoot":"","sources":["../../src/context/removeContextReference.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAI1E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,YAAY,CA8C3G"}
|
|
@@ -16,6 +16,10 @@ export function removeContextReference(context, reference) {
|
|
|
16
16
|
newContext.view = { ...newContext.view };
|
|
17
17
|
delete newContext.view.dashboard;
|
|
18
18
|
}
|
|
19
|
+
if (reference.where === "view.report" && areObjRefsEqual(newContext.view?.report?.ref, reference.ref)) {
|
|
20
|
+
newContext.view = { ...newContext.view };
|
|
21
|
+
delete newContext.view.report;
|
|
22
|
+
}
|
|
19
23
|
// remove reference
|
|
20
24
|
if (reference.where === "referencedObjects") {
|
|
21
25
|
newContext.referencedObjects = newContext.referencedObjects
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/selectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"selectContextReferences.d.ts","sourceRoot":"","sources":["../../src/context/selectContextReferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAuB,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMtF,wBAAgB,kCAAkC,CAC9C,OAAO,EAAE,YAAY,EACrB,WAAW,CAAC,EAAE,iBAAiB,GAChC,YAAY,CA+Bd;AAED,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,GAC/C,YAAY,CAoBd;AAED,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,OAAO,GAClB,YAAY,CAYd"}
|
|
@@ -39,9 +39,11 @@ export function selectContextReferences(context, selected) {
|
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
newContext = removeContextReference(newContext, context.ambientSelected?.dashboard);
|
|
42
|
+
newContext = removeContextReference(newContext, context.ambientSelected?.report);
|
|
42
43
|
newContext = removeContextReference(newContext, context.ambientSelected?.visualization);
|
|
43
44
|
if (newContext.ambientSelected?.activated) {
|
|
44
45
|
newContext = addContextReference(newContext, newContext.ambientSelected?.dashboard);
|
|
46
|
+
newContext = addContextReference(newContext, newContext.ambientSelected?.report);
|
|
45
47
|
newContext = addContextReference(newContext, newContext.ambientSelected?.visualization);
|
|
46
48
|
}
|
|
47
49
|
return newContext;
|
|
@@ -53,42 +55,39 @@ export function updateAmbientContext(context, ambient, loading) {
|
|
|
53
55
|
newContext.ambient = ambient;
|
|
54
56
|
newContext.ambientLoading = loading;
|
|
55
57
|
newContext = removeContextReference(newContext, context.ambientSelected?.dashboard);
|
|
58
|
+
newContext = removeContextReference(newContext, context.ambientSelected?.report);
|
|
56
59
|
newContext = removeContextReference(newContext, context.ambientSelected?.visualization);
|
|
57
60
|
newContext = updateContextReference(newContext, ambient, referenceChanged, activated);
|
|
58
61
|
return newContext;
|
|
59
62
|
}
|
|
60
63
|
function updateContextReference(newContext, ambient, referenceChanged, activated) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const ref = dash.ref;
|
|
65
|
-
const id = isIdentifierRef(ref) ? ref.identifier : ref.uri;
|
|
66
|
-
reference = {
|
|
67
|
-
id,
|
|
68
|
-
ref,
|
|
69
|
-
nesting: 0,
|
|
70
|
-
type: "dashboard",
|
|
71
|
-
where: "view.dashboard",
|
|
72
|
-
title: dash.title ?? "",
|
|
73
|
-
};
|
|
64
|
+
const dashboard = ambient?.view?.dashboard;
|
|
65
|
+
const report = ambient?.view?.report;
|
|
66
|
+
if (dashboard || report) {
|
|
74
67
|
newContext.loaded = true;
|
|
75
|
-
newContext.ambientSelected = {
|
|
76
|
-
...newContext.ambientSelected,
|
|
77
|
-
dashboard: reference,
|
|
78
|
-
...(referenceChanged ? { visualization: undefined } : {}),
|
|
79
|
-
...(activated ? { activated: true } : {}),
|
|
80
|
-
};
|
|
81
68
|
}
|
|
82
|
-
|
|
83
|
-
newContext.ambientSelected
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
newContext = addContextReference(newContext,
|
|
69
|
+
const selected = {
|
|
70
|
+
...newContext.ambientSelected,
|
|
71
|
+
dashboard: dashboard ? viewReference("dashboard", dashboard.ref, dashboard.title) : undefined,
|
|
72
|
+
report: report ? viewReference("report", report.ref, report.title) : undefined,
|
|
73
|
+
...(!dashboard || referenceChanged ? { visualization: undefined } : {}),
|
|
74
|
+
...((dashboard || report) && activated ? { activated: true } : {}),
|
|
75
|
+
};
|
|
76
|
+
newContext.ambientSelected = selected;
|
|
77
|
+
if (selected.activated) {
|
|
78
|
+
newContext = addContextReference(newContext, selected.dashboard);
|
|
79
|
+
newContext = addContextReference(newContext, selected.report);
|
|
80
|
+
newContext = addContextReference(newContext, selected.visualization);
|
|
92
81
|
}
|
|
93
82
|
return newContext;
|
|
94
83
|
}
|
|
84
|
+
function viewReference(type, ref, title) {
|
|
85
|
+
return {
|
|
86
|
+
id: isIdentifierRef(ref) ? ref.identifier : ref.uri,
|
|
87
|
+
ref,
|
|
88
|
+
nesting: 0,
|
|
89
|
+
type,
|
|
90
|
+
where: `view.${type}`,
|
|
91
|
+
title: title ?? "",
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -3,7 +3,6 @@ import { type IAnalyticalBackend, type IUserWorkspaceSettings } from "@gooddata/
|
|
|
3
3
|
import { type CatalogItem, type GenAIObjectType, type IColorPalette, type IInsight, type IListedDashboard } from "@gooddata/sdk-model";
|
|
4
4
|
import type { GenAIAssistantMode, LinkHandlerEvent } from "../components/ConfigContext.js";
|
|
5
5
|
import { type ChatEventHandler } from "../store/events.js";
|
|
6
|
-
import { type GenAIInitializeOnStart } from "../types.js";
|
|
7
6
|
export declare const useGenAIStore: (backend: IAnalyticalBackend, workspace: string, opts: {
|
|
8
7
|
eventHandlers?: ChatEventHandler[];
|
|
9
8
|
colorPalette?: IColorPalette;
|
|
@@ -15,7 +14,6 @@ export declare const useGenAIStore: (backend: IAnalyticalBackend, workspace: str
|
|
|
15
14
|
dashboards?: IListedDashboard[];
|
|
16
15
|
visualizations?: IInsight[];
|
|
17
16
|
isPreview?: boolean;
|
|
18
|
-
initializeOnStart?: GenAIInitializeOnStart;
|
|
19
17
|
allowInteractionIntelligence?: boolean;
|
|
20
18
|
onLinkClick?: (linkClickEvent: LinkHandlerEvent) => string | undefined;
|
|
21
19
|
allowNativeLinks?: boolean;
|