1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

tag-filter-file-show

This commit is contained in:
wangjianhui
2018-11-19 17:44:59 +08:00
committed by shanshuirenjia
parent 04d4f57b4e
commit 821cb29730
5 changed files with 121 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
import ListTagDialog from '../dialog/list-tag-dialog';
import CreateTagDialog from '../dialog/create-tag-dialog';
import UpdateTagDialog from '../dialog/update-tag-dialog';
import ListTaggedFilesDialog from '../dialog/list-taggedfiles-dialog';
const propTypes = {
repoID: PropTypes.string.isRequired,
@@ -22,6 +23,7 @@ class DirTool extends React.Component {
isListRepoTagShow: false,
isUpdateRepoTagShow: false,
isCreateRepoTagShow: false,
isListTaggedFileShow: false,
};
}
@@ -44,6 +46,14 @@ class DirTool extends React.Component {
});
}
onListTaggedFileToggle = (currentTag) => {
this.setState({
currentTag: currentTag,
isListRepoTagShow: !this.state.isListRepoTagShow,
isListTaggedFileShow: !this.state.isListTaggedFileShow,
});
}
isMarkdownFile(filePath) {
let name = Utils.getFileName(filePath);
return name.indexOf('.md') > -1 ? true : false;
@@ -70,6 +80,7 @@ class DirTool extends React.Component {
onListTagCancel={this.onListRepoTagToggle}
onCreateRepoTag={this.onCreateRepoTagToggle}
onUpdateRepoTag={this.onUpdateRepoTagToggle}
onListFileCancel={this.onListTaggedFileToggle}
/>
}
{
@@ -87,6 +98,13 @@ class DirTool extends React.Component {
toggleCancel={this.onUpdateRepoTagToggle}
/>
}
{
this.state.isListTaggedFileShow &&
<ListTaggedFilesDialog
repoTagId={this.state.currentTag.id}
toggleCancel={this.onListTaggedFileToggle}
/>
}
</Fragment>
);
} else if (!isFile && permission) {