Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
2ed90c45
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2ed90c45
编写于
12月 27, 2016
作者:
A
Alfredo Sumaran
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '18786-go-to-a-project-order' into 'master'
Go to a project order Closes #18786 See merge request !7737
上级
ae51027d
75060b93
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
3 deletion
+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
未找到文件。
app/assets/javascripts/project_select.js
浏览文件 @
2ed90c45
...
...
@@ -15,6 +15,7 @@
},
data
:
function
(
term
,
callback
)
{
var
finalCallback
,
projectsCallback
;
var
orderBy
=
$dropdown
.
data
(
'
order-by
'
);
finalCallback
=
function
(
projects
)
{
return
callback
(
projects
);
};
...
...
@@ -34,7 +35,7 @@
if
(
this
.
groupId
)
{
return
Api
.
groupProjects
(
this
.
groupId
,
term
,
projectsCallback
);
}
else
{
return
Api
.
projects
(
term
,
this
.
orderBy
,
projectsCallback
);
return
Api
.
projects
(
term
,
orderBy
,
projectsCallback
);
}
},
url
:
function
(
project
)
{
...
...
app/helpers/projects_helper.rb
浏览文件 @
2ed90c45
...
...
@@ -61,7 +61,7 @@ module ProjectsHelper
project_link
=
link_to
simple_sanitize
(
project
.
name
),
project_path
(
project
),
{
class:
"project-item-select-holder"
}
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"
)
end
end
...
...
changelogs/unreleased/18786-go-to-a-project-order.yml
0 → 100644
浏览文件 @
2ed90c45
---
title
:
Go to a project order
merge_request
:
7737
author
:
Jacopo Beschi @jacopo-beschi
spec/javascripts/fixtures/project_title.html.haml
浏览文件 @
2ed90c45
...
...
@@ -4,7 +4,7 @@
GitLab Org
%a
.project-item-select-holder
{
href:
"/gitlab-org/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
.dropdown-menu.dropdown-select.dropdown-menu-projects
.dropdown-title
...
...
spec/javascripts/project_title_spec.js
浏览文件 @
2ed90c45
...
...
@@ -26,6 +26,7 @@
var
fakeAjaxResponse
=
function
fakeAjaxResponse
(
req
)
{
var
d
;
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
.
resolve
(
this
.
projects_data
);
return
d
.
promise
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录