diff options
author | Phil Hughes <me@iamphill.com> | 2018-10-18 10:50:38 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-11-05 17:02:41 +0300 |
commit | f7df9ddb52be8a03b8fbd8c9a870f3e3af577562 (patch) | |
tree | 9ee176674a1aa2a4d57b2ffcb88c03e522891529 /app/assets/javascripts/diffs/store/getters.js | |
parent | 7d4b717c92d0e2f1db07fb3de0ce356b15d2f7df (diff) |
Re-implemented image commenting on diffs
This re-implements image commenting in merge request diffs.
This feature was previously lost when the merge request
page was refactored into Vue.
With this, we create an overlay component. The overlay
component handles displaying the comment badges
and the comment form badge.
Badges are displayed based on the position attribute
sent with the discussion.
Comment forms for diff files are controlled through
a different state property. This is so we don't
tie comment forms to diff files directly creating
deep nested state. Instead we create a flat array
which holds the file hash & the X & Y position of
the comment form.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48956
Diffstat (limited to 'app/assets/javascripts/diffs/store/getters.js')
-rw-r--r-- | app/assets/javascripts/diffs/store/getters.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index d4c205882ff..2bf0ad99c22 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -114,5 +114,8 @@ export const allBlobs = state => Object.values(state.treeEntries).filter(f => f. export const diffFilesLength = state => state.diffFiles.length; +export const getCommentFormForDiffFile = state => fileHash => + state.commentForms.find(form => form.fileHash === fileHash); + // prevent babel-plugin-rewire from generating an invalid default during karma tests export default () => {}; |