Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/files/src/components/FileEntry/FileEntryCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<td class="files-list__row-checkbox"
@keyup.esc.exact="resetSelection">
<NcLoadingIcon v-if="isLoading" :name="loadingLabel" />
<NcCheckboxRadioSwitch v-else
<NcCheckboxRadioSwitch v-else-if="!isEncrypted"
:aria-label="ariaLabel"
:checked="isSelected"
data-cy-files-list-row-checkbox
Expand Down Expand Up @@ -89,6 +89,9 @@ export default defineComponent({
isFile() {
return this.source.type === FileType.File
},
isEncrypted(): boolean {
return this.source?.attributes?.['is-encrypted'] === 1
},
ariaLabel() {
return this.isFile
? t('files', 'Toggle selection for file "{displayName}"', { displayName: this.source.basename })
Expand Down
17 changes: 13 additions & 4 deletions apps/files/src/components/FilesListTableHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,29 @@ export default defineComponent({
}
},

selectableNodes(): Node[] {
return this.nodes.filter((node: Node) => {
const enc = node?.attributes?.['is-encrypted']
return enc != 1
})
},

selectedNodes() {
return this.selectionStore.selected
},

isAllSelected() {
return this.selectedNodes.length === this.nodes.length
const total = this.selectableNodes.length
return total > 0 && this.selectedNodes.length === total
},

isNoneSelected() {
return this.selectedNodes.length === 0
},

isSomeSelected() {
return !this.isAllSelected && !this.isNoneSelected
const total = this.selectableNodes.length
return this.selectedNodes.length > 0 && this.selectedNodes.length < total
},
},

Expand Down Expand Up @@ -213,8 +222,8 @@ export default defineComponent({

onToggleAll(selected = true) {
if (selected) {
const selection = this.nodes.map(node => node.source).filter(Boolean) as FileSource[]
logger.debug('Added all nodes to selection', { selection })
const selection = this.selectableNodes.map(node => node.source).filter(Boolean) as FileSource[]
logger.debug('Added all selectable nodes to selection', { selection })
this.selectionStore.setLastIndex(null)
this.selectionStore.set(selection)
} else {
Expand Down
2 changes: 1 addition & 1 deletion apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<NcEmptyContent v-else
:name="currentView?.emptyTitle || t('files', 'No files in here')"
:description="currentView?.emptyCaption || t('files', 'Upload some content or sync with your devices!')"
data-cy-files-content-empty>
:data-cy-files-content-empty="currentView?.id">
<template v-if="directory !== '/'" #action>
<!-- Uploader -->
<UploadPicker v-if="canUpload && !isQuotaExceeded"
Expand Down
Loading