Commit Graph

65 Commits

Author SHA1 Message Date
Robin Appelman e8cbb8e2d8 Add js unit test 2014-11-26 12:14:35 +01:00
Morris Jobke 1979ec70a5 JS unit tests fix - use toBeUndefined() instead of toEqual(null) 2014-11-04 10:37:16 +01:00
Nazar Mokrynskyi 8198e70f24 Changed fileList.pageSize to function call 2014-10-15 19:18:35 +02:00
Nazar Mokrynskyi 63145f5765 Typo 2014-10-15 19:17:21 +02:00
Nazar Mokrynskyi 5033fc4e52 Stub for pageSize, because now it is dynamically calculated 2014-10-15 15:09:01 +02:00
Jan-Christoph Borchardt 2ac953e6a8 correct progress-icon to icon-loading-small 2014-09-22 18:24:32 +02:00
Jan-Christoph Borchardt 91d9d45c6c correct delete-icon to icon-delete, fix #11128 2014-09-22 18:17:33 +02:00
Vincent Petry 05cf940983 Tentative fix for legacy file actions unit test side effect
Sometimes the JS unit test with legacy file actions fail.

This fix runs the legacy file actions tests on a dummy instead of the
real one.
2014-09-16 15:38:44 +02:00
Vincent Petry f1bfe35cda Added permission check for drag and drop
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.
2014-09-04 20:18:24 +02:00
Vincent Petry 607ea636be Fixed folder icon update routine when share owner exists
Whenever a folder has a "data-share-owner" attribute, the icon is now
properly updated to a shared folder icon.
2014-08-15 16:19:50 +02:00
Vincent Petry 5565eabb81 Merge pull request #9683 from owncloud/fix_#8819_sorting
Fix #8819 sorting
2014-07-22 10:11:00 +02:00
Remco Brenninkmeijer d0cd4d5ad9 Adjusted tests for new default sorting 2014-07-17 20:27:55 +02:00
Vincent Petry 22653e21a2 Propagate file action changes to the file lists
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.
2014-07-09 12:26:33 +02:00
Robin Appelman 4fe1cdd2a7 Add machine readable error messages to OC\JSON
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
2014-07-04 16:20:27 +02:00
Vincent Petry 07118f599e Fix FileActions merging override
When merging FileActions, the register() functio needs to correctly
override the previously merged action handler without affecting the
original one.
2014-07-04 12:56:04 +02:00
Vincent Petry 025b71d068 Use fileActionsReady to re-render sharing icons
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.
2014-07-01 21:32:04 +02:00
Vincent Petry 509cdebab7 Fix fileActionsReady event after deferred file actions update 2014-07-01 18:50:54 +02:00
Morris Jobke 3b2fd5e4e6 Merge pull request #9254 from owncloud/fileactions-deferred
Sync file list with file actions
2014-06-27 15:03:21 +02:00
Jan-Christoph Borchardt b975f0e718 Merge pull request #9174 from owncloud/breadcrumbfix
Breadcrumb width calculation fix
2014-06-27 13:51:18 +02:00
Vincent Petry 586b3a9683 Sync file list with file actions
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.
2014-06-27 13:41:01 +02:00
Vincent Petry ec4cf96f0d Breadcrumb width calculation fix
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.
2014-06-27 11:11:34 +02:00
Lukas Reschke e070e292bf Merge pull request #9170 from owncloud/files-renamevalidationblur
Fix blurring of invalid file name on rename
2014-06-23 22:48:46 +02:00
Vincent Petry 7d4747ea16 Fix blurring of invalid file name on rename
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.
2014-06-23 16:35:11 +02:00
Vincent Petry 6850d0c6d7 Merge pull request #8931 from owncloud/filelist-usepathforaction
[master] Use actual file path on rename/delete
2014-06-23 15:53:23 +02:00
Vincent Petry 074d3a8f07 Clear file selection when list is repopulated
When calling FileList.setFiles() the current selection needs to be
cleared.
2014-06-23 12:55:42 +02:00
Vincent Petry 8ae2468345 Fix appending of rows after upload
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.
2014-06-19 18:21:42 +02:00
Vincent Petry d3d0035a9a Use actual file path on rename/delete
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.
2014-06-06 15:17:55 +02:00
Joas Schilling 1d0ac9a2c5 Fix tests 2014-06-03 11:45:53 +02:00
Morris Jobke 5d457dafc1 display "<1 kB" for really small files
* added parameters for humanFileSize to trigger that behaviour
* add unit tests for that
2014-06-02 15:33:09 +02:00
Lukas Reschke 756b158230 Merge pull request #8663 from owncloud/files-dndissue
Fixed drag and drop from external files, added tests
2014-05-30 16:28:20 +02:00
Vincent Petry 1d9129eac3 Sharing overview fixes and unit tests
- Fixed renaming and fileActionsReady event
- Added unit tests for shares list
- Fixed public page with defer
- Fixed file actions in sharing overview
- Fixed sharing counterpart list (10 entries max)
- Fixed file path attribute to be used in download action
- Fix sharing list headers
- OC.Share icons now operate on fileList instance
- Fix OC.Share.updateIcon when more than one list in DOM
2014-05-30 10:06:29 +02:00
Vincent Petry ef59c69dc8 Distinguish legacy file actions from regular file actions
Legacy file actions are registered by legacy apps through
window.FileActions.register(). These actions can only be used by the
main file list ("all files") because legacy apps can only deal with a
single list / container.

New file actions of compatible apps must be registered through
OCA.Files.fileActions. These will be used for other lists like the
sharing overview.

Fixed versions and sharing actions to use OCA.Files.fileActions, which
makes them available in the sharing overview list.
2014-05-30 10:06:29 +02:00
Vincent Petry 06e53b359a Added "dir" in file actions handler context and fixed versions
Added "dir" in file actions handler context so that handlers can know
what the path of the file was without having to look it up from the file
list.

Fixed versions app to use the context.dir instead of the old $('#dir')
element. This makes the versions popup work in the sharing overview.
2014-05-30 10:06:29 +02:00
Vincent Petry 89ff2857fc Add unit tests for fileActionsReady 2014-05-30 10:06:29 +02:00
Vincent Petry 8bdce6698c Added unit test for file action context argument 2014-05-30 10:06:29 +02:00
Vincent Petry d6e1643a0e Fix dropping files below the table 2014-05-22 11:16:42 +02:00
Vincent Petry 542b395858 Fixed drag and drop from external files, added tests
- Fixed detection whether the drop zone is inside the currently visible
  table
- Now dragging outside the table does nothing instead of uploading,
  because the user might drop on the sidebar
- Added unit tests for the drop handler
2014-05-21 17:38:09 +02:00
Vincent Petry 5a0281add8 Fixed issues with renaming
- summary is now untouched on rename instead of bogus incrementation
- fixes "Share" status icon by only triggring "fileActionsReady" once
- row is now reinserted even when rename is cancelled, this removes the
  hacky/buggy code that tried to rename the element back
- added unit tests to cover the fixed cases
2014-05-16 17:42:38 +02:00
Vincent Petry 6fd084243b Fixed many issues, clean up
- fixed upload and storage statistics
- fixed infinite scroll to use the correct contain for scroll detection
- fixed unit test that sometimes fail for rename case
- controls are now sticky again
- fixed selection overlay to be aligned with the table
- fixed "select all" checkbox that had id conflicts
- fixed public page
- fixed global actions permissions detection
- fix when URL contains an invalid view id
- viewer mode now hides the sidebar (ex: text editor)
- added unit tests for trashbin
- clean up storage info in template (most is retrieved via ajax call now)
2014-05-15 17:51:04 +02:00
Vincent Petry 9d38e3602b Namespacing for FileList, FileActions and trashbin app
- FileList is now an instantiable class
- FileActions is now in namespace
- added App class for trashbin app
- moved trashbin overrides into classes extending FileList
- replaced many static calls with "this." or "self." to make the classes
  reusable/extendable
- new URL parameter "view" to specify which view is shown, for example
  "files" or "trashbin"
- added OC.Util.History utility class in core for handling history
- moved URL handling/routing to OCA.Files.App
- popstate will correctly update the current view and notify the view of
  the URL change so it can update the current dir
- added JS unitt tests for the trashbin app
- fixed public app to work with the new namespaces
2014-05-15 17:51:04 +02:00
Vincent Petry 9a9665f361 Merge pull request #8041 from owncloud/files-sortcolumns
File list sorting by clicking on column headers
2014-05-12 12:50:27 +02:00
Vincent Petry 61db16321f Clear selection on reload (when changing sort) 2014-04-29 18:49:11 +02:00
Vincent Petry 10bc67bef9 Show spinner for all files when deleting all 2014-04-29 17:59:30 +02:00
Vincent Petry 688f6162da Add sorting to files list, trashbin and public files 2014-04-28 17:42:04 +02:00
Vincent Petry f99f451026 Fixed drag and drop into folder and onto breadcrumb
Fixed drag and drop code to use FileList.getSelectedFiles() instead of
the visible DOM elements.
2014-04-28 14:55:01 +02:00
Vincent Petry a15b68c10f Fixed selection summary calculation issue 2014-04-28 14:55:01 +02:00
Vincent Petry fd982df6ae Fixed selection to be based on FileList.files
The file selection is now based on the internal model array
FileList.files instead of the visible checkboxes.

This makes it possible to virtually select files that haven't been
rendered yet (select all, then deselect a visible one)

Added more unit tests for selection (with shift and ctrl as well)
2014-04-28 14:55:01 +02:00
Vincent Petry 8909b574fa Make sure there are always enough elements visible on the page 2014-04-28 14:55:01 +02:00
Vincent Petry 2883f231d0 Fixed insertion of files
Removed "insert" flag, inserting is by default for FileList.add().
Added "animate" flag to FileList.add().
Added logic to correctly detect when to insert/append elements whenever
the insertion point is visible or not.
Fixed "render next page" logic to work correctly when many pages of
files have been added.
2014-04-28 14:55:01 +02:00
Vincent Petry f6586f6bdf Fixed file sorting to work with scrolling
The FileList.files model is now updated with file operations.
Adding files to the list will add to the model first, then to the DOM.
If the insertion point isn't visible yet, the file won't be added to the
DOM until the user scrolls down.

Updated unit tests to include checking for the correct insertion point.
2014-04-28 14:55:00 +02:00