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

@ -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>