Draft: feat: add link to agents view in toast
Relates to issue #583669
Changes
This MR adds actionable links to toast notifications when enabling agents or flows at the group level in the AI Catalog, allowing users to navigate directly to the Automate > Agents view.
GraphQL Mutation Update
- Updated
create_ai_catalog_item_consumer.mutation.graphqlto includefullPathfield for bothgroupandprojectobjects in the mutation response - This provides the necessary data to construct the correct URLs for navigation
Agents Show Page (ai_catalog_agents_show.vue)
- Added
visitUrlimport from~/lib/utils/url_utility - Updated
addAgentToTargetmethod to:- Extract
fullPathfrom the mutation response - Construct the appropriate URL based on target type:
- Groups:
/groups/${fullPath}/-/automate/agents - Projects:
/${fullPath}/-/automate/agents
- Groups:
- Enhanced toast notification with:
-
autoHideDelay: 10000(10 seconds) - Action object with text "View in Automate"
- Clickable link that navigates to the Automate > Agents view
-
- Extract
Flows Show Page (ai_catalog_flows_show.vue)
- Added
visitUrlimport from~/lib/utils/url_utility - Updated
addFlowToTargetmethod with the same pattern as agents:- Extract
fullPathfrom the mutation response - Construct the appropriate URL based on target type
- Enhanced toast notification with action link
- Extract
Implementation Details
- Toast notifications include an actionable link following the UX pattern from
create_work_item_modal.vue - The link text is clear and actionable: "View in Automate"
- The toast stays visible for 10 seconds to give users time to click
- Both group and project level enablement have links to their respective Automate > Agents views
- The
onClickhandler prevents default behavior and usesvisitUrlfor navigation
Edited by Angus Ryer