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
48f7cdd9
Commit
48f7cdd9
authored
Mar 20, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
93a77b70
4ac99465
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
11 deletions
+49
-11
app/assets/javascripts/notes/components/discussion_filter.vue
...assets/javascripts/notes/components/discussion_filter.vue
+1
-1
app/assets/javascripts/notes/discussion_filters.js
app/assets/javascripts/notes/discussion_filters.js
+6
-7
app/assets/javascripts/notes/index.js
app/assets/javascripts/notes/index.js
+4
-3
changelogs/unreleased/58883-fix-fetching-comments.yml
changelogs/unreleased/58883-fix-fetching-comments.yml
+5
-0
spec/features/user_opens_link_to_comment.rb
spec/features/user_opens_link_to_comment.rb
+33
-0
No files found.
app/assets/javascripts/notes/components/discussion_filter.vue
View file @
48f7cdd9
...
...
@@ -22,7 +22,7 @@ export default {
},
selectedValue
:
{
type
:
Number
,
default
:
null
,
default
:
DISCUSSION_FILTERS_DEFAULT_VALUE
,
required
:
false
,
},
},
...
...
app/assets/javascripts/notes/discussion_filters.js
View file @
48f7cdd9
...
...
@@ -6,12 +6,16 @@ export default store => {
if
(
discussionFilterEl
)
{
const
{
defaultFilter
,
notesFilters
}
=
discussionFilterEl
.
dataset
;
const
selectedValue
=
defaultFilter
?
parseInt
(
defaultFilter
,
10
)
:
null
;
const
filterValues
=
notesFilters
?
JSON
.
parse
(
notesFilters
)
:
{};
const
filters
=
Object
.
keys
(
filterValues
).
map
(
entry
=>
({
title
:
entry
,
value
:
filterValues
[
entry
],
}));
const
props
=
{
filters
};
if
(
defaultFilter
)
{
props
.
selectedValue
=
parseInt
(
defaultFilter
,
10
);
}
return
new
Vue
({
el
:
discussionFilterEl
,
...
...
@@ -21,12 +25,7 @@ export default store => {
},
store
,
render
(
createElement
)
{
return
createElement
(
'
discussion-filter
'
,
{
props
:
{
filters
,
selectedValue
,
},
});
return
createElement
(
'
discussion-filter
'
,
{
props
});
},
});
}
...
...
app/assets/javascripts/notes/index.js
View file @
48f7cdd9
...
...
@@ -6,9 +6,8 @@ import createStore from './stores';
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
const
store
=
createStore
();
initDiscussionFilters
(
store
);
return
new
Vue
({
// eslint-disable-next-line no-new
new
Vue
({
el
:
'
#js-vue-notes
'
,
components
:
{
notesApp
,
...
...
@@ -49,4 +48,6 @@ document.addEventListener('DOMContentLoaded', () => {
});
},
});
initDiscussionFilters
(
store
);
});
changelogs/unreleased/58883-fix-fetching-comments.yml
0 → 100644
View file @
48f7cdd9
---
title
:
Fix error shown when loading links to specific comments
merge_request
:
26092
author
:
type
:
fixed
spec/features/user_opens_link_to_comment.rb
0 → 100644
View file @
48f7cdd9
# frozen_string_literal: true
require
'spec_helper'
describe
'User opens link to comment'
,
:js
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:note
)
{
create
(
:note_on_issue
,
project:
project
)
}
context
'authenticated user'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
it
'switches to all activity and does not show error message'
do
create
(
:user_preference
,
user:
user
,
issue_notes_filter:
UserPreference
::
NOTES_FILTERS
[
:only_activity
])
visit
Gitlab
::
UrlBuilder
.
build
(
note
)
expect
(
page
.
find
(
'#discussion-filter-dropdown'
)).
to
have_content
(
'Show all activity'
)
expect
(
page
).
not_to
have_content
(
'Something went wrong while fetching comments'
)
end
end
context
'anonymous user'
do
it
'does not show error message'
do
visit
Gitlab
::
UrlBuilder
.
build
(
note
)
expect
(
page
).
not_to
have_content
(
'Something went wrong while fetching comments'
)
end
end
end
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