6431 create new field activationStatus inside workspace table (#6439)

Closes #6431 
- create new field `activationStatus`
- create migration commands
- add logic to update `activationStatus` on workspace activation and on
stripe subscriptionStatus change

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
bosiraphael
2024-07-30 12:36:39 +02:00
committed by GitHub
parent 8e35edad30
commit cd4263f7fd
16 changed files with 242 additions and 30 deletions

View File

@ -6,6 +6,7 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useFindManyObjectMetadataItems } from '@/object-metadata/hooks/useFindManyObjectMetadataItems';
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
import { getObjectMetadataItemsMock } from '@/object-metadata/utils/getObjectMetadataItemsMock';
import { WorkspaceActivationStatus } from '~/generated/graphql';
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
@ -25,7 +26,7 @@ export const ObjectMetadataItemsLoadEffect = () => {
useEffect(() => {
const toSetObjectMetadataItems =
isUndefinedOrNull(currentUser) ||
currentWorkspace?.activationStatus !== 'active'
currentWorkspace?.activationStatus !== WorkspaceActivationStatus.Active
? getObjectMetadataItemsMock()
: newObjectMetadataItems;
if (