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
1f0bbd7d
Commit
1f0bbd7d
authored
Jan 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
aaf08b8a
5494f09a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
4 deletions
+58
-4
app/assets/javascripts/notes/components/discussion_filter.vue
...assets/javascripts/notes/components/discussion_filter.vue
+18
-2
app/assets/javascripts/notes/constants.js
app/assets/javascripts/notes/constants.js
+1
-0
changelogs/unreleased/54206-show-the-activity-filter-dropdown-in-discussion-tab-only.yml
...w-the-activity-filter-dropdown-in-discussion-tab-only.yml
+5
-0
spec/javascripts/notes/components/discussion_filter_spec.js
spec/javascripts/notes/components/discussion_filter_spec.js
+34
-2
No files found.
app/assets/javascripts/notes/components/discussion_filter.vue
View file @
1f0bbd7d
...
...
@@ -2,7 +2,11 @@
import
$
from
'
jquery
'
;
import
{
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
{
DISCUSSION_FILTERS_DEFAULT_VALUE
,
HISTORY_ONLY_FILTER_VALUE
}
from
'
../constants
'
;
import
{
DISCUSSION_FILTERS_DEFAULT_VALUE
,
HISTORY_ONLY_FILTER_VALUE
,
DISCUSSION_TAB_LABEL
,
}
from
'
../constants
'
;
export
default
{
components
:
{
...
...
@@ -23,6 +27,7 @@ export default {
return
{
currentValue
:
this
.
selectedValue
,
defaultValue
:
DISCUSSION_FILTERS_DEFAULT_VALUE
,
displayFilters
:
true
,
};
},
computed
:
{
...
...
@@ -32,6 +37,14 @@ export default {
return
this
.
filters
.
find
(
filter
=>
filter
.
value
===
this
.
currentValue
);
},
},
created
()
{
if
(
window
.
mrTabs
)
{
const
{
eventHub
,
currentTab
}
=
window
.
mrTabs
;
eventHub
.
$on
(
'
MergeRequestTabChange
'
,
this
.
toggleFilters
);
this
.
toggleFilters
(
currentTab
);
}
},
mounted
()
{
this
.
toggleCommentsForm
();
},
...
...
@@ -51,12 +64,15 @@ export default {
toggleCommentsForm
()
{
this
.
setCommentsDisabled
(
this
.
currentValue
===
HISTORY_ONLY_FILTER_VALUE
);
},
toggleFilters
(
tab
)
{
this
.
displayFilters
=
tab
===
DISCUSSION_TAB_LABEL
;
},
},
};
</
script
>
<
template
>
<div
class=
"discussion-filter-container d-inline-block align-bottom"
>
<div
v-if=
"displayFilters"
class=
"discussion-filter-container d-inline-block align-bottom"
>
<button
id=
"discussion-filter-dropdown"
ref=
"dropdownToggle"
...
...
app/assets/javascripts/notes/constants.js
View file @
1f0bbd7d
...
...
@@ -17,6 +17,7 @@ export const RESOLVE_NOTE_METHOD_NAME = 'post';
export
const
DESCRIPTION_TYPE
=
'
changed the description
'
;
export
const
HISTORY_ONLY_FILTER_VALUE
=
2
;
export
const
DISCUSSION_FILTERS_DEFAULT_VALUE
=
0
;
export
const
DISCUSSION_TAB_LABEL
=
'
show
'
;
export
const
NOTEABLE_TYPE_MAPPING
=
{
Issue
:
ISSUE_NOTEABLE_TYPE
,
...
...
changelogs/unreleased/54206-show-the-activity-filter-dropdown-in-discussion-tab-only.yml
0 → 100644
View file @
1f0bbd7d
---
title
:
Discussion filter only displayed in discussions tab for merge requests
merge_request
:
24082
author
:
type
:
changed
spec/javascripts/notes/components/discussion_filter_spec.js
View file @
1f0bbd7d
...
...
@@ -7,8 +7,9 @@ import { discussionFiltersMock, discussionMock } from '../mock_data';
describe
(
'
DiscussionFilter component
'
,
()
=>
{
let
vm
;
let
store
;
let
eventHub
;
beforeEach
(
()
=>
{
const
mountComponent
=
()
=>
{
store
=
createStore
();
const
discussions
=
[
...
...
@@ -22,7 +23,7 @@ describe('DiscussionFilter component', () => {
const
selectedValue
=
discussionFiltersMock
[
0
].
value
;
store
.
state
.
discussions
=
discussions
;
vm
=
mountComponentWithStore
(
Component
,
{
return
mountComponentWithStore
(
Component
,
{
el
:
null
,
store
,
props
:
{
...
...
@@ -30,6 +31,11 @@ describe('DiscussionFilter component', () => {
selectedValue
,
},
});
};
beforeEach
(()
=>
{
window
.
mrTabs
=
undefined
;
vm
=
mountComponent
();
});
afterEach
(()
=>
{
...
...
@@ -83,4 +89,30 @@ describe('DiscussionFilter component', () => {
expect
(
defaultFilter
.
lastChild
.
classList
).
toContain
(
'
dropdown-divider
'
);
});
describe
(
'
Merge request tabs
'
,
()
=>
{
eventHub
=
new
Vue
();
beforeEach
(()
=>
{
window
.
mrTabs
=
{
eventHub
,
currentTab
:
'
show
'
,
};
vm
=
mountComponent
();
});
afterEach
(()
=>
{
window
.
mrTabs
=
undefined
;
});
it
(
'
only renders when discussion tab is active
'
,
done
=>
{
eventHub
.
$emit
(
'
MergeRequestTabChange
'
,
'
commit
'
);
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
).
toBeUndefined
();
done
();
});
});
});
});
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