This commit is contained in:
Billy Bao 2025-11-28 11:51:52 +08:00
parent ef31e34713
commit d664bcd17b
3 changed files with 14 additions and 8 deletions

View file

@ -47,6 +47,7 @@ const AddDataSourceModal = ({
} }
open={visible || false} open={visible || false}
onOpenChange={(open) => !open && hideModal?.()} onOpenChange={(open) => !open && hideModal?.()}
maskClosable={false}
// onOk={() => handleOk()} // onOk={() => handleOk()}
okText={t('common.confirm')} okText={t('common.confirm')}
cancelText={t('common.cancel')} cancelText={t('common.cancel')}

View file

@ -315,12 +315,16 @@ const GmailTokenField = ({
<Dialog <Dialog
open={dialogOpen} open={dialogOpen}
onOpenChange={(open) => { onOpenChange={(open) => {
if (!open) { if (!open && dialogOpen) {
handleCancel(); handleCancel();
} }
}} }}
> >
<DialogContent> <DialogContent
onPointerDownOutside={(e) => e.preventDefault()}
onInteractOutside={(e) => e.preventDefault()}
onEscapeKeyDown={(e) => e.preventDefault()}
>
<DialogHeader> <DialogHeader>
<DialogTitle>Complete Gmail verification</DialogTitle> <DialogTitle>Complete Gmail verification</DialogTitle>
<DialogDescription> <DialogDescription>

View file

@ -1,5 +1,3 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { FileUploader } from '@/components/file-uploader'; import { FileUploader } from '@/components/file-uploader';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { import {
@ -17,6 +15,7 @@ import {
startGoogleDriveWebAuth, startGoogleDriveWebAuth,
} from '@/services/data-source-service'; } from '@/services/data-source-service';
import { Loader2 } from 'lucide-react'; import { Loader2 } from 'lucide-react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
type GoogleDriveTokenFieldProps = { type GoogleDriveTokenFieldProps = {
value?: string; value?: string;
@ -313,12 +312,16 @@ const GoogleDriveTokenField = ({
<Dialog <Dialog
open={dialogOpen} open={dialogOpen}
onOpenChange={(open) => { onOpenChange={(open) => {
if (!open) { if (!open && dialogOpen) {
handleCancel(); handleCancel();
} }
}} }}
> >
<DialogContent> <DialogContent
onPointerDownOutside={(e) => e.preventDefault()}
onInteractOutside={(e) => e.preventDefault()}
onEscapeKeyDown={(e) => e.preventDefault()}
>
<DialogHeader> <DialogHeader>
<DialogTitle>Complete Google verification</DialogTitle> <DialogTitle>Complete Google verification</DialogTitle>
<DialogDescription> <DialogDescription>
@ -326,7 +329,6 @@ const GoogleDriveTokenField = ({
Run the verification flow once to mint reusable tokens. Run the verification flow once to mint reusable tokens.
</DialogDescription> </DialogDescription>
</DialogHeader> </DialogHeader>
<div className="space-y-4"> <div className="space-y-4">
<div className="rounded-md border border-dashed border-muted-foreground/40 bg-muted/10 px-4 py-4 text-sm text-muted-foreground"> <div className="rounded-md border border-dashed border-muted-foreground/40 bg-muted/10 px-4 py-4 text-sm text-muted-foreground">
<div className="text-sm font-semibold text-foreground"> <div className="text-sm font-semibold text-foreground">
@ -370,7 +372,6 @@ const GoogleDriveTokenField = ({
</div> </div>
</div> </div>
</div> </div>
<DialogFooter className="pt-2"> <DialogFooter className="pt-2">
<Button variant="ghost" onClick={handleCancel}> <Button variant="ghost" onClick={handleCancel}>
Cancel Cancel