Feat: Add Null values at the last while sorting (#3292)

* Add Null values at the last while sorting
* Add contacts at last with special character in it
* Optimize SQL order and direction
This commit is contained in:
Tejaswini Chile
2021-11-10 14:11:00 +05:30
committed by GitHub
parent 6cfd7d3836
commit 358171062e
4 changed files with 120 additions and 11 deletions

View File

@@ -114,7 +114,7 @@ export default {
title: this.$t('CONTACTS_PAGE.LIST.TABLE_HEADER.NAME'),
fixed: 'left',
align: 'left',
sortBy: this.sortConfig.name || '',
sortBy: this.sortConfig.name || undefined,
width: 300,
renderBodyCell: ({ row }) => (
<woot-button
@@ -150,7 +150,7 @@ export default {
key: 'email',
title: this.$t('CONTACTS_PAGE.LIST.TABLE_HEADER.EMAIL_ADDRESS'),
align: 'left',
sortBy: this.sortConfig.email || '',
sortBy: this.sortConfig.email || undefined,
width: 240,
renderBodyCell: ({ row }) => {
if (row.email)
@@ -171,19 +171,21 @@ export default {
{
field: 'phone_number',
key: 'phone_number',
sortBy: this.sortConfig.phone_number || '',
sortBy: this.sortConfig.phone_number || undefined,
title: this.$t('CONTACTS_PAGE.LIST.TABLE_HEADER.PHONE_NUMBER'),
align: 'left',
},
{
field: 'company',
key: 'company',
sortBy: this.sortConfig.company_name || undefined,
title: this.$t('CONTACTS_PAGE.LIST.TABLE_HEADER.COMPANY'),
align: 'left',
},
{
field: 'city',
key: 'city',
sortBy: this.sortConfig.city || undefined,
title: this.$t('CONTACTS_PAGE.LIST.TABLE_HEADER.CITY'),
align: 'left',
},
@@ -192,6 +194,7 @@ export default {
key: 'country',
title: this.$t('CONTACTS_PAGE.LIST.TABLE_HEADER.COUNTRY'),
align: 'left',
sortBy: this.sortConfig.country || undefined,
renderBodyCell: ({ row }) => {
if (row.country) {
return (