-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add Quick-Access to favorite folder in left sidepanel in files-app #9720 #10176
Conversation
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.
-
Toggling the quick access list is not possible
-
I think we should hide it by default, otherwise some users who already have a bunch of favorites could end up with a long list of folders there and the other sections would be hidden on the first run
-
Adding a folder to the favorites will not update the list in the sidebar
-
Clicking the folder flashes a second indicator, which looks a bit weird.
-
There is also a JS error when clicking a folder in the sidebar:
Uncaught Error: Syntax error, unrecognized expression: li[data-id=http://localhost:8140/index.php/apps/files/?dir=/4 ]
at Function.ga.error (core.js?v=d502b209-3:2)
at ga.tokenize (core.js?v=d502b209-3:2)
at Function.ga [as find] (core.js?v=d502b209-3:2)
at a.fn.init.find (core.js?v=d502b209-3:2)
at a.fn.init.a.fn.find (core.js?v=d502b209-3:7)
at Navigation.setActiveItem (merged-index.js?v=d502b209-3:11396)
at Navigation._onClickItem (merged-index.js?v=d502b209-3:11421)
at HTMLDivElement.dispatch (core.js?v=d502b209-3:3)
at HTMLDivElement.r.handle (core.js?v=d502b209-3:3)
@newhinton Besides those comments, I really like it. @skjnldsv @newhinton Drag-and-drop is not included in the PR, right? |
@juliushaertl Which browser do you use? I cannot reproduce the behavior you are describing.
Do you mean the ordering is not updated?
I'll investigate and fix this
I cant reproduce those
At the moment it is only disabled. The code is still there, because i thougt that the "how to sort"-discussion wasn't over yet. I have the idea of an dropdown menu, which allows changing of the sorting-order, but i wanted a statement for that because that would introduce a dropdown-menu to the ui, which needs to be discussed. If you want to take a peak, look at newhinton:WithSettingsDropdown. I have tested it there. |
I can, I'll fix it!
@newhinton you can push to this pr! Is the drag and drop working? |
@newhinton Chrome 67
The folder that is added to the favorites is missing in the sidebar until i reload the whole page. |
@juliushaertl Sorry, i was confused there, drag&drop is not implemented at all. What i meant was the custom order, which is ordered by drag&drop :D so, nevermind :D I tested it with firefox and opera, so there may have slipped something @skjnldsv thanks for fixing it! Regarding old code, what about the different sorting methods? Currently, a value stored in the server decides about the sorting mechanism. There is currently no way of influcencing this value (because no ui for it, which is fine, don't get me wrong) except from directly calling the api with a proper value. I'd like to keep this, because it is not so much more code, and it allows a user who knows this to change the order. It's somewhat of a hidden feature, which is not optimal in any way, but dumping it is also not optimal (in my opinion). What should i do with it? It's not directly old code, since it does exactly what it is supposed to do |
foreach ($favElements['folders'] as $elem) { | ||
|
||
$id = substr($elem, strrpos($elem, '/') + 1, strlen($elem)); | ||
$link = $this->urlGenerator->linkToRouteAbsolute('files.view.index', ['dir' => $elem]); |
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.
Somehow the link generated here does not redirect to the proper view in fies :/
@juliushaertl any clue?
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.
clicking this redirect from /apps/files/?dir=/Test
to /apps/files/dir=/&view=Test
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.
Tested and works 👍
Unit test failure:
|
Any clue? I'm on the jsunit atm :) |
$helper = new \OCA\Files\Activity\Helper($tagger); | ||
|
||
try { | ||
$favElements = $helper->getFavoriteFilePaths($this->userSession->getUser()->getUID()); |
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.
This one is likely to cause the "DB used" exception. This one is called in a test that has no DB but actually needs one.
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 think I fixed the tests
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.
Works great for me now 👍
Good to go, if the jsunit tests are fixed. 😉
Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed duplicate collapse-button and changed api-endpoints Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed app-navigation-caption from apps.scss Signed-off-by: fnuesse <felix.nuesse@t-online.de> Changed api-endpoints Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Codestyle (.js) Signed-off-by: fnuesse <felix.nuesse@t-online.de> Hid away extended Settings Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed reverse state Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Missing reverse after changing sort-strategy Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Copyright-Header Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed UI-Flickering Signed-off-by: fnuesse <felix.nuesse@t-online.de> hid dotmenu on toggle while favorites are empty Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added Draggable to listelements (WIP) Signed-off-by: fnuesse <felix.nuesse@t-online.de> Rebuild appnavigation.php with recursive function to allow easy implementation of sublists Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed draggable Sublist-Elements Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed draggable Sublist-Elements Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added date-modified sorting option to quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added custom order sorting option to quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added custom order sorting option to quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added fallback for custom ordering Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Bad url-generation in javascript for new quickaccessitems Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed vertical scrolling in sortable-list which leads to "hidden" navbar Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed unnessessary console logs Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Bounds in custom sorting Signed-off-by: fnuesse <felix.nuesse@t-online.de> Reformatted code Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed horizontalscroll on sortable-list Fixed "stuck element" where you could not switch back to the original ordering in the sortable-list Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added icon-change on drag Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Navbar-closing in app when favorites-list is toggled on mobile Signed-off-by: fnuesse <felix.nuesse@t-online.de> Refactored Code Signed-off-by: fnuesse <felix.nuesse@t-online.de> Changed to alphabetical sorting Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed deletion of folder with identical names Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed ability to add files to the quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed wrong path-generation when added from favorites-star Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed Element from navbar when favorite-star in detailview is toggled off Signed-off-by: fnuesse <felix.nuesse@t-online.de> Changed Quota-Text to prevent boundarybreaks Reverted last commit
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
82de4d1
to
bd1929a
Compare
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
All fixed, let's wait for final tests |
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
phpunit test broken! fix pushed |
@skjnldsv I see you have removed the _setOnDrag function, i get that, but why do you keep all the other stuff, which is now dead code? If you had kept it, the feature would still work, even if you couldnt toggle it in the ui, and if you wanted to clean up code, there is a lot missing |
@newhinton I removed it because the drag wasn't working properly :) Thanks for your amazing work, this pr is a very nice addition to nc14!! |
@skjnldsv I would prefer to fix it instead of removing it, what do you say? |
Well, depend on what you wish to fix, but in the end we decided to remove the custom sorting, so if there are still stuff laying around, please remove them. ps: I fixed some errors in another issue, currently the addition/removal is broken, I forgot to edit something, do don't worry about this, I'll handle it :) |
In that case i meant the sortable handler (for custom sorting). While we are not using it for this feature, the handling of different sorting strategies is fully working in the current files-app, and the only thing currently breaking sortablelist is the missing handler. This enables us to use this feature later, when (and if) we found a solution for the ui-problem (look at newhinton:WithSettingsDropdown , i have experimented there) without redeveloping everything. If you want to remove it, (i can remove it, if you whish) you need to delete the api-routes, you need to remove the unnessessary sorting-variable in navigation.js, edit the quicksort-helper function to only return the alphabetical sorting value and edit the php-code to dump the initial-sorting. I believe my solution for sorting is quiet dynamic and expandable there, and while not perfect, provides a lot of possibilities and i would keep it, but in the end, it's your decision ;) |
No, we don't want to add a menu of any sort in the end. Let keep things simple, the ui already start to be a bit overcrowded :) Please, go ahead for the cleanup, I'm on another issue ;) |
@skjnldsv How do i push the cleanup? Should i open a new PR? |
Yes, on nextcloud/server please :) |
Somehow broke #9720 (sorry @newhinton) :(
Please review @nextcloud/designers
Already a 👍 from me!