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)
For received shares, the delete action becomes "Unshare" and for
personal mounts it becomes "Disconnect storage".
This also makes it possible from now on to pass a function to a file
action's "displayName" attribute.
This is required by the pdf viewer, since the files app on master uses the AppFramework it had applied the more strict defaults which made it not work on master.
The text editor app will register this instead.
Also made "fileList" a non-private attribute to make it possible for
plugins to access the attached file list object.
- Use "FileList" instead of "OCA.Files.App.fileList" that doesn't exist in public
link page.
- Fix public link upload by properly adding the form data using a new
utility function "addFormData". That one is needed because IE8 upload
and regular upload use a different format...
There is no need to calculate a human readable date on the server side.
We supply the mtime and a client can easily convert that himself if
needed. This is already done most of the time since the date is often
not in the exact right format.
There is also no need to attach icon info. We have that available in
javascript. And else the client should get the right icon based on the
mimetype for its platform.
* Updated tests
- 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
Tab heads are not rendered if only one tab.
The tab contents is updated on-demand. This means that if a tab is not
visible it is not rendered at first. If the tab was already rendered
through switching, its model will not get updated until the next time it
becomes visible. This will prevent needless rerendering of invisible tab
contents, especially considering that some tabs might need extra ajax
requests.
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.
When renaming over the web UI, check early that the target name is
valid.
This prevents nonsensical error messages when renaming to a name with a
trailing backslash.
The purpose of $originalStorage in unit tests was to remount the old
root.
However that storage itself is already wrapped by storage wrapper, so
remounting it would rewrap the storage several times.
This fix makes use of "loginAsUser()" and "logout()" from the TestCase
class to properly initialize and cleanup the FS as expected.
This checks if the offset exists before accessing it and also adds unit tests to this function which would have catched this before 🙈
Fixes https://github.com/owncloud/core/issues/14277
This will parse backslashes as directory separators in breadcrumbs. Thus when accessing something like `/index.php/apps/files?dir=foo\foo` the breadcrumb will properly resolve this instead of showing `foo\foo`
Fixes https://github.com/owncloud/core/issues/13643
This fixes an issue when renaming files from a flat list view like
"Favorites" or "Shared with you", in which case the path needs to be
present in the response to make sure the data-path attribute is properly
set in the JS side.
To make it possible for the web UI to correctly display the tag/favorite
information after a rename, this information is now returned in the
rename response
Whenever tags are updated, they need to be updated in the file list's
file info array as well.
This commit also adds unit tests and makes sure that whichever tags are
sent back by the server after update are used when updating
attributes/fileinfo.
This improves the OCA.Files.FileActions class to support passing a
"render" function in the action object.
The default function "_defaultRenderFunction" is used by default and
renders actions in the usual actions container.
Moved "Rename" and "Delete" to custom render functions.
When dropping files onto a read-only folder, a notification
is now shown instead of attempting to upload.
This for both the drag for upload and drag from inside the file list
cases.
Whenever an app needs to register an event late, it does that on the
original file actions object.
Since the file actions that the file list work on is a merged list, not
the original one, the registration event needs to be propagated there as
well.
Reload the files app in case of authentication errors, expired tokens or disabled app
Reloading will triger the full server side handeling of those errors
formatting
fix missing semicolon + some jshint warnings
Whenever file actions are modified, either by registering new actions or
when appending a new page of entries, the sharing app is now notified so
it can correctly refresh the sharing icon status.
Additionally, the core's loadIcons() method is also used to load the
existing shares and also refresh the sharing icons afterwards.
Whenever file actions are registered later, now the file lists are
automatically notified.
Added FileActions.addUpdateListener() to be able to receive such
notifications.
This removes the need for apps to manually call FileActions.display()
after registering new actions.
This fixes issues with race conditions when file actions are
registered after the file list was already rendered.
Rewrote the breadcrumb calculation to be more readable.
Breadcrumb now has a setMaxWidth() method to set the maximum allowed
width which is used to fit the breadcrumbs.
The breadcrumb width is now based on the container width, passed through
setMaxWidth() by the FileList class.
Now using fixed widths for the test crumbs to simulate consistent
widths across browsers which rendering engines might usually yield
different results.
When renaming to an existing file name, blurring the field should not
remove it.
This fix keeps the field until escape is pressed instead of replacing it
with a broken empty space.
When uploading files or folders, they only need to be appended or
updated when their path or a section of their path is inside the current
directory (which happens for folder upload)
Fixes issue where file was appended when dragging on a parent directory
onto the breadcrumb.
Fixes appending issue when uploading folders.
When renaming or deleting a file that is in a subdirectory, performing
the action from the sharing overview or another file list view, the
actual directory of the file must be used instead of the current
directory.