Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6243c04e
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,发现更多精彩内容 >>
未验证
提交
6243c04e
编写于
1月 22, 2019
作者:
F
Fatih Acet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix failing specs and lint errors.
上级
10649c49
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
58 addition
and
16 deletion
+58
-16
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+7
-1
app/assets/javascripts/issue_show/components/description.vue
app/assets/javascripts/issue_show/components/description.vue
+5
-2
app/assets/javascripts/task_list.js
app/assets/javascripts/task_list.js
+11
-9
spec/javascripts/issue_show/components/description_spec.js
spec/javascripts/issue_show/components/description_spec.js
+3
-0
spec/javascripts/merge_request_spec.js
spec/javascripts/merge_request_spec.js
+15
-2
spec/javascripts/notes_spec.js
spec/javascripts/notes_spec.js
+17
-2
未找到文件。
app/assets/javascripts/issue_show/components/app.vue
浏览文件 @
6243c04e
...
...
@@ -214,10 +214,16 @@ export default {
},
updateStoreState
()
{
this
.
service
.
getData
()
this
.
service
.
getData
()
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
{
this
.
store
.
updateState
(
data
);
})
.
catch
(()
=>
{
const
errMsg
=
`Error updating
${
this
.
issuableType
}
`
;
window
.
Flash
(
errMsg
);
});
},
...
...
app/assets/javascripts/issue_show/components/description.vue
浏览文件 @
6243c04e
...
...
@@ -39,6 +39,7 @@ export default {
lockVersion
:
{
type
:
Number
,
required
:
false
,
default
:
0
,
},
},
data
()
{
...
...
@@ -89,8 +90,10 @@ export default {
}
},
taskListUpdateError
({
errors
,
data
})
{
createFlash
(
'
Someone edited this issue at the same time you did and we updated the issue description.
'
);
taskListUpdateError
()
{
createFlash
(
'
Someone edited this issue at the same time you did and we updated the issue description.
'
,
);
this
.
$emit
(
'
taskListUpdateFailed
'
);
},
...
...
app/assets/javascripts/task_list.js
浏览文件 @
6243c04e
...
...
@@ -10,15 +10,17 @@ export default class TaskList {
this
.
fieldName
=
options
.
fieldName
;
this
.
lockVersion
=
options
.
lockVersion
;
this
.
onSuccess
=
options
.
onSuccess
||
(()
=>
{});
this
.
onError
=
options
.
onError
||
function
showFlash
(
e
)
{
let
errorMessages
=
''
;
this
.
onError
=
options
.
onError
||
function
showFlash
(
e
)
{
let
errorMessages
=
''
;
if
(
e
.
response
.
data
&&
typeof
e
.
response
.
data
===
'
object
'
)
{
errorMessages
=
e
.
response
.
data
.
errors
.
join
(
'
'
);
}
if
(
e
.
response
.
data
&&
typeof
e
.
response
.
data
===
'
object
'
)
{
errorMessages
=
e
.
response
.
data
.
errors
.
join
(
'
'
);
}
return
new
Flash
(
errorMessages
||
'
Update failed
'
,
'
alert
'
);
};
return
new
Flash
(
errorMessages
||
'
Update failed
'
,
'
alert
'
);
};
this
.
init
();
}
...
...
@@ -56,8 +58,8 @@ export default class TaskList {
[
this
.
fieldName
]:
$target
.
val
(),
lock_version
:
this
.
lockVersion
,
update_task
:
{
index
:
index
,
checked
:
checked
,
index
,
checked
,
line_number
:
lineNumber
,
line_source
:
lineSource
,
},
...
...
spec/javascripts/issue_show/components/description_spec.js
浏览文件 @
6243c04e
...
...
@@ -123,7 +123,10 @@ describe('Description component', () => {
fieldName
:
'
description
'
,
selector
:
'
.detail-page-description
'
,
onSuccess
:
jasmine
.
any
(
Function
),
onError
:
jasmine
.
any
(
Function
),
lockVersion
:
0
,
});
done
();
});
});
...
...
spec/javascripts/merge_request_spec.js
浏览文件 @
6243c04e
...
...
@@ -41,15 +41,28 @@ describe('MergeRequest', function() {
});
it
(
'
submits an ajax request on tasklist:changed
'
,
done
=>
{
$
(
'
.js-task-list-field
'
).
trigger
(
'
tasklist:changed
'
);
const
lineNumber
=
8
;
const
lineSource
=
'
- [ ] item 8
'
;
const
index
=
3
;
const
checked
=
true
;
$
(
'
.js-task-list-field
'
).
trigger
({
type
:
'
tasklist:changed
'
,
detail
:
{
lineNumber
,
lineSource
,
index
,
checked
},
});
setTimeout
(()
=>
{
expect
(
axios
.
patch
).
toHaveBeenCalledWith
(
`
${
gl
.
TEST_HOST
}
/frontend-fixtures/merge-requests-project/merge_requests/1.json`
,
{
merge_request
:
{
description
:
'
- [ ] Task List Item
'
},
merge_request
:
{
description
:
'
- [ ] Task List Item
'
,
lock_version
:
undefined
,
update_task
:
{
line_number
:
lineNumber
,
line_source
:
lineSource
,
index
,
checked
},
},
},
);
done
();
});
});
...
...
spec/javascripts/notes_spec.js
浏览文件 @
6243c04e
...
...
@@ -89,10 +89,25 @@ describe('Notes', function() {
});
it
(
'
submits an ajax request on tasklist:changed
'
,
function
(
done
)
{
$
(
'
.js-task-list-container
'
).
trigger
(
'
tasklist:changed
'
);
const
lineNumber
=
8
;
const
lineSource
=
'
- [ ] item 8
'
;
const
index
=
3
;
const
checked
=
true
;
$
(
'
.js-task-list-container
'
).
trigger
({
type
:
'
tasklist:changed
'
,
detail
:
{
lineNumber
,
lineSource
,
index
,
checked
},
});
setTimeout
(()
=>
{
expect
(
axios
.
patch
).
toHaveBeenCalled
();
expect
(
axios
.
patch
).
toHaveBeenCalledWith
(
undefined
,
{
note
:
{
note
:
''
,
lock_version
:
undefined
,
update_task
:
{
index
,
checked
,
line_number
:
lineNumber
,
line_source
:
lineSource
},
},
});
done
();
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录