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
66f4af5c
Commit
66f4af5c
authored
Jun 16, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IssueNotesRefactor: Refactor toggle to work with delegated handler.
parent
c77b2649
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+8
-1
app/assets/javascripts/notes/components/issue_note_header.vue
...assets/javascripts/notes/components/issue_note_header.vue
+3
-10
app/assets/javascripts/notes/stores/issue_notes_store.js
app/assets/javascripts/notes/stores/issue_notes_store.js
+5
-1
No files found.
app/assets/javascripts/notes/components/issue_discussion.vue
View file @
66f4af5c
...
...
@@ -43,6 +43,13 @@ export default {
this
.
signInLink
=
signInLink
.
getAttribute
(
'
href
'
);
}
},
methods
:
{
toggleDiscussion
()
{
this
.
$store
.
commit
(
'
toggleDiscussion
'
,
{
discussionId
:
this
.
note
.
id
,
});
}
},
};
</
script
>
...
...
@@ -64,7 +71,7 @@ export default {
:createdAt=
"discussion.created_at"
:notePath=
"discussion.path"
:includeToggle=
"true"
:
discussionId=
"note.id
"
:
toggleHandler=
"toggleDiscussion
"
actionText=
"started a discussion"
/>
<issue-note-edited-text
v-if=
"note.last_updated_by"
...
...
app/assets/javascripts/notes/components/issue_note_header.vue
View file @
66f4af5c
...
...
@@ -30,21 +30,14 @@ export default {
required
:
false
,
default
:
false
,
},
discussionId
:
{
type
:
String
,
toggleHandler
:
{
type
:
Function
,
required
:
false
,
},
},
components
:
{
TimeAgoTooltip
,
},
methods
:
{
toggle
()
{
this
.
$store
.
commit
(
'
toggleDiscussion
'
,
{
discussionId
:
this
.
discussionId
,
});
},
},
};
</
script
>
...
...
@@ -78,7 +71,7 @@ export default {
v-if=
"includeToggle"
class=
"discussion-actions"
>
<button
@
click=
"toggle"
@
click=
"toggle
Handler
"
class=
"note-action-button discussion-toggle-button js-toggle-button"
type=
"button"
>
<i
...
...
app/assets/javascripts/notes/stores/issue_notes_store.js
View file @
66f4af5c
...
...
@@ -3,6 +3,10 @@
import
service
from
'
../services/issue_notes_service
'
;
const
findNoteObjectById
=
(
notes
,
id
)
=>
{
return
notes
.
filter
(
n
=>
n
.
id
===
id
)[
0
];
};
const
state
=
{
notes
:
[],
};
...
...
@@ -18,7 +22,7 @@ const mutations = {
storeState
.
notes
=
notes
;
},
toggleDiscussion
(
storeState
,
{
discussionId
})
{
const
[
discussion
]
=
storeState
.
notes
.
filter
(
note
=>
note
.
id
===
discussionId
);
const
discussion
=
findNoteObjectById
(
storeState
.
notes
,
discussionId
);
discussion
.
expanded
=
!
discussion
.
expanded
;
},
...
...
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