Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ebf22493
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,发现更多精彩内容 >>
提交
ebf22493
编写于
11月 29, 2017
作者:
K
Kushal Pandya
提交者:
Phil Hughes
11月 29, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix item name and namespace text overflow in Projects dropdown
上级
a2fea928
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
3 deletion
+40
-3
app/assets/javascripts/projects_dropdown/components/projects_list_item.vue
...ripts/projects_dropdown/components/projects_list_item.vue
+22
-3
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+1
-0
changelogs/unreleased/39827-fix-projects-dropdown-overflow.yml
...elogs/unreleased/39827-fix-projects-dropdown-overflow.yml
+5
-0
spec/javascripts/projects_dropdown/components/projects_list_item_spec.js
...s/projects_dropdown/components/projects_list_item_spec.js
+12
-0
未找到文件。
app/assets/javascripts/projects_dropdown/components/projects_list_item.vue
浏览文件 @
ebf22493
...
@@ -48,6 +48,27 @@ export default {
...
@@ -48,6 +48,27 @@ export default {
}
}
return
this
.
projectName
;
return
this
.
projectName
;
},
},
/**
* Smartly truncates project namespace by doing two things;
* 1. Only include Group names in path by removing project name
* 2. Only include first and last group names in the path
* when namespace has more than 2 groups present
*
* First part (removal of project name from namespace) can be
* done from backend but doing so involves migration of
* existing project namespaces which is not wise thing to do.
*/
truncatedNamespace
()
{
const
namespaceArr
=
this
.
namespace
.
split
(
'
/
'
);
namespaceArr
.
splice
(
-
1
,
1
);
let
namespace
=
namespaceArr
.
join
(
'
/
'
);
if
(
namespaceArr
.
length
>
2
)
{
namespace
=
`
${
namespaceArr
[
0
]}
/ ... /
${
namespaceArr
.
pop
()}
`
;
}
return
namespace
;
},
},
},
};
};
</
script
>
</
script
>
...
@@ -87,9 +108,7 @@ export default {
...
@@ -87,9 +108,7 @@ export default {
<div
<div
class=
"project-namespace"
class=
"project-namespace"
:title=
"namespace"
:title=
"namespace"
>
>
{{
truncatedNamespace
}}
</div>
{{
namespace
}}
</div>
</div>
</div>
</a>
</a>
</li>
</li>
...
...
app/assets/stylesheets/framework/dropdowns.scss
浏览文件 @
ebf22493
...
@@ -1002,6 +1002,7 @@ header.header-content .dropdown-menu.projects-dropdown-menu {
...
@@ -1002,6 +1002,7 @@ header.header-content .dropdown-menu.projects-dropdown-menu {
max-width
:
250px
;
max-width
:
250px
;
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
}
&
:hover
{
&
:hover
{
...
...
changelogs/unreleased/39827-fix-projects-dropdown-overflow.yml
0 → 100644
浏览文件 @
ebf22493
---
title
:
Fix item name and namespace text overflow in Projects dropdown
merge_request
:
15451
author
:
type
:
fixed
spec/javascripts/projects_dropdown/components/projects_list_item_spec.js
浏览文件 @
ebf22493
...
@@ -50,6 +50,18 @@ describe('ProjectsListItemComponent', () => {
...
@@ -50,6 +50,18 @@ describe('ProjectsListItemComponent', () => {
expect
(
vm
.
highlightedProjectName
).
toBe
(
mockProject
.
name
);
expect
(
vm
.
highlightedProjectName
).
toBe
(
mockProject
.
name
);
});
});
});
});
describe
(
'
truncatedNamespace
'
,
()
=>
{
it
(
'
should truncate project name from namespace string
'
,
()
=>
{
vm
.
namespace
=
'
platform / nokia-3310
'
;
expect
(
vm
.
truncatedNamespace
).
toBe
(
'
platform
'
);
});
it
(
'
should truncate namespace string from the middle if it includes more than two groups in path
'
,
()
=>
{
vm
.
namespace
=
'
platform / hardware / broadcom / Wifi Group / Mobile Chipset / nokia-3310
'
;
expect
(
vm
.
truncatedNamespace
).
toBe
(
'
platform / ... / Mobile Chipset
'
);
});
});
});
});
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录