Update option descriptions in agent/flow delete modal

What does this MR do and why?

  1. Changes the text in the agents/flows delete modal for Admin Mode users to the text discussed in this issue.
  2. For Admin Mode users, changes the pre-selected delete option to be the "hard delete" option, since that was the recommended option (as referenced in the discussion mentioned in the same issue).
  3. Adds a test for the details below

About forceHardDelete

  • The value of forceHardDelete defaults to false which is why the "soft delete" option was originally pre-selected.
  • However, changing it to default true meant that users without permission to "hard delete" (and therefore do not see the radio options to change which deletion method to use) would only ever be able to "hard delete" items, which isn't what we want.
  • I got around this by adding a method openDeleteModal that both opens the delete modal and sets the value of forceHardDelete to canHardDelete ensuring only users who have permission to hard delete can do so

Since the value of forceHardDelete is what the backend uses to apply the deletion method (from how I understand it) and my changes potentially affected that, it felt prudent to add a test to make sure that for users without permission to hard delete, it's always passed as false to the delete function. However, I would love some notes if any on how I implemented this test.

Screenshots or screen recordings

For users who can hard delete

Delete_Agent_-_Can_Hard_Delete

The GraphQL documentation link used

For users who cannot hard delete (text not changed, since they don't have the radio options)

Delete_Agent_-_Can_t_Hard_Delete

How to set up and validate locally

Test deleting agents and flows as both

  1. A user who can hard delete items (ie. instance admin)
  2. A user who has the ability to delete items but is not in Admin Mode

In Vue dev tools, check the value of forceHardDelete in <AiCatalogItemActions>

Screenshot_2025-12-11_at_8.29.27_PM

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #582876

Edited by Allison Villa

Merge request reports

Loading