-
Notifications
You must be signed in to change notification settings - Fork 653
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
feat(PWA): Add sorting to List View #1767
base: develop
Are you sure you want to change the base?
Conversation
d14a711
to
3fee017
Compare
fafcef3
to
6372ab3
Compare
<script> | ||
export default { | ||
name: 'PhSortAscending' | ||
} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert these icon components to composition API. You don't need "export default" then. Check other Icon files in this same folder for consistency. Also, rename the Icon to "SortAscendingIcon.vue"? To be uniform with other icon names
@@ -0,0 +1,13 @@ | |||
<template> | |||
<svg xmlns="http://www.w3.org/2000/svg" width="1.2em" height="1.2em" viewBox="0 0 256 256"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-format all code using prettier
run npx prettier . --write
in your frontend folder
We will soon add it to pre-commit
@@ -0,0 +1,51 @@ | |||
<template> | |||
<!-- Filter Action Sheet --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This newly added component is needed anymore, remove it?
frontend/src/components/ListView.vue
Outdated
@@ -184,10 +160,18 @@ const listOptions = ref({ | |||
doctype: props.doctype, | |||
fields: props.fields, | |||
group_by: props.groupBy, | |||
order_by: `\`tab${props.doctype}\`.modified desc`, | |||
order_by: `\`tab${props.doctype}\`.modified asc`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it desc only? We would want to see the latest document on top
@@ -345,7 +360,6 @@ onMounted(async () => { | |||
await workflow.workflowDoc.promise | |||
workflowStateField.value = workflow.getWorkflowStateField() | |||
fetchDocumentList() | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new line was for logical separation. Retain it
frontend/src/components/ListView.vue
Outdated
@@ -293,6 +307,7 @@ function clearFilters() { | |||
areFiltersApplied.value = false | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend/src/components/ListView.vue
Outdated
@@ -213,6 +197,10 @@ const defaultFilters = computed(() => { | |||
return filters | |||
}) | |||
|
|||
const toggleSortOrder = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be used anywhere?
…alities to ListView
…ion functionality, toggle button
… field in Dropdown
…e labels in Select component
70ffc5b
to
32c1183
Compare
c0d6ef6
to
947aa94
Compare
Added a dropdown button for sorting the fields in the List View of the mobile app. Dropdown expands to reveal the field buttons which when selected sort the list by that field and adds a check icon besides it. The button's inner text indicates the sort order which can be toggled on reselecting the selected field.