Refactor onboarding user vars to be absent when user is fully onboarded (#6531)
In this PR: - take feedbacks from: https://github.com/twentyhq/twenty/pull/6530 / https://github.com/twentyhq/twenty/pull/6529 / https://github.com/twentyhq/twenty/pull/6526 / https://github.com/twentyhq/twenty/pull/6512 - refactor onboarding uservars to be absent when the user is fully onboarded: isStepComplete ==> isStepIncomplete - introduce a new workspace.activationStatus: CREATION_ONGOING I'm retesting the whole flow: - with/without BILLING - sign in with/without SSO - sign up with/without SSO - another workspaceMembers join the team - subscriptionCanceled - access to billingPortal
This commit is contained in:
@ -2,7 +2,6 @@ import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { RecordGqlOperationFilter } from '@/object-record/graphql/types/RecordGqlOperationFilter';
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { PREFETCH_CONFIG } from '@/prefetch/constants/PrefetchConfig';
|
||||
@ -17,21 +16,18 @@ export const usePrefetchedData = <T extends ObjectRecord>(
|
||||
prefetchIsLoadedFamilyState(prefetchKey),
|
||||
);
|
||||
|
||||
const prefetchQueryKey = PREFETCH_CONFIG[prefetchKey];
|
||||
const { operationSignatureFactory, objectNameSingular } =
|
||||
PREFETCH_CONFIG[prefetchKey];
|
||||
|
||||
const { objectMetadataItem } = useObjectMetadataItem({
|
||||
objectNameSingular: prefetchQueryKey.objectNameSingular,
|
||||
objectNameSingular,
|
||||
});
|
||||
|
||||
const { records } = useFindManyRecords<T>({
|
||||
skip: !isDataPrefetched,
|
||||
objectNameSingular: prefetchQueryKey.objectNameSingular,
|
||||
objectNameSingular: objectNameSingular,
|
||||
recordGqlFields:
|
||||
prefetchQueryKey.fields ??
|
||||
generateDepthOneRecordGqlFields({
|
||||
objectMetadataItem,
|
||||
}),
|
||||
filter,
|
||||
operationSignatureFactory({ objectMetadataItem }).fields ?? filter,
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user