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
4fba69dc
Commit
4fba69dc
authored
Nov 07, 2016
by
Phil Hughes
Committed by
Fatih Acet
Nov 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed up resolve discussions
parent
1505fc3a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
27 deletions
+43
-27
app/assets/javascripts/diff_notes/components/comment_resolve_btn.js.es6
...ascripts/diff_notes/components/comment_resolve_btn.js.es6
+9
-3
app/assets/javascripts/diff_notes/components/resolve_btn.js.es6
...sets/javascripts/diff_notes/components/resolve_btn.js.es6
+5
-3
app/assets/javascripts/diff_notes/components/resolve_count.js.es6
...ts/javascripts/diff_notes/components/resolve_count.js.es6
+3
-0
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js.es6
...ripts/diff_notes/components/resolve_discussion_btn.js.es6
+5
-3
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
+8
-7
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+2
-1
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+9
-8
app/views/projects/notes/_note.html.haml
app/views/projects/notes/_note.html.haml
+2
-2
No files found.
app/assets/javascripts/diff_notes/components/comment_resolve_btn.js.es6
View file @
4fba69dc
/* eslint-disable */
/* eslint-disable */
((
w
) => {
(() => {
w.
CommentAndResolveBtn = Vue.extend({
const
CommentAndResolveBtn = Vue.extend({
props: {
props: {
discussionId: String,
discussionId: String,
textareaIsEmpty: Boolean
},
data() {
return {
textareaIsEmpty: true
}
},
},
computed: {
computed: {
discussion: function () {
discussion: function () {
...
@@ -47,4 +51,6 @@
...
@@ -47,4 +51,6 @@
$(`#new-discussion-note-form-${this.discussionId} .note-textarea`).off('input.comment-and-resolve-btn');
$(`#new-discussion-note-form-${this.discussionId} .note-textarea`).off('input.comment-and-resolve-btn');
}
}
});
});
Vue.component('comment-and-resolve-btn', CommentAndResolveBtn);
})(window);
})(window);
app/assets/javascripts/diff_notes/components/resolve_btn.js.es6
View file @
4fba69dc
/* eslint-disable */
/* eslint-disable */
((
w
) => {
(() => {
w.
ResolveBtn = Vue.extend({
const
ResolveBtn = Vue.extend({
props: {
props: {
noteId: Number,
noteId: Number,
discussionId: String,
discussionId: String,
...
@@ -101,4 +101,6 @@
...
@@ -101,4 +101,6 @@
CommentsStore.create(this.discussionId, this.noteId, this.canResolve, this.resolved, this.resolvedBy);
CommentsStore.create(this.discussionId, this.noteId, this.canResolve, this.resolved, this.resolvedBy);
}
}
});
});
})(window);
Vue.component('resolve-btn', ResolveBtn);
})();
app/assets/javascripts/diff_notes/components/resolve_count.js.es6
View file @
4fba69dc
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
computed: {
computed: {
allResolved: function () {
allResolved: function () {
return this.resolvedDiscussionCount === this.discussionCount;
return this.resolvedDiscussionCount === this.discussionCount;
},
resolvedCountText() {
return this.discussionCount === 0 ? 'discussion' : 'discussions';
}
}
}
}
});
});
...
...
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js.es6
View file @
4fba69dc
/* eslint-disable */
/* eslint-disable */
((
w
) => {
(() => {
w.
ResolveDiscussionBtn = Vue.extend({
const
ResolveDiscussionBtn = Vue.extend({
props: {
props: {
discussionId: String,
discussionId: String,
mergeRequestId: Number,
mergeRequestId: Number,
...
@@ -54,4 +54,6 @@
...
@@ -54,4 +54,6 @@
CommentsStore.createDiscussion(this.discussionId, this.canResolve);
CommentsStore.createDiscussion(this.discussionId, this.canResolve);
}
}
});
});
})(window);
Vue.component('resolve-discussion-btn', ResolveDiscussionBtn);
})();
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
View file @
4fba69dc
...
@@ -10,17 +10,18 @@
...
@@ -10,17 +10,18 @@
$(() => {
$(() => {
window.DiffNotesApp = new Vue({
window.DiffNotesApp = new Vue({
el: '#diff-notes-app',
el: '#diff-notes-app',
components: {
'resolve-btn': ResolveBtn,
'resolve-discussion-btn': ResolveDiscussionBtn,
'comment-and-resolve-btn': CommentAndResolveBtn
},
methods: {
methods: {
compileComponents: function () {
compileComponents: function () {
const $components = $('resolve-btn, resolve-discussion-btn, jump-to-discussion');
const $components = $('resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn');
if ($components.length) {
if ($components.length) {
$components.each(function () {
$components.each(function () {
DiffNotesApp.$compile($(this).get(0));
const $this = $(this);
const tmp = Vue.extend({
template: $this.get(0).outerHTML,
parent: DiffNotesApp,
});
$this.replaceWith(new tmp().$mount().$el);
});
});
}
}
}
}
...
...
app/assets/javascripts/notes.js
View file @
4fba69dc
...
@@ -647,7 +647,8 @@
...
@@ -647,7 +647,8 @@
var
$commentBtn
=
form
.
find
(
'
comment-and-resolve-btn
'
);
var
$commentBtn
=
form
.
find
(
'
comment-and-resolve-btn
'
);
$commentBtn
$commentBtn
.
attr
(
'
:discussion-id
'
,
"
'
"
+
dataHolder
.
data
(
'
discussionId
'
)
+
"
'
"
);
.
attr
(
'
:discussion-id
'
,
"
'
"
+
dataHolder
.
data
(
'
discussionId
'
)
+
"
'
"
);
DiffNotesApp
.
$compile
(
$commentBtn
.
get
(
0
));
DiffNotesApp
.
compileComponents
();
}
}
form
.
find
(
"
.js-note-text
"
).
focus
();
form
.
find
(
"
.js-note-text
"
).
focus
();
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
4fba69dc
...
@@ -74,14 +74,15 @@
...
@@ -74,14 +74,15 @@
%span
.badge
=
@merge_request
.
diff_size
%span
.badge
=
@merge_request
.
diff_size
%li
#resolve-count-app
.line-resolve-all-container.pull-right.prepend-top-10.hidden-xs
{
"v-cloak"
=>
true
}
%li
#resolve-count-app
.line-resolve-all-container.pull-right.prepend-top-10.hidden-xs
{
"v-cloak"
=>
true
}
%resolve-count
{
"inline-template"
=>
true
,
":logged-out"
=>
"#{current_user.nil?}"
}
%resolve-count
{
"inline-template"
=>
true
,
":logged-out"
=>
"#{current_user.nil?}"
}
.line-resolve-all
{
"v-show"
=>
"discussionCount > 0"
,
%div
":class"
=>
"{ 'has-next-btn': !loggedOut && resolvedDiscussionCount !== discussionCount }"
}
.line-resolve-all
{
"v-show"
=>
"discussionCount > 0"
,
%span
.line-resolve-btn.is-disabled
{
type:
"button"
,
":class"
=>
"{ 'has-next-btn': !loggedOut && resolvedDiscussionCount !== discussionCount }"
}
":class"
=>
"{ 'is-active': resolvedDiscussionCount === discussionCount }"
}
%span
.line-resolve-btn.is-disabled
{
type:
"button"
,
=
render
"shared/icons/icon_status_success.svg"
":class"
=>
"{ 'is-active': resolvedDiscussionCount === discussionCount }"
}
%span
.line-resolve-text
=
render
"shared/icons/icon_status_success.svg"
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ discussionCount | pluralize 'discussion' }} resolved
%span
.line-resolve-text
=
render
"discussions/jump_to_next"
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
=
render
"discussions/jump_to_next"
.tab-content
#diff-notes-app
.tab-content
#diff-notes-app
#notes
.notes.tab-pane.voting_notes
#notes
.notes.tab-pane.voting_notes
...
...
app/views/projects/notes/_note.html.haml
View file @
4fba69dc
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
"resolved-by"
=>
"#{note.resolved_by.try(:name)}"
,
"resolved-by"
=>
"#{note.resolved_by.try(:name)}"
,
"v-show"
=>
"#{can_resolve || note.resolved?}"
,
"v-show"
=>
"#{can_resolve || note.resolved?}"
,
"inline-template"
=>
true
,
"inline-template"
=>
true
,
"
v-ref:note_#{note.id}"
=>
true
}
"
ref"
=>
"note_#{note.id}"
}
.note-action-button
.note-action-button
=
icon
(
"spin spinner"
,
"v-show"
=>
"loading"
)
=
icon
(
"spin spinner"
,
"v-show"
=>
"loading"
)
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
"@click"
=>
"resolve"
,
"@click"
=>
"resolve"
,
":title"
=>
"buttonText"
,
":title"
=>
"buttonText"
,
"v-show"
=>
"!loading"
,
"v-show"
=>
"!loading"
,
"
v-el:button"
=>
true
}
"
:ref"
=>
"'button'"
}
=
render
"shared/icons/icon_status_success.svg"
=
render
"shared/icons/icon_status_success.svg"
...
...
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