Fix send email error when empty connected account (#10005)
- Fix send email error when empty connected account - Add a global util to valid uuid - Add an util to check if object is workflow related
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { isWorkflowSubObjectMetadata } from '@/object-metadata/utils/isWorkflowSubObjectMetadata';
|
||||
import { isWorkflowRelatedObjectMetadata } from '@/object-metadata/utils/isWorkflowRelatedObjectMetadata';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { FeatureFlagKey } from '~/generated-metadata/graphql';
|
||||
|
||||
@ -14,11 +13,7 @@ export const useFilteredObjectMetadataItems = () => {
|
||||
);
|
||||
|
||||
const isWorkflowToBeFiltered = (nameSingular: string) => {
|
||||
return (
|
||||
!isWorkflowEnabled &&
|
||||
(nameSingular === CoreObjectNameSingular.Workflow ||
|
||||
isWorkflowSubObjectMetadata(nameSingular))
|
||||
);
|
||||
return !isWorkflowEnabled && isWorkflowRelatedObjectMetadata(nameSingular);
|
||||
};
|
||||
|
||||
const activeObjectMetadataItems = objectMetadataItems.filter(
|
||||
|
||||
@ -5,8 +5,7 @@ import { objectMetadataItemFamilySelector } from '@/object-metadata/states/objec
|
||||
import { objectMetadataItemsState } from '@/object-metadata/states/objectMetadataItemsState';
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { isWorkflowSubObjectMetadata } from '@/object-metadata/utils/isWorkflowSubObjectMetadata';
|
||||
import { isWorkflowRelatedObjectMetadata } from '@/object-metadata/utils/isWorkflowRelatedObjectMetadata';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { FeatureFlagKey } from '~/generated-metadata/graphql';
|
||||
import { ObjectMetadataItemIdentifier } from '../types/ObjectMetadataItemIdentifier';
|
||||
@ -26,9 +25,7 @@ export const useObjectMetadataItem = ({
|
||||
);
|
||||
|
||||
const isWorkflowToBeFiltered =
|
||||
!isWorkflowEnabled &&
|
||||
(objectNameSingular === CoreObjectNameSingular.Workflow ||
|
||||
isWorkflowSubObjectMetadata(objectNameSingular));
|
||||
!isWorkflowEnabled && isWorkflowRelatedObjectMetadata(objectNameSingular);
|
||||
|
||||
const objectMetadataItems = useRecoilValue(objectMetadataItemsState);
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
import { isWorkflowSubObjectMetadata } from '@/object-metadata/utils/isWorkflowSubObjectMetadata';
|
||||
import { CoreObjectNameSingular } from '../types/CoreObjectNameSingular';
|
||||
|
||||
export const isWorkflowRelatedObjectMetadata = (objectNameSingular: string) => {
|
||||
return (
|
||||
objectNameSingular === CoreObjectNameSingular.Workflow ||
|
||||
isWorkflowSubObjectMetadata(objectNameSingular)
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user