mirror of https://github.com/buster-so/buster.git
commit
1988ee8c84
|
@ -39,7 +39,7 @@ export const prefetchGetMyUserInfo = async (
|
|||
queryFn: () => initialData!,
|
||||
initialData
|
||||
});
|
||||
return { queryClient, initialData };
|
||||
return queryClient;
|
||||
};
|
||||
|
||||
export const useGetUser = (params: Parameters<typeof getUser>[0]) => {
|
||||
|
|
|
@ -8,6 +8,7 @@ import { prefetchGetMyUserInfo } from '@/api/buster_rest';
|
|||
import { getSupabaseUserContext } from '@/lib/supabase';
|
||||
import { AppProviders } from '@/context/AppProviders';
|
||||
import { headers } from 'next/headers';
|
||||
import { queryKeys } from '@/api/query_keys';
|
||||
|
||||
export default async function Layout({
|
||||
children
|
||||
|
@ -18,10 +19,19 @@ export default async function Layout({
|
|||
const pathname = headersList.get('x-pathname');
|
||||
const supabaseContext = await getSupabaseUserContext();
|
||||
const { accessToken } = supabaseContext;
|
||||
const { initialData: userInfo, queryClient } = await prefetchGetMyUserInfo({
|
||||
const queryClient = await prefetchGetMyUserInfo({
|
||||
jwtToken: accessToken
|
||||
});
|
||||
|
||||
const userInfoState = queryClient.getQueryState(queryKeys.userGetUserMyself.queryKey);
|
||||
|
||||
const is402Error = userInfoState?.status === 'error' && userInfoState?.error?.status === 402;
|
||||
|
||||
if (is402Error) {
|
||||
return <ClientRedirect to={createBusterRoute({ route: BusterRoutes.INFO_GETTING_STARTED })} />;
|
||||
}
|
||||
|
||||
const userInfo = queryClient.getQueryData(queryKeys.userGetUserMyself.queryKey);
|
||||
const newUserRoute = createBusterRoute({ route: BusterRoutes.NEW_USER });
|
||||
|
||||
if (
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
import { Paragraph, Text, Title } from '@/components/ui/typography';
|
||||
import { Button } from '@/components/ui/buttons';
|
||||
import { Card, CardContent, CardFooter } from '@/components/ui/card/CardBase';
|
||||
import { BUSTER_GETTING_STARTED_URL } from '@/routes/externalRoutes';
|
||||
import { BusterLogo } from '@/assets/svg/BusterLogo';
|
||||
import { ArrowUpRight } from '@/components/ui/icons';
|
||||
|
||||
export default function GettingStartedPage() {
|
||||
return (
|
||||
<div className="container flex min-h-screen w-full min-w-screen items-center justify-center py-10">
|
||||
<Card className="w-full max-w-lg">
|
||||
<CardContent className="space-y-4 pt-6 text-center">
|
||||
<>
|
||||
<div className="flex justify-center">
|
||||
<BusterLogo className="h-10 w-10" />
|
||||
</div>
|
||||
|
||||
<Title as={'h1'} variant="default">
|
||||
Welcome to Buster!
|
||||
</Title>
|
||||
<Paragraph size={'md'}>
|
||||
It looks like your organization hasn't been fully set up yet. To get started with
|
||||
Buster, you'll need to complete the organization setup process or verify your
|
||||
payment information.
|
||||
</Paragraph>
|
||||
</>
|
||||
</CardContent>
|
||||
<CardFooter className="w-full pt-0">
|
||||
<a
|
||||
href={BUSTER_GETTING_STARTED_URL}
|
||||
target="_blank"
|
||||
className="w-full"
|
||||
rel="noopener noreferrer">
|
||||
<Button
|
||||
size="tall"
|
||||
variant={'black'}
|
||||
block
|
||||
suffix={
|
||||
<span className="text-base">
|
||||
<ArrowUpRight />
|
||||
</span>
|
||||
}>
|
||||
Get Started
|
||||
</Button>
|
||||
</a>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
import { useDebounceFn, useMemoizedFn } from '@/hooks';
|
||||
import { useMemoizedFn } from '@/hooks';
|
||||
import { EditableTitle } from '@/components/ui/typography/EditableTitle';
|
||||
import React from 'react';
|
||||
import { useUpdateDashboard } from '@/api/buster_rest/dashboards';
|
||||
|
@ -50,7 +50,7 @@ export const DashboardEditTitles: React.FC<{
|
|||
className={'py-0! pl-0!'}
|
||||
readOnly={readOnly}
|
||||
onChange={onChangeDashboardDescription}
|
||||
defaultValue={description}
|
||||
value={description}
|
||||
autoResize={descriptionAutoResize}
|
||||
placeholder="Add description..."
|
||||
/>
|
||||
|
|
|
@ -9,6 +9,8 @@ import { ScrollArea } from '@/components/ui/scroll-area';
|
|||
import { useAutoScroll } from '@/hooks/useAutoScroll';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import { ReasoningScrollToBottom } from './ReasoningScrollToBottom';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { queryKeys } from '@/api/query_keys';
|
||||
|
||||
interface ReasoningControllerProps {
|
||||
chatId: string;
|
||||
|
@ -23,6 +25,11 @@ export const ReasoningController: React.FC<ReasoningControllerProps> = ({ chatId
|
|||
const { data: isCompletedStream } = useGetChatMessage(messageId, {
|
||||
select: ({ isCompletedStream }) => isCompletedStream
|
||||
});
|
||||
const blackBoxMessage = useQuery({
|
||||
...queryKeys.chatsBlackBoxMessages(messageId),
|
||||
notifyOnChangeProps: ['data']
|
||||
}).data;
|
||||
|
||||
const viewportRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const { isAutoScrollEnabled, scrollToBottom, enableAutoScroll } = useAutoScroll(viewportRef, {
|
||||
|
@ -49,11 +56,11 @@ export const ReasoningController: React.FC<ReasoningControllerProps> = ({ chatId
|
|||
isCompletedStream={isCompletedStream ?? true}
|
||||
chatId={chatId}
|
||||
messageId={messageId}
|
||||
isLastMessage={messageIndex === reasoningMessageIds.length - 1}
|
||||
isLastMessage={messageIndex === reasoningMessageIds.length - 1 && !blackBoxMessage}
|
||||
/>
|
||||
))}
|
||||
|
||||
<BlackBoxMessage messageId={messageId} />
|
||||
<BlackBoxMessage blackBoxMessage={blackBoxMessage} />
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
|
|
|
@ -5,25 +5,22 @@ import React from 'react';
|
|||
import { queryKeys } from '@/api/query_keys';
|
||||
import { BarContainer } from './BarContainer';
|
||||
|
||||
export const BlackBoxMessage: React.FC<{ messageId: string }> = React.memo(({ messageId }) => {
|
||||
const blackBoxMessage = useQuery({
|
||||
...queryKeys.chatsBlackBoxMessages(messageId),
|
||||
notifyOnChangeProps: ['data']
|
||||
}).data;
|
||||
export const BlackBoxMessage: React.FC<{ blackBoxMessage: string | undefined | null }> = React.memo(
|
||||
({ blackBoxMessage }) => {
|
||||
if (blackBoxMessage) {
|
||||
return (
|
||||
<BarContainer
|
||||
showBar={false}
|
||||
status={'loading'}
|
||||
isCompletedStream={false}
|
||||
title={blackBoxMessage}
|
||||
secondaryTitle={''}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (blackBoxMessage) {
|
||||
return (
|
||||
<BarContainer
|
||||
showBar={false}
|
||||
status={'loading'}
|
||||
isCompletedStream={false}
|
||||
title={blackBoxMessage}
|
||||
secondaryTitle={''}
|
||||
/>
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
);
|
||||
|
||||
BlackBoxMessage.displayName = 'BlackBoxMessage';
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
export enum BusterInfoRoutes {
|
||||
INFO_GETTING_STARTED = '/info/getting-started'
|
||||
}
|
||||
|
||||
export type BusterInfoRoutesWithArgs = {
|
||||
[BusterInfoRoutes.INFO_GETTING_STARTED]: { route: BusterInfoRoutes.INFO_GETTING_STARTED };
|
||||
};
|
|
@ -1,6 +1,7 @@
|
|||
import { BusterAppRoutes, BusterAppRoutesWithArgs } from './busterAppRoutes';
|
||||
import { BusterAuthRoutes, BusterAuthRoutesWithArgs } from './busterAuthRoutes';
|
||||
import { BusterEmbedRoutes, BusterEmbedRoutesWithArgs } from './busterEmbedRoutes';
|
||||
import { BusterInfoRoutes, BusterInfoRoutesWithArgs } from './busterInfoRoutes';
|
||||
import { BusterSettingsRoutes, BusterSettingsRoutesWithArgs } from './busterSettingsRoutes';
|
||||
|
||||
export enum BusterRootRoutes {
|
||||
|
@ -16,6 +17,7 @@ export const BusterRoutes = {
|
|||
...BusterAuthRoutes,
|
||||
...BusterSettingsRoutes,
|
||||
...BusterEmbedRoutes,
|
||||
...BusterInfoRoutes,
|
||||
...BusterRootRoutes
|
||||
};
|
||||
|
||||
|
@ -24,12 +26,14 @@ export type BusterRoutes =
|
|||
| BusterAuthRoutes
|
||||
| BusterSettingsRoutes
|
||||
| BusterEmbedRoutes
|
||||
| BusterInfoRoutes
|
||||
| BusterRootRoutes;
|
||||
|
||||
export type BusterRoutesWithArgs = BusterRootRoutesWithArgs &
|
||||
BusterAuthRoutesWithArgs &
|
||||
BusterAppRoutesWithArgs &
|
||||
BusterEmbedRoutesWithArgs &
|
||||
BusterSettingsRoutesWithArgs;
|
||||
BusterSettingsRoutesWithArgs &
|
||||
BusterInfoRoutesWithArgs;
|
||||
|
||||
export type BusterRoutesWithArgsRoute = BusterRoutesWithArgs[BusterRoutes];
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
export const BUSTER_HOME_PAGE = 'https://buster.so';
|
||||
export const BUSTER_DOCS_URL = 'https://docs.buster.so';
|
||||
export const BUSTER_GETTING_STARTED_URL = 'https://www.buster.so/get-started';
|
||||
|
|
Loading…
Reference in New Issue