Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
2e2f0675
Commit
2e2f0675
authored
Nov 13, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UX adjustments and spec corrections
parent
d19019ec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
39 deletions
+15
-39
app/assets/javascripts/project.js
app/assets/javascripts/project.js
+0
-30
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+4
-0
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+2
-2
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+2
-2
spec/helpers/button_helper_spec.rb
spec/helpers/button_helper_spec.rb
+7
-5
No files found.
app/assets/javascripts/project.js
View file @
2e2f0675
...
@@ -29,36 +29,6 @@ export default class Project {
...
@@ -29,36 +29,6 @@ export default class Project {
return
$
(
'
.clone
'
).
text
(
url
);
return
$
(
'
.clone
'
).
text
(
url
);
});
});
// Ref switcher
// Ref switcher
this
.
initRefSwitcher
();
$
(
'
.project-refs-select
'
).
on
(
'
change
'
,
function
()
{
return
$
(
this
).
parents
(
'
form
'
).
submit
();
});
$
(
'
.hide-no-ssh-message
'
).
on
(
'
click
'
,
function
(
e
)
{
Cookies
.
set
(
'
hide_no_ssh_message
'
,
'
false
'
);
$
(
this
).
parents
(
'
.no-ssh-key-message
'
).
remove
();
return
e
.
preventDefault
();
});
$
(
'
.hide-no-password-message
'
).
on
(
'
click
'
,
function
(
e
)
{
Cookies
.
set
(
'
hide_no_password_message
'
,
'
false
'
);
$
(
this
).
parents
(
'
.no-password-message
'
).
remove
();
return
e
.
preventDefault
();
});
this
.
projectSelectDropdown
();
$
(
'
a
'
,
$cloneOptions
).
on
(
'
click
'
,
(
e
)
=>
{
const
$this
=
$
(
e
.
currentTarget
);
const
url
=
$this
.
attr
(
'
href
'
);
e
.
preventDefault
();
$
(
'
.is-active
'
,
$cloneOptions
).
not
(
$this
).
removeClass
(
'
is-active
'
);
$this
.
toggleClass
(
'
is-active
'
);
$projectCloneField
.
val
(
url
);
$cloneBtnText
.
text
(
$this
.
text
());
return
$
(
'
.clone
'
).
text
(
url
);
});
// Ref switcher
Project
.
initRefSwitcher
();
Project
.
initRefSwitcher
();
$
(
'
.project-refs-select
'
).
on
(
'
change
'
,
function
()
{
$
(
'
.project-refs-select
'
).
on
(
'
change
'
,
function
()
{
return
$
(
this
).
parents
(
'
form
'
).
submit
();
return
$
(
this
).
parents
(
'
form
'
).
submit
();
...
...
app/assets/stylesheets/pages/projects.scss
View file @
2e2f0675
...
@@ -406,6 +406,10 @@
...
@@ -406,6 +406,10 @@
.clone-dropdown-btn
{
.clone-dropdown-btn
{
background-color
:
$white-light
;
background-color
:
$white-light
;
}
}
.clone-options-dropdown
{
min-width
:
240px
;
}
}
}
.project-repo-buttons
{
.project-repo-buttons
{
...
...
app/helpers/application_settings_helper.rb
View file @
2e2f0675
...
@@ -30,9 +30,9 @@ module ApplicationSettingsHelper
...
@@ -30,9 +30,9 @@ module ApplicationSettingsHelper
def
enabled_project_button
(
project
,
protocol
)
def
enabled_project_button
(
project
,
protocol
)
case
protocol
case
protocol
when
'ssh'
when
'ssh'
ssh_clone_button
(
project
,
'bottom'
,
append_link:
false
)
ssh_clone_button
(
project
,
append_link:
false
)
else
else
http_clone_button
(
project
,
'bottom'
,
append_link:
false
)
http_clone_button
(
project
,
append_link:
false
)
end
end
end
end
...
...
app/helpers/button_helper.rb
View file @
2e2f0675
...
@@ -56,7 +56,7 @@ module ButtonHelper
...
@@ -56,7 +56,7 @@ module ButtonHelper
end
end
end
end
def
http_clone_button
(
project
,
placement
=
'right'
,
append_link:
true
)
def
http_clone_button
(
project
,
append_link:
true
)
protocol
=
gitlab_config
.
protocol
.
upcase
protocol
=
gitlab_config
.
protocol
.
upcase
protocol_description
=
protocol_description
=
...
@@ -79,7 +79,7 @@ module ButtonHelper
...
@@ -79,7 +79,7 @@ module ButtonHelper
end
end
def
ssh_clone_button
(
project
,
append_link:
true
)
def
ssh_clone_button
(
project
,
append_link:
true
)
ssh_description
=
_
(
'Add an SSH key to your profile to pull or push via SSH.'
)
ssh_description
=
_
(
"You won't be able to pull or push project code via SSH until you add an SSH key to your profile"
)
ssh_element_output
=
content_tag
(
:strong
,
'SSH'
,
class:
'dropdown-menu-inner-title'
)
ssh_element_output
=
content_tag
(
:strong
,
'SSH'
,
class:
'dropdown-menu-inner-title'
)
ssh_element_output
<<
content_tag
(
:span
,
ssh_description
,
class:
'dropdown-menu-inner-content'
)
if
current_user
.
try
(
:require_ssh_key?
)
ssh_element_output
<<
content_tag
(
:span
,
ssh_description
,
class:
'dropdown-menu-inner-content'
)
if
current_user
.
try
(
:require_ssh_key?
)
...
...
spec/helpers/button_helper_spec.rb
View file @
2e2f0675
...
@@ -26,9 +26,10 @@ describe ButtonHelper do
...
@@ -26,9 +26,10 @@ describe ButtonHelper do
context
'when user has password automatically set'
do
context
'when user has password automatically set'
do
let
(
:user
)
{
create
(
:user
,
password_automatically_set:
true
)
}
let
(
:user
)
{
create
(
:user
,
password_automatically_set:
true
)
}
it
'shows a password tooltip'
do
it
'shows the password text on the dropdown'
do
expect
(
element
.
attr
(
'class'
)).
to
include
(
has_tooltip_class
)
expect
(
element
.
children
.
length
).
to
eq
(
2
)
expect
(
element
.
attr
(
'data-title'
)).
to
eq
(
'Set a password on your account to pull or push via HTTP.'
)
expect
(
element
.
children
[
1
].
name
).
to
eq
(
'span'
)
expect
(
element
.
children
[
1
].
children
[
0
].
text
).
to
eq
(
'Set a password on your account to pull or push via HTTP.'
)
end
end
end
end
end
end
...
@@ -40,8 +41,9 @@ describe ButtonHelper do
...
@@ -40,8 +41,9 @@ describe ButtonHelper do
context
'when user has no personal access tokens'
do
context
'when user has no personal access tokens'
do
it
'has a personal access token tooltip '
do
it
'has a personal access token tooltip '
do
expect
(
element
.
attr
(
'class'
)).
to
include
(
has_tooltip_class
)
expect
(
element
.
children
.
length
).
to
eq
(
2
)
expect
(
element
.
attr
(
'data-title'
)).
to
eq
(
'Create a personal access token on your account to pull or push via HTTP.'
)
expect
(
element
.
children
[
1
].
name
).
to
eq
(
'span'
)
expect
(
element
.
children
[
1
].
children
[
0
].
text
).
to
eq
(
'Create a personal access token on your account to pull or push via HTTP.'
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment