Fix empty trigger on readonly + fix cache apollo on deactivation (#9912)
- On deactivation, we should not need to refresh so the workflow disappear from cmd+k https://github.com/user-attachments/assets/826fa4c6-3faa-49d1-b180-ed5d3ed187e5 - When readonly, step empty, we should not see the right drawer https://github.com/user-attachments/assets/b557ef61-da81-446d-b160-f26c4c7a5191
This commit is contained in:
@ -3,6 +3,7 @@ import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
|
||||
import { RightDrawerHotkeyScope } from '@/ui/layout/right-drawer/types/RightDrawerHotkeyScope';
|
||||
import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';
|
||||
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
|
||||
import { EMPTY_TRIGGER_STEP_ID } from '@/workflow/workflow-diagram/constants/EmptyTriggerStepId';
|
||||
import { useTriggerNodeSelection } from '@/workflow/workflow-diagram/hooks/useTriggerNodeSelection';
|
||||
import { workflowSelectedNodeState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeState';
|
||||
import {
|
||||
@ -27,7 +28,7 @@ export const WorkflowDiagramCanvasReadonlyEffect = () => {
|
||||
const selectedNode = nodes[0] as WorkflowDiagramNode;
|
||||
const isClosingStep = isDefined(selectedNode) === false;
|
||||
|
||||
if (isClosingStep) {
|
||||
if (isClosingStep || selectedNode.type === EMPTY_TRIGGER_STEP_ID) {
|
||||
closeRightDrawer();
|
||||
closeCommandMenu();
|
||||
return;
|
||||
@ -37,6 +38,7 @@ export const WorkflowDiagramCanvasReadonlyEffect = () => {
|
||||
setHotkeyScope(RightDrawerHotkeyScope.RightDrawer, { goto: false });
|
||||
|
||||
const selectedNodeData = selectedNode.data as WorkflowDiagramStepNodeData;
|
||||
|
||||
openRightDrawer(RightDrawerPages.WorkflowStepView, {
|
||||
title: selectedNodeData.name,
|
||||
Icon: getIcon(getWorkflowNodeIconKey(selectedNodeData)),
|
||||
|
||||
Reference in New Issue
Block a user