mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
@@ -15,6 +15,7 @@ const propTypes = {
|
|||||||
permission: PropTypes.bool.isRequired,
|
permission: PropTypes.bool.isRequired,
|
||||||
currentPath: PropTypes.string.isRequired,
|
currentPath: PropTypes.string.isRequired,
|
||||||
updateUsedRepoTags: PropTypes.func.isRequired,
|
updateUsedRepoTags: PropTypes.func.isRequired,
|
||||||
|
onDeleteRepoTag: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
class DirTool extends React.Component {
|
class DirTool extends React.Component {
|
||||||
@@ -121,6 +122,7 @@ class DirTool extends React.Component {
|
|||||||
currentTag={this.state.currentTag}
|
currentTag={this.state.currentTag}
|
||||||
onClose={this.onCloseRepoTagDialog}
|
onClose={this.onCloseRepoTagDialog}
|
||||||
toggleCancel={this.onUpdateRepoTagToggle}
|
toggleCancel={this.onUpdateRepoTagToggle}
|
||||||
|
onDeleteRepoTag={this.props.onDeleteRepoTag}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ const propTypes = {
|
|||||||
isViewFile: PropTypes.bool,
|
isViewFile: PropTypes.bool,
|
||||||
updateUsedRepoTags: PropTypes.func.isRequired,
|
updateUsedRepoTags: PropTypes.func.isRequired,
|
||||||
fileTags: PropTypes.array.isRequired,
|
fileTags: PropTypes.array.isRequired,
|
||||||
|
onDeleteRepoTag: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
class CurDirPath extends React.Component {
|
class CurDirPath extends React.Component {
|
||||||
@@ -37,6 +38,7 @@ class CurDirPath extends React.Component {
|
|||||||
permission={this.props.permission}
|
permission={this.props.permission}
|
||||||
currentPath={this.props.currentPath}
|
currentPath={this.props.currentPath}
|
||||||
updateUsedRepoTags={this.props.updateUsedRepoTags}
|
updateUsedRepoTags={this.props.updateUsedRepoTags}
|
||||||
|
onDeleteRepoTag={this.props.onDeleteRepoTag}
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -8,6 +8,7 @@ const propTypes = {
|
|||||||
currentTag: PropTypes.object,
|
currentTag: PropTypes.object,
|
||||||
repoID: PropTypes.string.isRequired,
|
repoID: PropTypes.string.isRequired,
|
||||||
toggleCancel: PropTypes.func.isRequired,
|
toggleCancel: PropTypes.func.isRequired,
|
||||||
|
onDeleteRepoTag: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired
|
onClose: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -65,8 +66,11 @@ class UpdateTagDialog extends React.Component {
|
|||||||
onDeleteTag = () => {
|
onDeleteTag = () => {
|
||||||
let tag = this.props.currentTag;
|
let tag = this.props.currentTag;
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
seafileAPI.deleteRepoTag(repoID, tag.id).then(() => {
|
seafileAPI.deleteRepoTag(repoID, tag.id).then((res) => {
|
||||||
this.props.toggleCancel();
|
this.props.toggleCancel();
|
||||||
|
if (res.data.success === "true") {
|
||||||
|
this.props.onDeleteRepoTag(tag.id);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,6 +75,7 @@ const propTypes = {
|
|||||||
selectedDirent: PropTypes.object,
|
selectedDirent: PropTypes.object,
|
||||||
closeDirentDetail: PropTypes.func.isRequired,
|
closeDirentDetail: PropTypes.func.isRequired,
|
||||||
showDirentDetail: PropTypes.func.isRequired,
|
showDirentDetail: PropTypes.func.isRequired,
|
||||||
|
onDeleteRepoTag: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
class LibContentContainer extends React.Component {
|
class LibContentContainer extends React.Component {
|
||||||
@@ -153,6 +154,7 @@ class LibContentContainer extends React.Component {
|
|||||||
onPathClick={this.onPathClick}
|
onPathClick={this.onPathClick}
|
||||||
updateUsedRepoTags={this.props.updateUsedRepoTags}
|
updateUsedRepoTags={this.props.updateUsedRepoTags}
|
||||||
fileTags={this.props.fileTags}
|
fileTags={this.props.fileTags}
|
||||||
|
onDeleteRepoTag={this.props.onDeleteRepoTag}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={`cur-view-content ${this.props.currentMode === 'column' ? 'view-mode-container' : ''}`}>
|
<div className={`cur-view-content ${this.props.currentMode === 'column' ? 'view-mode-container' : ''}`}>
|
||||||
|
@@ -1229,6 +1229,20 @@ class LibContentView extends React.Component {
|
|||||||
this.onDirentSelected(dirent);
|
this.onDirentSelected(dirent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDeleteRepoTag = (deletedTagID) => {
|
||||||
|
let direntList = this.state.direntList.map(dirent => {
|
||||||
|
if (dirent.file_tags) {
|
||||||
|
let fileTags = dirent.file_tags.filter(item => {
|
||||||
|
return item.repo_tag_id !== deletedTagID;
|
||||||
|
});
|
||||||
|
dirent.file_tags = fileTags;
|
||||||
|
}
|
||||||
|
return dirent;
|
||||||
|
});
|
||||||
|
this.setState({direntList: direntList});
|
||||||
|
this.updateUsedRepoTags();
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.state.libNeedDecrypt) {
|
if (this.state.libNeedDecrypt) {
|
||||||
return (
|
return (
|
||||||
@@ -1380,6 +1394,7 @@ class LibContentView extends React.Component {
|
|||||||
selectedDirent={this.state.selectedDirentList && this.state.selectedDirentList[0]}
|
selectedDirent={this.state.selectedDirentList && this.state.selectedDirentList[0]}
|
||||||
closeDirentDetail={this.closeDirentDetail}
|
closeDirentDetail={this.closeDirentDetail}
|
||||||
showDirentDetail={this.showDirentDetail}
|
showDirentDetail={this.showDirentDetail}
|
||||||
|
onDeleteRepoTag={this.onDeleteRepoTag}
|
||||||
/>
|
/>
|
||||||
{this.state.pathExist && !this.state.isViewFile && (
|
{this.state.pathExist && !this.state.isViewFile && (
|
||||||
<FileUploader
|
<FileUploader
|
||||||
|
Reference in New Issue
Block a user