From d051f92de9f3b937abd5ff54813d23c7bae3eeb3 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Wed, 24 Feb 2016 18:00:18 +0100 Subject: [PATCH] Update styling --- .../action.share/class.ShareCenter.php | 1 + .../action.share/res/react-share-form.css | 8 +++- .../action.share/res/react-share-form.less | 8 +++- .../action.share/res/react/ShareDialog.js | 44 ++++++++++++++++--- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/core/src/plugins/action.share/class.ShareCenter.php b/core/src/plugins/action.share/class.ShareCenter.php index bb1cef821f..384c51d827 100644 --- a/core/src/plugins/action.share/class.ShareCenter.php +++ b/core/src/plugins/action.share/class.ShareCenter.php @@ -1501,6 +1501,7 @@ public function shareNode($httpVars, &$update){ } + // OCS LINK if(isSet($httpVars["ocs_data"])){ $ocsData = json_decode($httpVars["ocs_data"], true); diff --git a/core/src/plugins/action.share/res/react-share-form.css b/core/src/plugins/action.share/res/react-share-form.css index c99badb4fc..dc30b5761d 100644 --- a/core/src/plugins/action.share/res/react-share-form.css +++ b/core/src/plugins/action.share/res/react-share-form.css @@ -188,7 +188,8 @@ div#react_share_form div.user-badge span.avatar { div#react_share_form div.user-badge.user-type-group span.avatar { background-color: #47b092; } -div#react_share_form div.user-badge.user-type-tmp_user span.avatar { +div#react_share_form div.user-badge.user-type-tmp_user span.avatar, +div#react_share_form div.user-badge.user-type-remote_user span.avatar { background-color: #438db3; } div#react_share_form div.user-badge img { @@ -245,7 +246,10 @@ div#react_share_form div.remote-users-add div.user { } div#react_share_form div.remote-users-add button.mui-icon-button { margin-top: 26px; - color: #ccc; + color: #438db3; +} +div#react_share_form div.remote-users-add button.mui-icon-button.mui-is-disabled { + color: #eee; } div.react-autosuggest { padding-left: 4px; diff --git a/core/src/plugins/action.share/res/react-share-form.less b/core/src/plugins/action.share/res/react-share-form.less index f9ea723ef2..5424d30e6e 100644 --- a/core/src/plugins/action.share/res/react-share-form.less +++ b/core/src/plugins/action.share/res/react-share-form.less @@ -216,7 +216,8 @@ div#react_share_form { background-color: @color1; } } - &.user-type-tmp_user{ + &.user-type-tmp_user, + &.user-type-remote_user{ span.avatar{ background-color: @color3; } @@ -275,7 +276,10 @@ div#react_share_form { } button.mui-icon-button{ margin-top: 26px; - color: #ccc; + color: @color3; + &.mui-is-disabled{ + color: #eee; + } } } } diff --git a/core/src/plugins/action.share/res/react/ShareDialog.js b/core/src/plugins/action.share/res/react/ShareDialog.js index 771ccc2aca..705cac3159 100644 --- a/core/src/plugins/action.share/res/react/ShareDialog.js +++ b/core/src/plugins/action.share/res/react/ShareDialog.js @@ -74,8 +74,10 @@ } if( (model.getNode().isLeaf() && auth.file_workspaces) || (!model.getNode().isLeaf() && auth.folder_workspaces)){ var users = model.getSharedUsers(); + var ocsUsers = model.getOcsInvitations(); + var totalUsers = users.length + ocsUsers.length; panels.push( - + ); @@ -259,8 +261,10 @@ }*/ if(this.props.type == 'group') { avatar = ; - }else if(this.props.type == 'temporary'){ + }else if(this.props.type == 'temporary') { avatar = ; + }else if(this.props.type == 'remote_user'){ + avatar = ; }else{ avatar = ; } @@ -588,6 +592,10 @@ shareModel: React.PropTypes.instanceOf(ReactModel.Share) }, + getInitialState: function(){ + return {addDisabled: true}; + }, + addUser:function(){ var h = this.refs["host"].getValue(); var u = this.refs["user"].getValue(); @@ -598,21 +606,45 @@ this.props.shareModel.removeOcsInvitation(invite); }, + monitorInput:function(){ + var h = this.refs["host"].getValue(); + var u = this.refs["user"].getValue(); + this.setState({addDisabled:!(h && u)}); + }, + render: function(){ var inv = this.props.shareModel.getOcsInvitations().map(function(invite){ var rem = function(){ this.removeUser(invite); }.bind(this); - return
{invite.HOST} -- {invite.USER} -- X
; + var status; + if(!invite.STATUS){ + status = 'not sent'; + }else if(invite.STATUS == 1){ + status = 'pending'; + }else if(invite.STATUS == 2){ + status = 'accepted'; + }else if(invite.STATUS == 4){ + status = 'rejected'; + } + var menuItems = [{text:'Remove', callback:rem}]; + return ( + + ); }.bind(this)); return (

Remote Users

- - - + + +
{inv}