forked from twentyhq/twenty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: persist resized column widths (twentyhq#1017)
* feat: persist resized column widths Closes twentyhq#981 * test: mock company and person view fields
- Loading branch information
1 parent
b08bd6e
commit 3aef22b
Showing
18 changed files
with
342 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 21 additions & 2 deletions
23
front/src/modules/companies/table/components/CompanyTableMockData.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
import { companyViewFields } from '@/companies/constants/companyViewFields'; | ||
import { useEffect } from 'react'; | ||
import { useSetRecoilState } from 'recoil'; | ||
|
||
import { useSetEntityTableData } from '@/ui/table/hooks/useSetEntityTableData'; | ||
import { entityTableDimensionsState } from '@/ui/table/states/entityTableDimensionsState'; | ||
import { viewFieldsFamilyState } from '@/ui/table/states/viewFieldsState'; | ||
|
||
import { companyViewFields } from '../../constants/companyViewFields'; | ||
|
||
import { mockedCompaniesData } from './companies-mock-data'; | ||
|
||
export function CompanyTableMockData() { | ||
const setEntityTableDimensions = useSetRecoilState( | ||
entityTableDimensionsState, | ||
); | ||
const setViewFields = useSetRecoilState(viewFieldsFamilyState); | ||
const setEntityTableData = useSetEntityTableData(); | ||
|
||
setEntityTableData(mockedCompaniesData, companyViewFields, []); | ||
setEntityTableData(mockedCompaniesData, []); | ||
|
||
useEffect(() => { | ||
setViewFields(companyViewFields); | ||
setEntityTableDimensions((prevState) => ({ | ||
...prevState, | ||
numberOfColumns: companyViewFields.length, | ||
})); | ||
}, [setEntityTableDimensions, setViewFields]); | ||
|
||
return <></>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
front/src/modules/ui/table/components/GenericEntityTableData.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.