Skip to content
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

make it possible to share the current folder #1618

Merged
merged 13 commits into from
Nov 8, 2016

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Oct 4, 2016

With this PR I want to add a little share icon to the file list breadcrumb view to reflect whether the current folder is shared or not. On top of this enhancement, I'll add a click handler for opening the share tab view, to finally be able share the current folder without having to navigate up one level.

@rullzer @schiessle I'm totally new to the sharing code. What's the best way to determine whether the current folder has been shared or not? From inspecting responses on my test env I've observed that the share-types property of the directory's PROPFIND request is only set if the folder was shared. Is that correct? Can I rely on that property or should I use something different?

TODO:

  • show Shared + icon when the folder is shared, similar to the file list rows
  • show nothing for now if the folder is not shared (there should be a icon/button later though)
  • bind to change events on the directory's file info model and update the UI accordingly
  • add tests

Fix #1072

@mention-bot
Copy link

@ChristophWurst, thanks for your PR! By analyzing the history of the files in this pull request, we identified @PVince81, @butonic and @icewind1991 to be potential reviewers.

@ChristophWurst
Copy link
Member Author

cc @jancborchardt for the UI part. Do you have an idea how it should look like?

@jancborchardt
Copy link
Member

Yeah, the UI part is described in #1072 :) Anything else you need?

@MorrisJobke MorrisJobke mentioned this pull request Oct 4, 2016
47 tasks
@ChristophWurst
Copy link
Member Author

Alright, opening the share tab was easier than I thought. However, the passed OCA.Files.FileInfoModel seems to lack some properties that are passed when opening the sidebar for sharing files. Therefore it currently claims that sharing is not allowed.

@ChristophWurst ChristophWurst changed the title [WIP] show whether the current folder was shared or not [WIP] make it possible to share the current folder Oct 4, 2016
@rullzer
Copy link
Member

rullzer commented Oct 5, 2016

@ChristophWurst yes that property is only set if the folder was shared. I'm not sure if it is recursive at the moment. but that is a different issue.

@ChristophWurst ChristophWurst changed the title [WIP] make it possible to share the current folder make it possible to share the current folder Oct 10, 2016
@codecov-io
Copy link

codecov-io commented Oct 10, 2016

Current coverage is 57.80% (diff: 0.00%)

Merging #1618 into master will decrease coverage by <.01%

@@             master      #1618   diff @@
==========================================
  Files          1094       1095     +1   
  Lines         62798      62849    +51   
  Methods        6996       7006    +10   
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          36301      36328    +27   
- Misses        26497      26521    +24   
  Partials          0          0          
Diff Coverage File Path
0% apps/files_sharing/appinfo/app.php

Powered by Codecov. Last update 1c8f9d6...9bd181b

@@ -68,6 +76,9 @@
dirInfo: self._dirInfo
});
});
this._shareTab.on('sharesChanged', function(shareModel) {
alert('aaoobb');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is triggered correctly. However, the shareTypes property of the FileInfoModel is not upated, therefore the view does not reflect the current sharing status

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah mmm joy. I'll look into that.

@jancborchardt
Copy link
Member

jancborchardt commented Oct 18, 2016

  • remove »aaoobb« alert ;)
  • when the folder is shared via link, the indicator should use the correct icon icon-public to be symmetric to what we do in the file list
  • there are 2 nested spans for the icon-share. Instead of that, the span next to the folder name should directly have the icon-share class and also the pointer style, because it already has the padding for clickability too. No need for nesting here.
  • small glitch: When navigating back up from a subfolder, the folder name is erased from the breadcrumb, but the share indicator still shows. Should vanish as well.
  • reduce whitespace around icon a bit
  • we do not need the single icon class anymore. Any class prefixed icon- takes care of that

Otherwise fuck yeah, awesome work so we can finally easily share photo folders! :)

@schiessle
Copy link
Member

I just tried it but I couldn't find the option to share the current folder. But maybe it is to early to try it out.

Just one remark, because @ChristophWurst asked for sharing stuff. Instead of having a different code path to create shares, how about just opening the sidebar for the selected folder if you click on the bread-crumb and then use the existing share dialog? The only thing we would need to implement here is the click on the bread-crumb to open the sidebar for the folder? Maybe the same could/should happen if you click on a empty space in the file listing?

@jancborchardt
Copy link
Member

Instead of having a different code path to create shares, how about just opening the sidebar for the selected folder if you click on the bread-crumb and then use the existing share dialog? The only thing we would need to implement here is the click on the bread-crumb to open the sidebar for the folder?

That was my impression of what @ChristophWurst does here. :)

@ChristophWurst
Copy link
Member Author

@schiessle @jancborchardt that's exactly what this PR does :-)

var shareTypes = [];
var shares = shareModel.getSharesWithCurrentItem();

for(i = 0; i < shares.length; i++) {
Copy link
Member Author

@ChristophWurst ChristophWurst Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TODO: i is undefined

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
…hare tab

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
ChristophWurst and others added 6 commits November 7, 2016 14:58
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
…y info model changes

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer
Copy link
Member

rullzer commented Nov 7, 2016

Ok this should(tm) work now.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 8, 2016
@ChristophWurst
Copy link
Member Author

Ok this should(tm) work now.

Confirmed, it works. 👍 for @rullzer's changes :-)

@rullzer
Copy link
Member

rullzer commented Nov 8, 2016

Almost goes without saying but 👍 for the intial stuff

@MorrisJobke
Copy link
Member

I'm on it - I will fix the styling

* properly center share icon
* also apply styles for public share icon

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@MorrisJobke
Copy link
Member

I fixed the styling:

  • properly center share icon
  • also apply styles for public share icon

Before:
bildschirmfoto 2016-11-08 um 11 14 07
After:
bildschirmfoto 2016-11-08 um 11 14 13

Tested in Safari, Firefox, Chrome and IE11 👍

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 8, 2016
@MorrisJobke MorrisJobke merged commit 5f15020 into master Nov 8, 2016
@MorrisJobke MorrisJobke deleted the show-folder-shared-status branch November 8, 2016 15:23
@@ -901,7 +901,7 @@ div.crumb > span {
color: #555;
}
div.crumb.last a {
padding-right: 14px;
padding-right: 0px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact this is causing an issue on the home folder since the span next to it is hidden.
capture d ecran_2016-11-10_16-51-46

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div.crumb.last a + span {
    margin-left: -24px;
}

Will do the trick, can you test @MorrisJobke ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work here - then the icon is overlapped in subfolders.

@skjnldsv Could you open an issue for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I can :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish design Design, UI, UX, etc. enhancement feature: files feature: sharing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants