Permalink
Browse files

Fix some broken shares scenariis - Fix react component not correctly …

…destroyed in InfoPanel
  • Loading branch information...
1 parent 1af4745 commit 5f75ae6b9e7c3f1da0853b49d954f3757af3e966 @cdujeu cdujeu committed Sep 24, 2016
@@ -249,4 +249,6 @@
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
"230" => "Please save before sending an invitation",
"231" => "Click to start downloading",
+ "232" => "No entries found for share, did you maybe delete some users?",
+ "233" => "Reset this share",
);
@@ -248,4 +248,6 @@
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
"230" => "Please save before sending an invitation",
"231" => "Click to start downloading",
+ "232" => "No entries found for share, did you maybe delete some users?",
+ "233" => "Reset this share",
);
@@ -248,4 +248,6 @@
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
"230" => "Please save before sending an invitation",
"231" => "Click to start downloading",
+ "232" => "No entries found for share, did you maybe delete some users?",
+ "233" => "Reset this share",
);
@@ -247,4 +247,6 @@
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
"230" => "Please save before sending an invitation",
"231" => "Click to start downloading",
+ "232" => "No entries found for share, did you maybe delete some users?",
+ "233" => "Reset this share",
);
@@ -247,4 +247,6 @@
"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.",
"231" => "Cliquez pour télécharger",
+ "232" => "Pas d'entrées pour ce partage, peut-être avez-vous supprimé des utilisateurs?",
+ "233" => "Réinitialiser le partage",
);
@@ -247,5 +247,7 @@
"231" => "Click to start downloading",
"11" => "Expiration",
"49" => "create user",
+ "232" => "No entries found for share, did you maybe delete some users?",
+ "233" => "Reset this share",
// will be replaced by the filename to download
);
@@ -247,4 +247,6 @@
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
"230" => "Please save before sending an invitation",
"231" => "Click to start downloading",
+ "232" => "No entries found for share, did you maybe delete some users?",
+ "233" => "Reset this share",
);
@@ -247,5 +247,7 @@
"161" => "Deprecated Link",
"162" => "You have one or more legacy link on this file. Links are still active, but you can replace them with a new share link by stopping this share and recreating a new one. Copy the share 'hash' (the last part of the link, e.g. http://yourpydio.com/data/public/<em style='color:red;'>206a51</em>.php) and apply it to the new link using the 'Change Parameters' form.",
"163" => "Drop Files Here (for upload-enabled minisites)",
+"232" => "No entries found for share, did you maybe delete some users?",
+"233" => "Reset this share",
// will be replaced by the filename to download
);
@@ -33,6 +33,10 @@
Loader.INSTANCE.hookAfterDelete();
}
var mainCont = container.querySelectorAll("#ajxp_shared_info_panel .infoPanelTable")[0];
+ mainCont.destroy = function(){
+ React.unmountComponentAtNode(mainCont);
+ };
+ mainCont.className += (mainCont.className ? ' ' : '') + 'infopanel-destroyable-pane';
React.render(
React.createElement(InfoPanel, {pydio:global.pydio, node:node}),
mainCont
@@ -294,13 +298,25 @@
</div>
);
}
+ if(this.state.model.getStatus() !== 'loading' && !sharedUsersEntries.length
+ && !remoteUsersEntries.length && !this.state.model.hasPublicLink()){
+ let func = function(){
+ this.state.model.stopSharing();
+ }.bind(this);
+ var noEntriesFoundBlock = (
+ <div className="infoPanelRow">
+ <div className="infoPanelValue">{this.getMessage(232)} <a style={{textDecoration:'underline',cursor:'pointer'}} onClick={func}>{this.getMessage(233)}</a></div>
+ </div>
+ );
+ }
return (
<div>
{linkField}
{downloadField}
{templateField}
{sharedUsersBlock}
+ {noEntriesFoundBlock}
</div>
);
}
@@ -144,7 +144,7 @@ public function toJson(ContextInterface $ctx, $watcher, $rightsManager, $publicA
}
$sharedEntries = $rightsManager->computeSharedRepositoryAccessRights($this->getRepositoryId(), true, $repoRootNode);
if(empty($sharedEntries)){
- return false;
+// return false;
}
$cFilter = $this->getRepository()->getContentFilter();
if(!empty($cFilter)){
@@ -141,6 +141,9 @@ Class.create("InfoPanel", AjxpPane, {
this.htmlElement.select(".class-FetchedResultPane").each(function(el){
el.ajxpPaneObject.destroy();
});
+ this.htmlElement.select(".infopanel-destroyable-pane").each(function(el){
+ el.destroy();
+ });
}
this.setContent('');
},

0 comments on commit 5f75ae6

Please sign in to comment.