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

@ -8,12 +8,15 @@ import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';
import { contextStoreCurrentObjectMetadataIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataIdComponentState';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
export const RecordIndexActionMenu = () => {
const contextStoreCurrentObjectMetadataId = useRecoilComponentValueV2(
contextStoreCurrentObjectMetadataIdComponentState,
);
const isWorkflowEnabled = useIsFeatureEnabled('IS_WORKFLOW_ENABLED');
return (
<>
{contextStoreCurrentObjectMetadataId && (
@ -28,7 +31,7 @@ export const RecordIndexActionMenu = () => {
<ActionMenuConfirmationModals />
<RecordIndexActionMenuEffect />
<RecordActionMenuEntriesSetter />
<RecordAgnosticActionsSetterEffect />
{isWorkflowEnabled && <RecordAgnosticActionsSetterEffect />}
</ActionMenuContext.Provider>
)}
</>

View File

@ -7,6 +7,7 @@ import { contextStoreCurrentObjectMetadataIdComponentState } from '@/context-sto
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { RecordShowPageBaseHeader } from '~/pages/object-record/RecordShowPageBaseHeader';
export const RecordShowActionMenu = ({
@ -26,6 +27,8 @@ export const RecordShowActionMenu = ({
contextStoreCurrentObjectMetadataIdComponentState,
);
const isWorkflowEnabled = useIsFeatureEnabled('IS_WORKFLOW_ENABLED');
// TODO: refactor RecordShowPageBaseHeader to use the context store
return (
@ -48,7 +51,7 @@ export const RecordShowActionMenu = ({
/>
<ActionMenuConfirmationModals />
<RecordActionMenuEntriesSetter />
<RecordAgnosticActionsSetterEffect />
{isWorkflowEnabled && <RecordAgnosticActionsSetterEffect />}
</ActionMenuContext.Provider>
)}
</>

View File

@ -6,12 +6,15 @@ import { ActionMenuContext } from '@/action-menu/contexts/ActionMenuContext';
import { contextStoreCurrentObjectMetadataIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataIdComponentState';
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
export const RecordShowRightDrawerActionMenu = () => {
const contextStoreCurrentObjectMetadataId = useRecoilComponentValueV2(
contextStoreCurrentObjectMetadataIdComponentState,
);
const isWorkflowEnabled = useIsFeatureEnabled('IS_WORKFLOW_ENABLED');
return (
<>
{contextStoreCurrentObjectMetadataId && (
@ -24,7 +27,7 @@ export const RecordShowRightDrawerActionMenu = () => {
<RightDrawerActionMenuDropdown />
<ActionMenuConfirmationModals />
<RecordActionMenuEntriesSetter />
<RecordAgnosticActionsSetterEffect />
{isWorkflowEnabled && <RecordAgnosticActionsSetterEffect />}
</ActionMenuContext.Provider>
)}
</>