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
44d0cb49
Commit
44d0cb49
authored
Feb 28, 2020
by
Donald Cook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow multiple descriptionVersions
Also updated naming
parent
c719bfb5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
11 deletions
+19
-11
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+2
-2
app/assets/javascripts/notes/stores/getters.js
app/assets/javascripts/notes/stores/getters.js
+1
-1
app/assets/javascripts/notes/stores/modules/index.js
app/assets/javascripts/notes/stores/modules/index.js
+1
-1
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+3
-3
app/assets/javascripts/vue_shared/components/notes/system_note.vue
...s/javascripts/vue_shared/components/notes/system_note.vue
+9
-2
ee/app/assets/javascripts/notes/mixins/description_version_history.js
...s/javascripts/notes/mixins/description_version_history.js
+3
-2
No files found.
app/assets/javascripts/notes/stores/actions.js
View file @
44d0cb49
...
...
@@ -515,7 +515,7 @@ export const removeConvertedDiscussion = ({ commit }, noteId) =>
export
const
setCurrentDiscussionId
=
({
commit
},
discussionId
)
=>
commit
(
types
.
SET_CURRENT_DISCUSSION_ID
,
discussionId
);
export
const
fetchDescriptionVersion
=
({
dispatch
},
{
endpoint
,
startingVersion
})
=>
{
export
const
fetchDescriptionVersion
=
({
dispatch
},
{
endpoint
,
startingVersion
,
versionId
})
=>
{
let
requestUrl
=
endpoint
;
if
(
startingVersion
)
{
...
...
@@ -526,7 +526,7 @@ export const fetchDescriptionVersion = ({ dispatch }, { endpoint, startingVersio
return
axios
.
get
(
requestUrl
)
.
then
(
res
=>
{
dispatch
(
'
receiveDescriptionVersion
'
,
res
.
data
);
dispatch
(
'
receiveDescriptionVersion
'
,
{
descriptionVersion
:
res
.
data
,
versionId
}
);
})
.
catch
(
error
=>
{
dispatch
(
'
receiveDescriptionVersionError
'
,
error
);
...
...
app/assets/javascripts/notes/stores/getters.js
View file @
44d0cb49
...
...
@@ -28,7 +28,7 @@ export const getUserData = state => state.userData || {};
export
const
getUserDataByProp
=
state
=>
prop
=>
state
.
userData
&&
state
.
userData
[
prop
];
export
const
descriptionVersion
=
state
=>
state
.
descriptionVersion
;
export
const
descriptionVersion
s
=
state
=>
state
.
descriptionVersions
;
export
const
notesById
=
state
=>
state
.
discussions
.
reduce
((
acc
,
note
)
=>
{
...
...
app/assets/javascripts/notes/stores/modules/index.js
View file @
44d0cb49
...
...
@@ -28,7 +28,7 @@ export default () => ({
commentsDisabled
:
false
,
resolvableDiscussionsCount
:
0
,
unresolvedDiscussionsCount
:
0
,
descriptionVersion
:
null
,
descriptionVersion
s
:
{}
,
},
actions
,
getters
,
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
44d0cb49
...
...
@@ -288,9 +288,9 @@ export default {
[
types
.
REQUEST_DESCRIPTION_VERSION
](
state
)
{
state
.
isLoadingDescriptionVersion
=
true
;
},
[
types
.
RECEIVE_DESCRIPTION_VERSION
](
state
,
descriptionVersion
)
{
state
.
isLoadingDescriptionVersion
=
false
;
state
.
descriptionVersion
=
descriptionVersion
;
[
types
.
RECEIVE_DESCRIPTION_VERSION
](
state
,
{
descriptionVersion
,
versionId
}
)
{
const
descriptionVersions
=
{
...
state
.
descriptionVersions
,
[
versionId
]:
descriptionVersion
}
;
Object
.
assign
(
state
,
{
descriptionVersions
,
isLoadingDescriptionVersion
:
false
})
;
},
[
types
.
RECEIVE_DESCRIPTION_VERSION_ERROR
](
state
)
{
state
.
isLoadingDescriptionVersion
=
false
;
...
...
app/assets/javascripts/vue_shared/components/notes/system_note.vue
View file @
44d0cb49
...
...
@@ -54,7 +54,7 @@ export default {
};
},
computed
:
{
...
mapGetters
([
'
targetNoteHash
'
,
'
descriptionVersion
'
]),
...
mapGetters
([
'
targetNoteHash
'
,
'
descriptionVersion
s
'
]),
...
mapState
([
'
isLoadingDescriptionVersion
'
]),
noteAnchorId
()
{
return
`note_
${
this
.
note
.
id
}
`
;
...
...
@@ -81,6 +81,9 @@ export default {
.
children
().
length
>
MAX_VISIBLE_COMMIT_LIST_COUNT
);
},
descriptionVersion
()
{
return
this
.
descriptionVersions
[
this
.
note
.
description_version_id
];
},
},
mounted
()
{
initMRPopovers
(
this
.
$el
.
querySelectorAll
(
'
.gfm-merge_request
'
));
...
...
@@ -104,7 +107,11 @@ export default {
<span
v-html=
"actionTextHtml"
></span>
<template
v-if=
"canSeeDescriptionVersion"
slot=
"extra-controls"
>
·
<button
type=
"button"
class=
"btn-blank btn-link"
@
click=
"toggleDescriptionVersion"
>
<button
type=
"button"
class=
"btn-blank btn-link"
@
click=
"toggleDescriptionVersion(note.description_version_id)"
>
{{
__
(
'
Compare with previous version
'
)
}}
<icon
:name=
"descriptionVersionToggleIcon"
:size=
"12"
class=
"append-left-5"
/>
</button>
...
...
ee/app/assets/javascripts/notes/mixins/description_version_history.js
View file @
44d0cb49
...
...
@@ -25,15 +25,16 @@ export default {
methods
:
{
toggleDescriptionVersion
()
{
this
.
isDescriptionVersionExpanded
=
!
this
.
isDescriptionVersionExpanded
;
const
versionId
=
this
.
note
.
description_version_id
;
if
(
this
.
descriptionVersion
)
{
if
(
this
.
descriptionVersion
s
?.[
versionId
]
)
{
return
false
;
}
const
endpoint
=
this
.
note
.
description_diff_path
;
const
startingVersion
=
this
.
note
.
start_description_version_id
;
return
this
.
fetchDescriptionVersion
({
endpoint
,
startingVersion
});
return
this
.
fetchDescriptionVersion
({
endpoint
,
startingVersion
,
versionId
});
},
deleteDescriptionVersion
()
{
const
endpoint
=
this
.
note
.
delete_description_version_path
;
...
...
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