Skip to content

Commit 5b542df

Browse files
committed
feat: add files api
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent c3e6fbb commit 5b542df

File tree

4 files changed

+70
-14
lines changed

4 files changed

+70
-14
lines changed

developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_27.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ Front-end changes
2525
Added APIs
2626
^^^^^^^^^^
2727

28-
* A new Files Router API allows you to control the files router service and update views, querys or param without page reload (`nextcloud/server#37824 <https://github.com/nextcloud/server/pull/37824>`_)
29-
30-
.. code-block:: js
31-
32-
// https://github.com/nextcloud/server/blob/master/apps/files/src/services/RouterService.ts
33-
OCP.Files.Router.goTo('/trashbin?dir=/Unsplash.d1680193199')
34-
OCP.Files.Router.goToRoute('fileslist', { view: 'files' }, { dir: '/Folders/Group folder' })
28+
* A new Files Router API allows you to control the files router service and update views, querys or param without page reload. See :ref:`FilesAPI`
3529

3630
Back-end changes
3731
----------------
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
============
2-
Activity API
3-
============
1+
========
2+
Activity
3+
========
44

55
Find the documentation in the `Activity app repo <https://github.com/nextcloud/activity/blob/master/docs/endpoint-v2.md>`__.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
.. _FilesAPI:
2+
3+
=====
4+
Files
5+
=====
6+
7+
.. sectionauthor:: John Molakvoæ <skjnldsv@protonmail.com>
8+
9+
Since Nextcloud 27, the files app has been rewritten to use new standards
10+
and frameworks. This means that the old documentation is no longer valid.
11+
We will update and document the new files app APIs and methods here.
12+
13+
.. note:: Some external libraries offers in-depth technical documentation.
14+
Please have a look at the following:
15+
16+
* https://github.com/nextcloud/nextcloud-files (`documentation <https://nextcloud.github.io/nextcloud-files/>`_)
17+
* https://github.com/nextcloud/nextcloud-upload
18+
19+
20+
Router
21+
^^^^^^
22+
23+
To change views and parameters of the current Files app, we expose the router.
24+
This directly maps to the Vue router. You can check their own `documentation <https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location>`_ to
25+
better understand the methods.
26+
27+
.. code-block:: ts
28+
29+
/**
30+
* Trigger a route change on the files app
31+
*
32+
* @param path the url path, eg: '/trashbin?dir=/Deleted'
33+
* @param replace replace the current history
34+
* @see https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location
35+
*/
36+
goTo(path: string, replace: boolean = false): Promise<Route>
37+
38+
/**
39+
* Trigger a route change on the files App
40+
*
41+
* @param name the route name
42+
* @param params the route parameters
43+
* @param query the url query parameters
44+
* @param replace replace the current history
45+
* @see https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location
46+
*/
47+
goToRoute(
48+
name?: string,
49+
params?: Dictionary<string>,
50+
query?: Dictionary<string | (string | null)[] | null | undefined>,
51+
replace?: boolean,
52+
): Promise<Route>
53+
54+
55+
Examples
56+
--------
57+
58+
.. code-block:: js
59+
60+
OCP.Files.Router.goTo('/trashbin?dir=/Unsplash.d1680193199')
61+
OCP.Files.Router.goToRoute('fileslist', { view: 'files' }, { dir: '/Folders/Group folder' })

developer_manual/client_apis/index.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ Clients and Client APIs
77
.. toctree::
88
:maxdepth: 2
99

10-
general
10+
activity-api
1111
android_library/index
12-
WebDAV/index
13-
OCS/index
12+
files
13+
general
1414
LoginFlow/index
15+
OCS/index
1516
RemoteWipe/index
16-
activity-api
17+
WebDAV/index
1718

0 commit comments

Comments
 (0)