diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-07-09 13:15:29 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-07-09 13:15:29 +0100 |
commit | 1070558d556ba64c0b8a8a38317246fee33709d3 (patch) | |
tree | c83cba929066a412514ece05eac717af26a94360 /app/assets/javascripts/diffs/components/inline_diff_view.vue | |
parent | 81b9b6f4095a430d2afe54a95ea1fa172fe9c0e1 (diff) | |
parent | 67157de1e4cc482b5321ba2f246bfd80a7893f93 (diff) | |
download | gitlab-ce-1070558d556ba64c0b8a8a38317246fee33709d3.tar.gz |
Merge branch 'master' into 48960-namespace-diff-module
* master:
Resolve "MR refactor: Performance costs of main element with `v-if`"
Add documentation on private projects
Make blob and other RPC's mandatory
Removed return statements from prettier script
Add missing strings to `locale/gitlab.pot`
Update `gettext:updated_check` regenerate pot file
Include wget in apk add command
[Rails5] Fix 'Invalid single-table inheritance type: Group is not a subclass of Gitlab::BackgroundMigration::FixCrossProjectLabelLinks::Namespace'
Updated color
Update doc on new option to add README when creating a project
Make more things mandatory
Updated (color of indent guide in Web IDE
Make all Gitaly diff flags mandatory
Diffstat (limited to 'app/assets/javascripts/diffs/components/inline_diff_view.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/inline_diff_view.vue | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/components/inline_diff_view.vue b/app/assets/javascripts/diffs/components/inline_diff_view.vue index 28a58e76ebe..9c1359f7c89 100644 --- a/app/assets/javascripts/diffs/components/inline_diff_view.vue +++ b/app/assets/javascripts/diffs/components/inline_diff_view.vue @@ -1,5 +1,5 @@ <script> -import { mapGetters } from 'vuex'; +import { mapGetters, mapState } from 'vuex'; import inlineDiffTableRow from './inline_diff_table_row.vue'; import inlineDiffCommentRow from './inline_diff_comment_row.vue'; import { trimFirstCharOfLineContent } from '../store/utils'; @@ -21,6 +21,10 @@ export default { }, computed: { ...mapGetters('diffs', ['commitId']), + ...mapGetters(['discussionsByLineCode']), + ...mapState({ + diffLineCommentForms: state => state.diffs.diffLineCommentForms, + }), normalizedDiffLines() { return this.diffLines.map(line => (line.richText ? trimFirstCharOfLineContent(line) : line)); }, @@ -31,6 +35,18 @@ export default { return window.gon.user_color_scheme; }, }, + methods: { + shouldRenderCommentRow(line) { + if (this.diffLineCommentForms[line.lineCode]) return true; + + const lineDiscussions = this.discussionsByLineCode[line.lineCode]; + if (lineDiscussions === undefined) { + return false; + } + + return lineDiscussions.every(discussion => discussion.expanded); + }, + }, }; </script> @@ -50,6 +66,7 @@ export default { :key="line.lineCode" /> <inline-diff-comment-row + v-if="shouldRenderCommentRow(line)" :diff-file="diffFile" :diff-lines="normalizedDiffLines" :line="line" |