diff options
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/services/TabSections.js | 8 | ||||
-rw-r--r-- | apps/files_sharing/src/views/SharingTab.vue | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/files_sharing/src/services/TabSections.js b/apps/files_sharing/src/services/TabSections.js index 8578f8f08d5..ab1237e7044 100644 --- a/apps/files_sharing/src/services/TabSections.js +++ b/apps/files_sharing/src/services/TabSections.js @@ -3,6 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +/** + * Callback to render a section in the sharing tab. + * + * @callback registerSectionCallback + * @param {undefined} el - Deprecated and will always be undefined (formerly the root element) + * @param {object} fileInfo - File info object + */ + export default class TabSections { _sections diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index bba8f0b2edb..2ed44a4b5ad 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -127,11 +127,10 @@ </NcPopover> </div> <!-- additional entries, use it with cautious --> - <div v-for="(section, index) in sections" - :ref="'section-' + index" + <div v-for="(component, index) in sectionComponents" :key="index" class="sharingTab__additionalContent"> - <component :is="section($refs['section-'+index], fileInfo)" :file-info="fileInfo" /> + <component :is="component" :file-info="fileInfo" /> </div> <!-- projects (deprecated as of NC25 (replaced by related_resources) - see instance config "projects.enabled" ; ignore this / remove it / move into own section) --> @@ -286,6 +285,10 @@ export default { // TRANSLATORS: Type as in with a keyboard : t('files_sharing', 'Type an email or federated cloud ID') }, + + sectionComponents() { + return this.sections.map((section) => section(undefined, this.fileInfo)) + }, }, methods: { /** |