summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/diff_row_utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_row_utils.js')
-rw-r--r--app/assets/javascripts/diffs/components/diff_row_utils.js25
1 files changed, 18 insertions, 7 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_row_utils.js b/app/assets/javascripts/diffs/components/diff_row_utils.js
index 7732badde34..479853caae3 100644
--- a/app/assets/javascripts/diffs/components/diff_row_utils.js
+++ b/app/assets/javascripts/diffs/components/diff_row_utils.js
@@ -57,21 +57,32 @@ export const classNameMapCell = ({ line, hll, isLoggedIn, isHover }) => {
export const addCommentTooltip = (line) => {
let tooltip;
- if (!line) return tooltip;
+ if (!line) {
+ return tooltip;
+ }
tooltip = __('Add a comment to this line or drag for multiple lines');
- const brokenSymlinks = line.commentsDisabled;
- if (brokenSymlinks) {
- if (brokenSymlinks.wasSymbolic || brokenSymlinks.isSymbolic) {
+ if (!line.problems) {
+ return tooltip;
+ }
+
+ const { brokenSymlink, brokenLineCode, fileOnlyMoved } = line.problems;
+
+ if (brokenSymlink) {
+ if (brokenSymlink.wasSymbolic || brokenSymlink.isSymbolic) {
tooltip = __(
- 'Commenting on symbolic links that replace or are replaced by files is currently not supported.',
+ 'Commenting on symbolic links that replace or are replaced by files is not supported',
);
- } else if (brokenSymlinks.wasReal || brokenSymlinks.isReal) {
+ } else if (brokenSymlink.wasReal || brokenSymlink.isReal) {
tooltip = __(
- 'Commenting on files that replace or are replaced by symbolic links is currently not supported.',
+ 'Commenting on files that replace or are replaced by symbolic links is not supported',
);
}
+ } else if (fileOnlyMoved) {
+ tooltip = __('Commenting on files that are only moved or renamed is not supported');
+ } else if (brokenLineCode) {
+ tooltip = __('Commenting on this line is not supported');
}
return tooltip;