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
Boxiang Sun
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 {
...
@@ -43,6 +43,13 @@ export default {
this
.
signInLink
=
signInLink
.
getAttribute
(
'
href
'
);
this
.
signInLink
=
signInLink
.
getAttribute
(
'
href
'
);
}
}
},
},
methods
:
{
toggleDiscussion
()
{
this
.
$store
.
commit
(
'
toggleDiscussion
'
,
{
discussionId
:
this
.
note
.
id
,
});
}
},
};
};
</
script
>
</
script
>
...
@@ -64,7 +71,7 @@ export default {
...
@@ -64,7 +71,7 @@ export default {
:createdAt=
"discussion.created_at"
:createdAt=
"discussion.created_at"
:notePath=
"discussion.path"
:notePath=
"discussion.path"
:includeToggle=
"true"
:includeToggle=
"true"
:
discussionId=
"note.id
"
:
toggleHandler=
"toggleDiscussion
"
actionText=
"started a discussion"
/>
actionText=
"started a discussion"
/>
<issue-note-edited-text
<issue-note-edited-text
v-if=
"note.last_updated_by"
v-if=
"note.last_updated_by"
...
...
app/assets/javascripts/notes/components/issue_note_header.vue
View file @
66f4af5c
...
@@ -30,21 +30,14 @@ export default {
...
@@ -30,21 +30,14 @@ export default {
required
:
false
,
required
:
false
,
default
:
false
,
default
:
false
,
},
},
discussionId
:
{
toggleHandler
:
{
type
:
String
,
type
:
Function
,
required
:
false
,
required
:
false
,
},
},
},
},
components
:
{
components
:
{
TimeAgoTooltip
,
TimeAgoTooltip
,
},
},
methods
:
{
toggle
()
{
this
.
$store
.
commit
(
'
toggleDiscussion
'
,
{
discussionId
:
this
.
discussionId
,
});
},
},
};
};
</
script
>
</
script
>
...
@@ -78,7 +71,7 @@ export default {
...
@@ -78,7 +71,7 @@ export default {
v-if=
"includeToggle"
v-if=
"includeToggle"
class=
"discussion-actions"
>
class=
"discussion-actions"
>
<button
<button
@
click=
"toggle"
@
click=
"toggle
Handler
"
class=
"note-action-button discussion-toggle-button js-toggle-button"
class=
"note-action-button discussion-toggle-button js-toggle-button"
type=
"button"
>
type=
"button"
>
<i
<i
...
...
app/assets/javascripts/notes/stores/issue_notes_store.js
View file @
66f4af5c
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
import
service
from
'
../services/issue_notes_service
'
;
import
service
from
'
../services/issue_notes_service
'
;
const
findNoteObjectById
=
(
notes
,
id
)
=>
{
return
notes
.
filter
(
n
=>
n
.
id
===
id
)[
0
];
};
const
state
=
{
const
state
=
{
notes
:
[],
notes
:
[],
};
};
...
@@ -18,7 +22,7 @@ const mutations = {
...
@@ -18,7 +22,7 @@ const mutations = {
storeState
.
notes
=
notes
;
storeState
.
notes
=
notes
;
},
},
toggleDiscussion
(
storeState
,
{
discussionId
})
{
toggleDiscussion
(
storeState
,
{
discussionId
})
{
const
[
discussion
]
=
storeState
.
notes
.
filter
(
note
=>
note
.
id
===
discussionId
);
const
discussion
=
findNoteObjectById
(
storeState
.
notes
,
discussionId
);
discussion
.
expanded
=
!
discussion
.
expanded
;
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