mirror of https://github.com/buster-so/buster.git
Merge pull request #907 from buster-so/big-nate-bus-1755-dashboard-click
click on dashboard opens chat
This commit is contained in:
commit
9fd2355e74
|
@ -409,6 +409,7 @@ const useDuplicateReportSelectMenu = ({ reportId }: { reportId: string }): IDrop
|
|||
icon: <DuplicatePlus />,
|
||||
onClick: () => {
|
||||
console.log('Duplicate report');
|
||||
alert('This feature is not available yet');
|
||||
},
|
||||
}),
|
||||
[reportId]
|
||||
|
|
|
@ -14,7 +14,6 @@ export const AssetContainer: React.FC<{
|
|||
const headerBorderVariant: AppPageLayoutProps['headerBorderVariant'] =
|
||||
headerBorderVariantProp ?? (isChatMode ? 'ghost' : 'default');
|
||||
|
||||
console.log('isChatMode', isChatMode, headerBorderVariant);
|
||||
return (
|
||||
<AppPageLayout
|
||||
header={header}
|
||||
|
|
|
@ -75,7 +75,12 @@ export const ChatResponseMessage_DashboardFile: React.FC<ResponseMessageFileProp
|
|||
selected={isSelectedFile}
|
||||
collapseDefaultIcon={<HeaderIcon isLoading={isLoading} isError={isError} />}
|
||||
fileName={FileInfo}
|
||||
headerWrapper={LinkHeaderWrapper({ linkProps: linkParams, metricId })}
|
||||
headerWrapper={({ children }) => (
|
||||
<Link {...linkParams}>
|
||||
{/** biome-ignore lint/complexity/noUselessFragments: weird error */}
|
||||
<>{children}</>
|
||||
</Link>
|
||||
)}
|
||||
>
|
||||
{!hasMetrics ? null : dashboardResponse ? (
|
||||
<Content
|
||||
|
@ -202,6 +207,7 @@ const Content = <
|
|||
return (
|
||||
<div
|
||||
className="flex flex-col gap-y-2.5 px-3.5 py-2"
|
||||
data-testid="dashboard-items"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
@ -264,22 +270,3 @@ const SelectDashboardButtonAndText: React.FC<{
|
|||
});
|
||||
|
||||
SelectDashboardButtonAndText.displayName = 'SelectDashboardButtonAndText';
|
||||
|
||||
const LinkHeaderWrapper = ({
|
||||
linkProps,
|
||||
metricId,
|
||||
}: {
|
||||
linkProps: ILinkProps;
|
||||
metricId: string | undefined;
|
||||
}): React.ComponentType<{ children: React.ReactNode }> => {
|
||||
if (!metricId) {
|
||||
return ({ children }: { children: React.ReactNode }) => children;
|
||||
}
|
||||
|
||||
return ({ children }: { children: React.ReactNode }) => (
|
||||
<Link {...linkProps}>
|
||||
{/** biome-ignore lint/complexity/noUselessFragments: weird error */}
|
||||
<>{children}</>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -28,6 +28,16 @@ export const ChatResponseMessage_File: React.FC<ChatResponseMessageProps> = Reac
|
|||
if (file_type === 'dashboard') {
|
||||
return ChatResponseMessage_DashboardFile;
|
||||
}
|
||||
if (file_type === 'report') {
|
||||
return ChatResponseMessage_StandardFile;
|
||||
}
|
||||
if (file_type === 'metric') {
|
||||
return ChatResponseMessage_StandardFile;
|
||||
}
|
||||
if (file_type === 'reasoning') {
|
||||
return ChatResponseMessage_StandardFile;
|
||||
}
|
||||
const _exhaustiveCheck: never = file_type;
|
||||
return ChatResponseMessage_StandardFile;
|
||||
}, [file_type]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue