-
-
Notifications
You must be signed in to change notification settings - Fork 294
Workflow Triggers #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Workflow Triggers #508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the button say "Triggers" instead of "Set Triggers" |
The menu makes it easy to set many triggers. But this is an uncommon usecase. It would be better to use an autocomplete with multiselection or just a select with multiselection https://mui.com/joy-ui/react-autocomplete/#multiple-selection https://mui.com/joy-ui/react-select/#multiple-selections |
@@ -75,6 +80,24 @@ export default function WorkflowList({ experimentInfo }) { | |||
mutate: mutateWorkflows, | |||
} = useSWR(chatAPI.Endpoints.Workflows.List(), fetcher); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use useAPI going forward
@@ -84,15 +107,39 @@ export default function WorkflowList({ experimentInfo }) { | |||
} | |||
}, [workflowsData, selectedWorkflowId, newWorkflowModalOpen]); | |||
|
|||
const workflows = workflowsData; | |||
// Close triggers menu when clicking outside | |||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should have to manage clickoutside etc. This should be managed by MUI Joy in the Menu Component
@@ -169,7 +219,7 @@ export default function WorkflowList({ experimentInfo }) { | |||
<Typography level="title-lg"> | |||
Workflow {selectedWorkflow?.name} | |||
</Typography> | |||
<Box pl={2} display="flex" flexDirection="row" gap={1}> | |||
<Box pl={2} display="flex" flexDirection="row" gap={1} position="relative"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does position=relative accomplish here?
const [optimisticConfigs, setOptimisticConfigs] = useState<TriggerConfig[] | null>(null); | ||
|
||
// Debug logging | ||
console.log('WorkflowTriggersMenu received:', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debug logging
|
||
// Ensure predefinedTriggers is an array and handle null/undefined cases | ||
const safePredefinedTriggers = Array.isArray(predefinedTriggers) ? predefinedTriggers : []; | ||
console.log('Safe predefined triggers:', safePredefinedTriggers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debug logging
return result; | ||
} | ||
|
||
export async function updateWorkflowTrigger(triggerId: string, payload: { is_enabled: boolean, config: { workflow_ids: number[] } }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add endpoints like this to our SDK. Use getFullURL
return result; | ||
} | ||
|
||
export async function listWorkflowsForExperiment(experimentId: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add endpoints like this to our SDK. Use getFullURL
return result; | ||
} | ||
|
||
export async function getPredefinedTriggers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add endpoints like this to our SDK. Use getFullURL
return result; | ||
} | ||
|
||
export async function getWorkflowDetails(workflowId: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add endpoints like this to our SDK. Use getFullURL
return result; | ||
} | ||
|
||
export async function updateWorkflowTriggerConfigs(workflowId: string, configs: Array<{trigger_type: string, is_enabled: boolean}>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add endpoints like this to our SDK. Use getFullURL
No description provided.