feat(developer_manual): 28 files-to-vue upgrade guide

Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ
2023-10-06 10:57:50 +02:00
committed by John Molakvoæ
parent 35604c8fea
commit 6c8565a3c1
2 changed files with 39 additions and 3 deletions

View File

@@ -22,7 +22,17 @@ Front-end changes
Added APIs
^^^^^^^^^^
* tbd
* File actions: to register file actions, please use the dedicated API from https://npmjs.org/@nextcloud/files or
https://nextcloud-libraries.github.io/nextcloud-files/functions/registerFileAction.html
* New file menu: to register entries in the new file menu, please use the dedicated API from https://npmjs.org/@nextcloud/files or
https://nextcloud-libraries.github.io/nextcloud-files/functions/addNewFileMenuEntry.html
* Reminder from 27, to interact with the Files app router, use ``OCP.Files.Router``. See :ref:`FilesAPI`
* To Interact with the Files app data, please use the following events. All of them have a `Node object <https://nextcloud-libraries.github.io/nextcloud-files/classes/Node.html>`_ as main parameter.
* ``files:node:created``: the node has been created
* ``files:node:deleted``: the node has been deleted
* ``files:node:moved``: the node has been moved (and its data is already updated)
* ``files:node:updated``: the node data has been updated
Changed APIs
^^^^^^^^^^^^
@@ -39,6 +49,7 @@ Removed APIs
* ``OC.loadScript`` and ``OC.loadStyle``: Use ``OCP.Loader`` instead.
* ``OC.appSettings``: There is no replacement.
* ``OCA.Files``: Everything removed but Sidebar and Settings. See the Added API section for replacements.
Back-end changes
----------------

View File

@@ -14,8 +14,33 @@ We will update and document the new files app APIs and methods here.
.. note:: Some external libraries offers in-depth technical documentation.
Please have a look at the following:
* https://github.com/nextcloud/nextcloud-files (`documentation <https://nextcloud.github.io/nextcloud-files/>`__)
* https://github.com/nextcloud/nextcloud-upload
* https://github.com/nextcloud-libraries/nextcloud-event-bus (`documentation <https://nextcloud-libraries.github.io/nextcloud-event-bus>`__)
* https://github.com/nextcloud-libraries/nextcloud-files (`documentation <https://nextcloud-libraries.github.io/nextcloud-files>`__)
* https://github.com/nextcloud-libraries/nextcloud-upload (`documentation <https://nextcloud-libraries.github.io/nextcloud-upload>`__)
Events
^^^^^^
To listen to files or folder changes or to trigger changes, you need to use
the ``event-bus`` and use the following events:
* ``files:node:created``: the node has been created
* ``files:node:deleted``: the node has been deleted
* ``files:node:moved``: the node has been moved (and its data is already updated)
* ``files:node:updated``: the node data has been updated
Example
-------
.. code-block:: ts
import type { Node } from '@nextcloud/files'
import { subscribe } from '@nextcloud/event-bus'
subscribe('files:node:created', (node: Node) => {
console.log('Node created', node)
})
Router