Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancher Trashbin a11y #5046

Merged
merged 1 commit into from
Apr 30, 2021
Merged
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: 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