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
b8ee5c18
Commit
b8ee5c18
authored
Feb 08, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failing diff notes vue tests
parent
87b4ccd1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
24 deletions
+21
-24
app/assets/javascripts/diff_notes/components/resolve_btn.js.es6
...sets/javascripts/diff_notes/components/resolve_btn.js.es6
+3
-7
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js.es6
...ripts/diff_notes/components/resolve_discussion_btn.js.es6
+4
-4
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
+4
-1
app/assets/javascripts/diff_notes/services/resolve.js.es6
app/assets/javascripts/diff_notes/services/resolve.js.es6
+9
-10
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+1
-2
No files found.
app/assets/javascripts/diff_notes/components/resolve_btn.js.es6
View file @
b8ee5c18
...
...
@@ -17,6 +17,7 @@ const Vue = require('vue');
},
data: function () {
return {
note: {},
discussions: CommentsStore.state,
loading: false
};
...
...
@@ -31,13 +32,6 @@ const Vue = require('vue');
discussion: function () {
return this.discussions[this.discussionId];
},
note: function () {
if (this.discussion) {
return this.discussion.getNote(this.noteId);
} else {
return undefined;
}
},
buttonText: function () {
if (this.isResolved) {
return `Resolved by ${this.resolvedByName}`;
...
...
@@ -107,6 +101,8 @@ const Vue = require('vue');
},
created: function () {
CommentsStore.create(this.discussionId, this.noteId, this.canResolve, this.resolved, this.resolvedBy);
this.note = this.discussion.getNote(this.noteId);
}
});
...
...
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js.es6
View file @
b8ee5c18
...
...
@@ -14,13 +14,11 @@ const Vue = require('vue');
},
data: function() {
return {
discussions: CommentsStore.state
discussions: CommentsStore.state,
discussion: {},
};
},
computed: {
discussion: function () {
return this.discussions[this.discussionId];
},
showButton: function () {
if (this.discussion) {
return this.discussion.isResolvable();
...
...
@@ -57,6 +55,8 @@ const Vue = require('vue');
},
created: function () {
CommentsStore.createDiscussion(this.discussionId, this.canResolve);
this.discussion = this.discussions[this.discussionId]
}
});
...
...
app/assets/javascripts/diff_notes/diff_notes_bundle.js.es6
View file @
b8ee5c18
...
...
@@ -11,11 +11,14 @@ requireAll(require.context('./mixins', false, /^\.\/.*\.(js|es6)$/));
requireAll(require.context('./components', false, /^\.\/.*\.(js|es6)$/));
$(() => {
const projectPath = document.querySelector('.merge-request').dataset.projectPath;
const COMPONENT_SELECTOR = 'resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn';
window.gl = window.gl || {};
window.gl.diffNoteApps = {};
window.ResolveService = new ResolveServiceClass(projectPath);
gl.diffNotesCompileComponents = () => {
const $components = $(COMPONENT_SELECTOR).filter(function () {
return $(this).closest('resolve-count').length !== 1;
...
...
@@ -45,6 +48,6 @@ $(() => {
el: '#resolve-count-app',
components: {
'resolve-count': ResolveCount
}
}
,
});
});
app/assets/javascripts/diff_notes/services/resolve.js.es6
View file @
b8ee5c18
...
...
@@ -3,20 +3,21 @@
/* global Flash */
/* global CommentsStore */
((w) => {
class ResolveServiceClass {
constructor() {
this.noteResource = Vue.resource('notes{/noteId}/resolve');
this.discussionResource = Vue.resource('merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve');
window.Vue.use(require('vue-resource'));
(() => {
window.ResolveServiceClass = class ResolveServiceClass {
constructor(rootPath) {
this.noteResource = Vue.resource(`${rootPath}/notes{/noteId}/resolve`);
this.discussionResource = Vue.resource(`${rootPath}/merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve`);
}
setCSRF() {
Vue.http.headers.common['X-CSRF-Token'] = $.rails.csrfToken();
}
prepareRequest(
root
) {
prepareRequest() {
this.setCSRF();
Vue.http.options.root = root;
}
resolve(projectPath, noteId) {
...
...
@@ -88,6 +89,4 @@
}, {});
}
}
w.ResolveService = new ResolveServiceClass();
})(window);
})();
app/views/projects/merge_requests/_show.html.haml
View file @
b8ee5c18
...
...
@@ -3,10 +3,9 @@
-
page_description
@merge_request
.
description
-
page_card_attributes
@merge_request
.
card_attributes
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_bundle_tag
(
'lib_vue'
)
=
page_specific_javascript_bundle_tag
(
'diff_notes'
)
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)
}
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)
,
'data-project-path'
=>
project_path
(
@merge_request
.
project
)
}
=
render
"projects/merge_requests/show/mr_title"
.merge-request-details.issuable-details
{
data:
{
id:
@merge_request
.
project
.
id
}
}
...
...
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