mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
[dir view - column mode] markdown file view: fixup for tags(display & edit) (#5497)
This commit is contained in:
@@ -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>);
|
||||
})}
|
||||
|
@@ -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}
|
||||
|
@@ -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}
|
||||
|
@@ -1333,7 +1333,12 @@ class LibContentView extends React.Component {
|
||||
let fileTags = res.data.file_tags.map(item => {
|
||||
return new FileTag(item);
|
||||
});
|
||||
this.updateDirent(dirent, 'file_tags', fileTags);
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user