Fix: Api key modal bug (#12213)

### What problem does this PR solve?

Fix: Api key modal bug

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-12-25 19:01:55 +08:00
committed by GitHub
parent c8eeba5880
commit cfd1250615
4 changed files with 18 additions and 16 deletions

View File

@ -170,7 +170,7 @@ const Modal: ModalType = ({
<DialogPrimitive.Root open={open} onOpenChange={handleChange}>
<DialogPrimitive.Portal>
<DialogPrimitive.Overlay
className="fixed inset-0 z-50 bg-bg-card backdrop-blur-[1px] flex items-center justify-center p-4"
className="fixed inset-0 z-[1000] bg-bg-card backdrop-blur-[1px] flex items-center justify-center p-4"
onClick={() => maskClosable && onOpenChange?.(false)}
>
<DialogPrimitive.Content
@ -195,7 +195,7 @@ const Modal: ModalType = ({
)}
>
{title && (
<DialogPrimitive.Title className="text-lg font-medium text-foreground">
<DialogPrimitive.Title className="text-lg font-medium text-foreground w-full">
{title}
</DialogPrimitive.Title>
)}

View File

@ -126,19 +126,20 @@ export const useManageValues = (props: IManageValuesProps) => {
// Handle blur event, synchronize to main state
const handleValueBlur = useCallback(() => {
// addUpdateValue(metaData.field, [...new Set([...tempValues])]);
tempValues.forEach((newValue, index) => {
if (index < data.values.length) {
const originalValue = data.values[index];
if (originalValue !== newValue) {
addUpdateValue(metaData.field, originalValue, newValue);
if (data.values.length > 0) {
tempValues.forEach((newValue, index) => {
if (index < data.values.length) {
const originalValue = data.values[index];
if (originalValue !== newValue) {
addUpdateValue(metaData.field, originalValue, newValue);
}
} else {
if (newValue) {
addUpdateValue(metaData.field, '', newValue);
}
}
} else {
if (newValue) {
addUpdateValue(metaData.field, '', newValue);
}
}
});
});
}
handleChange('values', [...new Set([...tempValues])]);
}, [handleChange, tempValues, metaData, data, addUpdateValue]);

View File

@ -257,6 +257,7 @@ export const ManageMetadataModal = (props: IManageModalProps) => {
isShowDescription,
isDeleteSingleValue,
handleEditValueRow,
metadataType,
]);
const table = useReactTable({

View File

@ -187,11 +187,11 @@ export function useDatasetTableColumns({
type: MetadataType.UpdateSingle,
record: row,
title: (
<div className="flex flex-col gap-2">
<div className="flex flex-col gap-2 w-full">
<div className="text-base font-normal">
{t('metadata.editMetadata')}
</div>
<div className="text-sm text-text-secondary">
<div className="text-sm text-text-secondary w-full truncate">
{t('metadata.editMetadataForDataset')}
{row.name}
</div>