Commit Graph

327 Commits

Author SHA1 Message Date
Daniel Calviño Sánchez 1f19a45a88 Merge pull request #6869 from burned42/6307-fix_page_title_not_changed
#6307 fix page title not changed
2017-10-27 17:12:47 +02:00
Bernd Stellwag 3e3e4899fa bugfix: set/change page title when switching to filelist
Signed-off-by: Bernd Stellwag <burned@zerties.org>
2017-10-27 15:23:39 +02:00
Morris Jobke c733cdaa65
Use ::class in test mocks of encryption app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 13:56:56 +02:00
Morris Jobke 1978867a11 Merge pull request #6709 from nextcloud/show-checkbox-where-the-favourite-icon-is-now
Show checkbox where the favourite icon is now
2017-10-25 01:07:51 +02:00
Morris Jobke 43e498844e
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-24 17:45:32 +02:00
Daniel Calviño Sánchez f392e78d5b Move checkboxes to their own column
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>
2017-10-19 01:46:13 +02:00
Daniel Calviño Sánchez 6b8713e8b6 Remove "has-favorites" class from file list table
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>
2017-10-19 01:46:13 +02:00
Daniel Calviño Sánchez 415ac9b3ac Move favorite mark to the top right corner of the thumbnail
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>
2017-10-19 01:46:13 +02:00
Daniel Calviño Sánchez 9ff0941c07 Replace inline favorite action with just a favorite icon
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>
2017-10-19 01:46:13 +02:00
Daniel Calviño Sánchez 420d1b91ab Add "Favorite" action to the file actions menu
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>
2017-10-19 01:46:13 +02:00
Daniel Calviño Sánchez a8f1902b02 Add support to FileActionsMenu for icon class functions
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>
2017-10-19 01:46:13 +02:00
John Molakvoæ (skjnldsv) ab1c34c5a5
Fixed tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2017-09-25 16:17:33 +02:00
Roeland Jago Douma eb00dbb593
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-09-21 18:30:20 +02:00
Morris Jobke 4b57f68b81
Fix unit tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-09-21 14:00:38 +02:00
Thomas Citharel 8c576a8d63 Add tests for FileList
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-09-15 18:14:34 +02:00
Roeland Jago Douma eea7de4c9f
Correctly format OCS response with favorites
The helper funtion did not handle the response correctly and basically
only returned the last share with tags.

This is a simple rewrite. That is still understandable. Loops maybe more
than strictly required. But preformance is not the issue here.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-29 12:03:13 +02:00
Morris Jobke cfe5d35862 Merge pull request #6252 from nextcloud/only_show1_error
Don't try the actual file upload if the checks already error out
2017-08-26 12:46:01 +02:00
Roeland Jago Douma 69d2d0178a
Don't try the actual file upload if the checks already error out
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-26 11:30:04 +02:00
Jan-Christoph Borchardt d0d6a92054 Fix sorting of entries in Files sidebar
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
2017-08-25 18:40:28 +02:00
Robin Appelman e1d6ca3c53
fix test
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-11 14:03:11 +02:00
Daniel Calviño Sánchez be56374c51 Fix sorting of favorite files
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>
2017-07-05 15:01:23 +02:00
Joas Schilling b481fa40ef
Adjust the unit test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-06-13 11:17:44 +02:00
Daniel Calviño Sánchez 0a3d9f25c1 Make possible to know the registered detail views in a details view
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>
2017-06-09 03:14:23 +02:00
Roeland Jago Douma 8d66e325a9
Do not reload the filelist on first open
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>
2017-05-04 13:29:49 +02:00
Vincent Petry 3f36548a6d
Reload file list when leaving hidden state
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.
2017-04-26 13:51:44 +02:00
Roeland Jago Douma 97c27395aa Merge pull request #4458 from nextcloud/fix/sinon-stub-deprecation-warnings
Fix sinon.stub deprecation warnings
2017-04-24 13:47:46 +02:00
Christoph Wurst 2317d7bb49
Fix sinon.stub deprecation warnings
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>
2017-04-24 10:39:37 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Joas Schilling 0564392cb9
Fix the tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-03-26 21:26:45 +02:00
noveens 40228c0c2b
added quit option in commentstabview.js
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>
2017-03-23 13:12:29 -06:00
Felix Heidecke 11f838f9e4
Add ignore_files to config,
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>
2017-03-20 01:17:12 -06:00
noveens 93f9db4d59
filelist only refreshed if directory changes
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>
2017-03-02 21:43:44 -06:00
Morris Jobke b954c2f186
Fix app name of files app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-02-14 17:36:23 -06:00
Joas Schilling d79838ac9b
Add tests for getUser()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-02-07 12:01:28 +01:00
Joas Schilling 881c7275a2
Add tests for getFile()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-02-07 11:49:32 +01:00
Michael Jobst a7526b9837
Style modifications of favorite star on main detail view (#26658)
* 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>
2016-12-19 17:34:09 +01:00
Joas Schilling 1a802d3383
Add tests for favorite action
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-12-04 12:54:34 +01:00
Joas Schilling 7c1b288b57
Add some generic tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-12-04 12:41:14 +01:00
Lukas Reschke 9704b4df52
Catch status code 400
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>
2016-12-01 19:13:28 +01:00
Joas Schilling 8f38adaab1 Merge pull request #2123 from nextcloud/downstream-26522
Skip hidden files when counting visible files in list
2016-11-16 19:10:35 +01:00
Joas Schilling 1dc23f2fd6
Remove the old activity extension
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-16 09:25:46 +01:00
Joas Schilling 0d940e581a
Move the favorites filter to IFilter
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-11-16 09:25:44 +01:00
Vincent Petry 1141fcc9ac
Skip hidden files when counting visible files in list (#26522)
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.
2016-11-14 16:21:57 +01:00
Thomas Müller 506ccdbd8d
Introduce an event for first time login based on the last login time stamp
Use firstLogin event to trigger creation of default calendar and default address book

Delay login of admin user after setup so that firstLogin event can properly be processed for the admin

Fixing tests ...

Skeleton files are not copied over -> only 3 cache entries are remaining

Use updateLastLoginTimestamp to properly setup lastLogin value for a test user
2016-11-14 14:50:10 +01:00
Lukas Reschke c0bbae28f0 Merge pull request #1741 from nextcloud/new_preview
Improve previews
2016-11-03 21:07:16 +01:00
Morris Jobke ae5eb79593 Merge pull request #1908 from nextcloud/downstream-26078
Upload autorename on client side
2016-11-03 14:21:35 +01:00
Roeland Jago Douma 87855aa97b
Added genertor helper & tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-03 14:00:33 +01:00
Morris Jobke 39573e602d Merge pull request #1978 from nextcloud/remove-send-mail-option
Remove send mail option
2016-11-02 22:36:05 +01:00
Vincent Petry 6a4ea2c15a
Upload autorename on client side
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.
2016-11-02 22:15:03 +01:00
Vincent Petry 7e701504be
Remove upload_limit in files app as it is not needed with PUT upload (#26069)
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>
2016-11-02 20:43:35 +01:00