Remove some hacks from files app about the *files_sharing* status
action, in general not sure why this hack was there instead of being in
the correct app - but it broke the grid view.
So now the sharing information is also available in grid view.
Moreover the icon is fixed in size to not overflow the actions menu.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
It is needed, e.g. for the note-to-recipient, that the headers
are also shown when there is no content (yet).
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Single file shares use the share token as source name, so we need to use
the displayname. To do so we need to set the download attribute to the
displayname of the file to download.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1. Move general files delete action (thats not trashbin app!) to files
tests.
2. Delete files (move to trashbin) before loading the page so previews
are not generated so they cannot lock the file.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
The backend does not allow bulk download within the trashbin,
so we need to disable this also on the frontend.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* Missing pieces of https://github.com/nextcloud/server/issues/46528
* Add checkbox to not show this dialog again
* Add user config as suggested by designers in files settings to
reenable or diable this behavior.
* Fix behavior of dialog: It says "keep .ext" but it does not keep the
extension but cancels the operation. From the button label the user
expects that the operation is continued but with the old extension.
* Added more test coverage by adding component tests.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Instead of downloading files, if there is no other default action,
we should just open the details tab.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit introduces end-to-end tests for various public link sharing scenarios in the `files_sharing` app. It validates the behavior under multiple configurations:
- Password and expiration date enforced
- Password enforced with a default expiration date
- Expiration date enforced with optional password
- Default password and expiration date without enforcement
- Password enforced, expiration date set but not enforced
- Both password and expiration date not enforced, but defaults set
- Password not enforced, expiration date enforced
- Password not enforced, default expiration date set
- Password and expiration date not enforced with no defaults
The tests ensure proper validation and functionality of the configurations, leveraging the `setupData` and `createShare` utilities.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
This update enhances the testing framework for public sharing by
improving the setup and management of share contexts.
It refactors the code to make the `createShare` function reusable externally,
ensuring better testability and flexibility.
Additionally, the update optimizes share permission adjustments and
improves state management, making public share setups more efficient and maintainable.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
When marking a file as favorite from within the sidebar make sure it
really works, this fixes two issues:
1. The source needs to be the plain source not URL encoded, as otherwise
the source of the node would be encoded twice (and show with encoding
in the navigation)
2. The store should also listen for the update events as the sidebar has
no access to the real node to update it, instead the store should -
as long as we only have the legacy sidebar - update the node when
added or removed as favorite.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
When changing the folder the filter will be re-mounted by the file list,
so we need to pass the current state of the filter to the filter UI.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Vue3 does not replace the element while mounting but only renders within
(replace inner HTML).
So it would result in two stacked `<main>` elements which is invalid and
an accessibility issue.
Instead we just use a `<div>` element for mounting.
For Vue2 apps this does not change anything as the whole element will be
replaced with a new `<main>` element.
For vanilla apps this will slightly decrease the accessibility as the
main landmark is now missing, but this is not a hard accessibility issue
as it would be for Vue3 apps having two main elements.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
If a session timed out or was closed in another tab,
then currently the user gets random error messages.
This intercepts 401 responses (should only happen if logged out, or the
users does something wrong).
If we get a 401, we make sure its because of the session,
by checking if the user can access the files app.
If that is also the case we forward the user to the login page
and set the redirect URL to the last used URL.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This also fixes Typescript issue but requires to slightly
adjust the Navigation test as the progress bar is not visible (because it is overlayed by another element).
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Problem: Is a node is renamed and the new name is out of the current
visible list of nodes the component will be recycled, this means
the props will change, so when the `onRename` functions is about to reset
the state the `this.source` will point to a different node.
To fix this, but also to separate business logic from visual representation,
the logic is moved into the renaming store and the component is only
responsible for rendering.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
The idea is to intercept the request,
then test the loading state,
and after the tests continue the request.
Problem here: `cy.intercept` has a timeout on the request-handler
which uses the same timeout as DOM assertions (4s) we could increase it,
but this also will increase DOM assertion timeout.
So instead we do not await in the request handler, but in the response handler.
This should use the response timeout which is much higher (30s).
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This fixes non reactive default action text of the name component.
Also use download action as default action so that only one place
is needed to define how to download a file.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* Resolves https://github.com/nextcloud/server/issues/45409
This includes two fixes:
1. The name in the "new node" dialog is correctly selected (e.g. `file.txt` only `file` is selected by default), to allow quick naming
2. `@nextcloud/files` functions for filename validation are used, this allows to use new Nextcloud 30 capabilities (e.g. reserved names)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>