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.graphqlto includewebPathfield for bothgroupandprojectobjects in the mutation response, as well as theidanditemTypeof the baseitem. 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
- Navigate to the catalog and any specific agent, click "Enable in group", and select a duo-enagled group.
- You should see a toast saying "Agent enabled in ", along with a link "View in group"
- Click on "View in group" should navigate to
http://gdk.test:3000/groups/gitlab-duo/-/automate/agents/<your-item-id> - Navigate to the agent list of a project within that group (such as
http://gdk.test:3000/gitlab-duo/test/-/automate/agents) - Click "Enable agent from group" and select the agent you just enabled at the group level, clikc "Enable"
- You should see a toast with the message: "Agent enabled in " and a link with message "View in project"
- 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