diff --git a/web/client/src/sections/metadataManagement/components/metadataTagModal.js b/web/client/src/sections/metadataManagement/components/metadataTagModal.js index 7741862..b32ee92 100644 --- a/web/client/src/sections/metadataManagement/components/metadataTagModal.js +++ b/web/client/src/sections/metadataManagement/components/metadataTagModal.js @@ -15,15 +15,21 @@ const MetadataDatabaseTagModal = (props) => { } const renderTagItems = () => { let tags = []; + const tagIds = form.getFieldValue('tags') || editData.record.tags || []; + let tagsValue = [] if (tagSet.length) { tagList.map(t => { if (tagSet.includes(t.tagSetId)) { t.tags.map(t => { - tags.push({t.name}) + tags.push({t.name}); + if (tagIds.includes(t.id)) { + tagsValue.push(t.id); + } }) } }); } + form.setFieldValue('tags', tagsValue); return tags; } return ( @@ -46,8 +52,7 @@ const MetadataDatabaseTagModal = (props) => { filterOption={(input, option) => option.props.children .toLowerCase().indexOf(input.toLowerCase()) >= 0} onChange={value => { - setTagSet(value) - form.setFieldValue('tags', []); + setTagSet(value); }} mode="multiple" > diff --git a/web/client/src/sections/metadataManagement/containers/filesTable.js b/web/client/src/sections/metadataManagement/containers/filesTable.js index 58c34d8..0f7110c 100644 --- a/web/client/src/sections/metadataManagement/containers/filesTable.js +++ b/web/client/src/sections/metadataManagement/containers/filesTable.js @@ -251,7 +251,7 @@ const FilesTable = (props) => { contentData.map(cd => { tableContent += ``; tableContent += `
${cd.name}
`; - tableContent += `
${cd.description}
`; + tableContent += `
${cd.description || ''}
`; tableContent += `
${cd.fileName ? cd.type : ''}
`; let tagName = cd.tagFiles.map(tagSet => tagSet.tag.name); tableContent += `
${tagName.join(',')}
`;