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

Commit 5f75ae6

Browse files
committed
Fix some broken shares scenariis - Fix react component not correctly destroyed in InfoPanel
1 parent 1af4745 commit 5f75ae6

File tree

11 files changed

+36
-1
lines changed

11 files changed

+36
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,6 @@
249249
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
250250
"230" => "Please save before sending an invitation",
251251
"231" => "Click to start downloading",
252+
"232" => "No entries found for share, did you maybe delete some users?",
253+
"233" => "Reset this share",
252254
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,6 @@
248248
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
249249
"230" => "Please save before sending an invitation",
250250
"231" => "Click to start downloading",
251+
"232" => "No entries found for share, did you maybe delete some users?",
252+
"233" => "Reset this share",
251253
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,6 @@
248248
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
249249
"230" => "Please save before sending an invitation",
250250
"231" => "Click to start downloading",
251+
"232" => "No entries found for share, did you maybe delete some users?",
252+
"233" => "Reset this share",
251253
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,6 @@
247247
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
248248
"230" => "Please save before sending an invitation",
249249
"231" => "Click to start downloading",
250+
"232" => "No entries found for share, did you maybe delete some users?",
251+
"233" => "Reset this share",
250252
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,6 @@
247247
"229" => "Collez ce code dans une page HTML pour insérer une prévisualisation du fichier.",
248248
"230" => "Veuillez sauver ce partage avant de pouvoir envoyer une invitation.",
249249
"231" => "Cliquez pour télécharger",
250+
"232" => "Pas d'entrées pour ce partage, peut-être avez-vous supprimé des utilisateurs?",
251+
"233" => "Réinitialiser le partage",
250252
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,7 @@
247247
"231" => "Click to start downloading",
248248
"11" => "Expiration",
249249
"49" => "create user",
250+
"232" => "No entries found for share, did you maybe delete some users?",
251+
"233" => "Reset this share",
250252
// will be replaced by the filename to download
251253
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,6 @@
247247
"229" => "Insert a preview of the file by pasting this code inside an HTML page.",
248248
"230" => "Please save before sending an invitation",
249249
"231" => "Click to start downloading",
250+
"232" => "No entries found for share, did you maybe delete some users?",
251+
"233" => "Reset this share",
250252
);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,7 @@
247247
"161" => "Deprecated Link",
248248
"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.",
249249
"163" => "Drop Files Here (for upload-enabled minisites)",
250+
"232" => "No entries found for share, did you maybe delete some users?",
251+
"233" => "Reset this share",
250252
// will be replaced by the filename to download
251253
);

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
Loader.INSTANCE.hookAfterDelete();
3434
}
3535
var mainCont = container.querySelectorAll("#ajxp_shared_info_panel .infoPanelTable")[0];
36+
mainCont.destroy = function(){
37+
React.unmountComponentAtNode(mainCont);
38+
};
39+
mainCont.className += (mainCont.className ? ' ' : '') + 'infopanel-destroyable-pane';
3640
React.render(
3741
React.createElement(InfoPanel, {pydio:global.pydio, node:node}),
3842
mainCont
@@ -294,13 +298,25 @@
294298
</div>
295299
);
296300
}
301+
if(this.state.model.getStatus() !== 'loading' && !sharedUsersEntries.length
302+
&& !remoteUsersEntries.length && !this.state.model.hasPublicLink()){
303+
let func = function(){
304+
this.state.model.stopSharing();
305+
}.bind(this);
306+
var noEntriesFoundBlock = (
307+
<div className="infoPanelRow">
308+
<div className="infoPanelValue">{this.getMessage(232)} <a style={{textDecoration:'underline',cursor:'pointer'}} onClick={func}>{this.getMessage(233)}</a></div>
309+
</div>
310+
);
311+
}
297312

298313
return (
299314
<div>
300315
{linkField}
301316
{downloadField}
302317
{templateField}
303318
{sharedUsersBlock}
319+
{noEntriesFoundBlock}
304320
</div>
305321
);
306322
}

core/src/plugins/action.share/src/Model/CompositeShare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function toJson(ContextInterface $ctx, $watcher, $rightsManager, $publicA
144144
}
145145
$sharedEntries = $rightsManager->computeSharedRepositoryAccessRights($this->getRepositoryId(), true, $repoRootNode);
146146
if(empty($sharedEntries)){
147-
return false;
147+
// return false;
148148
}
149149
$cFilter = $this->getRepository()->getContentFilter();
150150
if(!empty($cFilter)){

0 commit comments

Comments
 (0)