summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-11-14 10:36:45 +0000
committerPhil Hughes <me@iamphill.com>2017-11-17 14:51:28 +0000
commit04fcc7dab5b2c08dc33e9cb62bfe9c712db6ebff (patch)
tree0fbf66e4f4d1e99182efe3700aa7249529792da1
parente68ee8af4d981cb7b83fae76c0a94059add495fb (diff)
downloadgitlab-ce-04fcc7dab5b2c08dc33e9cb62bfe9c712db6ebff.tar.gz
Improved the design of the changed files dropdown
Closes #36687
-rw-r--r--app/assets/javascripts/dispatcher.js2
-rw-r--r--app/assets/stylesheets/pages/diff.scss32
-rw-r--r--app/views/projects/diffs/_stats.html.haml8
-rw-r--r--changelogs/unreleased/improved-changes-dropdown.yml5
4 files changed, 39 insertions, 8 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 5ff7edb6077..a8b2c97c188 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -340,7 +340,7 @@ import ProjectVariables from './project_variables';
container: '.js-commit-pipeline-graph',
}).bindEvents();
initNotes();
- initChangesDropdown();
+ initChangesDropdown(document.querySelector('.navbar-gitlab').offsetHeight - 16);
$('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath);
break;
case 'projects:commit:pipelines':
diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss
index bce94e09367..779ba431d85 100644
--- a/app/assets/stylesheets/pages/diff.scss
+++ b/app/assets/stylesheets/pages/diff.scss
@@ -628,21 +628,45 @@
}
.diff-file-changes {
- width: 450px;
+ max-width: 550px;
+ width: 100%;
z-index: 150;
@media (min-width: $screen-sm-min) {
left: $gl-padding;
}
- a {
+ .diff-changed-file {
+ display: flex;
padding-top: 8px;
padding-bottom: 8px;
+ min-width: 0;
}
- .diff-changed-file {
+ .diff-file-changed-icon {
+ margin-top: 2px;
+ }
+
+ .diff-changed-file-content {
display: flex;
- align-items: center;
+ flex-direction: column;
+ min-width: 0;
+ }
+
+ .diff-changed-file-name,
+ .diff-changed-file-path {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .diff-changed-file-path {
+ direction: rtl;
+ }
+
+ .diff-changed-stats {
+ margin-left: auto;
+ white-space: nowrap;
}
}
diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml
index 2de2cf9e38c..72fc828b0b3 100644
--- a/app/views/projects/diffs/_stats.html.haml
+++ b/app/views/projects/diffs/_stats.html.haml
@@ -22,9 +22,11 @@
- diff_files.each do |diff_file|
%li
%a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path }
- = icon("#{diff_file_changed_icon(diff_file)} fw", class: "#{diff_file_changed_icon_color(diff_file)} append-right-5")
- %span.diff-file-changes-path.append-right-5= diff_file.new_path
- .pull-right
+ = icon("#{diff_file_changed_icon(diff_file)} fw", class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon append-right-8")
+ %span.diff-changed-file-content.append-right-8
+ %strong.diff-changed-file-name= diff_file.blob.name
+ %span.diff-changed-file-path.prepend-top-5= diff_file.new_path
+ %span.diff-changed-stats
%span.cgreen<
+#{diff_file.added_lines}
%span.cred<
diff --git a/changelogs/unreleased/improved-changes-dropdown.yml b/changelogs/unreleased/improved-changes-dropdown.yml
new file mode 100644
index 00000000000..f305cbe573b
--- /dev/null
+++ b/changelogs/unreleased/improved-changes-dropdown.yml
@@ -0,0 +1,5 @@
+---
+title: Improved diff changed files dropdown design
+merge_request:
+author:
+type: changed