Update FE case to match BE graphql case (camelCase) (#154)

This commit is contained in:
Charles Bochet
2023-05-29 19:45:55 +02:00
committed by GitHub
parent de9cf61689
commit 2f50cdc07e
27 changed files with 200 additions and 204 deletions

View File

@ -61,7 +61,7 @@ function Companies() {
employees: null,
address: '',
pipes: [],
creationDate: new Date(),
createdAt: new Date(),
accountOwner: null,
__typename: 'companies',
};

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Companies Filter should render the filter company_employees 1`] = `
exports[`Companies Filter should render the filter employees 1`] = `
Object {
"employees": Object {
"gte": 2,
@ -8,7 +8,7 @@ Object {
}
`;
exports[`Companies Filter should render the filter company_name 1`] = `
exports[`Companies Filter should render the filter name 1`] = `
Object {
"name": Object {
"contains": "%name%",

View File

@ -126,16 +126,16 @@ export const useCompaniesColumns = () => {
),
size: 170,
}),
columnHelper.accessor('creationDate', {
columnHelper.accessor('createdAt', {
header: () => (
<ColumnHead viewName="Creation" viewIcon={<TbCalendar size={16} />} />
),
cell: (props) => (
<EditableDate
value={props.row.original.creationDate || new Date()}
value={props.row.original.createdAt || new Date()}
changeHandler={(value: Date) => {
const company = props.row.original;
company.creationDate = value;
company.createdAt = value;
updateCompany(company);
}}
/>

View File

@ -13,7 +13,7 @@ import { User, mapToUser } from '../../interfaces/entities/user.interface';
import { QueryMode } from '../../generated/graphql';
export const nameFilter = {
key: 'company_name',
key: 'name',
label: 'Company',
icon: <TbBuilding size={16} />,
type: 'text',
@ -43,7 +43,7 @@ export const nameFilter = {
} satisfies FilterConfigType<Company, string>;
export const employeesFilter = {
key: 'company_employees',
key: 'employees',
label: 'Employees',
icon: <TbSum size={16} />,
type: 'text',
@ -70,7 +70,7 @@ export const employeesFilter = {
} satisfies FilterConfigType<Company, string>;
export const urlFilter = {
key: 'company_domain_name',
key: 'domainName',
label: 'Url',
icon: <TbLink size={16} />,
type: 'text',
@ -103,7 +103,7 @@ export const urlFilter = {
} satisfies FilterConfigType<Company, string>;
export const addressFilter = {
key: 'company_address',
key: 'address',
label: 'Address',
icon: <TbMapPin size={16} />,
type: 'text',
@ -132,8 +132,8 @@ export const addressFilter = {
],
} satisfies FilterConfigType<Company, string>;
export const creationDateFilter = {
key: 'company_created_at',
export const ccreatedAtFilter = {
key: 'createdAt',
label: 'Created At',
icon: <TbCalendar size={16} />,
type: 'date',
@ -160,7 +160,7 @@ export const creationDateFilter = {
} satisfies FilterConfigType<Company, string>;
export const accountOwnerFilter = {
key: 'account_owner_name',
key: 'accountOwner',
label: 'Account Owner',
icon: <TbUser size={16} />,
type: 'relation',
@ -207,6 +207,6 @@ export const availableFilters = [
employeesFilter,
urlFilter,
addressFilter,
creationDateFilter,
ccreatedAtFilter,
accountOwnerFilter,
];

View File

@ -64,7 +64,7 @@ function People() {
phone: '',
company: null,
pipes: [],
creationDate: new Date(),
createdAt: new Date(),
city: '',
};

View File

@ -103,16 +103,16 @@ export const usePeopleColumns = () => {
),
size: 130,
}),
columnHelper.accessor('creationDate', {
columnHelper.accessor('createdAt', {
header: () => (
<ColumnHead viewName="Creation" viewIcon={<TbCalendar size={16} />} />
),
cell: (props) => (
<EditableDate
value={props.row.original.creationDate || new Date()}
value={props.row.original.createdAt || new Date()}
changeHandler={(value: Date) => {
const person = props.row.original;
person.creationDate = value;
person.createdAt = value;
updatePerson(person);
}}
/>

View File

@ -162,8 +162,8 @@ export const phoneFilter = {
],
} satisfies FilterConfigType<Person, string>;
export const creationDateFilter = {
key: 'person_created_at',
export const createdAtFilter = {
key: 'createdAt',
label: 'Created At',
icon: <TbCalendar size={16} />,
type: 'date',
@ -224,6 +224,6 @@ export const availableFilters = [
emailFilter,
companyFilter,
phoneFilter,
creationDateFilter,
createdAtFilter,
cityFilter,
] satisfies FilterConfigType<Person>[];