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:
@ -7,6 +7,7 @@ import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadat
|
||||
import { getObjectMetadataItemsMock } from '@/object-metadata/utils/getObjectMetadataItemsMock';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
import { WorkspaceActivationStatus } from '~/generated/graphql';
|
||||
import { ObjectMetadataItemIdentifier } from '../types/ObjectMetadataItemIdentifier';
|
||||
|
||||
export const useObjectMetadataItem = ({
|
||||
@ -26,7 +27,7 @@ export const useObjectMetadataItem = ({
|
||||
|
||||
let objectMetadataItems = useRecoilValue(objectMetadataItemsState);
|
||||
|
||||
if (currentWorkspace?.activationStatus !== 'active') {
|
||||
if (currentWorkspace?.activationStatus !== WorkspaceActivationStatus.Active) {
|
||||
objectMetadataItem =
|
||||
mockObjectMetadataItems.find(
|
||||
(objectMetadataItem) =>
|
||||
|
||||
@ -3,6 +3,7 @@ import { useRecoilValue } from 'recoil';
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
|
||||
import { getObjectMetadataItemsMock } from '@/object-metadata/utils/getObjectMetadataItemsMock';
|
||||
import { WorkspaceActivationStatus } from '~/generated/graphql';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export const useObjectNamePluralFromSingular = ({
|
||||
@ -20,7 +21,7 @@ export const useObjectNamePluralFromSingular = ({
|
||||
}),
|
||||
);
|
||||
|
||||
if (currentWorkspace?.activationStatus !== 'active') {
|
||||
if (currentWorkspace?.activationStatus !== WorkspaceActivationStatus.Active) {
|
||||
objectMetadataItem =
|
||||
mockObjectMetadataItems.find(
|
||||
(objectMetadataItem) =>
|
||||
|
||||
@ -3,6 +3,7 @@ import { useRecoilValue } from 'recoil';
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
|
||||
import { getObjectMetadataItemsMock } from '@/object-metadata/utils/getObjectMetadataItemsMock';
|
||||
import { WorkspaceActivationStatus } from '~/generated/graphql';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
export const useObjectNameSingularFromPlural = ({
|
||||
@ -21,7 +22,7 @@ export const useObjectNameSingularFromPlural = ({
|
||||
}),
|
||||
);
|
||||
|
||||
if (currentWorkspace?.activationStatus !== 'active') {
|
||||
if (currentWorkspace?.activationStatus !== WorkspaceActivationStatus.Active) {
|
||||
objectMetadataItem =
|
||||
mockObjectMetadataItems.find(
|
||||
(objectMetadataItem) =>
|
||||
|
||||
Reference in New Issue
Block a user