Add back trimChar method to remove trailing +/-
What does this MR do?
Trim first char of diff line text on diff discussions. Unfortunately the data that comes through includes the leading -
or +
(depending if user makes a comment on a deleted or newly added code).
So on the frontend, we're going to manually remove it. I'm reusing the same method that was removed in MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24568
Test Case
- Navigate to Merge Requests > [select a MR] > Changes
- Make a comment in the source code
- Add a comment on the source code
- Leave any comment and click the "Comment" button to submit
- Now navigate to > Discussion (Do not refresh the page)
-
Find the code when you left a comment, note there is no double + +
or- -
sign. Only one+
or-
exists.
note: if you left a comment on a deleted code, then the sign would be -
. if you left a comment on a newly created code, then the sign would be +
.
Tested on:
-
IE11 -
Edge -
Safari -
Firefox -
Chrome
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance 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
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 #59028 (closed)
Edited by 🤖 GitLab Bot 🤖