Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
e7a6531b
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,发现更多精彩内容 >>
未验证
提交
e7a6531b
编写于
1月 18, 2018
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move archived component to vue file
上级
d7c7061a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
60 addition
and
39 deletion
+60
-39
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.js
...ge_request_widget/components/states/mr_widget_archived.js
+0
-26
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.vue
...e_request_widget/components/states/mr_widget_archived.vue
+31
-0
app/assets/javascripts/vue_merge_request_widget/dependencies.js
...sets/javascripts/vue_merge_request_widget/dependencies.js
+1
-1
app/assets/javascripts/vue_merge_request_widget/index.js
app/assets/javascripts/vue_merge_request_widget/index.js
+3
-0
spec/javascripts/vue_mr_widget/components/states/mr_widget_archived_spec.js
...ue_mr_widget/components/states/mr_widget_archived_spec.js
+25
-12
未找到文件。
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.js
已删除
100644 → 0
浏览文件 @
d7c7061a
import
statusIcon
from
'
../mr_widget_status_icon
'
;
export
default
{
name
:
'
MRWidgetArchived
'
,
components
:
{
statusIcon
,
},
template
:
`
<div class="mr-widget-body media">
<div class="space-children">
<status-icon status="failed" />
<button
type="button"
class="btn btn-success btn-sm"
disabled="true">
Merge
</button>
</div>
<div class="media-body">
<span class="bold">
This project is archived, write access has been disabled
</span>
</div>
</div>
`
,
};
app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_archived.vue
0 → 100644
浏览文件 @
e7a6531b
<
script
>
import
statusIcon
from
'
../mr_widget_status_icon
'
;
export
default
{
name
:
'
MRWidgetArchived
'
,
components
:
{
statusIcon
,
},
};
</
script
>
<
template
>
<div
class=
"mr-widget-body media"
>
<div
class=
"space-children"
>
<status-icon
status=
"failed"
/>
<button
type=
"button"
class=
"btn btn-success btn-sm"
disabled=
"true"
>
{{
s__
(
"
mrWidget|Merge
"
)
}}
</button>
</div>
<div
class=
"media-body"
>
<span
class=
"bold"
>
{{
s__
(
"
mrWidget|This project is archived, write access has been disabled
"
)
}}
</span>
</div>
</div>
</
template
>
app/assets/javascripts/vue_merge_request_widget/dependencies.js
浏览文件 @
e7a6531b
...
...
@@ -21,7 +21,7 @@ export { default as FailedToMerge } from './components/states/mr_widget_failed_t
export
{
default
as
ClosedState
}
from
'
./components/states/mr_widget_closed
'
;
export
{
default
as
MergingState
}
from
'
./components/states/mr_widget_merging
'
;
export
{
default
as
WipState
}
from
'
./components/states/mr_widget_wip
'
;
export
{
default
as
ArchivedState
}
from
'
./components/states/mr_widget_archived
'
;
export
{
default
as
ArchivedState
}
from
'
./components/states/mr_widget_archived
.vue
'
;
export
{
default
as
ConflictsState
}
from
'
./components/states/mr_widget_conflicts
'
;
export
{
default
as
NothingToMergeState
}
from
'
./components/states/mr_widget_nothing_to_merge
'
;
export
{
default
as
MissingBranchState
}
from
'
./components/states/mr_widget_missing_branch
'
;
...
...
app/assets/javascripts/vue_merge_request_widget/index.js
浏览文件 @
e7a6531b
...
...
@@ -2,6 +2,9 @@ import {
Vue
,
mrWidgetOptions
,
}
from
'
./dependencies
'
;
import
Translate
from
'
../vue_shared/translate
'
;
Vue
.
use
(
Translate
);
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
gl
.
mrWidgetData
.
gitlabLogo
=
gon
.
gitlab_logo
;
...
...
spec/javascripts/vue_mr_widget/components/states/mr_widget_archived_spec.js
浏览文件 @
e7a6531b
import
Vue
from
'
vue
'
;
import
archivedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_archived
'
;
import
archivedComponent
from
'
~/vue_merge_request_widget/components/states/mr_widget_archived.vue
'
;
import
mountComponent
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
MRWidgetArchived
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
it
(
'
should have correct elements
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
archivedComponent
);
const
el
=
new
Component
({
el
:
document
.
createElement
(
'
div
'
),
}).
$el
;
let
vm
;
expect
(
el
.
classList
.
contains
(
'
mr-widget-body
'
)).
toBeTruthy
();
expect
(
el
.
querySelector
(
'
button
'
).
classList
.
contains
(
'
btn-success
'
)).
toBeTruthy
();
expect
(
el
.
querySelector
(
'
button
'
).
disabled
).
toBeTruthy
();
expect
(
el
.
innerText
).
toContain
(
'
This project is archived, write access has been disabled
'
);
});
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
archivedComponent
);
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders a ci status failed icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ci-status-icon
'
)).
not
.
toBeNull
();
});
it
(
'
renders a disabled button
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
getAttribute
(
'
disabled
'
)).
toEqual
(
'
disabled
'
);
expect
(
vm
.
$el
.
querySelector
(
'
button
'
).
textContent
.
trim
()).
toEqual
(
'
Merge
'
);
});
it
(
'
renders information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.bold
'
).
textContent
.
trim
(),
).
toEqual
(
'
This project is archived, write access has been disabled
'
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录