Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6243c04e
Commit
6243c04e
authored
Jan 22, 2019
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing specs and lint errors.
parent
10649c49
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
16 deletions
+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
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
6243c04e
...
@@ -214,10 +214,16 @@ export default {
...
@@ -214,10 +214,16 @@ export default {
},
},
updateStoreState
()
{
updateStoreState
()
{
this
.
service
.
getData
()
this
.
service
.
getData
()
.
then
(
res
=>
res
.
data
)
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
{
.
then
(
data
=>
{
this
.
store
.
updateState
(
data
);
this
.
store
.
updateState
(
data
);
})
.
catch
(()
=>
{
const
errMsg
=
`Error updating
${
this
.
issuableType
}
`
;
window
.
Flash
(
errMsg
);
});
});
},
},
...
...
app/assets/javascripts/issue_show/components/description.vue
View file @
6243c04e
...
@@ -39,6 +39,7 @@ export default {
...
@@ -39,6 +39,7 @@ export default {
lockVersion
:
{
lockVersion
:
{
type
:
Number
,
type
:
Number
,
required
:
false
,
required
:
false
,
default
:
0
,
},
},
},
},
data
()
{
data
()
{
...
@@ -89,8 +90,10 @@ export default {
...
@@ -89,8 +90,10 @@ export default {
}
}
},
},
taskListUpdateError
({
errors
,
data
})
{
taskListUpdateError
()
{
createFlash
(
'
Someone edited this issue at the same time you did and we updated the issue description.
'
);
createFlash
(
'
Someone edited this issue at the same time you did and we updated the issue description.
'
,
);
this
.
$emit
(
'
taskListUpdateFailed
'
);
this
.
$emit
(
'
taskListUpdateFailed
'
);
},
},
...
...
app/assets/javascripts/task_list.js
View file @
6243c04e
...
@@ -10,7 +10,9 @@ export default class TaskList {
...
@@ -10,7 +10,9 @@ export default class TaskList {
this
.
fieldName
=
options
.
fieldName
;
this
.
fieldName
=
options
.
fieldName
;
this
.
lockVersion
=
options
.
lockVersion
;
this
.
lockVersion
=
options
.
lockVersion
;
this
.
onSuccess
=
options
.
onSuccess
||
(()
=>
{});
this
.
onSuccess
=
options
.
onSuccess
||
(()
=>
{});
this
.
onError
=
options
.
onError
||
function
showFlash
(
e
)
{
this
.
onError
=
options
.
onError
||
function
showFlash
(
e
)
{
let
errorMessages
=
''
;
let
errorMessages
=
''
;
if
(
e
.
response
.
data
&&
typeof
e
.
response
.
data
===
'
object
'
)
{
if
(
e
.
response
.
data
&&
typeof
e
.
response
.
data
===
'
object
'
)
{
...
@@ -56,8 +58,8 @@ export default class TaskList {
...
@@ -56,8 +58,8 @@ export default class TaskList {
[
this
.
fieldName
]:
$target
.
val
(),
[
this
.
fieldName
]:
$target
.
val
(),
lock_version
:
this
.
lockVersion
,
lock_version
:
this
.
lockVersion
,
update_task
:
{
update_task
:
{
index
:
index
,
index
,
checked
:
checked
,
checked
,
line_number
:
lineNumber
,
line_number
:
lineNumber
,
line_source
:
lineSource
,
line_source
:
lineSource
,
},
},
...
...
spec/javascripts/issue_show/components/description_spec.js
View file @
6243c04e
...
@@ -123,7 +123,10 @@ describe('Description component', () => {
...
@@ -123,7 +123,10 @@ describe('Description component', () => {
fieldName
:
'
description
'
,
fieldName
:
'
description
'
,
selector
:
'
.detail-page-description
'
,
selector
:
'
.detail-page-description
'
,
onSuccess
:
jasmine
.
any
(
Function
),
onSuccess
:
jasmine
.
any
(
Function
),
onError
:
jasmine
.
any
(
Function
),
lockVersion
:
0
,
});
});
done
();
done
();
});
});
});
});
...
...
spec/javascripts/merge_request_spec.js
View file @
6243c04e
...
@@ -41,15 +41,28 @@ describe('MergeRequest', function() {
...
@@ -41,15 +41,28 @@ describe('MergeRequest', function() {
});
});
it
(
'
submits an ajax request on tasklist:changed
'
,
done
=>
{
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
(()
=>
{
setTimeout
(()
=>
{
expect
(
axios
.
patch
).
toHaveBeenCalledWith
(
expect
(
axios
.
patch
).
toHaveBeenCalledWith
(
`
${
gl
.
TEST_HOST
}
/frontend-fixtures/merge-requests-project/merge_requests/1.json`
,
`
${
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
();
done
();
});
});
});
});
...
...
spec/javascripts/notes_spec.js
View file @
6243c04e
...
@@ -89,10 +89,25 @@ describe('Notes', function() {
...
@@ -89,10 +89,25 @@ describe('Notes', function() {
});
});
it
(
'
submits an ajax request on tasklist:changed
'
,
function
(
done
)
{
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
(()
=>
{
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
();
done
();
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment