-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Permalinks #24434
Permalinks #24434
Conversation
By analyzing the blame information on this pull request, we identified @ChristophWurst, @LukasReschke and @tanghus to be potential reviewers |
Note: there is no UI yet to create such links, for testing please create these manually. |
|
Okay, delay aside, I found a way to replace the URL after the current folder was loaded. So if you observe the URL (when no fileid) present, it will appear without fileid until the folder is loaded, then the fileid will pop into the URL.
The fileid will now appear in all URLs under "All files" ! |
Basically if we detect a URL change, and the only change is appending the fileid, then we use |
|
|
Okay, looks like |
|
|
well, actually... activity app could also use the new URL format |
Just added: email about internal share now uses the shortened permalink. Would be good to get some feedback whether it works usability-wise @owncloud/designers |
More fixes:
|
|
'files.view.index', | ||
$args | ||
'files.viewcontroller.showFile', | ||
['fileId' => $items[0]['item_source']] |
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.
Undefined index in the unit test :)
10:20:05 1) MailNotificationsTest::testSendInternalShareMail
10:20:05 Undefined index: item_source
10:20:05
10:20:05 /ssd/jenkins/workspace/server-master-linux-php7-ci/database/sqlite/label/SLAVE/lib/private/Share/MailNotifications.php:124
10:20:05 /ssd/jenkins/workspace/server-master-linux-php7-ci/database/sqlite/label/SLAVE/tests/lib/share/MailNotificationsTest.php:250
Most useful feature ever. Code looks good and works. Great stuff!!!! 🚀 💘 ❤️ 🎉 |
I think this is ready for review @MorrisJobke @nickvergessen @guruz @rullzer @icewind1991 @schiesbn @VicDeo @georgehrke @Xenopathic @blizzz @ChristophWurst @LukasReschke mind checking the endpoint ? (disabled CSRF, etc) |
That's fine :) |
* Redirects to the file list and highlight the given file id | ||
* | ||
* @param string $fileId file id to show | ||
* |
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.
@return
missing
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.
missing @return
|
I love the local link thingy... but can't we just copy it to the clipboard directly? |
@rullzer copy to clipboard requires flash, see how Github does it with its copy link button. No flash, no button. |
Aaaah ok then never mind :) |
@rullzer (else we'd probably have that button for all link fields) |
* @return TemplateResponse | ||
* @throws \OCP\Files\NotFoundException | ||
*/ | ||
public function index($dir = '', $view = '') { | ||
public function index($dir = '', $view = '', $fileid = null) { | ||
if ($fileid !== null) { |
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.
So fileid always has preference if it is there. Sounds good
You can also use There are some wrapper libs that have fallbacks like https://clipboardjs.com |
$params = []; | ||
|
||
if (!empty($files)) { | ||
$file = current($files); |
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 was thinking... maybe it is good to loop over all files (if a file is shared via multiple ways)... and pick the one with the highest permission?
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.
Of course harder then it sounds because which do you pick if 1 has edit and 1 has share permissions.
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.
Also not that common scenario...
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.
@rullzer yeah good point, possibly something for later.
Also I thought about adding a "trashbin" route in case the file is detected in trash instead, but something for later also.
@georgehrke I'll make a ticket to research that. Could definitely be useful for the many link-copy locations we have: #24472 |
The following routes will redirect to the files app and display the matching folder. If the fileid is a file, it will scroll to it. - http://localhost/owncloud/index.php/f/$fileid - http://localhost/owncloud/index.php/files/?dir=somedir&fileid=$fileid
|
Fixed back button and unit test. |
👍 very very cool stuff! |
I cannot find the permalink in the curren owncloud version. What this feature removed? |
@LiamHD This feature will be released with ownCloud 9.1 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #11732
The following routes will redirect to the files app and display the
matching folder. If the fileid is a file, it will scroll to it.
Missing parts and challenges: