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

Commit

Permalink
Migrate Info Panel modified from ShareCenter to ShareDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Feb 29, 2016
1 parent e854cb3 commit 77eab14
Show file tree
Hide file tree
Showing 10 changed files with 351 additions and 33 deletions.
6 changes: 5 additions & 1 deletion core/src/plugins/action.share/class.ShareLink.php
Expand Up @@ -187,13 +187,17 @@ public function getJsonData($publicAccessManager, $messages){
$minisiteIsPublic = isSet($storedData["PRELOG_USER"]);
$dlDisabled = isSet($storedData["DOWNLOAD_DISABLED"]) && $storedData["DOWNLOAD_DISABLED"] === true;
$shareMeta = isSet($this->additionalMeta) ? $this->additionalMeta : array();
$internalUserId = (isSet($storedData["PRELOG_USER"]) ? $storedData["PRELOG_USER"] : $storedData["PRESET_LOGIN"]);
if(empty($internalUserId)){
throw new Exception("Oups, link ".$this->getHash()." has no internal user id, this is not normal.");
}

$jsonData = array(
"public" => $minisiteIsPublic?"true":"false",
"disable_download" => $dlDisabled,
"hash" => $this->getHash(),
"hash_is_shorten" => isSet($shareMeta["short_form_url"]),
"internal_user_id" => (isSet($storedData["PRELOG_USER"]) ? $storedData["PRELOG_USER"] : $storedData["PRESET_LOGIN"])
"internal_user_id" => $internalUserId
);

if(!isSet($storedData["TARGET"]) || $storedData["TARGET"] == "public"){
Expand Down
21 changes: 10 additions & 11 deletions core/src/plugins/action.share/manifest.xml
Expand Up @@ -35,6 +35,7 @@
<js file="plugins/action.share/qrcode.js" className="QRCode" autoload="false"/>
<js file="plugins/action.share/class.ShareCenter.js" className="ShareCenter" autoload="false"/>
<js file="plugins/action.share/res/build/model/ShareModel.js" className="ReactModelShare"/>
<js file="plugins/action.share/res/build/ShareInfoPanel.js" className="ShareInfoPanel" depends="React,ReactModelShare"/>
<js file="plugins/action.share/res/build/ShareDialog.js" className="ShareDialog" depends="React,ReactModelShare,PydioForm,UsersCompleter"/>
</resources>
</client_settings>
Expand Down Expand Up @@ -431,16 +432,14 @@
</gui>
<processing>
<clientCallback prepareModal="true"><![CDATA[
ResourcesManager.detectModuleToLoadAndApply('ShareCenter', function(){
if(!pydio.getController().shareCenter) {
pydio.getController().shareCenter = new ShareCenter();
}
if(window.actionArguments && window.actionArguments.length){
pydio.getController().shareCenter.performShareAction(window.actionArguments[0]);
}else if(window.actionManager){
pydio.getController().shareCenter.performShareAction(window.actionManager.getDataModel());
}
});
var dataModel;
if(window.actionArguments && window.actionArguments.length){
dataModel = window.actionArguments[0];
}else if(window.actionManager){
dataModel = window.actionManager.getDataModel();
}
var dialog = new AjxpReactDialogLoader('ShareDialog', 'MainPanel', {selection:dataModel});
dialog.openDialog('react_share_form', true);
]]></clientCallback>
</processing>
</action>
Expand Down Expand Up @@ -534,7 +533,7 @@
</actions>
<client_configs>
<component_config className="InfoPanel">
<infoPanelExtension mime="meta:ajxp_shared" attributes="" modifier="ShareCenter.prototype.loadInfoPanel">
<infoPanelExtension mime="meta:ajxp_shared" attributes="" modifier="ShareInfoPanel.loader">
<messages>
<message key="type_string" id="share_center.50"/>
</messages>
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/action.share/res/i18n/en.php
Expand Up @@ -222,7 +222,7 @@
"207" => "Remote Users",
"208" => "Share with users from other filesharing platforms (currently only Pydio and Owncloud are supported).",
"209" => "Remote Address",
"210" => "User Identifier",
"210" => "Identifier",
"211" => "pending",
"212" => "accepted",
"213" => "rejected",
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/action.share/res/i18n/fr.php
Expand Up @@ -79,7 +79,7 @@
"71"=> "Permissions",
"72"=> "Prévisualiser",
"73"=> "Télécharger",
"74"=> "Envoyer des fichiers",
"74"=> "Envoyer",
"75"=> "Veuillez utiliser des entiers positifs pour les champs Expiration et Nombre de téléchargements !",
"76"=> "Merci d'activer les cookies pour accéder à cette application",
"77"=> "Merci d'activer JavaScript pour accéder à cette application",
Expand Down Expand Up @@ -221,7 +221,7 @@
"207" => "Utilisateurs Distants",
"208" => "Partagez avec des utilisateurs d'autres plateformes de partage de fichiers (actuellement Pydio et Owncloud sont supportés).",
"209" => "Adresse de la plateforme",
"210" => "Identifiant utilisateur",
"210" => "Identifiant",
"211" => "en attente",
"212" => "accepté",
"213" => "rejeté",
Expand Down
50 changes: 50 additions & 0 deletions core/src/plugins/action.share/res/react-share-form.css
Expand Up @@ -325,3 +325,53 @@ div.react-autosuggest input#users-autosuggest {
height: 100%;
width: 100%;
}
div#ajxp_shared_info_panel .infoPanelLabel {
color: black;
}
div#ajxp_shared_info_panel input.share_info_panel_link {
box-sizing: border-box;
width: 100%;
}
div#ajxp_shared_info_panel .copy-button {
position: absolute;
right: 1px;
top: 1px;
cursor: pointer;
background-color: rgba(255, 255, 255, 0.87);
padding: 10px;
font-size: 14px;
border-radius: 0 2px 2px 0;
}
div#ajxp_shared_info_panel .copy-message {
text-align: center;
font-size: 13px;
}
div#ajxp_shared_info_panel .uUserEntry {
display: -webkit-box;
display: -webkit-flex;
display: flex;
font-size: 0.8em;
padding: 2px 0;
color: black;
}
div#ajxp_shared_info_panel .uUserEntry:last-of-type {
border-bottom: 0;
}
div#ajxp_shared_info_panel .uUserEntry .uLabel {
-webkit-box-flex: 5;
-webkit-flex: 5;
flex: 5;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
div#ajxp_shared_info_panel .uUserEntry .uRight,
div#ajxp_shared_info_panel .uUserEntry .uStatus {
display: none;
font-size: 0.8em;
color: #6D6D6D;
}
div#ajxp_shared_info_panel .uUserEntry:hover .uRight,
div#ajxp_shared_info_panel .uUserEntry:hover .uStatus {
display: inline;
}
49 changes: 49 additions & 0 deletions core/src/plugins/action.share/res/react-share-form.less
Expand Up @@ -353,4 +353,53 @@ div.react-autosuggest {
height: 100%;
width: 100%;
}
}

div#ajxp_shared_info_panel{
.infoPanelLabel{
color: black;
}
input.share_info_panel_link{
box-sizing: border-box;
width: 100%;
}
.copy-button{
position: absolute;
right: 1px;
top: 1px;
cursor: pointer;
background-color: rgba(255, 255, 255, 0.87);
padding: 10px;
font-size: 14px;
border-radius: 0 2px 2px 0;
}
.copy-message{
text-align: center;
font-size: 13px;
}
.uUserEntry{
display: flex;
font-size: 0.8em;
padding: 2px 0;
color: black;
&:last-of-type{
border-bottom: 0;
}
.uLabel{
flex: 5;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.uRight, .uStatus{
display: none;
font-size: 0.8em;
color: #6D6D6D;
}
&:hover{
.uRight, .uStatus{
display: inline;
}
}
}
}
6 changes: 3 additions & 3 deletions core/src/plugins/action.share/res/react/ShareDialog.js
Expand Up @@ -82,7 +82,7 @@
return {
status: 'idle',
mailerData: false,
model: new ReactModel.Share(this.props.pydio, this.props.selection)
model: new ReactModel.Share(this.props.pydio, this.props.selection.getUniqueNode())
};
},

Expand Down Expand Up @@ -762,9 +762,9 @@
this._clip.on('error', function(){
var copyMessage;
if( global.navigator.platform.indexOf("Mac") === 0 ){
copyMessage = global.pydio.MessageHash['share_center.144'];
copyMessage = this.context.getMessage('144');
}else{
copyMessage = global.pydio.MessageHash['share_center.143'];
copyMessage = this.context.getMessage('143');
}
this.refs['public-link-field'].focus();
this.setState({copyMessage:copyMessage}, this.clearCopyMessage);
Expand Down

0 comments on commit 77eab14

Please sign in to comment.