1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

feat: metadata status callback (#7716)

* feat: metadata status callback

* feat: optimzie code

---------

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2025-04-08 15:00:02 +08:00
committed by GitHub
parent a865aecb6f
commit 53bedae485
2 changed files with 16 additions and 8 deletions

View File

@@ -2245,6 +2245,14 @@ class LibContentView extends React.Component {
this.setState({ isDirentSelected });
};
metadataStatusCallback = ({ enableMetadata, enableTags }) => {
if (enableMetadata && enableTags) {
this.updateUsedRepoTags();
return;
}
this.clearRepoTags();
};
render() {
const { repoID } = this.props;
let { currentRepoInfo, userPerm, isCopyMoveProgressDialogShow, isDeleteFolderDialogOpen, errorMsg,
@@ -2320,7 +2328,7 @@ class LibContentView extends React.Component {
}
const detailDirent = currentDirent || currentNode?.object || null;
return (
<MetadataStatusProvider repoID={repoID} repoInfo={currentRepoInfo} hideMetadataView={this.hideMetadataView} updateUsedRepoTags={this.updateUsedRepoTags} clearRepoTags={this.clearRepoTags} >
<MetadataStatusProvider repoID={repoID} repoInfo={currentRepoInfo} hideMetadataView={this.hideMetadataView} statusCallback={this.metadataStatusCallback} >
<TagsProvider repoID={repoID} currentPath={path} repoInfo={currentRepoInfo} selectTagsView={this.onTreeNodeClick} >
<MetadataProvider repoID={repoID} currentPath={path} repoInfo={currentRepoInfo} selectMetadataView={this.onTreeNodeClick} >
<CollaboratorsProvider repoID={repoID}>