-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes: #4428 Testing for fetchMoreRecords is pending, along with component tests --------- Co-authored-by: Lucas Bordeau <[email protected]>
- Loading branch information
1 parent
a8dfff3
commit 4a67cfa
Showing
66 changed files
with
1,056 additions
and
365 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { overlayScrollbarsState } from '@/ui/utilities/scroll/states/overlayScrollbarsState'; | ||
import { useRecoilCallback } from 'recoil'; | ||
|
||
export const useScrollToPosition = () => { | ||
const scrollToPosition = useRecoilCallback( | ||
({ snapshot }) => | ||
(scrollPositionInPx: number) => { | ||
const overlayScrollbars = snapshot | ||
.getLoadable(overlayScrollbarsState) | ||
.getValue(); | ||
|
||
const scrollWrapper = overlayScrollbars?.elements().viewport; | ||
|
||
scrollWrapper?.scrollTo({ top: scrollPositionInPx }); | ||
}, | ||
[], | ||
); | ||
|
||
return { scrollToPosition }; | ||
}; |
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
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
30 changes: 30 additions & 0 deletions
30
...twenty-front/src/modules/object-metadata/components/PreComputedChipGeneratorsProvider.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { useMemo } from 'react'; | ||
import { useRecoilValue } from 'recoil'; | ||
|
||
import { PreComputedChipGeneratorsContext } from '@/object-metadata/context/PreComputedChipGeneratorsContext'; | ||
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState'; | ||
import { getRecordChipGenerators } from '@/object-record/utils/getRecordChipGenerators'; | ||
|
||
export const PreComputedChipGeneratorsProvider = ({ | ||
children, | ||
}: React.PropsWithChildren) => { | ||
const objectMetadataItems = useRecoilValue(objectMetadataItemsState); | ||
|
||
const { chipGeneratorPerObjectPerField, identifierChipGeneratorPerObject } = | ||
useMemo(() => { | ||
return getRecordChipGenerators(objectMetadataItems); | ||
}, [objectMetadataItems]); | ||
|
||
return ( | ||
<> | ||
<PreComputedChipGeneratorsContext.Provider | ||
value={{ | ||
chipGeneratorPerObjectPerField, | ||
identifierChipGeneratorPerObject, | ||
}} | ||
> | ||
{children} | ||
</PreComputedChipGeneratorsContext.Provider> | ||
</> | ||
); | ||
}; |
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
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
6 changes: 6 additions & 0 deletions
6
packages/twenty-front/src/modules/object-record/graphql/types/RecordGqlOperationVariables.ts
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,8 +1,14 @@ | ||
import { RecordGqlOperationFilter } from '@/object-record/graphql/types/RecordGqlOperationFilter'; | ||
import { RecordGqlOperationOrderBy } from '@/object-record/graphql/types/RecordGqlOperationOrderBy'; | ||
import { QueryCursorDirection } from '@/object-record/utils/generateFindManyRecordsQuery'; | ||
|
||
export type RecordGqlOperationVariables = { | ||
filter?: RecordGqlOperationFilter; | ||
orderBy?: RecordGqlOperationOrderBy; | ||
limit?: number; | ||
cursorFilter?: { | ||
cursor: string; | ||
cursorDirection: QueryCursorDirection; | ||
limit: number; | ||
}; | ||
}; |
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
Oops, something went wrong.