Skip to content

Commit c67ff10

Browse files
authored
Merge pull request #42983 from nextcloud/backport/42949/stable28
2 parents 0c89b04 + f64af7c commit c67ff10

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
lines changed

apps/files/src/components/FileEntry.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
<span v-if="source.attributes.failed" class="files-list__row--failed" />
3333

3434
<!-- Checkbox -->
35-
<FileEntryCheckbox :display-name="displayName"
36-
:fileid="fileid"
35+
<FileEntryCheckbox :fileid="fileid"
3736
:is-loading="isLoading"
38-
:nodes="nodes" />
37+
:nodes="nodes"
38+
:source="source" />
3939

4040
<!-- Link to file -->
4141
<td class="files-list__row-name" data-cy-files-list-row-name>

apps/files/src/components/FileEntry/FileEntryCheckbox.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
@keyup.esc.exact="resetSelection">
2525
<NcLoadingIcon v-if="isLoading" />
2626
<NcCheckboxRadioSwitch v-else
27-
:aria-label="t('files', 'Select the row for {displayName}', { displayName })"
27+
:aria-label="ariaLabel"
2828
:checked="isSelected"
2929
@update:checked="onSelectionChange" />
3030
</td>
3131
</template>
3232

3333
<script lang="ts">
34-
import { Node } from '@nextcloud/files'
34+
import { Node, FileType } from '@nextcloud/files'
3535
import { translate as t } from '@nextcloud/l10n'
3636
import Vue, { PropType } from 'vue'
3737
@@ -51,10 +51,6 @@ export default Vue.extend({
5151
},
5252
5353
props: {
54-
displayName: {
55-
type: String,
56-
required: true,
57-
},
5854
fileid: {
5955
type: String,
6056
required: true,
@@ -67,6 +63,10 @@ export default Vue.extend({
6763
type: Array as PropType<Node[]>,
6864
required: true,
6965
},
66+
source: {
67+
type: Object as PropType<Node>,
68+
required: true,
69+
},
7070
},
7171
7272
setup() {
@@ -88,6 +88,14 @@ export default Vue.extend({
8888
index() {
8989
return this.nodes.findIndex((node: Node) => node.fileid === parseInt(this.fileid))
9090
},
91+
isFile() {
92+
return this.source.type === FileType.File
93+
},
94+
ariaLabel() {
95+
return this.isFile
96+
? t('files', 'Toggle selection for file "{displayName}"', { displayName: this.source.basename })
97+
: t('files', 'Toggle selection for folder "{displayName}"', { displayName: this.source.basename })
98+
},
9199
},
92100
93101
methods: {

apps/files/src/components/FileEntryGrid.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
<span v-if="source.attributes.failed" class="files-list__row--failed" />
3838

3939
<!-- Checkbox -->
40-
<FileEntryCheckbox :display-name="displayName"
41-
:fileid="fileid"
40+
<FileEntryCheckbox :fileid="fileid"
4241
:is-loading="isLoading"
43-
:nodes="nodes" />
42+
:nodes="nodes"
43+
:source="source" />
4444

4545
<!-- Link to file -->
4646
<td class="files-list__row-name" data-cy-files-list-row-name>

apps/files/src/components/FilesListTableHeader.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</template>
7272

7373
<script lang="ts">
74-
import { translate } from '@nextcloud/l10n'
74+
import { translate as t } from '@nextcloud/l10n'
7575
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
7676
import Vue from 'vue'
7777
@@ -142,9 +142,7 @@ export default Vue.extend({
142142
},
143143
144144
selectAllBind() {
145-
const label = this.isNoneSelected || this.isSomeSelected
146-
? this.t('files', 'Select all')
147-
: this.t('files', 'Unselect all')
145+
const label = t('files', 'Toggle selection for all files and folders')
148146
return {
149147
'aria-label': label,
150148
checked: this.isAllSelected,
@@ -203,7 +201,7 @@ export default Vue.extend({
203201
this.selectionStore.reset()
204202
},
205203
206-
t: translate,
204+
t,
207205
},
208206
})
209207
</script>

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)