Fix: Make deployment toggles visible but disabled for deployments when a user does not have update deployment permissions #2692
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently we hide action items from users who do not have permission to take the relevant actions. This includes hiding the deployment schedule toggle from a user who does not have permission to update a deployment. However, the toggle shows information as well as an action.
This PR updates the different deployment toggles to allow a toggle to convey information about a deployment's/schedule's status and instead disables the toggle so a user without permissions cannot update the deployment. It also updates the related tooltip to advise the user they don't have permission to update the deployment.
Current - A user with Runner permissions can see that their deployment has two schedules but can not tell that one has been disabled:
This PR - A user with Runner permissions can see that a schedule is disabled but can not update it:
This PR is separate from the deployment status updates in #2645 and is aimed only at making status more visible for users who do not have permissions to take action.
Resolves PrefectHQ/prefect#15071