The sort comparator checks the "isFavorite" property of the FileInfo
objects to compare. That property is set when the file list is loaded
and the response from the server is parsed, and thus a freshly loaded
file list has the proper sorting for favorite files. However, the
property is not set in other cases, like when the FileInfo objects are
derived from FileInfoModels due to a file being marked as a favorite or
a text editor being closed, which causes the file to be sorted in the
wrong position.
There is no need to add the property in those situations, though; in all
cases the TagsPlugin adds a "tags" array property that contains an
OC.TAG_FAVORITE tag, so that tag can be checked instead of "isFavorite".
Moreover, although "isFavorite" was added by the main "_parseFileInfo"
function it did not really belong there but to the "FileInfoParser" from
the TagsPlugin; however, as that property now is not used anywhere it
was removed altogether.
A cleaner solution would have been to make the sort comparator
extensible by plugins like other behaviours of the file list and then
add the sorting logic related to favorite files to the TagsPlugin.
However, right now only the TagsPlugin would need to alter the main
sorting logic, and it seems like a corner case anyway. Even if it is
implemented as a plugin, favorite files is a core feature, so for the
time being it will be taken into account directly in the main sorting
logic; making the sort comparator extensible by plugins is defered until
there are other use cases for that.
Fixes#5410
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In some cases, an app may need to act on a detail view registered by
another app or the core, for example, to add extra elements to the
element of the detail view.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Fixes: #4644
Without this patch the filelist would always reload. However since not
all the correct data was set yet it would often:
1. fireoff a propfind to ../webdav/
2. fireoff a propfind to ../webdav/<PATH>
When just opening the file list those are the same so the result is just
fine. However if opening a direct link it means that there is a race
condition on which finishes first.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Whenever a file list is already initialized and was hidden when
switching to another file list in the navigation bar, if the user comes
back to this list it gets redisplayed. At this point the list needs to
be refreshed to be able to reflect any potential file changes done from
the other lists.
added quit option in notif in app.js
added quit option in notif in file-upload.js
added quit option in notif in fileinfomodel.js
added quit option in notif in filelist.js
added quit option in notif in filelist.js
added quit option in notif in tagsplugin.js
added quit option in notif in statusmanager.js
added quit option in notif in external.js
added quit option in notif in versionstabview.js
added quit option in notif in notification.js
changes according to the latest review.
timeout removed since there is a button to close it
translation capability added
typo fixed
test files updated
small errors fixed
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
check introduced at another method
comment added to explain one check
comment added to explain one check
unit tests added
small fixes in unit tests
missing semicolon added
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* fixed size issues on main detail view and disappearing of share recipients
* Changes due to code comments
* Moved reloadProperties() to FileInfoModel
* Solved Scrutinizer issues
* Bugfix: undefined value used on error
* check if options are set for FileInfoModel.initialize()
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
The file list UI logic that renders the next page doesn't properly
exclude hidden files when not shown. This fix makes sure that only rows
that are actually visible are counted when rendering a page, this makes
sure that the page will always have enough elements displayed.
- uses PUT method with jquery.fileupload for regular and public file
lists
- for IE and browsers that don't support it, use POST with iframe
transport
- implemented Sabre plugin to handle iframe transport and redirect the
embedded PUT request to the proper handler
- added RFC5995 POST to file collection with "add-member" property to
make it possible to auto-rename conflicting file names
- remove obsolete ajax/upload.php and obsolete ajax routes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Hidden files (dot files) are now always rendered in the DOM to make
sure that all file operations and selection still work as expected.
Their visibility is now toggled on CSS level.
When loading the next page of search results, make sure that the loop
can end if there are no more elements in case the total doesn't match.
Also added a check to avoid recomputing the search results whenever the
setFilter() is called with the same value. This happens when navigating
away to another folder, the search field gets cleared automatically and
it calls FileList.setFilter('').
When filtering the file list, if a result is on an unrendered page,
make sure to call _nextPage() to prerender the pages in order to
display all matching results.
* Fixed group share searching for members of
multiple group. Issue #11808.
* Fixed group share searching, continued.
Avoid searching for empty group list in getItemSharedWithUser().
Broke tests in previous commit, #12030.
* Simler check for group count.
* Fix for https://github.com/owncloud/core/issues/24783 , described there
* Now it's #24272, 24783 was a duplicate. Previous change was also not very good. Now we don't create ZIP with a single file inside.
this.updateSearch() sets the current file list instance and clears the box. This is unnecessary and makes the search box unsuable on some mobile devices where a keyboard fade-in causes a onResize trigger, which would then clear and blur the box.
add checkbox to toggle show/hide hidden files
persist show hidden setting
fix settings menu layout
test ApiController::showHiddenFiles
don't show hidden files by default
Store config in Backbone model and inject it into FileList
Filter files only temporarily when rending the file list
Fix file rename validation
and both receive a drop.
Build breadcrumb over and out callback in filelist.js and
pass them as options to utilize local selectors of filelist
Re-enable td elements after drop to bread crumb
Fix# drop handler still being called after enable,
it seems that waiting for a short time before re-enabling solves the
problem
* Add explanations for setTimeout re-enable td.filename drop handler
Plugins can extend _getWebdavProperties to add custom properties.
These should not be added to the original properties list, so now the
FileList makes a copy of the array.
Since Webdav doesn't contain that information, we need to rely on the
parent folder's mount type to find out whether a child item is a
shared/external root or not.
Fixed the mount type detection logic and added unit test.
Also added a fix that ignores detection if no parent folder exists (ex:
shared file list, favorites, etc)
In case a permanent notification "storage full" was displayed, it will
be hidden after deleting a file.
Directly after that a getstoragestats.php call is made that will decide
whether to reshow the notification based on the new free space.
- calculate multiselect header width to exclude scrollbar
- call FileList._onResize() when sidebar is toggled ("appresized"), this
also updates the breadcrumb width
- moved global getScrollBarWidth() to OC.Util namespace
When uploading files, first check if the files exist in the current file
list. For the ones that do, show a conflict dialog.
For the rest, upload directly.
If the upload operation detects a conflict on the server side, it will
also continue populating the conflict dialog.
From now on, server side conflict can only occur if someone concurrently
uploaded a file into the same folder but the current user hasn't
refreshed the list yet.
- Clicking a file row or selecting it will open the sidebar.
- When sidebar is open, its contents update with the last selection.
- Dragging doesn't open the sidebar but does update its contents if it was
open already.
- Switching folders closes the sidebar.
- Close sidebar when highlighted file got deleted/removed from list
- move versions to a tab in the files sidebar
- added mechanism to auto-update the row in the FileList whenever values
are set to the FileInfoModel given to the sidebar
- updated tags/favorite action to make use of that new mechanism
- added unit tests for NewFileMenu
- use generateUrl for FileList.createFile and FileList.createDirectory
- added unit tests for FileList.createFile and FileList.createDirectory
The old one contains untranslatable ' & ' if both files and dirs are
selected. The new code is especially designed to reuse strings from file
listing summary view (apps/files/js/filesummary.js), so no translation
is broken.
The favorite icon in the sidebar now triggers the file action and also
updates itself according to the model's state when triggered from the
file row.
The thumbnail triggers the default action.
Currently only one FileInfoModel is used for the selection and state
synchronization between views.
FileList reload now auto-closes the sidebar.
* this code adds a cookie when a special get parameter is set
* the content of this get parameter is used as value for the cookie
* the cookie expires after 20 seconds
* the JS code checks every 500 milliseconds for the cookie
-> if the cookie is set the request returned and the download is started