Put workflow run actions behind feature flag (#8796)
Put workflow run actions behind feature flag
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { useRecordAgnosticActions } from '@/action-menu/actions/record-agnostic-actions/hooks/useGlobalActions';
|
||||
import { useRecordAgnosticActions } from '@/action-menu/actions/record-agnostic-actions/hooks/useRecordAgnosticActions';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export const RecordAgnosticActionsSetterEffect = () => {
|
||||
|
||||
@ -7,12 +7,15 @@ import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/Snac
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { useAllActiveWorkflowVersions } from '@/workflow/hooks/useAllActiveWorkflowVersions';
|
||||
import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { IconSettingsAutomation } from 'twenty-ui';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const useWorkflowRunActions = () => {
|
||||
const isWorkflowEnabled = useIsFeatureEnabled('IS_WORKFLOW_ENABLED');
|
||||
|
||||
const { addActionMenuEntry, removeActionMenuEntry } = useActionMenuEntries();
|
||||
|
||||
const { records: activeWorkflowVersions } = useAllActiveWorkflowVersions({
|
||||
@ -26,6 +29,10 @@ export const useWorkflowRunActions = () => {
|
||||
const theme = useTheme();
|
||||
|
||||
const addWorkflowRunActions = () => {
|
||||
if (!isWorkflowEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const [
|
||||
index,
|
||||
activeWorkflowVersion,
|
||||
|
||||
Reference in New Issue
Block a user