Refator/sorts dropdown (#1568)
* WIP * Fixed lint * Ok for sorts * Fixed on dropdown toggle * Fix lint
This commit is contained in:
@ -5,10 +5,9 @@ import {
|
||||
IconMap,
|
||||
IconUsers,
|
||||
} from '@/ui/icon/index';
|
||||
import { SortType } from '@/ui/view-bar/types/interface';
|
||||
import { CompanyOrderByWithRelationInput as Companies_Order_By } from '~/generated/graphql';
|
||||
import { SortDefinition } from '@/ui/view-bar/types/SortDefinition';
|
||||
|
||||
export const availableSorts: SortType<Companies_Order_By>[] = [
|
||||
export const companyAvailableSorts: SortDefinition[] = [
|
||||
{
|
||||
key: 'name',
|
||||
label: 'Name',
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { IconCalendarEvent, IconCurrencyDollar } from '@/ui/icon/index';
|
||||
import { SortType } from '@/ui/view-bar/types/interface';
|
||||
import { PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By } from '~/generated/graphql';
|
||||
import { SortDefinition } from '@/ui/view-bar/types/SortDefinition';
|
||||
|
||||
export const opportunitiesSorts = [
|
||||
export const opportunitiesSorts: SortDefinition[] = [
|
||||
{
|
||||
key: 'createdAt',
|
||||
label: 'Creation',
|
||||
@ -18,4 +17,4 @@ export const opportunitiesSorts = [
|
||||
label: 'Expected close date',
|
||||
Icon: IconCalendarEvent,
|
||||
},
|
||||
] satisfies Array<SortType<PipelineProgresses_Order_By>>;
|
||||
];
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -68,7 +68,9 @@ export function Tasks() {
|
||||
<FilterDropdownButton
|
||||
key="tasks-filter-dropdown-button"
|
||||
context={TasksRecoilScopeContext}
|
||||
hotkeyScope={RelationPickerHotkeyScope.RelationPicker}
|
||||
hotkeyScope={{
|
||||
scope: RelationPickerHotkeyScope.RelationPicker,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user