Skip to content

Commit

Permalink
Merge pull request #5046 from owncloud/enhanche-trashbin-wording
Browse files Browse the repository at this point in the history
Enhancher Trashbin a11y
  • Loading branch information
Jan Ackermann authored Apr 30, 2021
2 parents 0eb948c + 0e66948 commit cb2c278
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/enhancement-trashbin-a11y
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Improve accessibility on trash bin

Add more context to the empty trash bin button text and only render it, if resources are present.

https://github.com/owncloud/web/pull/5046
13 changes: 10 additions & 3 deletions packages/web-app-files/src/components/BatchActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
<translate>Restore</translate>
</oc-button>
<oc-button
v-if="!isEmpty"
id="delete-selected-btn"
key="delete-btn"
@click="selectedFiles.length < 1 ? emptyTrashbin() : $_deleteResources_displayDialog()"
>
<oc-icon name="delete" />
{{ clearTrashbinButtonText }}
{{ emptyTrashbinButtonText }}
</oc-button>
</template>
<oc-grid v-if="displayBulkActions" gutter="small">
Expand Down Expand Up @@ -69,8 +70,10 @@ export default {
computed: {
...mapGetters('Files', ['selectedFiles', 'currentFolder', 'activeFiles']),
clearTrashbinButtonText() {
return this.selectedFiles.length < 1 ? this.$gettext('Empty') : this.$gettext('Delete')
emptyTrashbinButtonText() {
return this.selectedFiles.length < 1
? this.$gettext('Empty trash bin')
: this.$gettext('Delete')
},
canMove() {
Expand Down Expand Up @@ -111,6 +114,10 @@ export default {
displayBulkActions() {
return this.$route.meta.hasBulkActions && this.selectedFiles.length > 0
},
isEmpty() {
return this.activeFiles.length < 1
}
},
Expand Down

0 comments on commit cb2c278

Please sign in to comment.