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
Boxiang Sun
gitlab-ce
Commits
2ed90c45
Commit
2ed90c45
authored
Dec 27, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '18786-go-to-a-project-order' into 'master'
Go to a project order Closes #18786 See merge request !7737
parents
ae51027d
75060b93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
3 deletions
+9
-3
app/assets/javascripts/project_select.js
app/assets/javascripts/project_select.js
+2
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
changelogs/unreleased/18786-go-to-a-project-order.yml
changelogs/unreleased/18786-go-to-a-project-order.yml
+4
-0
spec/javascripts/fixtures/project_title.html.haml
spec/javascripts/fixtures/project_title.html.haml
+1
-1
spec/javascripts/project_title_spec.js
spec/javascripts/project_title_spec.js
+1
-0
No files found.
app/assets/javascripts/project_select.js
View file @
2ed90c45
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
},
},
data
:
function
(
term
,
callback
)
{
data
:
function
(
term
,
callback
)
{
var
finalCallback
,
projectsCallback
;
var
finalCallback
,
projectsCallback
;
var
orderBy
=
$dropdown
.
data
(
'
order-by
'
);
finalCallback
=
function
(
projects
)
{
finalCallback
=
function
(
projects
)
{
return
callback
(
projects
);
return
callback
(
projects
);
};
};
...
@@ -34,7 +35,7 @@
...
@@ -34,7 +35,7 @@
if
(
this
.
groupId
)
{
if
(
this
.
groupId
)
{
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
projectsCallback
);
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
projectsCallback
);
}
else
{
}
else
{
return
Api
.
projects
(
term
,
this
.
orderBy
,
projectsCallback
);
return
Api
.
projects
(
term
,
orderBy
,
projectsCallback
);
}
}
},
},
url
:
function
(
project
)
{
url
:
function
(
project
)
{
...
...
app/helpers/projects_helper.rb
View file @
2ed90c45
...
@@ -61,7 +61,7 @@ module ProjectsHelper
...
@@ -61,7 +61,7 @@ module ProjectsHelper
project_link
=
link_to
simple_sanitize
(
project
.
name
),
project_path
(
project
),
{
class:
"project-item-select-holder"
}
project_link
=
link_to
simple_sanitize
(
project
.
name
),
project_path
(
project
),
{
class:
"project-item-select-holder"
}
if
current_user
if
current_user
project_link
<<
button_tag
(
type:
'button'
,
class:
"dropdown-toggle-caret js-projects-dropdown-toggle"
,
aria:
{
label:
"Toggle switch project dropdown"
},
data:
{
target:
".js-dropdown-menu-projects"
,
toggle:
"dropdown"
})
do
project_link
<<
button_tag
(
type:
'button'
,
class:
'dropdown-toggle-caret js-projects-dropdown-toggle'
,
aria:
{
label:
'Toggle switch project dropdown'
},
data:
{
target:
'.js-dropdown-menu-projects'
,
toggle:
'dropdown'
,
order_by:
'last_activity_at'
})
do
icon
(
"chevron-down"
)
icon
(
"chevron-down"
)
end
end
end
end
...
...
changelogs/unreleased/18786-go-to-a-project-order.yml
0 → 100644
View file @
2ed90c45
---
title
:
Go to a project order
merge_request
:
7737
author
:
Jacopo Beschi @jacopo-beschi
spec/javascripts/fixtures/project_title.html.haml
View file @
2ed90c45
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
GitLab Org
GitLab Org
%a
.project-item-select-holder
{
href:
"/gitlab-org/gitlab-test"
}
%a
.project-item-select-holder
{
href:
"/gitlab-org/gitlab-test"
}
GitLab Test
GitLab Test
%i
.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle
{
"data-toggle"
=>
"dropdown"
,
"data-target"
=>
".header-content"
}
%i
.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle
{
"data-toggle"
=>
"dropdown"
,
"data-target"
=>
".header-content"
,
"data-order-by"
=>
"last_activity_at"
}
.js-dropdown-menu-projects
.js-dropdown-menu-projects
.dropdown-menu.dropdown-select.dropdown-menu-projects
.dropdown-menu.dropdown-select.dropdown-menu-projects
.dropdown-title
.dropdown-title
...
...
spec/javascripts/project_title_spec.js
View file @
2ed90c45
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
var
fakeAjaxResponse
=
function
fakeAjaxResponse
(
req
)
{
var
fakeAjaxResponse
=
function
fakeAjaxResponse
(
req
)
{
var
d
;
var
d
;
expect
(
req
.
url
).
toBe
(
'
/api/v3/projects.json?simple=true
'
);
expect
(
req
.
url
).
toBe
(
'
/api/v3/projects.json?simple=true
'
);
expect
(
req
.
data
).
toEqual
({
search
:
''
,
order_by
:
'
last_activity_at
'
,
per_page
:
20
});
d
=
$
.
Deferred
();
d
=
$
.
Deferred
();
d
.
resolve
(
this
.
projects_data
);
d
.
resolve
(
this
.
projects_data
);
return
d
.
promise
();
return
d
.
promise
();
...
...
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