Refator/sorts dropdown (#1568)

* WIP

* Fixed lint

* Ok for sorts

* Fixed on dropdown toggle

* Fix lint
This commit is contained in:
Lucas Bordeau
2023-09-14 01:38:11 +02:00
committed by GitHub
parent a392a81994
commit 8627416d60
55 changed files with 339 additions and 309 deletions

View File

@ -6,28 +6,27 @@ import {
IconPhone,
IconUser,
} from '@/ui/icon/index';
import { SortType } from '@/ui/view-bar/types/interface';
import {
PersonOrderByWithRelationInput as People_Order_By,
SortOrder as Order_By,
} from '~/generated/graphql';
import { SortDefinition } from '@/ui/view-bar/types/SortDefinition';
import { SortDirection } from '@/ui/view-bar/types/SortDirection';
export const availableSorts: SortType<People_Order_By>[] = [
export const peopleAvailableSorts: SortDefinition[] = [
{
key: 'fullname',
label: 'People',
Icon: IconUser,
orderByTemplate: (order: Order_By) => [
{ firstName: order },
{ lastName: order },
getOrderByTemplate: (direction: SortDirection) => [
{ firstName: direction },
{ lastName: direction },
],
},
{
key: 'company_name',
label: 'Company',
Icon: IconBuildingSkyscraper,
orderByTemplate: (order: Order_By) => [{ company: { name: order } }],
getOrderByTemplate: (direction: SortDirection) => [
{ company: { name: direction } },
],
},
{
key: 'email',