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.graphql to include fullPath field for both group and project objects 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 visitUrl import from ~/lib/utils/url_utility
  • Updated addAgentToTarget method to:
    • Extract fullPath from the mutation response
    • Construct the appropriate URL based on target type:
      • Groups: /groups/${fullPath}/-/automate/agents
      • Projects: /${fullPath}/-/automate/agents
    • Enhanced toast notification with:
      • autoHideDelay: 10000 (10 seconds)
      • Action object with text "View in Automate"
      • Clickable link that navigates to the Automate > Agents view

Flows Show Page (ai_catalog_flows_show.vue)

  • Added visitUrl import from ~/lib/utils/url_utility
  • Updated addFlowToTarget method with the same pattern as agents:
    • Extract fullPath from the mutation response
    • Construct the appropriate URL based on target type
    • Enhanced toast notification with action link

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 onClick handler prevents default behavior and uses visitUrl for navigation
Edited by Angus Ryer

Merge request reports

Loading