-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Avatars in share dialog #13866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avatars in share dialog #13866
Conversation
Looks great. Let's merge this after the 8.0 release. I wonder why you also added a avatar for the group shares. Up to now you can't set a avatar for a group. If you share a file from user1 to user2 and then open the share drop-down for user2 on the shared file you see something like "Shared with you by user user1", would be nice to have the avatar there too. |
@schiesbn I added the avatar also for the groups to make sure that the layout stayed the same. It can be trivially removed again of course. But in my opinion it looks better if they all indent the same amount. I'll look into the extra avatar. Should not be to hard. |
@rullzer makes sense, but then we also need a avatar for remote shares (aka server-to-server shares). With ownCloud 8 you will be able to share a file/folder to a user on another ownCloud server by adding something like Or you add a just some additional spacing for group and remote shares. I leave this decision to you, I think both is acceptable. Maybe @jancborchardt also has a opinion on this 😉 |
@schiesbn ah true I did not really play with remote shares that much. But indeed then that is required there as well. Shich would be rather easy to add. Lets see what @jancborchardt has to say. And then I can add it. Of course the remote avatar would then just be the same as for the groups. Unless we have a fancy way to retrieve remote avatars. |
I think this would be OK as a first step. Of course it would be really cool if we could also get the avatar from the remote server. |
We now also have remote avatars. Altough I could not fully test them since I do not have 2 ownlcoud 8 setups (yet). |
Great! You should also be able to create a remote share from user1 to user2 with both on the same server. It doesn't make sense but it is useful for testing purpose. |
If I have a server-to-server share in the list I get following syntax error in the JavaScript console (remote user us "schiesbn@vm/server1"):
|
Aah mmm seems more filtering is needed. I'll have a look at it. |
@rullzer nice! Just some remarks:
Thanks! :) |
Currently we still have the placeholder for remote shares. Should that stay or go? |
If the placeholder is the actual avatar of the user, then yes. If the remote user has an actual avatar, we should show that. If showing the actual avatar of the remote user is not possible, then we should not show a placeholder on one end. Thanks! :) (Also, please squash the commits into one again so it’s nicer after we merge it.) |
@jancborchardt done. It is currently not possible to get remote avatars. So that will be something for a future PR. |
Looks great! 👍 @schiesbn can you also review it again? @rullzer can you check out the errors from Jenkins and Scrutinizer? |
So the problem with he build-bot are the unit tests. For some reason they fail... I have no clue why since as far as I know I do not touch the code responsible for the unit tests. I'll look into it in more depth soon. |
Tested, looks great! The failing tests are a problem wit our build-bot. I created a new dummy-pr to get a final test. Once it passes I will merge your PR. |
@schiesbn well the unit test do also not pass locally. So I did break something. @PVince81 as requested
|
@@ -681,6 +692,9 @@ OC.Share={ | |||
html += '</div>'; | |||
html += '</li>'; | |||
html = $(html).appendTo('#shareWithList'); | |||
if (shareType == OC.Share.SHARE_TYPE_USER) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use triple equals ===
Please do the following:
|
Still not correct but it is a small step
So the unit tests pass again! |
expect(avatarStub.calledOnce).toEqual(true); | ||
var args = avatarStub.getCall(0).args; | ||
|
||
expect($('#avatar-user1')[0]).toEqual(jasmine.anything()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually do expect($('#avatar-user1').length).toEqual(1));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that might look cleaner indeed
The code looks good, haven't tested yet. |
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 14 lines...] > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git2703028884527562311.credentials # timeout=10 > git -c core.askpass=true fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse refs/remotes/origin/pr/13866/merge^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/pr/13866/merge^{commit} # timeout=10Checking out Revision 9da1be0b58085f4a766226f38155c7fb1c1e0a3e (refs/remotes/origin/pr/13866/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f 9da1be0b58085f4a766226f38155c7fb1c1e0a3e > git rev-list 8da12e0f9ed71ad6ad9b15060f849e3179231733 # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILURESetting status of ecb7d44 to FAILURE with url https://ci.owncloud.org/job/pull-request-analyser-ng-simple/9339/ and message: Merged build finished.Test FAILed. |
@rullzer I just remembered that there is an option in config.php to disable avatars. Can you add this to your code as well ? |
@PVince81 I added the checks and extended the unit tests. |
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 14 lines...] > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git6036363490301203250.credentials # timeout=10 > git -c core.askpass=true fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse refs/remotes/origin/pr/13866/merge^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/pr/13866/merge^{commit} # timeout=10Checking out Revision dccf9b71f33b336b55aa9c1580252dceb7fbd2bc (refs/remotes/origin/pr/13866/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f dccf9b71f33b336b55aa9c1580252dceb7fbd2bc > git rev-list 8da12e0f9ed71ad6ad9b15060f849e3179231733 # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILURESetting status of 9a6da8e to FAILURE with url https://ci.owncloud.org/job/pull-request-analyser-ng-simple/9390/ and message: Merged build finished.Test FAILed. |
The inspection completed: 8 new issues |
Tests successfully passed here: #14144 👍 from my side. |
Ok, so if the commits are squashed one more time into one this looks good to go! :) |
I do wonder whether this needs more vertical spacing: @jancborchardt what do you think ? @rullzer sorry for delaying the merge of this nice PR a bit more 😄 |
@PVince81 Hehe no problem. We have some time before 8.1 right :) Anyway. I'm fine either way. Adding a bit more spacing is not that hard. |
Anyway, I don't want to block this needlessly. The spacing wasn't that nice even before the avatars. 👍 |
Yeah, it’s a different issue. It doesn’t need vertical spacing, it needs a proper dropdown for the »create, edit, delete« actions ;) Great job @rullzer! :) |
As mentioned in #5506 and better illustrated in #3224 this PR add user avatars to the share dialog. Not int the auto complete list but of the users we have shared with. To add it to the autocompletelist probably requires some rework.
If a user does not have an avatar the placeholder image is shown so that formatting stays consistent.