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
e434318a
Commit
e434318a
authored
Aug 26, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use route hash in initial active discussion update
Ensures comment is highlighted on entry
parent
dbfd2337
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
app/assets/javascripts/design_management/components/design_notes/design_discussion.vue
..._management/components/design_notes/design_discussion.vue
+4
-3
app/assets/javascripts/design_management/pages/design/index.vue
...sets/javascripts/design_management/pages/design/index.vue
+4
-1
app/assets/javascripts/design_management/utils/design_management_utils.js
...cripts/design_management/utils/design_management_utils.js
+2
-0
changelogs/unreleased/fix-design-managemnt-comment-highlight.yml
...ogs/unreleased/fix-design-managemnt-comment-highlight.yml
+5
-0
No files found.
app/assets/javascripts/design_management/components/design_notes/design_discussion.vue
View file @
e434318a
...
...
@@ -62,16 +62,17 @@ export default {
activeDiscussion
:
{
query
:
activeDiscussionQuery
,
result
({
data
})
{
const
d
iscussionId
=
data
.
activeDiscussion
.
id
;
const
activeD
iscussionId
=
data
.
activeDiscussion
.
id
;
if
(
this
.
discussion
.
resolved
&&
!
this
.
resolvedDiscussionsExpanded
)
{
return
;
}
// We watch any changes to the active discussion from the design pins and scroll to this discussion if it exists
// We don't want scrollIntoView to be triggered from the discussion click itself
if
(
discussionId
&&
this
.
$el
&&
activeDiscussionId
&&
data
.
activeDiscussion
.
source
===
ACTIVE_DISCUSSION_SOURCE_TYPES
.
pin
&&
d
iscussionId
===
this
.
discussion
.
notes
[
0
].
id
activeD
iscussionId
===
this
.
discussion
.
notes
[
0
].
id
)
{
this
.
$el
.
scrollIntoView
({
behavior
:
'
smooth
'
,
...
...
app/assets/javascripts/design_management/pages/design/index.vue
View file @
e434318a
...
...
@@ -19,6 +19,7 @@ import {
extractDiscussions
,
extractDesign
,
updateImageDiffNoteOptimisticResponse
,
toDiffNoteGid
,
}
from
'
../../utils/design_management_utils
'
;
import
{
updateStoreAfterAddImageDiffNote
,
...
...
@@ -146,7 +147,9 @@ export default {
Mousetrap
.
bind
(
'
esc
'
,
this
.
closeDesign
);
this
.
trackEvent
();
// We need to reset the active discussion when opening a new design
this
.
updateActiveDiscussion
();
const
[,
noteId
]
=
this
.
$route
.
hash
.
match
(
/#note_
([
0-9
]
+
)
/
)
||
[];
const
diffNoteGid
=
noteId
?
toDiffNoteGid
(
noteId
)
:
undefined
;
return
this
.
updateActiveDiscussion
(
diffNoteGid
);
},
beforeDestroy
()
{
Mousetrap
.
unbind
(
'
esc
'
,
this
.
closeDesign
);
...
...
app/assets/javascripts/design_management/utils/design_management_utils.js
View file @
e434318a
...
...
@@ -34,6 +34,8 @@ export const extractDesigns = data => data.project.issue.designCollection.design
export
const
extractDesign
=
data
=>
(
extractDesigns
(
data
)
||
[])[
0
];
export
const
toDiffNoteGid
=
noteId
=>
`gid://gitlab/DiffNote/
${
noteId
}
`
;
/**
* Generates optimistic response for a design upload mutation
* @param {Array<File>} files
...
...
changelogs/unreleased/fix-design-managemnt-comment-highlight.yml
0 → 100644
View file @
e434318a
---
title
:
Ensure design comment is highlighted when comment is in URL
merge_request
:
40477
author
:
type
:
fixed
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