Put workflow run actions behind feature flag (#8796)

Put workflow run actions behind feature flag
This commit is contained in:
Raphaël Bosi
2024-11-28 16:03:34 +01:00
committed by GitHub
parent 75f5afb968
commit 33159e29b7
6 changed files with 20 additions and 4 deletions

View File

@ -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 = () => {

View File

@ -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,