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

[dir view - column mode] markdown file view: fixup for tags(display & edit) (#5497)

This commit is contained in:
llj
2023-06-07 20:41:12 +08:00
committed by GitHub
parent ff86195097
commit b4ed03c537
4 changed files with 10 additions and 4 deletions

View File

@@ -107,7 +107,7 @@ class DirPath extends React.Component {
<InternalLinkOperation repoID={this.props.repoID} path={this.props.currentPath}/>
)}
{(this.props.isViewFile && fileTags.length !== 0) &&
<span id='column-mode-file-tags' className="tag-list tag-list-stacked align-middle ml-1">
<span id='column-mode-file-tags' className="tag-list tag-list-stacked align-middle ml-1 d-flex align-items-center">
{fileTags.map((fileTag, index) => {
return (<span className="file-tag" key={fileTag.id} style={{zIndex: index, backgroundColor: fileTag.color}}></span>);
})}

View File

@@ -157,7 +157,7 @@ class DirentDetail extends React.Component {
}
renderDetailBody = (bigIconUrl, folderDirent) => {
const { dirent } = this.props;
const { dirent, fileTags } = this.props;
return (
<Fragment>
<div className="detail-body dirent-info">
@@ -171,7 +171,7 @@ class DirentDetail extends React.Component {
dirent={this.props.dirent || folderDirent}
direntType={this.state.direntType}
direntDetail={this.state.direntDetail}
fileTagList={dirent ? dirent.file_tags : []}
fileTagList={dirent ? dirent.file_tags : fileTags}
onFileTagChanged={this.props.onFileTagChanged}
fileParticipantList={this.state.fileParticipantList}
onParticipantsChange={this.onParticipantsChange}

View File

@@ -350,6 +350,7 @@ class LibContentContainer extends React.Component {
path={this.props.path}
dirent={this.state.currentDirent}
currentRepoInfo={this.props.currentRepoInfo}
fileTags={this.props.isViewFile ? this.props.fileTags : []}
onFileTagChanged={this.props.onFileTagChanged}
onItemDetailsClose={this.props.closeDirentDetail}
direntDetailPanelTab={this.props.direntDetailPanelTab}

View File

@@ -1333,7 +1333,12 @@ class LibContentView extends React.Component {
let fileTags = res.data.file_tags.map(item => {
return new FileTag(item);
});
if (this.state.isViewFile) {
this.setState({fileTags: fileTags});
} else {
this.updateDirent(dirent, 'file_tags', fileTags);
}
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);