summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTM Lee <tm89lee@gmail.com>2017-03-10 09:58:48 +0800
committerTM Lee <tm89lee@gmail.com>2017-04-23 18:44:42 +0800
commit7940a5d49ca7b0abbd0fed3bcc0184ebd33a7d0b (patch)
tree524e1e2139f19912d7026cc7a18895151a5b3173
parent1005389f70070245092c1ae5f3f9b10b8e7c102e (diff)
downloadgitlab-ce-7940a5d49ca7b0abbd0fed3bcc0184ebd33a7d0b.tar.gz
[#22826] Ensure find_file_link and download button is part of file tree header
- Move the find_file_link and download partial into the project tree_header partial - Added Changelog
-rw-r--r--app/assets/stylesheets/pages/tree.scss1
-rw-r--r--app/views/projects/tree/_tree_header.html.haml4
-rw-r--r--app/views/projects/tree/show.html.haml10
-rw-r--r--changelogs/unreleased/22826-ui-inconsistency-different-files-views-find-file-button-missing.yml4
-rw-r--r--spec/features/projects/files/find_files_spec.rb28
5 files changed, 37 insertions, 10 deletions
diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss
index f3916622b6f..03c75ce61f5 100644
--- a/app/assets/stylesheets/pages/tree.scss
+++ b/app/assets/stylesheets/pages/tree.scss
@@ -160,7 +160,6 @@
.tree-controls {
float: right;
- margin-top: 11px;
position: relative;
z-index: 2;
diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml
index 259207a6dfd..e7b3fe3ffda 100644
--- a/app/views/projects/tree/_tree_header.html.haml
+++ b/app/views/projects/tree/_tree_header.html.haml
@@ -1,3 +1,7 @@
+.tree-controls
+ = render 'projects/find_file_link'
+ = render 'projects/buttons/download', project: @project, ref: @ref
+
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'tree', path: @path
diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml
index a2a26039220..910d765aed0 100644
--- a/app/views/projects/tree/show.html.haml
+++ b/app/views/projects/tree/show.html.haml
@@ -7,12 +7,4 @@
= render 'projects/last_push'
%div{ class: container_class }
- .tree-controls
- = render 'projects/find_file_link'
- = render 'projects/buttons/download', project: @project, ref: @ref
-
- #tree-holder.tree-holder.clearfix
- .nav-block
- = render 'projects/tree/tree_header', tree: @tree
-
- = render 'projects/tree/tree_content', tree: @tree
+ = render 'projects/files'
diff --git a/changelogs/unreleased/22826-ui-inconsistency-different-files-views-find-file-button-missing.yml b/changelogs/unreleased/22826-ui-inconsistency-different-files-views-find-file-button-missing.yml
new file mode 100644
index 00000000000..c42fbd4e1f1
--- /dev/null
+++ b/changelogs/unreleased/22826-ui-inconsistency-different-files-views-find-file-button-missing.yml
@@ -0,0 +1,4 @@
+---
+title: Fix UI inconsistency different files view (find file button missing)
+merge_request: 9847
+author: TM Lee
diff --git a/spec/features/projects/files/find_files_spec.rb b/spec/features/projects/files/find_files_spec.rb
new file mode 100644
index 00000000000..06f52bef902
--- /dev/null
+++ b/spec/features/projects/files/find_files_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+feature 'Find files button in the tree header', feature: true do
+ given(:user) { create(:user) }
+ given(:project) { create(:project) }
+
+ background do
+ login_as(user)
+ project.team << [user, :developer]
+ end
+
+ scenario 'project main screen' do
+ visit namespace_project_path(
+ project.namespace,
+ project
+ )
+ expect(page).to have_selector('.tree-controls .shortcuts-find-file')
+ end
+
+ scenario 'project tree screen' do
+ visit namespace_project_tree_path(
+ project.namespace,
+ project,
+ project.default_branch
+ )
+ expect(page).to have_selector('.tree-controls .shortcuts-find-file')
+ end
+end