mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: Fixed the issue of not being able to select the time zone in the user center. (#11298)
… user center. ### What problem does this PR solve? Fix: Fixed the issue of not being able to select the time zone in the user center. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -86,6 +86,9 @@ const Modal: ModalType = ({
|
|||||||
onOk?.();
|
onOk?.();
|
||||||
}, [onOk, onOpenChange]);
|
}, [onOk, onOpenChange]);
|
||||||
const handleChange = (open: boolean) => {
|
const handleChange = (open: boolean) => {
|
||||||
|
if (!open && !maskClosable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onOpenChange?.(open);
|
onOpenChange?.(open);
|
||||||
console.log('open', open, onOpenChange);
|
console.log('open', open, onOpenChange);
|
||||||
if (open && !disabled) {
|
if (open && !disabled) {
|
||||||
@ -185,6 +188,7 @@ const Modal: ModalType = ({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="flex h-7 w-7 items-center justify-center rounded-full hover:bg-muted focus-visible:outline-none"
|
className="flex h-7 w-7 items-center justify-center rounded-full hover:bg-muted focus-visible:outline-none"
|
||||||
|
onClick={handleCancel}
|
||||||
>
|
>
|
||||||
{closeIcon}
|
{closeIcon}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -13,13 +13,7 @@ import {
|
|||||||
} from '@/components/ui/form';
|
} from '@/components/ui/form';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Modal } from '@/components/ui/modal/modal';
|
import { Modal } from '@/components/ui/modal/modal';
|
||||||
import {
|
import { RAGFlowSelect } from '@/components/ui/select';
|
||||||
Select,
|
|
||||||
SelectContent,
|
|
||||||
SelectItem,
|
|
||||||
SelectTrigger,
|
|
||||||
SelectValue,
|
|
||||||
} from '@/components/ui/select';
|
|
||||||
import { useTranslate } from '@/hooks/common-hooks';
|
import { useTranslate } from '@/hooks/common-hooks';
|
||||||
import { TimezoneList } from '@/pages/user-setting/constants';
|
import { TimezoneList } from '@/pages/user-setting/constants';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
@ -230,6 +224,7 @@ const ProfilePage: FC = () => {
|
|||||||
title={modalTitle[editType]}
|
title={modalTitle[editType]}
|
||||||
open={isEditing}
|
open={isEditing}
|
||||||
showfooter={false}
|
showfooter={false}
|
||||||
|
maskClosable={false}
|
||||||
titleClassName="text-base"
|
titleClassName="text-base"
|
||||||
onOpenChange={(open) => {
|
onOpenChange={(open) => {
|
||||||
if (!open) {
|
if (!open) {
|
||||||
@ -281,23 +276,14 @@ const ProfilePage: FC = () => {
|
|||||||
<FormLabel className="text-sm text-text-secondary whitespace-nowrap">
|
<FormLabel className="text-sm text-text-secondary whitespace-nowrap">
|
||||||
{t('timezone')}
|
{t('timezone')}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<Select
|
<RAGFlowSelect
|
||||||
|
options={TimezoneList.map((timeStr) => {
|
||||||
|
return { value: timeStr, label: timeStr };
|
||||||
|
})}
|
||||||
|
placeholder="Select a timeZone"
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
>
|
/>
|
||||||
<FormControl className="w-full bg-bg-input border-border-default">
|
|
||||||
<SelectTrigger>
|
|
||||||
<SelectValue placeholder="Select a timeZone" />
|
|
||||||
</SelectTrigger>
|
|
||||||
</FormControl>
|
|
||||||
<SelectContent>
|
|
||||||
{TimezoneList.map((timeStr) => (
|
|
||||||
<SelectItem key={timeStr} value={timeStr}>
|
|
||||||
{timeStr}
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex w-full pt-1">
|
<div className="flex w-full pt-1">
|
||||||
<div className="w-1/4"></div>
|
<div className="w-1/4"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user