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
Hide 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 {
},
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
();
});
});
...
...
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