feat: persist resized column widths (#1017)
* feat: persist resized column widths Closes #981 * test: mock company and person view fields
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Company, User } from '../../generated/graphql';
|
||||
import { companyViewFields } from '@/companies/constants/companyViewFields';
|
||||
import { Company, User, ViewField } from '~/generated/graphql';
|
||||
|
||||
type MockedCompany = Pick<
|
||||
Company,
|
||||
@ -118,3 +119,15 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
__typename: 'Company',
|
||||
},
|
||||
];
|
||||
|
||||
export const mockedCompanyViewFields = companyViewFields.map<ViewField>(
|
||||
(viewFieldDefinition) => ({
|
||||
__typename: 'ViewField',
|
||||
fieldName: viewFieldDefinition.columnLabel,
|
||||
id: viewFieldDefinition.id,
|
||||
index: viewFieldDefinition.columnOrder,
|
||||
isVisible: true,
|
||||
objectName: 'company',
|
||||
sizeInPx: viewFieldDefinition.columnSize,
|
||||
}),
|
||||
);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { Company, Person } from '~/generated/graphql';
|
||||
import { peopleViewFields } from '@/people/constants/peopleViewFields';
|
||||
import { Company, Person, ViewField } from '~/generated/graphql';
|
||||
|
||||
type RequiredAndNotNull<T> = {
|
||||
[P in keyof T]-?: Exclude<T[P], null | undefined>;
|
||||
@ -116,3 +117,15 @@ export const mockedPeopleData: MockedPerson[] = [
|
||||
city: 'Paris',
|
||||
},
|
||||
];
|
||||
|
||||
export const mockedPersonViewFields = peopleViewFields.map<ViewField>(
|
||||
(viewFieldDefinition) => ({
|
||||
__typename: 'ViewField',
|
||||
fieldName: viewFieldDefinition.columnLabel,
|
||||
id: viewFieldDefinition.id,
|
||||
index: viewFieldDefinition.columnOrder,
|
||||
isVisible: true,
|
||||
objectName: 'person',
|
||||
sizeInPx: viewFieldDefinition.columnSize,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user