Merge pull request #54413 from nextcloud/perf/render-sharing-tab-sections-only-once

perf: render sharing tab sections only once
This commit is contained in:
Simon L. 2025-08-13 22:59:32 +02:00 committed by GitHub
commit ec3be25955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 21 additions and 10 deletions

View file

@ -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

View file

@ -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: {
/**

2
dist/6348-6348.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/6348-6348.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/6348-6348.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
6348-6348.js.license

2
dist/7639-7639.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
7639-7639.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long