Feat/error boundaries (#2779)
* - Changed to objectNameSingular always defined - Added ErrorCatchAll * - Added mock mode for companies logged out - Added a proper ErrorBoundary component * Removed react-error-boundary * Implemented proper ErrorBoundary * Fixes * Change strategy about mocks --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -61,7 +61,7 @@ export const HooksCompanyBoardEffect = ({
|
||||
const currentViewSorts = useRecoilValue(currentViewSortsState);
|
||||
|
||||
const { objectMetadataItem } = useObjectMetadataItem({
|
||||
objectNamePlural: 'opportunities',
|
||||
objectNameSingular: 'opportunity',
|
||||
});
|
||||
|
||||
const { columnDefinitions, filterDefinitions, sortDefinitions } =
|
||||
@ -85,7 +85,7 @@ export const HooksCompanyBoardEffect = ({
|
||||
);
|
||||
|
||||
useFindManyRecords({
|
||||
objectNamePlural: 'pipelineSteps',
|
||||
objectNameSingular: 'pipelineStep',
|
||||
filter: {},
|
||||
onCompleted: useCallback(
|
||||
(data: PaginatedRecordTypeResults<PipelineStep>) => {
|
||||
@ -107,7 +107,7 @@ export const HooksCompanyBoardEffect = ({
|
||||
|
||||
const { fetchMoreRecords: fetchMoreOpportunities } = useFindManyRecords({
|
||||
skip: !pipelineSteps.length,
|
||||
objectNamePlural: 'opportunities',
|
||||
objectNameSingular: 'opportunity',
|
||||
filter: filter,
|
||||
orderBy: orderBy,
|
||||
onCompleted: useCallback(
|
||||
@ -132,7 +132,7 @@ export const HooksCompanyBoardEffect = ({
|
||||
|
||||
const { fetchMoreRecords: fetchMoreCompanies } = useFindManyRecords({
|
||||
skip: !opportunities.length,
|
||||
objectNamePlural: 'companies',
|
||||
objectNameSingular: 'company',
|
||||
filter: {
|
||||
id: {
|
||||
in: opportunities.map((opportunity) => opportunity.companyId || ''),
|
||||
|
||||
@ -78,7 +78,7 @@ export const NewOpportunityButton = () => {
|
||||
orderByField: 'createdAt',
|
||||
selectedIds: [],
|
||||
mappingFunction: (record: any) => identifiersMapper?.(record, 'company'),
|
||||
objectNamePlural: 'companies',
|
||||
objectNameSingular: 'company',
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@ -54,7 +54,7 @@ export const OpportunityPicker = ({
|
||||
orderByField: 'createdAt',
|
||||
selectedIds: [],
|
||||
mappingFunction: (record: any) => identifiersMapper?.(record, 'company'),
|
||||
objectNamePlural: 'companies',
|
||||
objectNameSingular: 'company',
|
||||
});
|
||||
|
||||
const [isProgressSelectionUnfolded, setIsProgressSelectionUnfolded] =
|
||||
|
||||
Reference in New Issue
Block a user