Display correct error message in the UI when default compliance framework is deleted

Summary

When a default compliance framework is deleted from compliance center-> frameworks, it does not display an Error in the UI. It just shows a spinner after Delete Framework is clicked.

Steps to reproduce

  1. Go to a top level group where you are admin
  2. Go to compliance center
  3. Click on default compliance framework
  4. Edit framework
  5. Delete framework

The graphql response is:

{
  "data": {
    "destroyComplianceFramework": {
      "errors": [
        "Cannot delete the default framework"
      ],
      "__typename": "DestroyComplianceFrameworkPayload"
    }
  }
}

But the UI does not display this error.

Example Project

What is the current bug behavior?

UI does not display an error.

What is the expected correct behavior?

UI should display the error returned from GraphQl response.

Relevant logs and/or screenshots

Screenshot Screenshot_2024-06-20_at_11.17.30_AM

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes