[go: up one dir, main page]

FE: Add link to agent and flow show page in toast after enabling

Relates to issue #583669 (closed)

Changes

This MR adds actionable links to toast notifications when enabling agents or flows at the group and project levels in the AI Catalog and Duo Agent Platform contexts, allowing users to navigate directly to the Automate > Agent/Flow view.

GraphQL Mutation Update

  • Updated create_ai_catalog_item_consumer.mutation.graphql to include webPath field for both group and project objects in the mutation response, as well as the id and itemType of the base item. This provides the necessary data to construct the correct URLs for navigation.

Components updated:

  • ai_catalog_agents_show.vue (project level enable functionality)
  • ai_catalog_flows_show.vue (project level enable functionality)
  • ai_agent_index.vue (enabling agents from the group namespace)
  • ai_flow_index.vue (enabling flows from the group namespace)

How to validate locally

  1. Navigate to the catalog and any specific agent, click "Enable in group", and select a duo-enagled group.
  2. You should see a toast saying "Agent enabled in ", along with a link "View in group"
  3. Click on "View in group" should navigate to http://gdk.test:3000/groups/gitlab-duo/-/automate/agents/<your-item-id>
  4. Navigate to the agent list of a project within that group (such as http://gdk.test:3000/gitlab-duo/test/-/automate/agents)
  5. Click "Enable agent from group" and select the agent you just enabled at the group level, clikc "Enable"
  6. You should see a toast with the message: "Agent enabled in " and a link with message "View in project"
  7. Clicking on the link should bring you to the agent show page (such as http://gdk.test:3000/gitlab-duo/test/-/automate/agents/88
Edited by Angus Ryer

Merge request reports

Loading