Permalink
Browse files

Make sure to save before trying to send an invitation to internal use…

…rs. Fix #1166

(cherry picked from commit c605731)
  • Loading branch information...
1 parent 52bae2d commit 1d2301aef73aca6a262651d149716da95ce6a19d @cdujeu cdujeu committed Jul 6, 2016
@@ -246,5 +246,6 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
- "229" => "Insert a preview of the file by pasting this code inside an HTML page."
+ "229" => "Insert a preview of the file by pasting this code inside an HTML page.",
+ "230" => "Please save before sending an invitation",
);
@@ -245,5 +245,6 @@
"226" => "Sie dürfen keine öffentlichen Links auf Ordner erstellen.",
"227" => "Sie dürfen keine internen Freigaben auf Dateien erstellen.",
"228" => "Sie dürfen keine internen Freigaben auf Ordner erstellen.",
- "229" => "Insert a preview of the file by pasting this code inside an HTML page."
+ "229" => "Insert a preview of the file by pasting this code inside an HTML page.",
+ "230" => "Please save before sending an invitation",
);
@@ -245,5 +245,6 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
- "229" => "Insert a preview of the file by pasting this code inside an HTML page."
+ "229" => "Insert a preview of the file by pasting this code inside an HTML page.",
+ "230" => "Please save before sending an invitation",
);
@@ -244,5 +244,6 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
- "229" => "Insert a preview of the file by pasting this code inside an HTML page."
+ "229" => "Insert a preview of the file by pasting this code inside an HTML page.",
+ "230" => "Please save before sending an invitation",
);
@@ -244,5 +244,6 @@
"226" => "Vous n'êtes pas autorisé à créer des liens publics sur les répertoires",
"227" => "Vous n'êtes pas autorisé à partager des fichiers en interne",
"228" => "Vous n'êtes pas autorisé à partager des répertoires en interne",
- "229" => "Collez ce code dans une page HTML pour insérer une prévisualisation du fichier."
+ "229" => "Collez ce code dans une page HTML pour insérer une prévisualisation du fichier.",
+ "230" => "Veuillez sauver ce partage avant de pouvoir envoyer une invitation.",
);
Oops, something went wrong.
@@ -244,5 +244,6 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
- "229" => "Insert a preview of the file by pasting this code inside an HTML page."
+ "229" => "Please save before sending an invitation",
+ "230" => "Insert a preview of the file by pasting this code inside an HTML page."
);
Oops, something went wrong.
@@ -252,17 +252,24 @@
shareModel:React.PropTypes.instanceOf(ReactModel.Share),
showMailer:React.PropTypes.func
},
+
onUserUpdate: function(operation, userId, userData){
this.props.shareModel.updateSharedUser(operation, userId, userData);
},
+
onSaveSelection:function(){
var label = window.prompt(this.context.getMessage(510, ''));
if(!label) return;
this.props.shareModel.saveSelectionAsTeam(label);
},
+
sendInvitations:function(userObjects){
- var mailData = this.props.shareModel.prepareEmail("repository");
- this.props.showMailer(mailData.subject, mailData.message, userObjects);
+ try{
+ var mailData = this.props.shareModel.prepareEmail("repository");
+ this.props.showMailer(mailData.subject, mailData.message, userObjects);
+ }catch(e){
+ global.alert(e.message);
+ }
},
render: function(){
@@ -886,16 +886,15 @@
link = this.getPublicLink(linkId);
message = s + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
}else{
+ if(!this._data['repository_url']){
+ throw new Error(MessageHash['share_center.229']);
+ }
s = MessageHash["share_center." + (this.getNode().isLeaf() ? "42" : "43")];
if(s) s = s.replace("%s", ApplicationTitle);
if(this._data['repository_url']){
link = this._data['repository_url'];
}
- //if(this.shareFolderMode == 'workspace'){
message = s + "\n\n " + "<a href='" + link +"'>" + MessageHash["share_center.46"].replace("%s1", this.getGlobal("label")).replace("%s2", ajaxplorer.appTitle) + "</a>";
- //}else{
- // message = s + "\n\n " + "<a href='" + link +"'>" + MessageHash["share_center.46" + (this.currentNode.isLeaf()?'_file':'_mini')].replace("%s1", this._currentRepositoryLabel) + "</a>";
- //}
}
var usersList = null;
if(this.shareFolderMode == 'workspace' && oForm) {

0 comments on commit 1d2301a

Please sign in to comment.