Complete Fix view work (#2272)

* Fix views

* Make view sorts and view filters functional

* Complete Company table view fix

* Fix model creation

* Start fixing board

* Complete work
This commit is contained in:
Charles Bochet
2023-10-29 16:29:00 +01:00
committed by GitHub
parent 685d342170
commit 9bab28912d
118 changed files with 1806 additions and 1413 deletions

View File

@ -0,0 +1,59 @@
import { FilterDropdownCompanySearchSelect } from '@/companies/components/FilterDropdownCompanySearchSelect';
import { FilterDefinitionByEntity } from '@/ui/data/filter/types/FilterDefinitionByEntity';
import {
IconBuildingSkyscraper,
IconCalendarEvent,
IconMail,
IconMap,
IconPhone,
IconUser,
} from '@/ui/display/icon/index';
import { Person } from '~/generated/graphql';
export const personTableFilterDefinitions: FilterDefinitionByEntity<Person>[] =
[
{
fieldId: 'firstName',
label: 'First name',
Icon: IconUser,
type: 'text',
},
{
fieldId: 'lastName',
label: 'Last name',
Icon: IconUser,
type: 'text',
},
{
fieldId: 'email',
label: 'Email',
Icon: IconMail,
type: 'text',
},
{
fieldId: 'companyId',
label: 'Company',
Icon: IconBuildingSkyscraper,
type: 'entity',
// TODO: replace this with a component that selects the dropdown to use based on the entity type
entitySelectComponent: <FilterDropdownCompanySearchSelect />,
},
{
fieldId: 'phone',
label: 'Phone',
Icon: IconPhone,
type: 'text',
},
{
fieldId: 'createdAt',
label: 'Created at',
Icon: IconCalendarEvent,
type: 'date',
},
{
fieldId: 'city',
label: 'City',
Icon: IconMap,
type: 'text',
},
];

View File

@ -0,0 +1,51 @@
import { SortDefinition } from '@/ui/data/sort/types/SortDefinition';
import { SortDirection } from '@/ui/data/sort/types/SortDirection';
import {
IconBuildingSkyscraper,
IconCalendarEvent,
IconMail,
IconMap,
IconPhone,
IconUser,
} from '@/ui/display/icon/index';
export const personTableSortDefinitions: SortDefinition[] = [
{
fieldId: 'fullname',
label: 'People',
Icon: IconUser,
getOrderByTemplate: (direction: SortDirection) => [
{ firstName: direction },
{ lastName: direction },
],
},
{
fieldId: 'company_name',
label: 'Company',
Icon: IconBuildingSkyscraper,
getOrderByTemplate: (direction: SortDirection) => [
{ company: { name: direction } },
],
},
{
fieldId: 'email',
label: 'Email',
Icon: IconMail,
},
{
fieldId: 'phone',
label: 'Phone',
Icon: IconPhone,
},
{
fieldId: 'createdAt',
label: 'Created at',
Icon: IconCalendarEvent,
},
{
fieldId: 'city',
label: 'City',
Icon: IconMap,
},
];