Skip to content

Commit df65ec1

Browse files
authored
Merge pull request #10429 from nextcloud/backport/10428/stable27
2 parents c2a13a3 + 03b8ac3 commit df65ec1

4 files changed

Lines changed: 70 additions & 13 deletions

File tree

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

developer_manual/client_apis/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ Clients and Client APIs
88
:maxdepth: 2
99

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

0 commit comments

Comments
 (0)