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:
Thomas Trompette
2025-01-29 17:25:20 +01:00
committed by GitHub
parent 85ae7084ab
commit ce0a6c1b17
3 changed files with 31 additions and 8 deletions

View File

@ -48,18 +48,12 @@ export const WorkflowStepDetail = ({
stepId,
workflowVersion,
});
if (!isDefined(stepDefinition)) {
if (!isDefined(stepDefinition) || !isDefined(stepDefinition.definition)) {
return null;
}
switch (stepDefinition.type) {
case 'trigger': {
if (!isDefined(stepDefinition.definition)) {
throw new Error(
'Expected the trigger to be defined at this point. Ensure the trigger has been set with a default value before trying to edit it.',
);
}
switch (stepDefinition.definition.type) {
case 'DATABASE_EVENT': {
return (