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
27ef40fe
Commit
27ef40fe
authored
Feb 27, 2020
by
Donald Cook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved descriptionVersion to a getter
parent
9d12e062
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
app/assets/javascripts/notes/stores/getters.js
app/assets/javascripts/notes/stores/getters.js
+2
-0
app/assets/javascripts/vue_shared/components/notes/system_note.vue
...s/javascripts/vue_shared/components/notes/system_note.vue
+2
-2
spec/frontend/notes/stores/getters_spec.js
spec/frontend/notes/stores/getters_spec.js
+7
-0
No files found.
app/assets/javascripts/notes/stores/getters.js
View file @
27ef40fe
...
...
@@ -28,6 +28,8 @@ export const getUserData = state => state.userData || {};
export
const
getUserDataByProp
=
state
=>
prop
=>
state
.
userData
&&
state
.
userData
[
prop
];
export
const
descriptionVersion
=
state
=>
state
.
descriptionVersion
;
export
const
notesById
=
state
=>
state
.
discussions
.
reduce
((
acc
,
note
)
=>
{
note
.
notes
.
every
(
n
=>
Object
.
assign
(
acc
,
{
[
n
.
id
]:
n
}));
...
...
app/assets/javascripts/vue_shared/components/notes/system_note.vue
View file @
27ef40fe
...
...
@@ -54,8 +54,8 @@ export default {
};
},
computed
:
{
...
mapGetters
([
'
targetNoteHash
'
]),
...
mapState
([
'
descriptionVersion
'
,
'
isLoadingDescriptionVersion
'
]),
...
mapGetters
([
'
targetNoteHash
'
,
'
descriptionVersion
'
]),
...
mapState
([
'
isLoadingDescriptionVersion
'
]),
noteAnchorId
()
{
return
`note_
${
this
.
note
.
id
}
`
;
},
...
...
spec/frontend/notes/stores/getters_spec.js
View file @
27ef40fe
...
...
@@ -35,6 +35,7 @@ describe('Getters Notes Store', () => {
notesData
:
notesDataMock
,
userData
:
userDataMock
,
noteableData
:
noteableDataMock
,
descriptionVersion
:
'
descriptionVersion
'
,
};
});
...
...
@@ -385,4 +386,10 @@ describe('Getters Notes Store', () => {
expect
(
getters
.
getDiscussion
(
state
)(
'
1
'
)).
toEqual
({
id
:
'
1
'
});
});
});
describe
(
'
descriptionVersion
'
,
()
=>
{
it
(
'
should return `descriptionVersion`
'
,
()
=>
{
expect
(
getters
.
descriptionVersion
(
state
)).
toEqual
(
'
descriptionVersion
'
);
});
});
});
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