mirror of https://github.com/buster-so/buster.git
Merge branch 'big-nate/bus-939-create-new-structure-for-chats' into nate/create-component-library
This commit is contained in:
commit
780f9a489b
|
@ -35,6 +35,7 @@
|
||||||
"@supabase/supabase-js": "^2.48.1",
|
"@supabase/supabase-js": "^2.48.1",
|
||||||
"@tailwindcss/forms": "^0.5.10",
|
"@tailwindcss/forms": "^0.5.10",
|
||||||
"@tanstack/react-query": "^5.66.9",
|
"@tanstack/react-query": "^5.66.9",
|
||||||
|
"@tanstack/react-query-devtools": "^5.66.9",
|
||||||
"@vercel/speed-insights": "^1.2.0",
|
"@vercel/speed-insights": "^1.2.0",
|
||||||
"ahooks": "^3.8.4",
|
"ahooks": "^3.8.4",
|
||||||
"antd": "5.23.3",
|
"antd": "5.23.3",
|
||||||
|
@ -116,7 +117,8 @@
|
||||||
"@storybook/nextjs": "^8.5.8",
|
"@storybook/nextjs": "^8.5.8",
|
||||||
"@storybook/react": "^8.5.8",
|
"@storybook/react": "^8.5.8",
|
||||||
"@storybook/test": "^8.5.8",
|
"@storybook/test": "^8.5.8",
|
||||||
"@tailwindcss/postcss": "^4.0.8",
|
"@tailwindcss/postcss": "^4.0.9",
|
||||||
|
"@tanstack/eslint-plugin-query": "^5.66.1",
|
||||||
"@testing-library/jest-dom": "^6.6.3",
|
"@testing-library/jest-dom": "^6.6.3",
|
||||||
"@testing-library/react": "^16.2.0",
|
"@testing-library/react": "^16.2.0",
|
||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { defaultRequestHandler } from '@/api/createInstance';
|
||||||
import nextApi from '@/api/next/instances';
|
import nextApi from '@/api/next/instances';
|
||||||
import { useSupabaseContext } from '../Supabase/SupabaseContextProvider';
|
import { useSupabaseContext } from '../Supabase/SupabaseContextProvider';
|
||||||
import { getQueryClient } from './getQueryClient';
|
import { getQueryClient } from './getQueryClient';
|
||||||
|
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools';
|
||||||
|
|
||||||
export const BusterReactQueryProvider = ({ children }: { children: React.ReactElement }) => {
|
export const BusterReactQueryProvider = ({ children }: { children: React.ReactElement }) => {
|
||||||
const accessToken = useSupabaseContext((state) => state.accessToken);
|
const accessToken = useSupabaseContext((state) => state.accessToken);
|
||||||
|
@ -20,5 +21,10 @@ export const BusterReactQueryProvider = ({ children }: { children: React.ReactEl
|
||||||
nextApi.interceptors.request.use((v) => defaultRequestHandler(v, { accessToken }));
|
nextApi.interceptors.request.use((v) => defaultRequestHandler(v, { accessToken }));
|
||||||
}, [accessToken]);
|
}, [accessToken]);
|
||||||
|
|
||||||
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
return (
|
||||||
|
<QueryClientProvider client={queryClient}>
|
||||||
|
{children}
|
||||||
|
<ReactQueryDevtoolsPanel />
|
||||||
|
</QueryClientProvider>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import { useBusterWebSocket } from '@/context/BusterWebSocket';
|
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { useTransition, type MutableRefObject } from 'react';
|
import { useTransition } from 'react';
|
||||||
import type { IBusterChat, IBusterChatMessage } from '../interfaces';
|
import type { IBusterChat, IBusterChatMessage } from '../interfaces';
|
||||||
import { useSocketQueryMutation } from '@/api/buster_socket_query';
|
import { useSocketQueryMutation } from '@/api/buster_socket_query';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
import { queryKeys } from '@/api/query_keys';
|
import { queryKeys } from '@/api/query_keys';
|
||||||
import { create } from 'mutative';
|
|
||||||
|
|
||||||
export const useChatUpdate = () => {
|
export const useChatUpdate = () => {
|
||||||
const [isPending, startTransition] = useTransition();
|
const [isPending, startTransition] = useTransition();
|
||||||
|
|
|
@ -6,7 +6,6 @@ import {
|
||||||
import { queryKeys } from '@/api/query_keys';
|
import { queryKeys } from '@/api/query_keys';
|
||||||
|
|
||||||
import { DashboardUpdate } from '@/api/buster_socket/dashboards';
|
import { DashboardUpdate } from '@/api/buster_socket/dashboards';
|
||||||
import { useBusterWebSocket } from '@/context/BusterWebSocket';
|
|
||||||
import { useSocketQueryMutation } from '@/api/buster_socket_query';
|
import { useSocketQueryMutation } from '@/api/buster_socket_query';
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { create } from 'mutative';
|
import { create } from 'mutative';
|
||||||
|
|
|
@ -32,9 +32,7 @@ const useBusterMetricsIndividual = () => {
|
||||||
return resolveEmptyMetric(data, _metricId);
|
return resolveEmptyMetric(data, _metricId);
|
||||||
});
|
});
|
||||||
|
|
||||||
//STATE UPDATERS
|
// STATE UPDATERS
|
||||||
|
|
||||||
// EMITTERS
|
|
||||||
|
|
||||||
const metricUpdateConfig = useUpdateMetricConfig({
|
const metricUpdateConfig = useUpdateMetricConfig({
|
||||||
getMetricId,
|
getMetricId,
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import last from 'lodash/last';
|
|
||||||
import { IBusterMetric } from '../interfaces';
|
import { IBusterMetric } from '../interfaces';
|
||||||
import { useBusterWebSocket } from '../../BusterWebSocket';
|
|
||||||
import { useUserConfigContextSelector } from '../../Users';
|
import { useUserConfigContextSelector } from '../../Users';
|
||||||
import { useBusterNotifications } from '../../BusterNotifications';
|
import { useBusterNotifications } from '../../BusterNotifications';
|
||||||
import { useBusterDashboardContextSelector } from '../../Dashboards';
|
|
||||||
import { useUpdateMetricConfig } from './useMetricUpdateConfig';
|
import { useUpdateMetricConfig } from './useMetricUpdateConfig';
|
||||||
|
|
||||||
export const useUpdateMetricAssosciations = ({
|
export const useUpdateMetricAssosciations = ({
|
||||||
|
@ -56,8 +53,6 @@ export const useUpdateMetricAssosciations = ({
|
||||||
dashboardId: string;
|
dashboardId: string;
|
||||||
useConfirmModal?: boolean;
|
useConfirmModal?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
// const prev = metricsRef.current;
|
|
||||||
|
|
||||||
const method = async () => {
|
const method = async () => {
|
||||||
await updateMetricMutation({
|
await updateMetricMutation({
|
||||||
id: metricId,
|
id: metricId,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import type { IBusterMetric } from '../interfaces';
|
||||||
import {
|
import {
|
||||||
BusterMetric,
|
BusterMetric,
|
||||||
DEFAULT_CHART_CONFIG,
|
DEFAULT_CHART_CONFIG,
|
||||||
IBusterMetricChartConfig,
|
type IBusterMetricChartConfig,
|
||||||
ShareRole,
|
ShareRole,
|
||||||
VerificationStatus
|
VerificationStatus
|
||||||
} from '@/api/asset_interfaces';
|
} from '@/api/asset_interfaces';
|
||||||
|
|
Loading…
Reference in New Issue