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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
4e679819
Commit
4e679819
authored
Jul 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing tests
parent
efb74875
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
29 deletions
+17
-29
app/assets/javascripts/diff_notes/components/resolve_comment_btn.js.es6
...ascripts/diff_notes/components/resolve_comment_btn.js.es6
+1
-2
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js.es6
...ripts/diff_notes/components/resolve_discussion_btn.js.es6
+2
-3
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
+1
-1
app/assets/javascripts/diff_notes/models/disucssion.js.es6
app/assets/javascripts/diff_notes/models/disucssion.js.es6
+1
-0
app/assets/javascripts/diff_notes/models/note.js.es6
app/assets/javascripts/diff_notes/models/note.js.es6
+0
-0
app/assets/javascripts/diff_notes/services/resolve.js.es6
app/assets/javascripts/diff_notes/services/resolve.js.es6
+8
-9
app/assets/javascripts/diff_notes/stores/comments.js.es6
app/assets/javascripts/diff_notes/stores/comments.js.es6
+0
-3
app/views/projects/notes/_note.html.haml
app/views/projects/notes/_note.html.haml
+2
-1
spec/features/merge_requests/diff_notes_resolve_spec.rb
spec/features/merge_requests/diff_notes_resolve_spec.rb
+2
-10
No files found.
app/assets/javascripts/diff_notes/components/resolve_comment_btn.js.es6
View file @
4e679819
...
...
@@ -5,8 +5,7 @@
},
computed: {
isDiscussionResolved: function () {
const discussion = CommentsStore.state[this.discussionId],
notes = CommentsStore.notesForDiscussion(this.discussionId);
const discussion = CommentsStore.state[this.discussionId];
return discussion.isResolved();
},
...
...
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js.es6
View file @
4e679819
...
...
@@ -11,8 +11,7 @@
},
data: function() {
return {
discussions: CommentsStore.state,
loadingObject: CommentsStore.loading,
discussions: CommentsStore.state
};
},
computed: {
...
...
@@ -27,7 +26,7 @@
}
},
loading: function () {
return this.
loadingObject[this.discussionId]
;
return this.
discussions[this.discussionId].loading
;
}
},
methods: {
...
...
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
View file @
4e679819
...
...
@@ -27,7 +27,7 @@ $(() => {
const $components = $('resolve-btn, resolve-discussion-btn, jump-to-discussion');
if ($components.length) {
$components.each(function () {
DiffNotesApp.$compile($(this).get(0))
DiffNotesApp.$compile($(this).get(0))
;
});
}
}
...
...
app/assets/javascripts/diff_notes/models/disucssion.js.es6
View file @
4e679819
...
...
@@ -2,6 +2,7 @@ class DiscussionModel {
constructor (discussionId) {
this.discussionId = discussionId;
this.notes = {};
this.loading = false;
}
createNote (noteId, resolved, user) {
...
...
app/assets/javascripts/diff_notes/models/note.js
→
app/assets/javascripts/diff_notes/models/note.js
.es6
View file @
4e679819
File moved
app/assets/javascripts/diff_notes/services/resolve.js.es6
View file @
4e679819
...
...
@@ -34,10 +34,12 @@
}
resolveAll(namespace, mergeRequestId, discussionId) {
const discussion = CommentsStore.state[discussionId];
this.setCSRF();
Vue.http.options.root = `/${namespace}`;
CommentsStore.loading[discussionId]
= true;
discussion.loading
= true;
return this.discussionResource.save({
mergeRequestId,
...
...
@@ -45,31 +47,28 @@
}, {}).then((response) => {
const data = response.data;
const user = data ? data.resolved_by : null;
const discussion = CommentsStore.state[discussionId];
discussion.resolveAllNotes(user);
CommentsStore.loading[discussionId] = false;
discussion.loading = false;
this.updateUpdatedHtml(discussionId, data);
});
}
unResolveAll(namespace, mergeRequestId, discussionId) {
const discussion = CommentsStore.state[discussionId];
this.setCSRF();
Vue.http.options.root = `/${namespace}`;
CommentsStore.loading[discussionId]
= true;
discussion.loading
= true;
return this.discussionResource.delete({
mergeRequestId,
discussionId
}, {}).then((response) => {
const data = response.data;
const discussion = CommentsStore.state[discussionId];
discussion.unResolveAllNotes();
CommentsStore.loading[discussionId] = false;
discussion.loading = false;
this.updateUpdatedHtml(discussionId, data);
});
...
...
app/assets/javascripts/diff_notes/stores/comments.js.es6
View file @
4e679819
((w) => {
w.CommentsStore = {
state: {},
loading: {},
get: function (discussionId, noteId) {
return this.state[discussionId].getNote(noteId);
},
...
...
@@ -10,7 +9,6 @@
if (!this.state[discussionId]) {
discussion = new DiscussionModel(discussionId);
Vue.set(this.state, discussionId, discussion);
Vue.set(this.loading, discussionId, false);
}
discussion.createNote(noteId, resolved, user);
...
...
@@ -27,7 +25,6 @@
if (Object.keys(discussion.notes).length === 0) {
Vue.delete(this.state, discussionId);
Vue.delete(this.loading, discussionId);
}
}
};
...
...
app/views/projects/notes/_note.html.haml
View file @
4e679819
...
...
@@ -22,7 +22,7 @@
-
if
access
%span
.note-role.hidden-xs
=
access
-
if
(
note
.
resolvable?
&&
can?
(
current_user
,
:resolve_note
,
note
))
||
(
note
.
resolved?
&&
!
can?
(
current_user
,
:resolve_note
,
note
))
-
if
note
.
resolvable?
%resolve-btn
{
":namespace-path"
=>
"'#{note.project.namespace.path}'"
,
":project-path"
=>
"'#{note.project.path}'"
,
":discussion-id"
=>
"'#{note.discussion_id}'"
,
...
...
@@ -30,6 +30,7 @@
":resolved"
=>
note
.
resolved?
,
":can-resolve"
=>
can?
(
current_user
,
:resolve_note
,
note
),
":resolved-by"
=>
"'#{note.resolved_by.try(:name)}'"
,
"v-show"
=>
"#{(note.resolvable? && can?(current_user, :resolve_note, note)) || (note.resolved? && !can?(current_user, :resolve_note, note))}"
,
"inline-template"
=>
true
,
"v-ref:note_#{note.id}"
=>
true
}
...
...
spec/features/merge_requests/diff_notes_resolve_spec.rb
View file @
4e679819
...
...
@@ -332,11 +332,7 @@ feature 'Diff notes resolve', feature: true, js: true do
it
'does not allow user to mark note as resolved'
do
page
.
within
'.diff-content .note'
do
expect
(
page
).
to
have_selector
(
'.line-resolve-btn.is-disabled'
)
find
(
'.line-resolve-btn'
).
click
expect
(
page
).
to
have_selector
(
'.line-resolve-btn.is-disabled'
)
expect
(
page
).
not_to
have_selector
(
'.line-resolve-btn'
)
end
page
.
within
'.line-resolve-all-container'
do
...
...
@@ -384,11 +380,7 @@ feature 'Diff notes resolve', feature: true, js: true do
it
'does not allow user to mark note as resolved'
do
page
.
within
'.diff-content .note'
do
expect
(
page
).
to
have_selector
(
'.line-resolve-btn.is-disabled'
)
find
(
'.line-resolve-btn'
).
click
expect
(
page
).
to
have_selector
(
'.line-resolve-btn.is-disabled'
)
expect
(
page
).
not_to
have_selector
(
'.line-resolve-btn'
)
end
page
.
within
'.line-resolve-all-container'
do
...
...
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