aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-06-22 19:09:16 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2023-07-12 12:05:42 +0000
commitea37d1a2eea1d9f4247c2b57ed6ca8457cba4dc8 (patch)
treea2822214c6f09fbbc57c32c441aa0fa9c97f9f56 /apps
parent789f027e2a62b38911f4ef7c5c7f113a59e4f223 (diff)
downloadnextcloud-server-ea37d1a2eea1d9f4247c2b57ed6ca8457cba4dc8.tar.gz
nextcloud-server-ea37d1a2eea1d9f4247c2b57ed6ca8457cba4dc8.zip
fix(files): sanitize name and ext display
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/components/FileEntry.vue14
-rw-r--r--apps/files/src/components/FilesListVirtual.vue6
2 files changed, 17 insertions, 3 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index fd61f5e3623..db32f2fab35 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -59,7 +59,11 @@
</span>
<!-- File name -->
- <span class="files-list__row-name-text">{{ displayName }}</span>
+ <span class="files-list__row-name-text">
+ <!-- Keep the displayName stuck to the extension to avoid whitespace rendering issues-->
+ <span class="files-list__row-name-name" v-text="displayName" />
+ <span class="files-list__row-name-ext" v-text="source.extension" />
+ </span>
</a>
</td>
@@ -237,8 +241,12 @@ export default Vue.extend({
return this.source?.fileid?.toString?.()
},
displayName() {
- return this.source.attributes.displayName
- || this.source.basename
+ const ext = (this.source.extension || '')
+ const name = (this.source.attributes.displayName
+ || this.source.basename)
+
+ // Strip extension from name if defined
+ return !ext ? name : name.slice(0, 0 - ext.length)
},
size() {
diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue
index 866fc6da00d..a982cbc09f9 100644
--- a/apps/files/src/components/FilesListVirtual.vue
+++ b/apps/files/src/components/FilesListVirtual.vue
@@ -299,6 +299,12 @@ export default Vue.extend({
// Make some space for the outline
padding: 5px 10px;
margin-left: -10px;
+ // Align two name and ext
+ display: inline-flex;
+ }
+
+ .files-list__row-name-ext {
+ color: var(--color-text-maxcontrast);
}
}