mirror of https://github.com/buster-so/buster.git
update table chart flow
This commit is contained in:
parent
2bdccb6a7c
commit
7daecfce7e
|
@ -54,8 +54,8 @@ export const LoginForm: React.FC<{}> = ({}) => {
|
|||
if (res?.error) throw res.error;
|
||||
} catch (error: any) {
|
||||
errorFallback(error);
|
||||
setLoading(null);
|
||||
}
|
||||
setLoading(null);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -66,8 +66,8 @@ export const LoginForm: React.FC<{}> = ({}) => {
|
|||
if (res?.error) throw res.error;
|
||||
} catch (error: any) {
|
||||
errorFallback(error);
|
||||
setLoading(null);
|
||||
}
|
||||
setLoading(null);
|
||||
});
|
||||
|
||||
const onSignInWithGithub = useMemoizedFn(async () => {
|
||||
|
@ -77,8 +77,8 @@ export const LoginForm: React.FC<{}> = ({}) => {
|
|||
if (res?.error) throw res.error;
|
||||
} catch (error: any) {
|
||||
errorFallback(error);
|
||||
setLoading(null);
|
||||
}
|
||||
setLoading(null);
|
||||
});
|
||||
|
||||
const onSignInWithAzure = useMemoizedFn(async () => {
|
||||
|
@ -101,8 +101,8 @@ export const LoginForm: React.FC<{}> = ({}) => {
|
|||
setSignUpSuccess(true);
|
||||
} catch (error: any) {
|
||||
errorFallback(error);
|
||||
setLoading(null);
|
||||
}
|
||||
setLoading(null);
|
||||
});
|
||||
|
||||
const onSubmitClick = useMemoizedFn((d: { email: string; password: string }) => {
|
||||
|
|
|
@ -31,8 +31,7 @@ const BusterTableChartBase: React.FC<BusterTableChartProps> = ({
|
|||
tableHeaderFontColor,
|
||||
tableColumnFontColor
|
||||
}) => {
|
||||
const { onUpdateMetricChartConfig, onSaveMetricToServer, onInitializeTableColumnWidths } =
|
||||
useUpdateMetricChart();
|
||||
const { onUpdateMetricChartConfig, onInitializeTableColumnWidths } = useUpdateMetricChart();
|
||||
|
||||
const onChangeConfig = useMemoizedFn((config: Partial<IBusterMetricChartConfig>) => {
|
||||
if (readOnly) return;
|
||||
|
|
|
@ -32,7 +32,7 @@ export const useUpdateMetricChart = (props?: { metricId?: string; chatId?: strin
|
|||
updateVersion: !chatId
|
||||
});
|
||||
const { mutateAsync: saveMetricToServerWithoutSideEffects } = useSaveMetric({
|
||||
updateOnSave: false
|
||||
updateOnSave: true
|
||||
});
|
||||
|
||||
const getMetricMemoized = useGetMetricMemoized();
|
||||
|
@ -141,16 +141,16 @@ export const useUpdateMetricChart = (props?: { metricId?: string; chatId?: strin
|
|||
tableColumnWidths
|
||||
};
|
||||
|
||||
setOriginalMetric({
|
||||
...originalMetric,
|
||||
chart_config: newChartConfig
|
||||
});
|
||||
|
||||
saveMetricToServerWithoutSideEffects({
|
||||
id: metricId,
|
||||
chart_config: newChartConfig,
|
||||
update_version: false
|
||||
});
|
||||
|
||||
setOriginalMetric({
|
||||
...originalMetric,
|
||||
chart_config: newChartConfig
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -3,7 +3,7 @@ import { useChatIndividualContextSelector } from '@/layouts/ChatLayout/ChatConte
|
|||
import { useMemoizedFn } from '@/hooks';
|
||||
import { useBusterNewChatContextSelector } from '@/context/Chats';
|
||||
import { useBusterNotifications } from '@/context/BusterNotifications';
|
||||
import { timeout } from '@/lib';
|
||||
import { timeout } from '@/lib/timeout';
|
||||
|
||||
type FlowType = 'followup-chat' | 'followup-metric' | 'followup-dashboard' | 'new';
|
||||
|
||||
|
@ -100,11 +100,13 @@ export const useChatInputFlow = ({
|
|||
},
|
||||
onOk: async () => {
|
||||
onResetToOriginal();
|
||||
|
||||
return await method();
|
||||
await timeout(25);
|
||||
method();
|
||||
return;
|
||||
},
|
||||
onCancel: async () => {
|
||||
return await method();
|
||||
method();
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue