Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9e93ea8e
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,发现更多精彩内容 >>
未验证
提交
9e93ea8e
编写于
6月 24, 2019
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove baseEndpoint from search dropdwon
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
88c8d177
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
15 addition
and
15 deletion
+15
-15
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
...avascripts/filtered_search/available_dropdown_mappings.js
+3
-3
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
...ripts/filtered_search/filtered_search_dropdown_manager.js
+3
-3
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+2
-1
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+2
-3
app/views/admin/runners/index.html.haml
app/views/admin/runners/index.html.haml
+1
-1
spec/helpers/search_helper_spec.rb
spec/helpers/search_helper_spec.rb
+3
-3
spec/javascripts/filtered_search/visual_token_value_spec.js
spec/javascripts/filtered_search/visual_token_value_spec.js
+1
-1
未找到文件。
app/assets/javascripts/filtered_search/available_dropdown_mappings.js
浏览文件 @
9e93ea8e
...
...
@@ -10,7 +10,7 @@ import { mergeUrlParams } from '../lib/utils/url_utility';
export
default
class
AvailableDropdownMappings
{
constructor
(
container
,
base
Endpoint
,
runnerTags
Endpoint
,
labelsEndpoint
,
milestonesEndpoint
,
groupsOnly
,
...
...
@@ -18,7 +18,7 @@ export default class AvailableDropdownMappings {
includeDescendantGroups
,
)
{
this
.
container
=
container
;
this
.
baseEndpoint
=
base
Endpoint
;
this
.
runnerTagsEndpoint
=
runnerTags
Endpoint
;
this
.
labelsEndpoint
=
labelsEndpoint
;
this
.
milestonesEndpoint
=
milestonesEndpoint
;
this
.
groupsOnly
=
groupsOnly
;
...
...
@@ -149,7 +149,7 @@ export default class AvailableDropdownMappings {
}
getRunnerTagsEndpoint
()
{
return
`
${
this
.
baseEndpoint
}
/admin/runners/tag_list
.json`
;
return
`
${
this
.
runnerTagsEndpoint
}
.json`
;
}
getMergeRequestTargetBranchesEndpoint
()
{
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
浏览文件 @
9e93ea8e
...
...
@@ -8,7 +8,7 @@ import FilteredSearchVisualTokens from './filtered_search_visual_tokens';
export
default
class
FilteredSearchDropdownManager
{
constructor
({
base
Endpoint
=
''
,
runnerTags
Endpoint
=
''
,
labelsEndpoint
=
''
,
milestonesEndpoint
=
''
,
tokenizer
,
...
...
@@ -19,7 +19,7 @@ export default class FilteredSearchDropdownManager {
filteredSearchTokenKeys
,
})
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
baseEndpoint
=
base
Endpoint
.
replace
(
/
\/
$/
,
''
);
this
.
runnerTagsEndpoint
=
runnerTags
Endpoint
.
replace
(
/
\/
$/
,
''
);
this
.
labelsEndpoint
=
labelsEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
milestonesEndpoint
=
milestonesEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
tokenizer
=
tokenizer
;
...
...
@@ -51,7 +51,7 @@ export default class FilteredSearchDropdownManager {
const
supportedTokens
=
this
.
filteredSearchTokenKeys
.
getKeys
();
const
availableMappings
=
new
AvailableDropdownMappings
(
this
.
container
,
this
.
base
Endpoint
,
this
.
runnerTags
Endpoint
,
this
.
labelsEndpoint
,
this
.
milestonesEndpoint
,
this
.
groupsOnly
,
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js
浏览文件 @
9e93ea8e
...
...
@@ -85,7 +85,8 @@ export default class FilteredSearchManager {
if
(
this
.
filteredSearchInput
)
{
this
.
tokenizer
=
FilteredSearchTokenizer
;
this
.
dropdownManager
=
new
FilteredSearchDropdownManager
({
baseEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-base-endpoint
'
)
||
''
,
runnerTagsEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-runner-tags-endpoint
'
)
||
''
,
labelsEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-labels-endpoint
'
)
||
''
,
milestonesEndpoint
:
this
.
filteredSearchInput
.
getAttribute
(
'
data-milestones-endpoint
'
)
||
''
,
tokenizer
:
this
.
tokenizer
,
...
...
app/helpers/search_helper.rb
浏览文件 @
9e93ea8e
...
...
@@ -169,18 +169,17 @@ module SearchHelper
autocomplete:
'off'
}
opts
[
:data
][
'runner-tags-endpoint'
]
=
tag_list_admin_runners_path
if
@project
.
present?
opts
[
:data
][
'project-id'
]
=
@project
.
id
opts
[
:data
][
'base-endpoint'
]
=
project_path
(
@project
)
opts
[
:data
][
'labels-endpoint'
]
=
project_labels_path
(
@project
)
opts
[
:data
][
'milestones-endpoint'
]
=
project_milestones_path
(
@project
)
elsif
@group
.
present?
opts
[
:data
][
'group-id'
]
=
@group
.
id
opts
[
:data
][
'base-endpoint'
]
=
group_canonical_path
(
@group
)
opts
[
:data
][
'labels-endpoint'
]
=
group_labels_path
(
@group
)
opts
[
:data
][
'milestones-endpoint'
]
=
group_milestones_path
(
@group
)
else
opts
[
:data
][
'base-endpoint'
]
=
root_dashboard_path
opts
[
:data
][
'labels-endpoint'
]
=
dashboard_labels_path
opts
[
:data
][
'milestones-endpoint'
]
=
dashboard_milestones_path
end
...
...
app/views/admin/runners/index.html.haml
浏览文件 @
9e93ea8e
...
...
@@ -58,7 +58,7 @@
.scroll-container
%ul
.tokens-container.list-unstyled
%li
.input-token
%input
.form-control.filtered-search
{
{
id:
'filtered-search-runners'
,
placeholder:
_
(
'Search or filter results...'
)
}
}
%input
.form-control.filtered-search
{
search_filter_input_options
(
'runners'
)
}
#js-dropdown-hint
.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
action:
'submit'
}
}
...
...
spec/helpers/search_helper_spec.rb
浏览文件 @
9e93ea8e
...
...
@@ -114,7 +114,7 @@ describe SearchHelper do
end
it
'includes project endpoints'
do
expect
(
search_filter_input_options
(
''
)[
:data
][
'
base-endpoint'
]).
to
eq
(
project_path
(
@project
)
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'
runner-tags-endpoint'
]).
to
eq
(
tag_list_admin_runners_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'labels-endpoint'
]).
to
eq
(
project_labels_path
(
@project
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
project_milestones_path
(
@project
))
end
...
...
@@ -134,7 +134,7 @@ describe SearchHelper do
end
it
'includes group endpoints'
do
expect
(
search_filter_input_options
(
''
)[
:data
][
'
base-endpoint'
]).
to
eq
(
"/groups
#{
group_path
(
@group
)
}
"
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'
runner-tags-endpoint'
]).
to
eq
(
tag_list_admin_runners_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'labels-endpoint'
]).
to
eq
(
group_labels_path
(
@group
))
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
group_milestones_path
(
@group
))
end
...
...
@@ -147,7 +147,7 @@ describe SearchHelper do
end
it
'includes dashboard endpoints'
do
expect
(
search_filter_input_options
(
''
)[
:data
][
'
base-endpoint'
]).
to
eq
(
"/dashboard"
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'
runner-tags-endpoint'
]).
to
eq
(
tag_list_admin_runners_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'labels-endpoint'
]).
to
eq
(
dashboard_labels_path
)
expect
(
search_filter_input_options
(
''
)[
:data
][
'milestones-endpoint'
]).
to
eq
(
dashboard_milestones_path
)
end
...
...
spec/javascripts/filtered_search/visual_token_value_spec.js
浏览文件 @
9e93ea8e
...
...
@@ -155,7 +155,7 @@ describe('Filtered Search Visual Tokens', () => {
`
);
const
filteredSearchInput
=
document
.
querySelector
(
'
.filtered-search
'
);
filteredSearchInput
.
dataset
.
baseEndpoint
=
dummyEndpoint
;
filteredSearchInput
.
dataset
.
runnerTagsEndpoint
=
`
${
dummyEndpoint
}
/admin/runners/tag_list`
;
filteredSearchInput
.
dataset
.
labelsEndpoint
=
`
${
dummyEndpoint
}
/-/labels`
;
filteredSearchInput
.
dataset
.
milestonesEndpoint
=
`
${
dummyEndpoint
}
/-/milestones`
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录