Commit Graph

397 Commits

Author SHA1 Message Date
Joas Schilling e9094b8a41 Only require the interface 2015-11-30 17:14:47 +01:00
Joas Schilling 6e0596432c Add a unit test that executes the query 2015-11-30 17:14:47 +01:00
Joas Schilling 623d34972d Oracle can not return statements but only values
So evaluate the condition directly and return 1 or 0
2015-11-30 17:12:48 +01:00
Thomas Müller 1480964768 Adding more test suites to group DB 2015-11-30 10:55:05 +01:00
Thomas Müller 3bb6dcea64 Apply DB group annotation ... 2015-11-30 10:55:05 +01:00
Lukas Reschke 391bc49dab Move files/ajax/scan.php to background job
The background job will now be executed in chunks of 500 users all 10 minutes.
2015-11-28 13:06:53 +01:00
Vincent Petry fa2be0750c Make files app use Webdav for most operations 2015-11-22 16:05:50 +01:00
Vincent Petry 8fc0e05564 Remove "Text file" entry in the "+" menu
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.
2015-11-19 15:36:21 +01:00
Lukas Reschke daa388ce8d Move index.php from files to AppFramework
1. Allows it to use the more secure CSP rules of the AppFramework.
2. Adds some unit tests.
2015-11-16 21:10:11 +01:00
Vincent Petry 80cf4e84e3 Fix file action download spinner 2015-10-30 14:58:53 +01:00
Vincent Petry 9c9158e6b7 Fix icon update to be more consistent
Makes the details bar show the same icon as in the list.
2015-10-29 12:59:51 +01:00
Lukas Reschke 8f09d5b67c Update license headers 2015-10-26 14:04:01 +01:00
Vincent Petry abd0ba1f25 Fix file upload, conflict dialog, also in public link
- 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...
2015-10-21 12:18:06 +02:00
Thomas Müller 899165113c Merge pull request #19742 from owncloud/shareinfo_performance
Do not calculate non essential info
2015-10-20 14:25:36 +02:00
Robin Appelman 416da0dfe9 fix delete orphan shares test with object home storage 2015-10-16 21:41:51 +02:00
Vincent Petry 204b3ca189 Do not register sidebar panels when no sidebar 2015-10-15 16:30:50 +02:00
Roeland Jago Douma 5e9ca79788 Do not calculate non essential info
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
2015-10-13 14:56:55 +02:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Roeland Jago Douma 6bf6ff9564 If an inline files action provides an alt text show it
* Added unit tests for icon display
* Added unit tests for icon alt text display
2015-10-03 15:47:20 +02:00
Morris Jobke 4b3a5a257f Fix moment.js "a few seconds ago" with "seconds ago"
* fixes #18627
2015-10-02 10:51:51 +02:00
Thomas Müller 750f19340f Merge pull request #19310 from owncloud/hide-sort-indicator
hide sort indicator when in multiselect mode, ref #19056
2015-09-30 11:07:45 +02:00
Thomas Müller 733673b39d Merge pull request #19365 from owncloud/files-detailsbar-interaction
Fix sidebar interaction
2015-09-29 14:44:28 +02:00
Vincent Petry d52361b09b Disable sorting when multiselect is enabled in file list 2015-09-29 13:24:33 +02:00
Vincent Petry f9acf4627e Fix sidebar interaction
- 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
2015-09-28 15:23:37 +02:00
Vincent Petry a8fb0038e9 Hide sidebar tab headers conditionally
Added canDisplay() in DetailsTabView that should return false if the tab
header of this tab must be hidden
2015-09-28 14:57:44 +02:00
Thomas Müller 72024ad201 Merge pull request #19404 from owncloud/files-sidebar-sorttabs
Fix tabs order in files sidebar
2015-09-28 12:55:38 +02:00
Vincent Petry 5e4a52d3c2 Fix tabs order in files sidebar 2015-09-28 12:30:12 +02:00
Vincent Petry f35b6833ff Fix order of actions in the files actions menu 2015-09-28 11:19:49 +02:00
Jan-Christoph Borchardt 004de1425e Merge pull request #18630 from owncloud/files-combineuploadbutton
Combine upload action into the "New" menu
2015-09-07 14:03:57 +02:00
Vincent Petry 310d797284 Add versions tab to files sidebar
- 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
2015-09-03 16:47:24 +02:00
Vincent Petry 73c61941e2 Tags in FileInfo map must be an array
Fixes FileList.elementToFile to make an array for the tags instead of
keeping the original joined string
2015-09-03 13:01:14 +02:00
Vincent Petry 4ba2333507 Added unit tests for "new" file menu and small fixes
- added unit tests for NewFileMenu
- use generateUrl for FileList.createFile and FileList.createDirectory
- added unit tests for FileList.createFile and FileList.createDirectory
2015-09-03 12:17:35 +02:00
Vincent Petry 3ea9f97c36 Fix sidebar thumbnail loading JS unit tests 2015-09-03 08:24:50 +02:00
Raghu Nayyar c6053daf43 Fixes failing tests 2015-08-31 00:14:07 +02:00
Vincent Petry 5e6fa3c938 Fix trashbin sidebar
Do not display size as it is not available.
Use display name instead of name to remove the ".d123456" suffix.
2015-08-25 11:29:35 +02:00
Vincent Petry 37939fb0e8 Parse mtime from the data attributes 2015-08-24 17:16:20 +02:00
Vincent Petry 31d62c10bf Merge pull request #17501 from tbartenstein/patch-1
Update fileinfo.php
2015-08-24 09:57:27 +02:00
tbartenstein 5e1c2aecc7 fix unit test for folder renaming (icon)
fix unit test to go with #17501 and check for the new icon
2015-08-21 18:54:09 +02:00
Vincent Petry ffff156965 Merge pull request #18310 from hasso/selection-string-fix
Fix the string counting a selected files/dirs
2015-08-18 10:43:17 +02:00
Hasso Tepper 97bc73ad49 Update unit test to reflect the string change 2015-08-17 15:31:44 +03:00
Vincent Petry e2549fa660 Improve right sidebar tabs behavior
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.
2015-08-14 16:51:04 +02:00
Vincent Petry c964eff17b Make file actions work from sidebar
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.
2015-08-12 17:30:20 +02:00
Jan-Christoph Borchardt d04a6bce6f Merge pull request #17709 from owncloud/fileactions-dropdown
Move file actions to dropdown
2015-08-11 15:13:59 +02:00
Morris Jobke 0abc637782 Merge pull request #18171 from owncloud/fix-language-of-files-activities-in-emails
Correctly make use of the languageCode argument in the files activity extension
2015-08-11 12:34:58 +02:00
Vincent Petry 984ae8140d Fixed file actions menu to close when reclicking trigger
FileActionsMenu is now a backbone view.
The trigger and highlight handling is now done in the
FileActions.showMenu() method using events.
2015-08-11 11:35:46 +02:00
Joas Schilling 81c3bbad57 Correctly make use of the languageCode argument in the files activity extension 2015-08-10 14:40:33 +02:00
Vincent Petry 9454e9043a Updated unit tests for file actions and actions menu 2015-08-10 14:12:34 +02:00
Vincent Petry 038d29b8de Fix unit test for tipsy->tooltip change 2015-08-10 11:23:39 +02:00
Arthur Schiwon 9c402c761f fix timezone issue with unittest 2015-08-07 01:22:45 +02:00
Vincent Petry bdfab8108e Fix sidebar mtime display unit test 2015-08-07 01:22:45 +02:00
Vincent Petry 781ba420c9 Use own tabs impl in files sidebar
Also change style.
2015-08-07 01:22:44 +02:00
Arthur Schiwon 734c6b0b6f extend MainFileInfoDetailView JS tests 2015-08-07 01:22:43 +02:00
Vincent Petry e0bcd56402 More work on right sidebar unit tests 2015-08-07 01:22:43 +02:00
Vincent Petry 3e44ca6dc2 Added unit tests for right sidebar 2015-08-07 01:22:43 +02:00
Morris Jobke 5699fff889 Merge pull request #17175 from owncloud/add-download-feedback
Add loading spinner to download icon
2015-07-30 16:34:35 +02:00
Roeland Jago Douma eb7a796ad9 Fix unit tests 2015-07-09 18:42:46 +02:00
Morris Jobke 3d8297c254 Fix unit tests and introduce better mocks of the HTML 2015-07-07 13:56:49 +02:00
Lukas Reschke d1f0ff372e Merge pull request #17163 from owncloud/update-licenses
Update license headers
2015-06-27 20:22:23 +02:00
Clark Tomlinson ca1da0acb7 add check if server returns a 500 and display error
resolves https://github.com/owncloud/core/issues/17170
2015-06-26 12:50:09 -04:00
Morris Jobke f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
Clark Tomlinson 5466dcadc0 adding correct blocking logic for fff 2015-06-22 11:42:42 -04:00
Vincent Petry 13617c8bf1 Check target name on rename with web UI
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.
2015-05-29 19:30:09 +02:00
Scrutinizer Auto-Fixer fdbc21fc6c Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-05-19 11:23:06 +00:00
Vincent Petry 69f88b38c9 Fix file name validation in New menu 2015-04-27 16:31:18 +02:00
Morris Jobke f4bc852db3 Show hint if there is no delete permission
* add class .no-permission which shows the default delete icon
* fixes #15172
* add unit test for no permission and for delete permission
2015-04-23 21:49:59 +02:00
Vincent Petry 53a23364ef Added empty content message for empty read-only folders 2015-04-21 14:31:13 +02:00
Thomas Müller 02614d214e Merge pull request #15437 from owncloud/deleteorphanedfiles
[command] delete orphaned file cache entries
2015-04-10 00:09:56 +02:00
Morris Jobke 9c76d068c3 Merge pull request #15196 from owncloud/limit-file-activities-to-favorites
Limit file activities to favorites
2015-04-09 00:18:31 +02:00
Vincent Petry f8cfc03f36 Replace originalStorage in tests with a proper teardown
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.
2015-04-08 12:45:38 +02:00
Morris Jobke cefdcea021 [command] delete orphaned file cache entries
* ./occ files:cleanup
* delete file cache entries without an existing storage
2015-04-08 10:23:56 +02:00
Joas Schilling e16d61e293 Remove server timezone dependency from files list test 2015-04-07 10:12:15 +02:00
Joas Schilling 730efe25a4 Make scrutinizer happy 2015-04-01 12:13:49 +02:00
Joas Schilling efcc2e87ab Adjust by/self filter aswell and fix tests 2015-03-31 17:35:04 +02:00
Joas Schilling 9233d32834 Move tag related code into a helper so we can test the query without a view 2015-03-30 17:21:06 +02:00
Thomas Müller 2b0906cdff Adding a pending indicator to the files summary - fixes #14853 2015-03-27 01:16:29 +01:00
Thomas Müller a8b756154a Merge pull request #14495 from owncloud/update-mailmap-01
Updating .mailmap
2015-03-26 17:17:18 +01:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Morris Jobke 92f0dba3c8 Show hidden files (dot files) in gray 2015-03-26 10:35:27 +01:00
Morris Jobke dac4436807 Merge pull request #15170 from owncloud/middleclickbreadcrumb
Fix middle click on breadcrumb
2015-03-26 00:19:52 +01:00
Vincent Petry b3de3d7245 Fix breadcrumb click JS unit test 2015-03-25 09:27:55 +01:00
Roeland Jago Douma 0ea3878111 No longer directly output OC_Image for thumbnails
* Only use public interfaces
  - Injected IPreview
* Added unit tests
2015-03-24 18:55:06 +01:00
Thomas Müller abacfd84da fixing js unit tests 2015-03-09 10:38:38 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Lukas Reschke 6e9a2515ea Merge pull request #14278 from owncloud/fix-index
Check if the offset exists before accessing
2015-02-20 14:56:13 +01:00
Thomas Müller b7ff0d44d8 apply backslash fix to _setCurrentDir 2015-02-19 20:20:33 +01:00
Lukas Reschke 3213b04aef Check if the offset exists before accessing
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
2015-02-17 17:08:23 +01:00
Lukas Reschke b848062d88 Parse backslash as directory separator in breadcrumb
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
2015-01-24 09:56:00 +01:00
Vincent Petry 7f24e77cfc Disallow ctrl click to select when selection not allowed 2015-01-15 18:16:27 +01:00
Morris Jobke c4aeb0b5b5 Merge pull request #13289 from owncloud/fav-keepfavoncancelrename
Properly update internal file info with updated tags
2015-01-13 08:28:30 +01:00
Thomas Müller d20a1bbdbf Merge pull request #13154 from owncloud/fix13141
don't show no files yet when mask is in place, fixes #13141
2015-01-12 22:48:25 +01:00
Vincent Petry 8cc13031e9 Return path attribute for ajax rename operations
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.
2015-01-12 18:15:31 +01:00
Vincent Petry dac7828480 Return tags after rename
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
2015-01-12 18:14:17 +01:00
Vincent Petry ef1dd3ea0a Properly update internal file info with updated tags
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.
2015-01-12 17:58:57 +01:00
Jörn Friedrich Dreyer 45a20744fc add js tests for filelist filtering 2015-01-09 10:49:22 +01:00
Jörn Friedrich Dreyer 6ba8881343 add file summary filter spec tests 2015-01-02 10:28:42 +01:00
Morris Jobke 75e8b39826 Merge pull request #12879 from owncloud/mountconfig
Add mount specific options
2014-12-18 23:38:14 +01:00
Morris Jobke ec0401f97b be more explicit in JS unit tests - caused by accessibility issues 2014-12-18 01:27:58 +01:00
Robin Appelman fd85424742 Add getMountPoint to FileInfo 2014-12-17 14:03:50 +01:00
Vincent Petry ab35459cac Propertly restore thumbnail on cancel/rename/move
Since the thumbnail is now in a div, the code that tries to change the
thumbnail have been adapted here as well.
2014-12-17 13:12:57 +01:00
Vincent Petry 33eb4483b2 Fixed has-favorites CSS 2014-12-15 15:18:29 +01:00
Vincent Petry a5bb66f4a7 Added favorites feature to the files app 2014-12-15 12:10:54 +01:00
Morris Jobke 5b3971f002 Merge pull request #12639 from owncloud/bad_mtime_format
Fix formatting of bad dates from external storages
2014-12-13 10:07:10 +01:00
Robin McCorkell fdbb68a3c3 Return ? if mtime is 0 or -1
Tooltip contains 'Unable to determine date'. Fixes #6395
2014-12-12 23:54:18 +00:00
Vincent Petry 81e9d43e23 Move file thumbnail into the label element 2014-12-11 18:21:25 +01:00
Lukas Reschke d3188159d2 Merge pull request #12394 from owncloud/files-fileactionsimprovements
Improve FileActions JS to allow for custom rendering
2014-12-08 11:30:21 +01:00
brumsel 0dcfd5f20b Modified filesort test cases to test for large sizes & timestamps 2014-12-03 23:45:57 +01:00
Robin Appelman e8cbb8e2d8 Add js unit test 2014-11-26 12:14:35 +01:00
Vincent Petry e689bc745f Improve FileActions JS to allow for custom rendering
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.
2014-11-24 16:26:50 +01:00
Joas Schilling 76ebd3a050 Make apps/ extend the \Test\TestCase and fix overwritten methods 2014-11-19 14:52:09 +01:00
Joas Schilling bb540722cd Use base class to reset the file mapper 2014-11-19 14:52:07 +01:00
Joas Schilling 6625d5c88f Correctly restore previous root mount point after testing 2014-11-17 10:48:19 +01:00
Morris Jobke 1979ec70a5 JS unit tests fix - use toBeUndefined() instead of toEqual(null) 2014-11-04 10:37:16 +01:00
Thomas Müller f776bcd4a0 remove unnecessary require calls - the ownCloud class loader is supposed to take care of this 2014-10-30 17:20:40 +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
Bjoern Schiessle bc8e1ebf75 new unit test added 2014-08-11 12:03:08 +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
Robin Appelman ea07f0a18e Fix unit test 2014-06-06 09:56:01 +02:00
Robin Appelman 28615cca9c Fix unit tests 2014-06-06 09:56:01 +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
Björn Schießle 88d26aac7b Merge pull request #8612 from owncloud/share-updateshareiconsafterrename
[master] Fixed issues with renaming
2014-05-21 06:27:07 -04:00
Morris Jobke dc36d30953 Remove all occurences of @brief and @returns from PHPDoc
* test case added to avoid adding them later
2014-05-19 17:50:53 +02:00
Thomas Müller 95741f3936 Merge pull request #8435 from owncloud/fix-8322-master
Expose permission via WebDAV
2014-05-19 16:52:03 +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
Thomas Müller 95fe55f9e7 fix broken unit test 2014-05-02 20:35:03 +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 af22e7ec95 Added unit test in files app for sort function in helper class
Added unit test for the Helper class in the files app that tests the
different sort orders.
2014-04-28 17:42:04 +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
Vincent Petry 9c2fbea6a4 Fix file selection for infinite scrolling
- moved file selection code to FileList
- fix selection summary when all files are selected
- nextPage now auto-selects files if "select all" checkbox is checked
- fixed trashbin to use the same selection logic as FileList
2014-04-28 14:55:00 +02:00
Vincent Petry 9f62059efa Fix file summary to use the whole file list
- moved the summary code into a new class FileSummary
- FileSummary is calculated only once, then updated with add/remove
- added new OC.Util namespace for JS utility functions
2014-04-28 14:49:39 +02:00
Bjoern Schiessle 27c5a978f9 we no longer need to handle the Shared folder different from any other folder 2014-04-23 12:54:25 +02:00
Vincent Petry 0be9de5df5 Files, trashbin, public apps use ajax/JSON for the file list
Files app:

- removed file list template, now rendering list from JSON response
- FileList.addFile/addDir is now FileList.add() and takes a JS map with all required
  arguments instead of having a long number of function arguments
- added unit tests for many FileList operations
- fixed newfile.php, newfolder.php and rename.php to return the file's
  full JSON on success
- removed obsolete/unused undo code
- removed download_url / loading options, now using
  Files.getDownloadUrl() for that
- server side now uses Helper::getFileInfo() to prepare file JSON response
- previews are now client-side only

Breadcrumbs are now JS only:

- Added BreadCrumb class to handle breadcrumb rendering and events
- Added unit test for BreadCrumb class
- Moved all relevant JS functions to the BreadCrumb class

Public page now uses ajax to load the file list:

- Added Helper class in sharing app to make it easier to authenticate
  and retrieve the file's real path
- Added ajax/list.php to retrieve the file list
- Fixed FileActions and FileList to work with the ajax list

Core:

- Fixed file picker dialog to use the same list format as files app
2014-04-02 15:33:47 +02:00
Vincent Petry aaa8d6ec02 Fixed broken delete file action 2014-04-01 16:09:48 +02:00
Vincent Petry 07f78c8248 Added unit tests for "add()" method for file upload
- Added OC.Upload.init() to make the code testable
- Added unit tests for the add() method of the uploader with some error
  cases
2014-03-06 13:53:34 +01:00
Bjoern Schiessle 2e73c957e5 don't allow to create a file or folder named 'Shared' in the root folder, also exclude all combinations of lower and upper case letters 2014-03-05 13:16:25 +01:00
Robin Appelman f710205ee7 Make unit tests expect the svg icons 2014-02-20 16:56:09 +01:00
Vincent Petry d5397d813c Do not send file list for select all on Download/delete
- When all files are selected, do not send the whole file list
- Download will trigger download for the parent folder, also works
  with root
- Delete will send "allfiles" to the server that will find the file
  list or the passed directory by itself
2014-02-13 20:28:52 +01:00
Thomas Müller 6d3b61f388 Merge pull request #7011 from owncloud/jshint
Added .jshintrc
2014-02-04 12:11:32 -08:00
Vincent Petry ba1b9df8a9 Fixed file name validation unit test + added newline
- fixed file name validation unit test
- added "\n" as forbidden character in isFileNameValid()
2014-01-30 13:40:01 +01:00
Vincent Petry d36a2ff9ee Added .jshintrc
- Also fixes a few JSHint warnings in files app
- Added "global" comment on top of files app to suppress warning and
  also inform devs about what globals are use
2014-01-30 13:40:01 +01:00
Vincent Petry bc598f1919 Updated unit tests for rename action
- rename action is now checked inside of ".nametext" element
- added test to ensure that display() correctly resets all actions
  including the rename one
2014-01-30 10:07:08 +01:00
Vincent Petry 58c7042e70 Added error message for when target folder was removed
Whent trying to upload/rename/create files in a folder that was removed
or rename, the correct error message is now shown.

In the case of upload of multiple files, the upload is cancelled.

This situation can happen if the target folder was renamed or removed
from another browser window or client.
2014-01-29 12:46:11 +01:00
Vincent Petry c6695bbd76 Fixed download URL in public page
- Refactored download URL building to make it overridable
- Added download URL override in public page
- Added JS unit tests for download URL
- Added OC.redirect() method to facilitate unit testing
2014-01-24 13:38:39 +01:00
Vincent Petry 0671c58e36 Fixed filelist unit tests hidden params
Also added dummy table
2014-01-24 13:19:44 +01:00
Vincent Petry 350214c609 Added Javascript unit tests
- added karma utility to run jasmine unit tests
- added Sinon library (for stubs/mocks/fakeserver)
- added a few unit tests for core and files
- added autotest-js.sh script
2014-01-16 17:12:29 +01:00
Vincent Petry bc64931cd0 Fixed unit tests for ajax rename 2013-11-27 23:19:57 +01:00
Vincent Petry 356eef0739 Quota storage wrapper is now used for all users in sharing mode
When accessing a shared folder, the folder's owner appears as mountpoint
but wasn't wrapped by a quota storage wrapper.

This fix makes sure that all home storages are wrapped by a quota
storage wrapper, if applicable, to make sure quotas are respected when
uploading into shared folders.
2013-11-21 12:04:54 +01:00
Thomas Müller a90cefcea2 avoid usage of brand name 'ownCloud' 2013-10-28 21:42:48 +01:00
kondou 9e8a6b704d Add _many_ newlines at the end of files 2013-08-18 11:06:59 +02:00
Morris Jobke e0547a25ab if rename of file fails, the rename is undone in the view - #fix 2820
Changes:
 * OC.dialog -> OC.Notification
 * Added test
 * Fixed OC.Notification.show() issue for queued items
 * Highlight failed item and show notification
2013-06-15 09:58:27 +02:00
Morris Jobke e2bd32323d [files] fix mock creation and remove hardcoded 'require' statement 2013-05-12 13:02:01 +02:00
Morris Jobke b777c0fd75 [files] rename lib to "App" 2013-05-12 11:47:22 +02:00
Morris Jobke 7e23e97676 [files] rename test class and add rename test 2013-05-12 11:47:22 +02:00
Morris Jobke d4ba9cf338 [files] remove realpath in test 2013-05-12 11:47:22 +02:00
Morris Jobke bb5554de7f [files] rename tests 2013-05-12 11:47:22 +02:00