Treat suspended workspace as workspaces that need to be synced (#9669)
In this PR: - migrate WorkspaceActivationStatus to twenty-shared (and update case to make FE and BE consistent) - introduce isWorkspaceActiveOrSuspended in twenty-shared - refactor the code to use it (when we fetch data on the FE, we want to keep SUSPENDED workspace working + when we sync workspaces we want it too)
This commit is contained in:
@ -16,7 +16,7 @@ const Wrapper = getJestMetadataAndApolloMocksWrapper({
|
||||
featureFlags: [],
|
||||
allowImpersonation: false,
|
||||
subdomain: 'test',
|
||||
activationStatus: WorkspaceActivationStatus.Active,
|
||||
activationStatus: WorkspaceActivationStatus.ACTIVE,
|
||||
hasValidEntrepriseKey: false,
|
||||
metadataVersion: 1,
|
||||
isPublicInviteLinkEnabled: false,
|
||||
|
||||
@ -2,7 +2,7 @@ import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
|
||||
import { WorkspaceActivationStatus } from '~/generated/graphql';
|
||||
import { isWorkspaceActiveOrSuspended } from 'twenty-shared';
|
||||
import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
@ -20,7 +20,7 @@ export const useObjectNamePluralFromSingular = ({
|
||||
}),
|
||||
);
|
||||
|
||||
if (currentWorkspace?.activationStatus !== WorkspaceActivationStatus.Active) {
|
||||
if (!isWorkspaceActiveOrSuspended(currentWorkspace)) {
|
||||
objectMetadataItem =
|
||||
generatedMockObjectMetadataItems.find(
|
||||
(objectMetadataItem) =>
|
||||
|
||||
@ -2,7 +2,7 @@ import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objectMetadataItemFamilySelector';
|
||||
import { WorkspaceActivationStatus } from '~/generated/graphql';
|
||||
import { isWorkspaceActiveOrSuspended } from 'twenty-shared';
|
||||
import { generatedMockObjectMetadataItems } from '~/testing/mock-data/generatedMockObjectMetadataItems';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
@ -20,7 +20,7 @@ export const useObjectNameSingularFromPlural = ({
|
||||
}),
|
||||
);
|
||||
|
||||
if (currentWorkspace?.activationStatus !== WorkspaceActivationStatus.Active) {
|
||||
if (!isWorkspaceActiveOrSuspended(currentWorkspace)) {
|
||||
objectMetadataItem =
|
||||
generatedMockObjectMetadataItems.find(
|
||||
(objectMetadataItem) =>
|
||||
|
||||
Reference in New Issue
Block a user