Skip to content

Commit 9eb9815

Browse files
authored
Merge pull request #13967 from nextcloud/feat/document-33-profile
docs: document changes of the `OCA.Profile.ProfileSections` API
2 parents c8b6ae9 + f4a65ef commit 9eb9815

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_33.rst

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,49 @@ you now have to listen to the ``viewer:sidebar:open`` event-bus event from the V
3737
So enable the **open sidebar** action within the viewer you have to set ``enabledSidebar``
3838
when opening the viewer to allow opening the sidebar from within the viewer and listen for the mentioned event.
3939

40+
Profile app
41+
^^^^^^^^^^^
42+
43+
To make the profile sections API framework agnostic, allowing us to migrate the profile app to Vue 3
44+
while still allow external apps to use Vue 2 based profile section,
45+
the ``OCA.Core.ProfileSections`` API was replaced with ``OCA.Profile.ProfileSections``
46+
which uses custom web components instead of being based on Vue components.
47+
48+
As of Nextcloud 33 the ``OCA.Profile.ProfileSections.registerSection`` method accepts
49+
a section object in the following format:
50+
51+
.. code-block:: typescript
52+
53+
interface ProfileSection {
54+
/**
55+
* Unique identifier for the section
56+
*/
57+
id: string
58+
/**
59+
* The order in which the section should appear (lower numbers appear first)
60+
*/
61+
order: number
62+
/**
63+
* The custom element tag name to be used for this section
64+
*
65+
* The custom element must have been registered beforehand,
66+
* and must have the a `user` property of type `string | undefined`.
67+
*
68+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Web_components
69+
*/
70+
tagName: string
71+
/**
72+
* Static parameters to be passed to the custom web component
73+
*/
74+
params?: Record<string, unknown>
75+
}
76+
77+
4078
Added APIs
4179
^^^^^^^^^^
4280

43-
- TBD
81+
- ``OCA.Profile.ProfileSections`` was added as a framework agnostic replacement for ``OCA.Core.ProfileSections``.
82+
See section about the profile app above.
4483

4584
Changed APIs
4685
^^^^^^^^^^^^
@@ -74,6 +113,9 @@ Removed APIs
74113
- To replace ``OC.getPort`` use ``window.location.port``.
75114
- To replace ``OC.getProtocol`` use ``window.location.protocol``.
76115

116+
- The ``OCA.Core.ProfileSections`` API was removed and replaced with the framework agnostic ``OCA.Profile.ProfileSections`` API.
117+
See section about the profile app above.
118+
77119
- The ``OCA.Files.Sidebar`` API is removed.
78120
This was the last API using the legacy ``FileInfo`` API.
79121
It is now replaced with the new Node based sidebar API available from the `@nextcloud/files <https://www.npmjs.com/package/@nextcloud/files>`_ package.

0 commit comments

Comments
 (0)