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

Implemented: support to only allow user to select max 100 orders at once(#85zryr6gv) #118

Merged
merged 2 commits into from
Apr 26, 2023
Merged
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
6 changes: 4 additions & 2 deletions src/components/ViewSizeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ export default defineComponent({
},
methods: {
prepareViewSizeOptions () {
// Added check to only have 100 as the max option in size selector
const maxViewSize = this.total > 100 ? 100 : this.total
// creating an array of numbers using Array.keys method and then multiplying each by 5
return [ ...Array(Math.ceil(this.total / 5)).keys() ].map( i => {
return [ ...Array(Math.ceil(maxViewSize / 5)).keys() ].map( i => {
const count = (i+1) * 5
// added check that if the count is greater than the total orders available then assigning orders total as size option
return count > this.total ? this.total : count
return count > maxViewSize ? maxViewSize : count
})
},
async updateViewSize(size: number) {
Expand Down