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
Jérome Perrin
gitlab-ce
Commits
18da66a5
Commit
18da66a5
authored
Apr 19, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove-iife-diff-notes-bundle' into 'master'
Remove IIFE's in diff_notes_bundle.js See merge request !10729
parents
ba1e9495
e8561287
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
731 additions
and
753 deletions
+731
-753
app/assets/javascripts/diff_notes/components/comment_resolve_btn.js
.../javascripts/diff_notes/components/comment_resolve_btn.js
+49
-51
app/assets/javascripts/diff_notes/components/diff_note_avatars.js
...ts/javascripts/diff_notes/components/diff_note_avatars.js
+129
-131
app/assets/javascripts/diff_notes/components/jump_to_discussion.js
...s/javascripts/diff_notes/components/jump_to_discussion.js
+154
-156
app/assets/javascripts/diff_notes/components/new_issue_for_discussion.js
...scripts/diff_notes/components/new_issue_for_discussion.js
+20
-22
app/assets/javascripts/diff_notes/components/resolve_btn.js
app/assets/javascripts/diff_notes/components/resolve_btn.js
+98
-100
app/assets/javascripts/diff_notes/components/resolve_count.js
...assets/javascripts/diff_notes/components/resolve_count.js
+17
-19
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js
...vascripts/diff_notes/components/resolve_discussion_btn.js
+47
-49
app/assets/javascripts/diff_notes/mixins/discussion.js
app/assets/javascripts/diff_notes/mixins/discussion.js
+24
-26
app/assets/javascripts/diff_notes/services/resolve.js
app/assets/javascripts/diff_notes/services/resolve.js
+53
-55
app/assets/javascripts/diff_notes/stores/comments.js
app/assets/javascripts/diff_notes/stores/comments.js
+44
-46
spec/javascripts/diff_comments_store_spec.js
spec/javascripts/diff_comments_store_spec.js
+96
-98
No files found.
app/assets/javascripts/diff_notes/components/comment_resolve_btn.js
View file @
18da66a5
...
...
@@ -3,8 +3,7 @@
import
Vue
from
'
vue
'
;
(()
=>
{
const
CommentAndResolveBtn
=
Vue
.
extend
({
const
CommentAndResolveBtn
=
Vue
.
extend
({
props
:
{
discussionId
:
String
,
},
...
...
@@ -61,7 +60,6 @@ import Vue from 'vue';
$
(
`.js-discussion-note-form[data-discussion-id=
${
this
.
discussionId
}
] .note-textarea`
).
off
(
'
input.comment-and-resolve-btn
'
);
}
});
});
Vue
.
component
(
'
comment-and-resolve-btn
'
,
CommentAndResolveBtn
);
})(
window
);
Vue
.
component
(
'
comment-and-resolve-btn
'
,
CommentAndResolveBtn
);
app/assets/javascripts/diff_notes/components/diff_note_avatars.js
View file @
18da66a5
...
...
@@ -4,8 +4,7 @@
import
Vue
from
'
vue
'
;
import
collapseIcon
from
'
../icons/collapse_icon.svg
'
;
(()
=>
{
const
DiffNoteAvatars
=
Vue
.
extend
({
const
DiffNoteAvatars
=
Vue
.
extend
({
props
:
[
'
discussionId
'
],
data
()
{
return
{
...
...
@@ -152,7 +151,6 @@ import collapseIcon from '../icons/collapse_icon.svg';
this
.
isVisible
=
$
(
`.diffs .notes[data-discussion-id="
${
this
.
discussion
.
id
}
"]`
).
is
(
'
:visible
'
);
},
},
});
});
Vue
.
component
(
'
diff-note-avatars
'
,
DiffNoteAvatars
);
})();
Vue
.
component
(
'
diff-note-avatars
'
,
DiffNoteAvatars
);
app/assets/javascripts/diff_notes/components/jump_to_discussion.js
View file @
18da66a5
...
...
@@ -4,8 +4,7 @@
import
Vue
from
'
vue
'
;
(()
=>
{
const
JumpToDiscussion
=
Vue
.
extend
({
const
JumpToDiscussion
=
Vue
.
extend
({
mixins
:
[
DiscussionMixins
],
props
:
{
discussionId
:
String
...
...
@@ -189,7 +188,6 @@ import Vue from 'vue';
created
()
{
this
.
discussion
=
this
.
discussions
[
this
.
discussionId
];
},
});
});
Vue
.
component
(
'
jump-to-discussion
'
,
JumpToDiscussion
);
})();
Vue
.
component
(
'
jump-to-discussion
'
,
JumpToDiscussion
);
app/assets/javascripts/diff_notes/components/new_issue_for_discussion.js
View file @
18da66a5
...
...
@@ -2,8 +2,7 @@
import
Vue
from
'
vue
'
;
(()
=>
{
const
NewIssueForDiscussion
=
Vue
.
extend
({
const
NewIssueForDiscussion
=
Vue
.
extend
({
props
:
{
discussionId
:
{
type
:
String
,
...
...
@@ -24,7 +23,6 @@ import Vue from 'vue';
return
false
;
},
},
});
});
Vue
.
component
(
'
new-issue-for-discussion-btn
'
,
NewIssueForDiscussion
);
})();
Vue
.
component
(
'
new-issue-for-discussion-btn
'
,
NewIssueForDiscussion
);
app/assets/javascripts/diff_notes/components/resolve_btn.js
View file @
18da66a5
...
...
@@ -5,8 +5,7 @@
import
Vue
from
'
vue
'
;
(()
=>
{
const
ResolveBtn
=
Vue
.
extend
({
const
ResolveBtn
=
Vue
.
extend
({
props
:
{
noteId
:
Number
,
discussionId
:
String
,
...
...
@@ -115,7 +114,6 @@ import Vue from 'vue';
noteTruncated
:
this
.
noteTruncated
,
});
}
});
});
Vue
.
component
(
'
resolve-btn
'
,
ResolveBtn
);
})();
Vue
.
component
(
'
resolve-btn
'
,
ResolveBtn
);
app/assets/javascripts/diff_notes/components/resolve_count.js
View file @
18da66a5
...
...
@@ -4,8 +4,7 @@
import
Vue
from
'
vue
'
;
((
w
)
=>
{
w
.
ResolveCount
=
Vue
.
extend
({
window
.
ResolveCount
=
Vue
.
extend
({
mixins
:
[
DiscussionMixins
],
props
:
{
loggedOut
:
Boolean
...
...
@@ -23,5 +22,4 @@ import Vue from 'vue';
return
this
.
discussionCount
===
1
?
'
discussion
'
:
'
discussions
'
;
}
}
});
})(
window
);
});
app/assets/javascripts/diff_notes/components/resolve_discussion_btn.js
View file @
18da66a5
...
...
@@ -4,8 +4,7 @@
import
Vue
from
'
vue
'
;
(()
=>
{
const
ResolveDiscussionBtn
=
Vue
.
extend
({
const
ResolveDiscussionBtn
=
Vue
.
extend
({
props
:
{
discussionId
:
String
,
mergeRequestId
:
Number
,
...
...
@@ -56,7 +55,6 @@ import Vue from 'vue';
this
.
discussion
=
CommentsStore
.
state
[
this
.
discussionId
];
}
});
});
Vue
.
component
(
'
resolve-discussion-btn
'
,
ResolveDiscussionBtn
);
})();
Vue
.
component
(
'
resolve-discussion-btn
'
,
ResolveDiscussionBtn
);
app/assets/javascripts/diff_notes/mixins/discussion.js
View file @
18da66a5
/* eslint-disable object-shorthand, func-names, guard-for-in, no-restricted-syntax, comma-dangle, no-param-reassign, max-len */
((
w
)
=>
{
w
.
DiscussionMixins
=
{
window
.
DiscussionMixins
=
{
computed
:
{
discussionCount
:
function
()
{
return
Object
.
keys
(
this
.
discussions
).
length
;
...
...
@@ -33,5 +32,4 @@
return
unresolvedCount
;
}
}
};
})(
window
);
};
app/assets/javascripts/diff_notes/services/resolve.js
View file @
18da66a5
...
...
@@ -9,10 +9,9 @@ require('../../vue_shared/vue_resource_interceptor');
Vue
.
use
(
VueResource
);
(()
=>
{
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
class
ResolveServiceClass
{
class
ResolveServiceClass
{
constructor
(
root
)
{
this
.
noteResource
=
Vue
.
resource
(
`
${
root
}
/notes{/noteId}/resolve`
);
this
.
discussionResource
=
Vue
.
resource
(
`
${
root
}
/merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve`
);
...
...
@@ -78,7 +77,6 @@ Vue.use(VueResource);
discussionId
},
{});
}
}
}
gl
.
DiffNotesResolveServiceClass
=
ResolveServiceClass
;
})();
gl
.
DiffNotesResolveServiceClass
=
ResolveServiceClass
;
app/assets/javascripts/diff_notes/stores/comments.js
View file @
18da66a5
...
...
@@ -3,8 +3,7 @@
import
Vue
from
'
vue
'
;
((
w
)
=>
{
w
.
CommentsStore
=
{
window
.
CommentsStore
=
{
state
:
{},
get
:
function
(
discussionId
,
noteId
)
{
return
this
.
state
[
discussionId
].
getNote
(
noteId
);
...
...
@@ -54,5 +53,4 @@ import Vue from 'vue';
return
ids
;
}
};
})(
window
);
};
spec/javascripts/diff_comments_store_spec.js
View file @
18da66a5
...
...
@@ -5,8 +5,7 @@ require('~/diff_notes/models/discussion');
require
(
'
~/diff_notes/models/note
'
);
require
(
'
~/diff_notes/stores/comments
'
);
(()
=>
{
function
createDiscussion
(
noteId
=
1
,
resolved
=
true
)
{
function
createDiscussion
(
noteId
=
1
,
resolved
=
true
)
{
CommentsStore
.
create
({
discussionId
:
'
a
'
,
noteId
,
...
...
@@ -17,13 +16,13 @@ require('~/diff_notes/stores/comments');
authorAvatar
:
'
test
'
,
noteTruncated
:
'
test...
'
,
});
}
}
beforeEach
(()
=>
{
beforeEach
(()
=>
{
CommentsStore
.
state
=
{};
});
});
describe
(
'
New discussion
'
,
()
=>
{
describe
(
'
New discussion
'
,
()
=>
{
it
(
'
creates new discussion
'
,
()
=>
{
expect
(
Object
.
keys
(
CommentsStore
.
state
).
length
).
toBe
(
0
);
createDiscussion
();
...
...
@@ -37,9 +36,9 @@ require('~/diff_notes/stores/comments');
const
discussion
=
CommentsStore
.
state
[
'
a
'
];
expect
(
Object
.
keys
(
discussion
.
notes
).
length
).
toBe
(
2
);
});
});
});
describe
(
'
Get note
'
,
()
=>
{
describe
(
'
Get note
'
,
()
=>
{
beforeEach
(()
=>
{
expect
(
Object
.
keys
(
CommentsStore
.
state
).
length
).
toBe
(
0
);
createDiscussion
();
...
...
@@ -50,9 +49,9 @@ require('~/diff_notes/stores/comments');
expect
(
note
).
toBeDefined
();
expect
(
note
.
id
).
toBe
(
1
);
});
});
});
describe
(
'
Delete discussion
'
,
()
=>
{
describe
(
'
Delete discussion
'
,
()
=>
{
beforeEach
(()
=>
{
expect
(
Object
.
keys
(
CommentsStore
.
state
).
length
).
toBe
(
0
);
createDiscussion
();
...
...
@@ -73,9 +72,9 @@ require('~/diff_notes/stores/comments');
CommentsStore
.
delete
(
'
a
'
,
2
);
expect
(
Object
.
keys
(
CommentsStore
.
state
).
length
).
toBe
(
0
);
});
});
});
describe
(
'
Update note
'
,
()
=>
{
describe
(
'
Update note
'
,
()
=>
{
beforeEach
(()
=>
{
expect
(
Object
.
keys
(
CommentsStore
.
state
).
length
).
toBe
(
0
);
createDiscussion
();
...
...
@@ -87,9 +86,9 @@ require('~/diff_notes/stores/comments');
const
note
=
CommentsStore
.
get
(
'
a
'
,
1
);
expect
(
note
.
resolved
).
toBe
(
false
);
});
});
});
describe
(
'
Discussion resolved
'
,
()
=>
{
describe
(
'
Discussion resolved
'
,
()
=>
{
beforeEach
(()
=>
{
expect
(
Object
.
keys
(
CommentsStore
.
state
).
length
).
toBe
(
0
);
createDiscussion
();
...
...
@@ -129,5 +128,4 @@ require('~/diff_notes/stores/comments');
discussion
.
unResolveAllNotes
();
expect
(
discussion
.
isResolved
()).
toBe
(
false
);
});
});
})();
});
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