Skip to content

Commit 83e623f

Browse files
author
Tim Zallmann
committed
Merge branch 'winh-tree-dropdown-caret' into 'master'
Add chevron to create dropdown on repository page Closes #39458 See merge request gitlab-org/gitlab-ce!15648
2 parents 7619bdd + e7d23a2 commit 83e623f

File tree

8 files changed

+36
-19
lines changed

8 files changed

+36
-19
lines changed

app/assets/images/icons.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"iconCount":179,"spriteSize":81882,"icons":["abuse","account","admin","angle-double-left","angle-double-right","angle-down","angle-left","angle-right","angle-up","appearance","applications","approval","arrow-right","assignee","bold","book","branch","bullhorn","calendar","cancel","chart","chevron-down","chevron-left","chevron-right","chevron-up","clock","close","code","collapse","comment-dots","comment-next","comment","comments","commit","credit-card","cut","dashboard","disk","doc_code","doc_image","doc_text","double-headed-arrow","download","duplicate","earth","ellipsis_v","emoji_slightly_smiling_face","emoji_smile","emoji_smiley","epic","external-link","eye-slash","eye","file-addition","file-deletion","file-modified","filter","folder","fork","geo-nodes","git-merge","group","history","home","hook","hourglass","image-comment-dark","import","issue-block","issue-child","issue-close","issue-duplicate","issue-new","issue-open-m","issue-open","issue-parent","issues","italic","key-2","key","label","labels","leave","level-up","license","link","list-bulleted","list-numbered","location-dot","location","lock-open","lock","log","mail","menu","merge-request-close","messages","mobile-issue-close","monitor","more","notifications-off","notifications","overview","pencil-square","pencil","pipeline","play","plus-square-o","plus-square","plus","preferences","profile","project","push-rules","question-o","question","quote","redo","remove","repeat","retry","scale","screen-full","screen-normal","scroll_down","scroll_up","search","settings","shield","slight-frown","slight-smile","smile","smiley","snippet","spam","spinner","star-o","star","status_canceled_borderless","status_canceled","status_closed","status_created_borderless","status_created","status_failed_borderless","status_failed","status_manual_borderless","status_manual","status_notfound_borderless","status_open","status_pending_borderless","status_pending","status_running_borderless","status_running","status_skipped_borderless","status_skipped","status_success_borderless","status_success_solid","status_success","status_warning_borderless","status_warning","stop","task-done","template","terminal","thumb-down","thumb-up","thumbtack","timer","todo-add","todo-done","token","unapproval","unassignee","unlink","user","users","volume-up","warning","work"]}
1+
{"iconCount":180,"spriteSize":82176,"icons":["abuse","account","admin","angle-double-left","angle-double-right","angle-down","angle-left","angle-right","angle-up","appearance","applications","approval","arrow-down","arrow-right","assignee","bold","book","branch","bullhorn","calendar","cancel","chart","chevron-down","chevron-left","chevron-right","chevron-up","clock","close","code","collapse","comment-dots","comment-next","comment","comments","commit","credit-card","cut","dashboard","disk","doc_code","doc_image","doc_text","double-headed-arrow","download","duplicate","earth","ellipsis_v","emoji_slightly_smiling_face","emoji_smile","emoji_smiley","epic","external-link","eye-slash","eye","file-addition","file-deletion","file-modified","filter","folder","fork","geo-nodes","git-merge","group","history","home","hook","hourglass","image-comment-dark","import","issue-block","issue-child","issue-close","issue-duplicate","issue-new","issue-open-m","issue-open","issue-parent","issues","italic","key-2","key","label","labels","leave","level-up","license","link","list-bulleted","list-numbered","location-dot","location","lock-open","lock","log","mail","menu","merge-request-close","messages","mobile-issue-close","monitor","more","notifications-off","notifications","overview","pencil-square","pencil","pipeline","play","plus-square-o","plus-square","plus","preferences","profile","project","push-rules","question-o","question","quote","redo","remove","repeat","retry","scale","screen-full","screen-normal","scroll_down","scroll_up","search","settings","shield","slight-frown","slight-smile","smile","smiley","snippet","spam","spinner","star-o","star","status_canceled_borderless","status_canceled","status_closed","status_created_borderless","status_created","status_failed_borderless","status_failed","status_manual_borderless","status_manual","status_notfound_borderless","status_open","status_pending_borderless","status_pending","status_running_borderless","status_running","status_skipped_borderless","status_skipped","status_success_borderless","status_success_solid","status_success","status_warning_borderless","status_warning","stop","task-done","template","terminal","thumb-down","thumb-up","thumbtack","timer","todo-add","todo-done","token","unapproval","unassignee","unlink","user","users","volume-up","warning","work"]}

app/assets/images/icons.svg

+1-1
Loading
Loading
Loading

app/assets/javascripts/repo/components/new_dropdown/index.vue

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
import { mapState } from 'vuex';
33
import newModal from './modal.vue';
44
import upload from './upload.vue';
5+
import icon from '../../../vue_shared/components/icon.vue';
56
67
export default {
78
components: {
9+
icon,
810
newModal,
911
upload,
1012
},
@@ -41,11 +43,14 @@
4143
data-toggle="dropdown"
4244
aria-label="Create new file or directory"
4345
>
44-
<i
45-
class="fa fa-plus"
46-
aria-hidden="true"
47-
>
48-
</i>
46+
<icon
47+
name="plus"
48+
css-classes="pull-left"
49+
/>
50+
<icon
51+
name="arrow-down"
52+
css-classes="pull-left"
53+
/>
4954
</button>
5055
<ul class="dropdown-menu">
5156
<li>

app/assets/stylesheets/pages/tree.scss

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
.nav-block {
55
margin: 10px 0;
66

7+
.btn .fa,
8+
.btn svg {
9+
color: $gl-text-color-secondary;
10+
}
11+
712
@media (min-width: $screen-sm-min) {
813
display: flex;
914

@@ -91,8 +96,12 @@
9196
}
9297

9398
.add-to-tree {
94-
vertical-align: middle;
95-
padding: 6px 10px;
99+
vertical-align: top;
100+
padding: 8px;
101+
102+
svg {
103+
top: 0;
104+
}
96105
}
97106

98107
.tree-table {

app/views/projects/tree/_old_tree_header.html.haml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- if on_top_of_branch?
2+
- addtotree_toggle_attributes = { href: '#', 'data-toggle': 'dropdown', 'data-target': '.add-to-tree-dropdown' }
3+
- else
4+
- addtotree_toggle_attributes = { title: _("You can only add files when you are on a branch"), data: { container: 'body' }, class: 'disabled has-tooltip' }
5+
16
%ul.breadcrumb.repo-breadcrumb
27
%li
38
= link_to project_tree_path(@project, @ref) do
@@ -8,13 +13,10 @@
813

914
- if current_user
1015
%li
11-
- if !on_top_of_branch?
12-
%span.btn.add-to-tree.disabled.has-tooltip{ title: _("You can only add files when you are on a branch"), data: { container: 'body' } }
13-
= icon('plus')
14-
- else
15-
%span.dropdown
16-
%a.dropdown-toggle.btn.add-to-tree{ href: '#', "data-toggle" => "dropdown", "data-target" => ".add-to-tree-dropdown" }
17-
= icon('plus')
16+
%a.btn.add-to-tree{ addtotree_toggle_attributes }
17+
= sprite_icon('plus', size: 16, css_class: 'pull-left')
18+
= sprite_icon('arrow-down', size: 16, css_class: 'pull-left')
19+
- if on_top_of_branch?
1820
.add-to-tree-dropdown
1921
%ul.dropdown-menu
2022
- if can_edit_tree?

yarn.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
to-fast-properties "^2.0.0"
5656

5757
"@gitlab-org/gitlab-svgs@^1.1.1":
58-
version "1.1.1"
59-
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.1.%3Cspan%20class="x x-first x-last">1.tgz#6e07ea02c3b104fa8b5d860a5e2fa9dab4edab96"
58+
version "1.1.3"
59+
resolved "https://registry.yarnpkg.com/@gitlab-org/gitlab-svgs/-/gitlab-svgs-1.1.%3Cspan%20class="x x-first x-last">3.tgz#2beead1bcdd83e7400de29b01014bf17bf76318e"
6060

6161
"@types/jquery@^2.0.40":
6262
version "2.0.48"

0 commit comments

Comments
 (0)