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

Move sharing page options to menu in top right #6652

Merged
merged 11 commits into from
Nov 2, 2017
Merged

Conversation

jancborchardt
Copy link
Member

@jancborchardt jancborchardt commented Sep 26, 2017

Making the sharing page a bit cleaner. Before & after:
screenshot from 2017-09-26 16-56-45
screenshot from 2017-09-26 17-13-26

TO DO:

  • Make the dropdown interactive – need @nextcloud/javascript help for this
  • Clicking »Direct link« should copy it to clipboard and give that as feedback in a tooltip
  • When there is no preview but only filetype icon (like for zip files etc), the download button should show directly under the filetype icon too

@skjnldsv
Copy link
Member

skjnldsv commented Sep 26, 2017

Nice pr! :)

Make the dropdown interactive

What do you mean?

@codecov
Copy link

codecov bot commented Sep 26, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@ce12cd9). Click here to learn what that means.
The diff coverage is 21.87%.

@@            Coverage Diff            @@
##             master    #6652   +/-   ##
=========================================
  Coverage          ?   50.61%           
  Complexity        ?    24297           
=========================================
  Files             ?     1577           
  Lines             ?    92922           
  Branches          ?     1359           
=========================================
  Hits              ?    47036           
  Misses            ?    45886           
  Partials          ?        0
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/templates/public.php 0% <0%> (ø) 0 <0> (?)
apps/files_sharing/js/public.js 48.74% <63.63%> (ø) 0 <0> (?)

@jancborchardt
Copy link
Member Author

@skjnldsv I mean not showing that dropdown permanently, and only opening it on click of the Download action. :)

@skjnldsv
Copy link
Member

skjnldsv commented Sep 26, 2017

Oh ok! :)

$(document).ready(function() {
	$('.app-navigation-entry-utils-menu-button button:not([class])').click(function() {
		$(this).parents('.app-navigation-entry-utils').next().show();
	});
})
$(document).mouseup(function(e) {
	var container = $(".app-navigation-entry-menu");

	// if the target of the click isn't the container nor a descendant of the container
	if (!container.is(e.target) && container.has(e.target).length === 0) {
		container.hide();
	}
});

It's what I use on the simple template app I made, not sure if this is a good idea though :)
We definitely should implement this into master!

@jancborchardt
Copy link
Member Author

@skjnldsv added it, thanks! :) I tried to play around with .toggle() to also close the menu back on second click but it seems to not work. Any idea?

@jancborchardt jancborchardt added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 29, 2017
@jancborchardt
Copy link
Member Author

Also I might have used a really rough way to decide if the download button should be shown under the filetype icon too – for files which can’t be previewed, i.e. anything except images: https://github.com/nextcloud/server/pull/6652/files#diff-28509333ad5b898bf1af427bd3e64113R103 cc @rullzer

@MorrisJobke
Copy link
Member

🏓 for review here :)

@jancborchardt
Copy link
Member Author

Yes, please review @nextcloud/designers @nextcloud/javascript :)

@skjnldsv
Copy link
Member

Everything seems good with this! But before I review, can anyone tell me what the "direct link" option is supposed to do?

@jancborchardt
Copy link
Member Author

Direct link for images is supposed to only show the image (without background or header) so it can be embedded directly.

For filetypes other than files which can directly be shown, it's basically just a link to the page (cause lots of regular people don't know a URL from the bar can be copied, and look for a "Copy link" option).

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

Sorry there is so many changes needed 🙈
This is looking great nonetheless, much easier to read on mobile/narrow screens. 😅

But it makes me wonder if we shouldn't display as many button as we could and but them in the menu if there isn't enough space left, same as the app list on the nextcloud header. :)

<span id="download-text"><?php p($l->t('Download'))?></span>
</a>
<?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
<a href="#" id="share-menutoggle" class="menutoggle icon-more-white"><span class="share-menutoggle-text"><?php p($l->t('Download')) ?></span></a>
Copy link
Member

Choose a reason for hiding this comment

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

Why is the download link having the icon-more-white class? This needs to be 2 separate elements. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Download is just the text label for the menu, so it's the same element. :)

Copy link
Member

Choose a reason for hiding this comment

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

It feels strange! :/ :)

</a>
<?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
<a href="#" id="share-menutoggle" class="menutoggle icon-more-white"><span class="share-menutoggle-text"><?php p($l->t('Download')) ?></span></a>
<div id="share-menu" class="popovermenu menu hidden">
Copy link
Member

Choose a reason for hiding this comment

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

You do not need the hidden class as the popover is hidden by default.

@@ -424,4 +424,18 @@ $(document).ready(function () {
return App.fileList.generatePreviewUrl(urlSpec);
};
}

$('#share-menutoggle').click(function() {
$('#share-menu').show();
Copy link
Member

Choose a reason for hiding this comment

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

Please use the class 'open'.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's the code you gave me above. ;)


// if the target of the click isn't the container nor a descendant of the container
if (!container.is(e.target) && container.has(e.target).length === 0) {
container.hide();
Copy link
Member

Choose a reason for hiding this comment

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

Please use the class 'open'.

@@ -84,16 +100,14 @@
<!-- Preview frame is filled via JS to support SVG images for modern browsers -->
<div id="imgframe"></div>
<?php endif; ?>
<?php if ($_['previewURL'] === $_['downloadURL']): ?>
<div class="directDownload">
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
Copy link
Member

Choose a reason for hiding this comment

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

It's not working on my setup, No response or feedback when clicking this link.
Maybe we should also fix this here?

@@ -143,6 +143,8 @@
#header-left, .header-left {
Copy link
Member

Choose a reason for hiding this comment

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

This could have a display: inline-flex for easier alignment .

Copy link
Member Author

Choose a reason for hiding this comment

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

That’s already set in the lines above. :)

Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Signed-off-by: Jan-Christoph Borchardt <[email protected]>
@jancborchardt
Copy link
Member Author

This is now ready for review @nextcloud/javascript @nextcloud/designers @nextcloud/sharing! :)

@jancborchardt
Copy link
Member Author

@skjnldsv can you re-review? :) @rullzer @schiessle @MorrisJobke can you also review please?

Signed-off-by: Jan-Christoph Borchardt <[email protected]>
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

Seems to work!
Lets get this in!

@rullzer rullzer added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews help wanted labels Nov 2, 2017
@skjnldsv skjnldsv merged commit 3091ddb into master Nov 2, 2017
@skjnldsv skjnldsv deleted the sharing-link-menu branch November 2, 2017 16:41
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: sharing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants