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

Commit c605731

Browse files
committed
Make sure to save before trying to send an invitation to internal users. Fix #1166
1 parent efeb573 commit c605731

File tree

10 files changed

+20
-6
lines changed

10 files changed

+20
-6
lines changed

core/src/plugins/action.share/res/i18n/ca.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,5 @@
246246
"226" => "You are not allowed to create public links on folders",
247247
"227" => "You are not allowed to share files internally",
248248
"228" => "You are not allowed to share folders internally",
249+
"229" => "Please save before sending an invitation",
249250
);

core/src/plugins/action.share/res/i18n/de.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,5 @@
245245
"226" => "Sie dürfen keine öffentlichen Links auf Ordner erstellen.",
246246
"227" => "Sie dürfen keine internen Freigaben auf Dateien erstellen.",
247247
"228" => "Sie dürfen keine internen Freigaben auf Ordner erstellen.",
248+
"229" => "Please save before sending an invitation",
248249
);

core/src/plugins/action.share/res/i18n/en.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,5 @@
245245
"226" => "You are not allowed to create public links on folders",
246246
"227" => "You are not allowed to share files internally",
247247
"228" => "You are not allowed to share folders internally",
248+
"229" => "Please save before sending an invitation",
248249
);

core/src/plugins/action.share/res/i18n/es.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,5 @@
244244
"226" => "You are not allowed to create public links on folders",
245245
"227" => "You are not allowed to share files internally",
246246
"228" => "You are not allowed to share folders internally",
247+
"229" => "Please save before sending an invitation",
247248
);

core/src/plugins/action.share/res/i18n/fr.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,5 @@
244244
"226" => "Vous n'êtes pas autorisé à créer des liens publics sur les répertoires",
245245
"227" => "Vous n'êtes pas autorisé à partager des fichiers en interne",
246246
"228" => "Vous n'êtes pas autorisé à partager des répertoires en interne",
247+
"229" => "Veuillez sauver ce partage avant de pouvoir envoyer une invitation.",
247248
);

core/src/plugins/action.share/res/i18n/it.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@
242242
"226" => "Non sei autorizzato per la creazione di link pubblici alle cartelle",
243243
"227" => "Non sei autorizzato per la condivisione interna di file",
244244
"228" => "Non sei autorizzato per la condivisione interna delle cartelle",
245+
"229" => "Please save before sending an invitation",
245246
"11" => "Expiration",
246247
"49" => "create user",
247248
// will be replaced by the filename to download

core/src/plugins/action.share/res/i18n/pt.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,5 @@
244244
"226" => "You are not allowed to create public links on folders",
245245
"227" => "You are not allowed to share files internally",
246246
"228" => "You are not allowed to share folders internally",
247+
"229" => "Please save before sending an invitation",
247248
);

core/src/plugins/action.share/res/i18n/ru.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"226" => "You are not allowed to create public links on folders",
240240
"227" => "You are not allowed to share files internally",
241241
"228" => "You are not allowed to share folders internally",
242+
"229" => "Please save before sending an invitation",
242243
"159" => "Owner",
243244
"160" => "You are not allowed to delete this shared item",
244245
"161" => "Deprecated Link",

core/src/plugins/action.share/res/react/ShareDialog.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,24 @@
253253
shareModel:React.PropTypes.instanceOf(ReactModel.Share),
254254
showMailer:React.PropTypes.func
255255
},
256+
256257
onUserUpdate: function(operation, userId, userData){
257258
this.props.shareModel.updateSharedUser(operation, userId, userData);
258259
},
260+
259261
onSaveSelection:function(){
260262
var label = window.prompt(this.context.getMessage(510, ''));
261263
if(!label) return;
262264
this.props.shareModel.saveSelectionAsTeam(label);
263265
},
266+
264267
sendInvitations:function(userObjects){
265-
var mailData = this.props.shareModel.prepareEmail("repository");
266-
this.props.showMailer(mailData.subject, mailData.message, userObjects);
268+
try{
269+
var mailData = this.props.shareModel.prepareEmail("repository");
270+
this.props.showMailer(mailData.subject, mailData.message, userObjects);
271+
}catch(e){
272+
global.alert(e.message);
273+
}
267274
},
268275

269276
render: function(){

core/src/plugins/action.share/res/react/model/ShareModel.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,16 +872,15 @@
872872
link = this.getPublicLink(linkId);
873873
message = s + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
874874
}else{
875+
if(!this._data['repository_url']){
876+
throw new Error(MessageHash['share_center.229']);
877+
}
875878
s = MessageHash["share_center." + (this.getNode().isLeaf() ? "42" : "43")];
876879
if(s) s = s.replace("%s", ApplicationTitle);
877880
if(this._data['repository_url']){
878881
link = this._data['repository_url'];
879882
}
880-
//if(this.shareFolderMode == 'workspace'){
881883
message = s + "\n\n " + "<a href='" + link +"'>" + MessageHash["share_center.46"].replace("%s1", this.getGlobal("label")).replace("%s2", ajaxplorer.appTitle) + "</a>";
882-
//}else{
883-
// message = s + "\n\n " + "<a href='" + link +"'>" + MessageHash["share_center.46" + (this.currentNode.isLeaf()?'_file':'_mini')].replace("%s1", this._currentRepositoryLabel) + "</a>";
884-
//}
885884
}
886885
var usersList = null;
887886
if(this.shareFolderMode == 'workspace' && oForm) {

0 commit comments

Comments
 (0)