summaryrefslogtreecommitdiff
path: root/app/assets/stylesheets
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-18 08:50:38 +0100
committerPhil Hughes <me@iamphill.com>2018-11-05 14:02:41 +0000
commitf7df9ddb52be8a03b8fbd8c9a870f3e3af577562 (patch)
tree9ee176674a1aa2a4d57b2ffcb88c03e522891529 /app/assets/stylesheets
parent7d4b717c92d0e2f1db07fb3de0ce356b15d2f7df (diff)
downloadgitlab-ce-f7df9ddb52be8a03b8fbd8c9a870f3e3af577562.tar.gz
Re-implemented image commenting on diffs
This re-implements image commenting in merge request diffs. This feature was previously lost when the merge request page was refactored into Vue. With this, we create an overlay component. The overlay component handles displaying the comment badges and the comment form badge. Badges are displayed based on the position attribute sent with the discussion. Comment forms for diff files are controlled through a different state property. This is so we don't tie comment forms to diff files directly creating deep nested state. Instead we create a flat array which holds the file hash & the X & Y position of the comment form. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48956
Diffstat (limited to 'app/assets/stylesheets')
-rw-r--r--app/assets/stylesheets/pages/diff.scss47
1 files changed, 33 insertions, 14 deletions
diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss
index 52c91266ff4..19bc4262e21 100644
--- a/app/assets/stylesheets/pages/diff.scss
+++ b/app/assets/stylesheets/pages/diff.scss
@@ -421,21 +421,13 @@
.diff-file-container {
.frame.deleted {
- border: 0;
+ border: 1px solid $deleted;
background-color: inherit;
-
- .image_file img {
- border: 1px solid $deleted;
- }
}
.frame.added {
- border: 0;
+ border: 1px solid $added;
background-color: inherit;
-
- .image_file img {
- border: 1px solid $added;
- }
}
.swipe.view,
@@ -481,6 +473,11 @@
bottom: -25px;
}
}
+
+ .discussion-notes .discussion-notes {
+ margin-left: 0;
+ border-left: 0;
+ }
}
.file-content .diff-file {
@@ -804,7 +801,7 @@
// double jagged line divider
.discussion-notes + .discussion-notes::before,
- .discussion-notes + .discussion-form::before {
+ .diff-file-discussions + .discussion-form::before {
content: '';
position: relative;
display: block;
@@ -844,6 +841,13 @@
background-repeat: repeat;
}
+ .diff-file-discussions + .discussion-form::before {
+ width: auto;
+ margin-left: -16px;
+ margin-right: -16px;
+ margin-bottom: 16px;
+ }
+
.notes {
position: relative;
}
@@ -870,11 +874,13 @@
}
}
-.files:not([data-can-create-note]) .frame {
+.files:not([data-can-create-note="true"]) .frame {
cursor: auto;
}
-.frame.click-to-comment {
+.frame,
+.frame.click-to-comment,
+.btn-transparent.image-diff-overlay-add-comment {
position: relative;
cursor: image-url('illustrations/image_comment_light_cursor.svg')
$image-comment-cursor-left-offset $image-comment-cursor-top-offset,
@@ -910,6 +916,7 @@
.frame .badge.badge-pill,
.image-diff-avatar-link .badge.badge-pill,
+.user-avatar-link .badge.badge-pill,
.notes > .badge.badge-pill {
position: absolute;
background-color: $blue-400;
@@ -944,7 +951,8 @@
}
}
-.image-diff-avatar-link {
+.image-diff-avatar-link,
+.user-avatar-link {
position: relative;
.badge.badge-pill,
@@ -1073,3 +1081,14 @@
top: 0;
}
}
+
+.image-diff-overlay,
+.image-diff-overlay-add-comment {
+ top: 0;
+ left: 0;
+
+ &:active,
+ &:focus {
+ outline: 0;
+ }
+}