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

feat(PWA): Add sorting to List View #1767

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

vinyselopal
Copy link
Contributor

@vinyselopal vinyselopal commented May 13, 2024

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.
list_view_sort2

@vinyselopal vinyselopal force-pushed the list_view_sort branch 4 times, most recently from d14a711 to 3fee017 Compare May 16, 2024 06:49
@vinyselopal vinyselopal changed the title List view sort Add sorting to the PWA List View May 16, 2024
@ruchamahabal ruchamahabal changed the title Add sorting to the PWA List View feat(PWA): Add sorting to List View May 16, 2024
@vinyselopal vinyselopal force-pushed the list_view_sort branch 2 times, most recently from fafcef3 to 6372ab3 Compare May 16, 2024 12:25
Comment on lines 6 to 10
<script>
export default {
name: 'PhSortAscending'
}
</script>
Copy link
Member

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">
Copy link
Member

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 -->
Copy link
Member

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?

@@ -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`,
Copy link
Member

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()

Copy link
Member

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

@@ -293,6 +307,7 @@ function clearFilters() {
areFiltersApplied.value = false
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -213,6 +197,10 @@ const defaultFilters = computed(() => {
return filters
})

const toggleSortOrder = () => {
Copy link
Member

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?

@vinyselopal vinyselopal marked this pull request as ready for review June 4, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants