Describe the bug
When as an Admin you try to delete a Sector type already link to a process you have a SQL error displayed.
The error is due to foreign key constraint violation.
To Reproduce
- As Admin go to 'Settings'
- Create a sector type
- Create a sector for the previous sector type
- In a process go to the Filters section, check the enable scope
- Select a Scope in the scope dropdown list
- Select a Scope type in the Scope filter depth dropdown list
- Save the Process
- Go back to 'Settings'
- Try to delete the Scope type you linked to a scope in the previous Process
- See error
Expected behavior
The user should be displayed a message that said he can not delete the sector type because it is already link to a process.
The message error text should be in a yml file for translation purpose.
Or when a Scope type is linked to a process the delete button should not be clickable or displayed for this Scope type.
Screenshots
Enabling the Scope and Scope type in a Process

Trying to delete the Scope type in the Setting page

Confirm delete

Error page on try.decidim

Stacktrace
The stack trace on local server

Extra data
- Device: Desktop
- Device OS: Windows 10
- Browser: Chrome
- Decidim Version: 0.27.2 and try.decidim.org
- Decidim installation:
Additional context
No response
Describe the bug
When as an Admin you try to delete a Sector type already link to a process you have a SQL error displayed.
The error is due to foreign key constraint violation.
To Reproduce
Expected behavior
The user should be displayed a message that said he can not delete the sector type because it is already link to a process.
The message error text should be in a yml file for translation purpose.
Or when a Scope type is linked to a process the delete button should not be clickable or displayed for this Scope type.
Screenshots
Enabling the Scope and Scope type in a Process

Trying to delete the Scope type in the Setting page

Confirm delete

Error page on try.decidim

Stacktrace
The stack trace on local server

Extra data
Additional context
No response