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
89c796db
Commit
89c796db
authored
Sep 05, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed another rspec about collapsing notes after adding them
parent
a0dc3923
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+4
-2
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+4
-5
spec/features/merge_request/user_posts_diff_notes_spec.rb
spec/features/merge_request/user_posts_diff_notes_spec.rb
+1
-1
No files found.
app/assets/javascripts/notes/stores/actions.js
View file @
89c796db
...
...
@@ -43,7 +43,7 @@ export const fetchDiscussions = ({ commit }, path) =>
commit
(
types
.
SET_INITIAL_DISCUSSIONS
,
discussions
);
});
export
const
refetchDiscussionById
=
({
commit
},
{
path
,
discussionId
})
=>
export
const
refetchDiscussionById
=
({
commit
,
state
},
{
path
,
discussionId
})
=>
new
Promise
(
resolve
=>
{
service
.
fetchDiscussions
(
path
)
...
...
@@ -52,7 +52,9 @@ export const refetchDiscussionById = ({ commit }, { path, discussionId }) =>
const
selectedDiscussion
=
discussions
.
find
(
discussion
=>
discussion
.
id
===
discussionId
);
if
(
selectedDiscussion
)
{
commit
(
types
.
UPDATE_DISCUSSION
,
selectedDiscussion
);
resolve
(
selectedDiscussion
);
// We need to refetch as it is now the transformed one in state
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
resolve
(
discussion
);
}
})
.
catch
(()
=>
{});
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
89c796db
...
...
@@ -54,13 +54,12 @@ export default {
[
types
.
EXPAND_DISCUSSION
](
state
,
{
discussionId
})
{
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
discussion
.
expanded
=
true
;
Object
.
assign
(
discussion
,
{
expanded
:
true
});
},
[
types
.
COLLAPSE_DISCUSSION
](
state
,
{
discussionId
})
{
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
discussion
.
expanded
=
false
;
Object
.
assign
(
discussion
,
{
expanded
:
false
})
;
},
[
types
.
REMOVE_PLACEHOLDER_NOTES
](
state
)
{
...
...
@@ -95,6 +94,7 @@ export default {
[
types
.
SET_USER_DATA
](
state
,
data
)
{
Object
.
assign
(
state
,
{
userData
:
data
});
},
[
types
.
SET_INITIAL_DISCUSSIONS
](
state
,
discussionsData
)
{
const
discussions
=
[];
...
...
@@ -168,8 +168,7 @@ export default {
[
types
.
TOGGLE_DISCUSSION
](
state
,
{
discussionId
})
{
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
discussion
.
expanded
=
!
discussion
.
expanded
;
Object
.
assign
(
discussion
,
{
expanded
:
!
discussion
.
expanded
});
},
[
types
.
UPDATE_NOTE
](
state
,
note
)
{
...
...
spec/features/merge_request/user_posts_diff_notes_spec.rb
View file @
89c796db
...
...
@@ -7,7 +7,7 @@ describe 'Merge request > User posts diff notes', :js do
let
(
:project
)
{
merge_request
.
source_project
}
let
(
:user
)
{
project
.
creator
}
let
(
:comment_button_class
)
{
'.add-diff-note'
}
let
(
:notes_holder_input_class
)
{
'
note-edit-form
'
}
let
(
:notes_holder_input_class
)
{
'
js-temp-notes-holder
'
}
let
(
:notes_holder_input_xpath
)
{
'./following-sibling::*[contains(concat(" ", @class, " "), " notes_holder ")]'
}
let
(
:test_note_comment
)
{
'this is a test note!'
}
...
...
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