Add inapplicable reason in MR suggestion Tooltip
Issue: #219455 (closed)
MR | Changes |
---|---|
!34149 (merged) | BE Implementation |
|
FE - Display Tooltip Message |
What does this MR do?
In this previous MR, !33357 (merged), we displayed a generic message why the suggestion can not be applied. In this MR, we will display a more specific reason why the suggestion can not be applied. That inapplicable reason will be provided from the BE.
Testing Case
- Go to Merge Requests > "Changes" tab
- Comment on a line with code and click "insert suggestion" (docs)
- The tooltip will display the message from the BE for the following reason
Copy and paste from BE
BE Message | Reason |
---|---|
You don't have write access to the source branch. |
when user has no write access to branch. |
This merge request was merged. To apply this suggestion, edit this file directly. |
when MR was merged. |
This merge request is closed. To apply this suggestion, edit this file directly. |
when MR is closed. |
Can't apply as the source branch was deleted. |
when source branch is deleted. |
Can't apply as this line was changed in a more recent version. |
when the line where suggestion is on is outdated. |
Can't apply as these lines were changed in a more recent version. |
when lines where suggestion is on are outdated. |
This suggestion already matches its content. |
when suggestion has the same content as the line it is on. |
Can't apply this suggestion. |
default message when suggestion cannot be applied but doesn't fall into any of criteria above. We won't show this message anywhere right now but it makes sense to return something (e.g. when suggestion is already applied). |
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #219455 (closed)
Edited by Samantha Ming