Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Rewire missing action for deleting user-created workspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Apr 8, 2016
1 parent 58627f0 commit 1c046f1
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions core/src/plugins/gui.ajax/res/js/ui/reactjs/jsx/LeftNavigation.js
Expand Up @@ -459,19 +459,29 @@
this.wrapper.remove();
},

handleRemoveTplBasedWorkspace: function(event){
event.stopPropagation();
if(!global.confirm(this.props.pydio.MessageHash['424'])){
return;
}
PydioApi.getClient().request({get_action:'user_delete_repository', repository_id:this.props.workspace.getId()}, function(transport){
PydioApi.getClient().parseXmlMessage(transport.responseXML);
});
},

onClick:function() {
this.props.pydio.triggerRepositoryChange(this.props.workspace.getId());
},

render:function(){
var current = this.props.pydio.user.getActiveRepository(),
var current = (this.props.pydio.user.getActiveRepository() == this.props.workspace.getId()),
currentClass="workspace-entry",
messages = this.props.pydio.MessageHash,
onHover, onOut, onClick,
additionalAction,
badge, badgeNum, newWorkspace;

if (current == this.props.workspace.getId()) {
if (current) {
currentClass +=" workspace-current";
}

Expand Down Expand Up @@ -512,14 +522,15 @@

if (this.props.workspace.getOwner() && !this.props.workspace.getAccessStatus() && !this.props.workspace.getLastConnection()) {
newWorkspace = <span className="workspace-new">NEW</span>;

// Dialog for remote shares
if (this.props.workspace.getRepositoryType() == "remote") {
onClick = this.handleOpenAlert.bind(this, 'new_share');
}
}else if(this.props.workspace.getRepositoryType() == "remote"){
}else if(this.props.workspace.getRepositoryType() == "remote" && !current){
// Remote share but already accepted, add delete
additionalAction = <span className="workspace-additional-action mdi mdi-close" onClick={this.handleOpenAlert.bind(this, 'reject_accepted')} title={messages['550']}/>;
}else if(this.props.workspace.userEditable && !current){
additionalAction = <span className="workspace-additional-action mdi mdi-close" onClick={this.handleRemoveTplBasedWorkspace} title={messages['423']}/>;
}

return (
Expand Down

0 comments on commit 1c046f1

Please sign in to comment.