mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(files): fix extension with custom displayName
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
parent
8fa9607f0f
commit
77446325b2
7 changed files with 19 additions and 11 deletions
|
|
@ -85,7 +85,7 @@
|
|||
<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-" v-text="displayName" />
|
||||
<span class="files-list__row-name-ext" v-text="source.extension" />
|
||||
<span class="files-list__row-name-ext" v-text="extension" />
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
|
|
@ -157,6 +157,7 @@ import { debounce } from 'debounce'
|
|||
import { emit } from '@nextcloud/event-bus'
|
||||
import { formatFileSize, Permission } from '@nextcloud/files'
|
||||
import { Fragment } from 'vue-frag'
|
||||
import { extname } from 'path'
|
||||
import { showError, showSuccess } from '@nextcloud/dialogs'
|
||||
import { translate } from '@nextcloud/l10n'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
|
@ -290,8 +291,15 @@ export default Vue.extend({
|
|||
fileid() {
|
||||
return this.source?.fileid?.toString?.()
|
||||
},
|
||||
|
||||
extension() {
|
||||
if (this.source.attributes?.displayName) {
|
||||
return extname(this.source.attributes.displayName)
|
||||
}
|
||||
return this.source.extension || ''
|
||||
},
|
||||
displayName() {
|
||||
const ext = (this.source.extension || '')
|
||||
const ext = this.extension
|
||||
const name = (this.source.attributes.displayName
|
||||
|| this.source.basename)
|
||||
|
||||
|
|
|
|||
4
dist/1929-1929.js
vendored
4
dist/1929-1929.js
vendored
File diff suppressed because one or more lines are too long
2
dist/1929-1929.js.map
vendored
2
dist/1929-1929.js.map
vendored
File diff suppressed because one or more lines are too long
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
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue