aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/tests/js
Commit message (Collapse)AuthorAgeFilesLines
* Fix "fileActions.currentFile" not set before using itDaniel Calviño Sánchez2017-12-261-0/+24
| | | | | | | | | | | When an empty area of a file row was clicked and the "Details" action was executed "fileActions.currentFile" was not guaranteed to be set to the appropriate object (it depended on the previous actions of the user), so when it was used by "getCurrentMimeType()" and other FileActions functions they may not work as expected. Now it is explicitly set to the appropriate value before its use. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #7591 from ↵Morris Jobke2017-12-222-3/+89
|\ | | | | | | | | nextcloud/trigger-events-before-and-after-a-file-action-is-executed Trigger events before and after a file action is executed
| * Trigger events before and after a file action is executedDaniel Calviño Sánchez2017-12-192-3/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the same way that other elements can know when a FileAction is registered or a default action is set this commit makes possible to be notified before and after a FileAction is executed. This is achieved by wrapping the registered action handler in a custom function that notifies the listeners before and after executing the handler itself. Due to this approach only FileActions registered through "registerAction" trigger the events, although that is not a problem as this is how the actions should be added to the FileActions anyway. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Fixed breadcrumbs testsJohn Molakvoæ (skjnldsv)2017-12-211-12/+31
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* show e2e folder icon on encrypted foldersBjoern Schiessle2017-11-201-0/+26
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Add data attribute to file list rows telling if the file is encryptedDaniel Calviño Sánchez2017-11-201-5/+33
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #7047 from ↵Björn Schießle2017-11-201-0/+9
|\ | | | | | | | | nextcloud/add-support-for-files-with-no-permissions Add support for files with no permissions
| * Add proper handling of files without permissionsDaniel Calviño Sánchez2017-11-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | Now a file gets its directory permissions only if it contained no permissions (they were undefined or null), but not if its permissions were set to "NONE". Besides that, now file actions that do not require any permission on the file to be performed can be used on files that have no permissions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Merge pull request #7051 from nextcloud/breadcrumbs-refactorMorris Jobke2017-11-132-105/+148
|\ \ | | | | | | Breadcrumbs refactor
| * | Added more tests and only test jsunit on drone (for testing only)John Molakvoæ (skjnldsv)2017-11-131-0/+13
| | | | | | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
| * | Add menu testsJohn Molakvoæ (skjnldsv)2017-11-121-0/+54
| | | | | | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
| * | Fixed tests and width calculationJohn Molakvoæ (skjnldsv)2017-11-081-1/+1
| | | | | | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
| * | Fixed remaining testsJohn Molakvoæ (skjnldsv)2017-11-082-5/+5
| | | | | | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
| * | Fixed some more test and loop fixJohn Molakvoæ (skjnldsv)2017-11-081-2/+2
| | | | | | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
| * | Updated tests according to new systemJohn Molakvoæ (skjnldsv)2017-11-081-99/+75
| |/ | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* / Hide summary file actions when a selected file does not matchDaniel Calviño Sánchez2017-11-021-0/+23
|/ | | | | | | | | | When several files are selected and one of them can not be deleted the "Delete" file action is not shown in the summary. This commit extends that behaviour too to the other file actions in the summary ("Move or copy" and "Download"), so now an action is shown in the summary only if it can be executed on all the currently selected files. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #6869 from burned42/6307-fix_page_title_not_changedDaniel Calviño Sánchez2017-10-271-1/+3
|\ | | | | #6307 fix page title not changed
| * bugfix: set/change page title when switching to filelistBernd Stellwag2017-10-271-1/+3
| | | | | | | | Signed-off-by: Bernd Stellwag <burned@zerties.org>
* | Move checkboxes to their own columnDaniel Calviño Sánchez2017-10-191-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The selection column is not only a visual column, but also a real column of the file list table. Unlike other columns whose width is reduced in space constrained screens the selection column must stay the same so the tapping area is large enough to be easily usable The selection column does not appear in the search results table, so its contents have to be explicitly aligned with those of the main table based on whether the main table has a selection column or not (using the "has-selection" CSS class in the same way as the "has-favorite" CSS class was being used when there was a column for favorite actions). In the tests the ":visible" selector can no longer be used. That selector matches elements with a width or height that is greater than zero, but the dimensions calculated in the unit tests are not reliable; the width of the link was zero before these changes, and now moving the checkbox to its own column causes the height of the link to become zero too, so it no longer matches the ":visible" selector even if it is not hidden. As hidding and showing the link is based on its "display" CSS property its value is the one checked now. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Remove "has-favorites" class from file list tableDaniel Calviño Sánchez2017-10-191-3/+0
| | | | | | | | | | | | | | | | The "has-favorites" CSS class is no longer used after moving the favorite mark to the top right corner of the thumbnail, so there is no need to add it to the table. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Move favorite mark to the top right corner of the thumbnailDaniel Calviño Sánchez2017-10-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The favorite icon was shown on its own "column" (not a real column in the table, but a visual column achieved through margins and left positions). Now the icon was moved to the top right corner of the file thumbnail, and the thumbnail and file name were moved to the left to fill the space left by the "column". To keep the markup in line with its visual representation (and to ease the placing through CSS), the favorite mark is no longer prepended to the row, but appended to the thumbnail instead. In the same way, the thumbnail is no longer appended to the checkbox label, but to the link with the name of the file instead (although the checkbox is still shown at the bottom right corner of the thumbnail, and clicking on the thumbnail still selects the file). In order to show the "busy" state on a file the "icon-loading-small" CSS class is set to the parent element of the thumbnail, so the thumbnail is also wrapped now by another div with the same size and position as the label. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Replace inline favorite action with just a favorite iconDaniel Calviño Sánchez2017-10-191-62/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparatory step for a following commit in which the position of the favorite icon and the checkbox will be swapped; in that new design the favorite icon is no longer expected to be an action but just a simple mark on whether the file is favorited or not (the action is expected to be triggered then only from the file actions menu). The favorite icon is now fully shown or completely hidden depending on whether the file is favorited or not. As the icon is just informative but no longer an action now it does not change when hovered or focus. In the same way, the alternative text when the file is not favorited now it is not "Favorite" (an action) but "Not favorited" instead. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add "Favorite" action to the file actions menuDaniel Calviño Sánchez2017-10-191-0/+56
| | | | | | | | | | | | | | | | | | | | | | The new FileAction for the menu is essentially the same as the old inline FileAction, except for the rendering; in this case the FileAction is shown in the menu in a standard way, so there is no need to provide a custom renderer (although the menu entry text and icon change depending on whether the file is currently a favorite or not, but that can be done just with displayName and iconClass functions). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add support to FileActionsMenu for icon class functionsDaniel Calviño Sánchez2017-10-191-0/+28
|/ | | | | | | | | | | | Icon class function properties make possible to render a different icon class depending on the context of the file action. Inline file actions had support for them already and called them passing the file name and context of the file action as parameters. Due to this the FileActionsMenu passes those parameters too to icon class functions instead of just the context like done for display name functions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fixed testsJohn Molakvoæ (skjnldsv)2017-09-251-8/+9
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Add tests for FileListThomas Citharel2017-09-151-0/+98
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Don't try the actual file upload if the checks already error outRoeland Jago Douma2017-08-261-0/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* fix testRobin Appelman2017-07-111-9/+11
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix sorting of favorite filesDaniel Calviño Sánchez2017-07-051-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Make possible to know the registered detail views in a details viewDaniel Calviño Sánchez2017-06-092-0/+47
| | | | | | | | 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>
* Do not reload the filelist on first openRoeland Jago Douma2017-05-041-0/+6
| | | | | | | | | | | | | | | | 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>
* Reload file list when leaving hidden stateVincent Petry2017-04-261-0/+6
| | | | | | | | 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.
* Fix sinon.stub deprecation warningsChristoph Wurst2017-04-241-1/+1
| | | | | | | | | | Calls to `sinon.stub(obj, 'meth', fn)` are deprecated and therefore replaced by `sinon.stub(obj, 'meth).callsFake(fn)` as instructed by the deprecation warning. This makes the js unit testing output readable again. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* added quit option in commentstabview.jsnoveens2017-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add ignore_files to config,Felix Heidecke2017-03-201-1/+3
| | | | | | | | | | | | | | | | test files against ignore_files list on upload fix typo and indentation Move blacklist declaration to lib/public/Files/FileInfo.php, Rename *ignored to *blacklisted Mocked blacklist_files for testing Mocked blacklist_files for testing Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* filelist only refreshed if directory changesnoveens2017-03-021-0/+18
| | | | | | | | | | | | | | | | 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>
* Style modifications of favorite star on main detail view (#26658)Michael Jobst2016-12-191-10/+10
| | | | | | | | | | | | * Style modifications of favorite star on main detail view * Removed unused opacity change on mouse over * favorite star title fixed * favorite star opacity should always be .7 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Catch status code 400Lukas Reschke2016-12-011-0/+5
| | | | | | In case the server returns a statuscode 400 we should also gracefully return to the home directory. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Skip hidden files when counting visible files in list (#26522)Vincent Petry2016-11-141-0/+28
| | | | | | 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.
* Upload autorename on client sideVincent Petry2016-11-021-4/+57
| | | | | | | | | | | Removes the need for POST to collection which would hit against upload limits. The client tries to auto rename the file by adding a suffix "(2)". It tries to use the file list on the client side to guess a suitable name. In case a file still cannot be uploaded and creates a conflict, which can happen when the file was concurrently uploaded, the logic will continue increasing the suffix.
* Remove upload_limit in files app as it is not needed with PUT upload (#26069)Vincent Petry2016-11-021-14/+0
| | | | | | | The web UI now uses for PUT uploads which aren't restricted by PHP's upload_max_filesize and post_max_size Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Highlight files and update storage stats at end of upload (#26164)Vincent Petry2016-10-251-4/+13
| | | | | Properly trigger the "stop" even from the uploader. Also update storage stats at the end of all uploads instead of for each upload.
* Merge pull request #1883 from nextcloud/downstream-26145Morris Jobke2016-10-251-1/+1
|\ | | | | Storage 503 message improvements
| * Storage 503 message improvementsVincent Petry2016-10-241-1/+1
| | | | | | | | | | "Storage not available" is now "Storage temporarily not available". Exceptions are now logged in DEBUG level, not FATAL.
* | More fixes to file uploadVincent Petry2016-10-241-1/+1
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Fix js unit tests for webdav put upload changesVincent Petry2016-10-242-49/+37
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Use Webdav PUT for uploads in the web browserVincent Petry2016-10-242-92/+257
|/ | | | | | | | | | | | | | - 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>
* Make it possible to filter by tags with REPORT methodVincent Petry2016-10-191-31/+22
| | | | | | | | | | | Enhanced the REPORT method on the Webdav endpoint and added a "oc:favorite" filter rule. When set, it will return a flat list of results filtered with only favorite files. The web UI was also adjusted to use this REPORT method instead of the private API endpoint. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Also prevent null byte characterJoas Schilling2016-09-011-0/+1
|
* Filter out %0A from pathsJoas Schilling2016-09-011-1/+2
|