Skip to content

SocketAPI: "Open in browser" and disable Share entries when sharing is disabled - #6330

Merged
ogoffart merged 1 commit into
masterfrom
socketapi
Jan 26, 2018
Merged

ogoffart merged 1 commit into
masterfrom
socketapi

Conversation

@ogoffart

Copy link
Copy Markdown
Contributor

This adds "Open in browser" entry in the menu (Issue #5903)

Also mark the share entries as disabled when sharing is not allowed
or not available for a given file.
If sharing is disabled globaly in the branding or in the server,
the share entry will not be present.
(Issues #4205 and #4608)

Meta issue #6292

@ogoffart
ogoffart requested a review from ckamm January 23, 2018 15:47
@ogoffart ogoffart added the ReadyToTest QA, please validate the fix/enhancement label Jan 23, 2018
@ogoffart

Copy link
Copy Markdown
Contributor Author

Should work on All platform except OSX. (because of #6328 )

@ogoffart ogoffart added this to the 2.5.0 milestone Jan 23, 2018
Comment thread src/gui/socketapi.cpp Outdated
QString relativePath = systemPath.mid(syncFolder->cleanPath().length() + 1);
bool isOnTheServer = syncFolder->journalDb()->getFileRecord(relativePath, &rec) && rec.isValid();

listener->sendMessage(QLatin1String("MENU_ITEM:OPEN_PRIVATE_LINK") + flagString(isOnTheServer) + tr("Open in browser"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: I think it would look nicer if this was the last option in the menu, because it belongs with the other "private link" actions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I put it first because I thought it would be the most commonly used action. But I can put it last.

@ckamm

ckamm commented Jan 24, 2018

Copy link
Copy Markdown
Contributor

@SamuAlfageme This is what was requested in the ticket but I still think disabling sharing options for files that can't be reshared is confusing. The user doesn't know why the options are suddenly disabled!

How about we put a single disabled "This item cannot be reshared" action in the menu instead?

@ogoffart

Copy link
Copy Markdown
Contributor Author

How about we put a single disabled "This item cannot be reshared" action in the menu instead?

I like that idea.

So if the file is not on the server, it can be the normal menu, disabled (then normally the overlay icon should show it is syncing)
But if the permissions are wrong, change the menu to a disabled "this item cannot be reshared" Do the email/copy private link menu actions still make sense in this case?

@ckamm

ckamm commented Jan 25, 2018 •

Copy link
Copy Markdown
Contributor

@ogoffart I'm not certain about email/copy private link. Why would you want to do that if you can't share it with anyone. That's why I thought disabling them when resharing is disabled is fine.

But maybe your private link works with the person who originally shared the item with you? Then the actions could be useful. I'll test that now.

EDIT: Yes. So if A shares an item with a user B, B still might want to copy/email the private link for that item or its contents. Either to A or to other people who have access.

@ogoffart

Copy link
Copy Markdown
Contributor Author

I updated the request. The "open in browser" is now the last item.

If sharing is not allowed, there is a new disabled entry that says it is not allowed.
But the email and copy private link are still enabled.

Comment thread src/gui/socketapi.cpp Outdated
// If sharing is globally disabled, do not show any sharing entries.
// If there is no permission to share for this file, add a disabled entry saying so
if (isOnTheServer && !rec._remotePerm.isNull() && !rec._remotePerm.hasPermission(RemotePermissions::CanReshare)) {
listener->sendMessage(QLatin1String("MENU_ITEM:DISABLED:d:") + tr("Re-sharing this file is not allowed"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very minor: it's called "resharing" without dash on the server

…s disabled.

This adds "Open in browser" entry in the menu (Issue #5903)

Also mark the entries as disabled when the file is not yet on the server.
If re-sharing is not allowed for that file, a disabled explaination
entry is added to the menu.
If sharing is disabled globaly in the branding or in the server,
the share entry will not be present.
(Issues #4205 and #4608)

Meta issue #6292
@SamuAlfageme

Copy link
Copy Markdown
Contributor

@ogoffart

If sharing is not allowed, there is a new disabled entry that says it is not allowed.
But the email and copy private link are still enabled.

That's working like a clock when sharing is disabled for a file ("reshare"):

resharing_not_allowed

But when sharing is disabled in capabilities we are not displaying the "private link entries":

(The icon overlay also stays in "shared" but this happens in the webUI as well - IIRC there was no "remove sharing from all oc:permissions" event when disabling this switch)

@ckamm

ckamm commented Apr 12, 2018

Copy link
Copy Markdown
Contributor

@SamuAlfageme You're saying: Please show the private link options when sharing capabilities are disabled? Does that make sense?

I thought the primary usecase for private links was for pointing to files inside a directory you had shared with someone - why would one care about private links when sharing is impossible globally? (I understand it makes sense when resharing is forbidden - file could already be shared)

@SamuAlfageme

Copy link
Copy Markdown
Contributor

@ckamm you're absolutely right on your explanation - I got myself influenced by what it happens on the webUI:

no_sharing_link

(I'll poke PMs to see if they should disable that switch in there as well)

@michaelstingl

Copy link
Copy Markdown
Contributor

@pmaier1 FYI ^

Thought about it. Private links maybe could stay, even when sharing is disabled. They are useful for the user itself. With "open in browser" feature in client, demand is probably smaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ReadyToTest QA, please validate the fix/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants