Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-12-27 14:27:50 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-12-29 11:42:33 +0300
commit345d02ff77303a3409f09b6db2828fb09c9cfe6c (patch)
tree5a8fb5fab0029802ccb59cbd93000133843cdbe1 /apps/settings
parentca5bf437fff6d0ce7bc7066dbfce099946aa9411 (diff)
Fix rendering app authors with homepage or email
When the first author of an app doesn't have homepage/email attributes set in info.xml then any further author was rendered as `[object Object]` due to the complex XML node seralized to a JavaScript string. The logic was fixed so that it converts any of the authors to simple text. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/src/views/Apps.vue18
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/settings/src/views/Apps.vue b/apps/settings/src/views/Apps.vue
index 327faa4ac6a..12d270e5c3e 100644
--- a/apps/settings/src/views/Apps.vue
+++ b/apps/settings/src/views/Apps.vue
@@ -229,13 +229,19 @@ export default {
// sidebar app binding
appSidebar() {
+ const authorName = (xmlNode) => {
+ if (xmlNode['@value']) {
+ // Complex node (with email or homepage attribute)
+ return xmlNode['@value']
+ }
+
+ // Simple text node
+ return xmlNode
+ }
+
const author = Array.isArray(this.app.author)
- ? this.app.author[0]['@value']
- ? this.app.author.map(author => author['@value']).join(', ')
- : this.app.author.join(', ')
- : this.app.author['@value']
- ? this.app.author['@value']
- : this.app.author
+ ? this.app.author.map(authorName).join(', ')
+ : authorName(this.app.author)
const license = t('settings', '{license}-licensed', { license: ('' + this.app.licence).toUpperCase() })
const subtitle = t('settings', 'by {author}\n{license}', { author, license })