mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +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}/>
|
<InternalLinkOperation repoID={this.props.repoID} path={this.props.currentPath}/>
|
||||||
)}
|
)}
|
||||||
{(this.props.isViewFile && fileTags.length !== 0) &&
|
{(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) => {
|
{fileTags.map((fileTag, index) => {
|
||||||
return (<span className="file-tag" key={fileTag.id} style={{zIndex: index, backgroundColor: fileTag.color}}></span>);
|
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) => {
|
renderDetailBody = (bigIconUrl, folderDirent) => {
|
||||||
const { dirent } = this.props;
|
const { dirent, fileTags } = this.props;
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div className="detail-body dirent-info">
|
<div className="detail-body dirent-info">
|
||||||
@@ -171,7 +171,7 @@ class DirentDetail extends React.Component {
|
|||||||
dirent={this.props.dirent || folderDirent}
|
dirent={this.props.dirent || folderDirent}
|
||||||
direntType={this.state.direntType}
|
direntType={this.state.direntType}
|
||||||
direntDetail={this.state.direntDetail}
|
direntDetail={this.state.direntDetail}
|
||||||
fileTagList={dirent ? dirent.file_tags : []}
|
fileTagList={dirent ? dirent.file_tags : fileTags}
|
||||||
onFileTagChanged={this.props.onFileTagChanged}
|
onFileTagChanged={this.props.onFileTagChanged}
|
||||||
fileParticipantList={this.state.fileParticipantList}
|
fileParticipantList={this.state.fileParticipantList}
|
||||||
onParticipantsChange={this.onParticipantsChange}
|
onParticipantsChange={this.onParticipantsChange}
|
||||||
|
@@ -350,6 +350,7 @@ class LibContentContainer extends React.Component {
|
|||||||
path={this.props.path}
|
path={this.props.path}
|
||||||
dirent={this.state.currentDirent}
|
dirent={this.state.currentDirent}
|
||||||
currentRepoInfo={this.props.currentRepoInfo}
|
currentRepoInfo={this.props.currentRepoInfo}
|
||||||
|
fileTags={this.props.isViewFile ? this.props.fileTags : []}
|
||||||
onFileTagChanged={this.props.onFileTagChanged}
|
onFileTagChanged={this.props.onFileTagChanged}
|
||||||
onItemDetailsClose={this.props.closeDirentDetail}
|
onItemDetailsClose={this.props.closeDirentDetail}
|
||||||
direntDetailPanelTab={this.props.direntDetailPanelTab}
|
direntDetailPanelTab={this.props.direntDetailPanelTab}
|
||||||
|
@@ -1333,7 +1333,12 @@ class LibContentView extends React.Component {
|
|||||||
let fileTags = res.data.file_tags.map(item => {
|
let fileTags = res.data.file_tags.map(item => {
|
||||||
return new FileTag(item);
|
return new FileTag(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.state.isViewFile) {
|
||||||
|
this.setState({fileTags: fileTags});
|
||||||
|
} else {
|
||||||
this.updateDirent(dirent, 'file_tags', fileTags);
|
this.updateDirent(dirent, 'file_tags', fileTags);
|
||||||
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
|
Reference in New Issue
Block a user