mirror of
https://github.com/nextcloud/server.git
synced 2026-04-28 09:37:29 -04:00
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>
This commit is contained in:
parent
789f027e2a
commit
ea37d1a2ee
4 changed files with 20 additions and 6 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue