-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move page size to view options
- Loading branch information
Showing
6 changed files
with
135 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Enhancement: add page size view option | ||
|
||
We've added a new item into the view options which can be used to set the number of items displayed per page. | ||
This value is persisted in the local storage so that the user doesn't have to update it every time he visits the app. | ||
|
||
https://github.com/owncloud/web/pull/5470 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
packages/web-app-files/src/components/AppBar/ViewOptions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<template> | ||
<div> | ||
<oc-button | ||
id="files-view-options-btn" | ||
key="files-view-options-btn" | ||
data-testid="files-view-options-btn" | ||
:aria-label="viewButtonAriaLabel" | ||
variation="passive" | ||
appearance="raw" | ||
size="small" | ||
gap-size="xsmall" | ||
> | ||
<oc-icon name="tune" size="small" /> | ||
<translate>View</translate> | ||
</oc-button> | ||
<oc-drop | ||
drop-id="files-view-options-drop" | ||
toggle="#files-view-options-btn" | ||
mode="click" | ||
class="uk-width-auto" | ||
> | ||
<oc-list> | ||
<li class="files-view-options-list-item"> | ||
<oc-switch | ||
v-model="hiddenFilesShownModel" | ||
data-testid="files-switch-hidden-files" | ||
:label="$gettext('Show hidden files')" | ||
/> | ||
</li> | ||
<li class="files-view-options-list-item"> | ||
<oc-page-size | ||
v-model="$_filesListPagination_pageItemsLimit" | ||
data-testid="files-pagination-size" | ||
:label="$gettext('Items per page')" | ||
:options="[100, 500, 1000, $gettext('All')]" | ||
class="files-pagination-size" | ||
/> | ||
</li> | ||
</oc-list> | ||
</oc-drop> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapMutations, mapState } from 'vuex' | ||
import MixinFilesListPagination from '../../mixins/filesListPagination' | ||
export default { | ||
mixins: [MixinFilesListPagination], | ||
computed: { | ||
...mapState('Files', ['areHiddenFilesShown']), | ||
viewButtonAriaLabel() { | ||
return this.$gettext('Display customization options of the files list') | ||
}, | ||
hiddenFilesShownModel: { | ||
get() { | ||
return this.areHiddenFilesShown | ||
}, | ||
set(value) { | ||
this.SET_HIDDEN_FILES_VISIBILITY(value) | ||
} | ||
} | ||
}, | ||
methods: { | ||
...mapMutations('Files', ['SET_HIDDEN_FILES_VISIBILITY']) | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.files-view-options-list-item { | ||
& > * { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
& + & { | ||
margin-top: var(--oc-space-small); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters