...@@ -488,7 +488,6 @@ danger-review: ...@@ -488,7 +488,6 @@ danger-review:
<<: *pull-cache <<: *pull-cache
image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger
stage: test stage: test
allow_failure: true
dependencies: [] dependencies: []
before_script: [] before_script: []
only: only:
...@@ -555,7 +554,8 @@ docs lint: ...@@ -555,7 +554,8 @@ docs lint:
# Build HTML from Markdown # Build HTML from Markdown
- bundle exec nanoc - bundle exec nanoc
# Check the internal links # Check the internal links
- bundle exec nanoc check internal_links # Disabled until https://gitlab.com/gitlab-com/gitlab-docs/issues/305 is resolved
# - bundle exec nanoc check internal_links
downtime_check: downtime_check:
<<: *rake-exec <<: *rake-exec
... ...
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
/doc/ @axil @marcia /doc/ @axil @marcia
# Frontend maintainers should see everything in `app/assets/` # Frontend maintainers should see everything in `app/assets/`
app/assets/ @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann app/assets/ @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann @kushalpandya
*.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann *.scss @annabeldunstone @ClemMakesApps @fatihacet @filipa @iamphill @mikegreiling @timzallmann @kushalpandya
# Someone from the database team should review changes in `db/` # Someone from the database team should review changes in `db/`
db/ @abrandl @NikolayS db/ @abrandl @NikolayS
... ...
......
### Problem to solve ### Problem to solve
<!--- What problem do we solve? -->
### Target audience
<!--- For whom are we doing this? Include either a persona from https://design.gitlab.com/#/getting-started/personas or define a specific company role. e.a. "Release Manager" or "Security Analyst" -->
### Further details ### Further details
(Include use cases, benefits, and/or goals) <!--- Include use cases, benefits, and/or goals (contributes to our vision?) -->
### Proposal ### Proposal
<!--- How are we going to solve the problem? -->
### What does success look like, and how can we measure that? ### What does success look like, and how can we measure that?
(If no way to measure success, link to an issue that will implement a way to measure this) <!--- If no way to measure success, link to an issue that will implement a way to measure this -->
### Links / references ### Links / references
... ...
......
7.5.0 7.6.0
...@@ -807,7 +807,7 @@ GEM ...@@ -807,7 +807,7 @@ GEM
selenium-webdriver (3.12.0) selenium-webdriver (3.12.0)
childprocess (~> 0.5) childprocess (~> 0.5)
rubyzip (~> 1.2) rubyzip (~> 1.2)
sentry-raven (2.7.2) sentry-raven (2.7.4)
faraday (>= 0.7.6, < 1.0) faraday (>= 0.7.6, < 1.0)
settingslogic (2.0.9) settingslogic (2.0.9)
sexp_processor (4.11.0) sexp_processor (4.11.0)
... ...
......
...@@ -21,8 +21,11 @@ const Api = { ...@@ -21,8 +21,11 @@ const Api = {
projectTemplatePath: '/api/:version/projects/:id/templates/:type/:key', projectTemplatePath: '/api/:version/projects/:id/templates/:type/:key',
projectTemplatesPath: '/api/:version/projects/:id/templates/:type', projectTemplatesPath: '/api/:version/projects/:id/templates/:type',
usersPath: '/api/:version/users.json', usersPath: '/api/:version/users.json',
userStatusPath: '/api/:version/user/status', userPath: '/api/:version/users/:id',
userStatusPath: '/api/:version/users/:id/status',
userPostStatusPath: '/api/:version/user/status',
commitPath: '/api/:version/projects/:id/repository/commits', commitPath: '/api/:version/projects/:id/repository/commits',
applySuggestionPath: '/api/:version/suggestions/:id/apply',
commitPipelinesPath: '/:project_id/commit/:sha/pipelines', commitPipelinesPath: '/:project_id/commit/:sha/pipelines',
branchSinglePath: '/api/:version/projects/:id/repository/branches/:branch', branchSinglePath: '/api/:version/projects/:id/repository/branches/:branch',
createBranchPath: '/api/:version/projects/:id/repository/branches', createBranchPath: '/api/:version/projects/:id/repository/branches',
...@@ -183,6 +186,12 @@ const Api = { ...@@ -183,6 +186,12 @@ const Api = {
}); });
}, },
applySuggestion(id) {
const url = Api.buildUrl(Api.applySuggestionPath).replace(':id', encodeURIComponent(id));
return axios.put(url);
},
commitPipelines(projectId, sha) { commitPipelines(projectId, sha) {
const encodedProjectId = projectId const encodedProjectId = projectId
.split('/') .split('/')
...@@ -254,6 +263,20 @@ const Api = { ...@@ -254,6 +263,20 @@ const Api = {
}); });
}, },
user(id, options) {
const url = Api.buildUrl(this.userPath).replace(':id', encodeURIComponent(id));
return axios.get(url, {
params: options,
});
},
userStatus(id, options) {
const url = Api.buildUrl(this.userStatusPath).replace(':id', encodeURIComponent(id));
return axios.get(url, {
params: options,
});
},
branches(id, query = '', options = {}) { branches(id, query = '', options = {}) {
const url = Api.buildUrl(this.createBranchPath).replace(':id', encodeURIComponent(id)); const url = Api.buildUrl(this.createBranchPath).replace(':id', encodeURIComponent(id));
...@@ -276,7 +299,7 @@ const Api = { ...@@ -276,7 +299,7 @@ const Api = {
}, },
postUserStatus({ emoji, message }) { postUserStatus({ emoji, message }) {
const url = Api.buildUrl(this.userStatusPath); const url = Api.buildUrl(this.userPostStatusPath);
return axios.put(url, { return axios.put(url, {
emoji, emoji,
... ...
......
...@@ -3,6 +3,7 @@ import syntaxHighlight from '~/syntax_highlight'; ...@@ -3,6 +3,7 @@ import syntaxHighlight from '~/syntax_highlight';
import renderMath from './render_math'; import renderMath from './render_math';
import renderMermaid from './render_mermaid'; import renderMermaid from './render_mermaid';
import highlightCurrentUser from './highlight_current_user'; import highlightCurrentUser from './highlight_current_user';
import initUserPopovers from '../../user_popovers';
// Render GitLab flavoured Markdown // Render GitLab flavoured Markdown
// //
...@@ -13,6 +14,7 @@ $.fn.renderGFM = function renderGFM() { ...@@ -13,6 +14,7 @@ $.fn.renderGFM = function renderGFM() {
renderMath(this.find('.js-render-math')); renderMath(this.find('.js-render-math'));
renderMermaid(this.find('.js-render-mermaid')); renderMermaid(this.find('.js-render-mermaid'));
highlightCurrentUser(this.find('.gfm-project_member').get()); highlightCurrentUser(this.find('.gfm-project_member').get());
initUserPopovers(this.find('.gfm-project_member').get());
return this; return this;
}; };
... ...
......
...@@ -15,6 +15,16 @@ export default { ...@@ -15,6 +15,16 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
cssClass: {
type: String,
required: false,
default: '',
},
tooltipPlacement: {
type: String,
required: false,
default: 'bottom',
},
}, },
computed: { computed: {
title() { title() {
...@@ -66,15 +76,13 @@ export default { ...@@ -66,15 +76,13 @@ export default {
<template> <template>
<span> <span>
<span ref="issueDueDate" class="board-card-info card-number"> <span ref="issueDueDate" :class="cssClass" class="board-card-info card-number">
<icon <icon :class="{ 'text-danger': isPastDue, 'board-card-info-icon': true }" name="calendar" />
:class="{ 'text-danger': isPastDue, 'board-card-info-icon': true }" <time :class="{ 'text-danger': isPastDue }" datetime="date" class="board-card-info-text">{{
name="calendar"
/><time :class="{ 'text-danger': isPastDue }" datetime="date" class="board-card-info-text">{{
body body
}}</time> }}</time>
</span> </span>
<gl-tooltip :target="() => $refs.issueDueDate" placement="bottom"> <gl-tooltip :target="() => $refs.issueDueDate" :placement="tooltipPlacement">
<span class="bold">{{ __('Due date') }}</span> <br /> <span class="bold">{{ __('Due date') }}</span> <br />
<span :class="{ 'text-danger-muted': isPastDue }">{{ title }}</span> <span :class="{ 'text-danger-muted': isPastDue }">{{ title }}</span>
</gl-tooltip> </gl-tooltip>
... ...
......
...@@ -42,6 +42,16 @@ export default { ...@@ -42,6 +42,16 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
changesEmptyStateIllustration: {
type: String,
required: false,
default: '',
},
}, },
data() { data() {
return { return {
...@@ -196,6 +206,7 @@ export default { ...@@ -196,6 +206,7 @@ export default {
v-for="file in diffFiles" v-for="file in diffFiles"
:key="file.newPath" :key="file.newPath"
:file="file" :file="file"
:help-page-path="helpPagePath"
:can-current-user-fork="canCurrentUserFork" :can-current-user-fork="canCurrentUserFork"
/> />
</template> </template>
... ...
......
...@@ -23,6 +23,11 @@ export default { ...@@ -23,6 +23,11 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
...mapState({ ...mapState({
...@@ -74,11 +79,13 @@ export default { ...@@ -74,11 +79,13 @@ export default {
v-if="isInlineView" v-if="isInlineView"
:diff-file="diffFile" :diff-file="diffFile"
:diff-lines="diffFile.highlighted_diff_lines || []" :diff-lines="diffFile.highlighted_diff_lines || []"
:help-page-path="helpPagePath"
/> />
<parallel-diff-view <parallel-diff-view
v-if="isParallelView" v-if="isParallelView"
:diff-file="diffFile" :diff-file="diffFile"
:diff-lines="diffFile.parallel_diff_lines || []" :diff-lines="diffFile.parallel_diff_lines || []"
:help-page-path="helpPagePath"
/> />
</template> </template>
<diff-viewer <diff-viewer
... ...
......
...@@ -13,6 +13,11 @@ export default { ...@@ -13,6 +13,11 @@ export default {
type: Array, type: Array,
required: true, required: true,
}, },
line: {
type: Object,
required: false,
default: null,
},
shouldCollapseDiscussions: { shouldCollapseDiscussions: {
type: Boolean, type: Boolean,
required: false, required: false,
...@@ -23,6 +28,11 @@ export default { ...@@ -23,6 +28,11 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
methods: { methods: {
...mapActions(['toggleDiscussion']), ...mapActions(['toggleDiscussion']),
...@@ -72,6 +82,8 @@ export default { ...@@ -72,6 +82,8 @@ export default {
:render-diff-file="false" :render-diff-file="false"
:always-expanded="true" :always-expanded="true"
:discussions-by-diff-order="true" :discussions-by-diff-order="true"
:line="line"
:help-page-path="helpPagePath"
@noteDeleted="deleteNoteHandler" @noteDeleted="deleteNoteHandler"
> >
<span v-if="renderAvatarBadge" slot="avatar-badge" class="badge badge-pill"> <span v-if="renderAvatarBadge" slot="avatar-badge" class="badge badge-pill">
... ...
......
...@@ -4,6 +4,7 @@ import _ from 'underscore'; ...@@ -4,6 +4,7 @@ import _ from 'underscore';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import eventHub from '../../notes/event_hub';
import DiffFileHeader from './diff_file_header.vue'; import DiffFileHeader from './diff_file_header.vue';
import DiffContent from './diff_content.vue'; import DiffContent from './diff_content.vue';
...@@ -22,6 +23,11 @@ export default { ...@@ -22,6 +23,11 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
data() { data() {
return { return {
...@@ -75,6 +81,9 @@ export default { ...@@ -75,6 +81,9 @@ export default {
} }
}, },
}, },
created() {
eventHub.$on(`loadCollapsedDiff/${this.file.file_hash}`, this.handleLoadCollapsedDiff);
},
methods: { methods: {
...mapActions('diffs', ['loadCollapsedDiff', 'assignDiscussionsToDiff']), ...mapActions('diffs', ['loadCollapsedDiff', 'assignDiscussionsToDiff']),
handleToggle() { handleToggle() {
...@@ -160,6 +169,7 @@ export default { ...@@ -160,6 +169,7 @@ export default {
v-if="!isCollapsed && file.renderIt" v-if="!isCollapsed && file.renderIt"
:class="{ hidden: isCollapsed || file.too_large }" :class="{ hidden: isCollapsed || file.too_large }"
:diff-file="file" :diff-file="file"
:help-page-path="helpPagePath"
/> />
<gl-loading-icon v-if="showLoadingIcon" class="diff-content loading" /> <gl-loading-icon v-if="showLoadingIcon" class="diff-content loading" />
<div v-else-if="showExpandMessage" class="nothing-here-block diff-collapsed"> <div v-else-if="showExpandMessage" class="nothing-here-block diff-collapsed">
... ...
......
...@@ -94,6 +94,7 @@ export default { ...@@ -94,6 +94,7 @@ export default {
ref="noteForm" ref="noteForm"
:is-editing="true" :is-editing="true"
:line-code="line.line_code" :line-code="line.line_code"
:line="line"
save-button-title="Comment" save-button-title="Comment"
class="diff-comment-form" class="diff-comment-form"
@cancelForm="handleCancelCommentForm" @cancelForm="handleCancelCommentForm"
... ...
......
...@@ -16,6 +16,11 @@ export default { ...@@ -16,6 +16,11 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
className() { className() {
...@@ -38,7 +43,12 @@ export default { ...@@ -38,7 +43,12 @@ export default {
<tr v-if="shouldRender" :class="className" class="notes_holder"> <tr v-if="shouldRender" :class="className" class="notes_holder">
<td class="notes_content" colspan="3"> <td class="notes_content" colspan="3">
<div class="content"> <div class="content">
<diff-discussions v-if="line.discussions.length" :discussions="line.discussions" /> <diff-discussions
v-if="line.discussions.length"
:line="line"
:discussions="line.discussions"
:help-page-path="helpPagePath"
/>
<diff-line-note-form <diff-line-note-form
v-if="line.hasForm" v-if="line.hasForm"
:diff-file-hash="diffFileHash" :diff-file-hash="diffFileHash"
... ...
......
...@@ -17,6 +17,11 @@ export default { ...@@ -17,6 +17,11 @@ export default {
type: Array, type: Array,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
...mapGetters('diffs', ['commitId']), ...mapGetters('diffs', ['commitId']),
...@@ -47,6 +52,7 @@ export default { ...@@ -47,6 +52,7 @@ export default {
:key="`icr-${index}`" :key="`icr-${index}`"
:diff-file-hash="diffFile.file_hash" :diff-file-hash="diffFile.file_hash"
:line="line" :line="line"
:help-page-path="helpPagePath"
/> />
</template> </template>
</tbody> </tbody>
... ...
......
...@@ -20,6 +20,11 @@ export default { ...@@ -20,6 +20,11 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
hasExpandedDiscussionOnLeft() { hasExpandedDiscussionOnLeft() {
...@@ -87,6 +92,8 @@ export default { ...@@ -87,6 +92,8 @@ export default {
<diff-discussions <diff-discussions
v-if="line.left.discussions.length" v-if="line.left.discussions.length"
:discussions="line.left.discussions" :discussions="line.left.discussions"
:line="line.left"
:help-page-path="helpPagePath"
/> />
</div> </div>
<diff-line-note-form <diff-line-note-form
...@@ -102,6 +109,8 @@ export default { ...@@ -102,6 +109,8 @@ export default {
<diff-discussions <diff-discussions
v-if="line.right.discussions.length" v-if="line.right.discussions.length"
:discussions="line.right.discussions" :discussions="line.right.discussions"
:line="line.right"
:help-page-path="helpPagePath"
/> />
</div> </div>
<diff-line-note-form <diff-line-note-form
... ...
......
...@@ -17,6 +17,11 @@ export default { ...@@ -17,6 +17,11 @@ export default {
type: Array, type: Array,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
...mapGetters('diffs', ['commitId']), ...mapGetters('diffs', ['commitId']),
...@@ -49,6 +54,7 @@ export default { ...@@ -49,6 +54,7 @@ export default {
:line="line" :line="line"
:diff-file-hash="diffFile.file_hash" :diff-file-hash="diffFile.file_hash"
:line-index="index" :line-index="index"
:help-page-path="helpPagePath"
/> />
</template> </template>
</tbody> </tbody>
... ...
......
...@@ -16,6 +16,7 @@ export default function initDiffsApp(store) { ...@@ -16,6 +16,7 @@ export default function initDiffsApp(store) {
return { return {
endpoint: dataset.endpoint, endpoint: dataset.endpoint,
projectPath: dataset.projectPath, projectPath: dataset.projectPath,
helpPagePath: dataset.helpPagePath,
currentUser: JSON.parse(dataset.currentUserData) || {}, currentUser: JSON.parse(dataset.currentUserData) || {},
}; };
}, },
...@@ -30,6 +31,7 @@ export default function initDiffsApp(store) { ...@@ -30,6 +31,7 @@ export default function initDiffsApp(store) {
endpoint: this.endpoint, endpoint: this.endpoint,
currentUser: this.currentUser, currentUser: this.currentUser,
projectPath: this.projectPath, projectPath: this.projectPath,
helpPagePath: this.helpPagePath,
shouldShow: this.activeTab === 'diffs', shouldShow: this.activeTab === 'diffs',
}, },
}); });
... ...
......
...@@ -3,8 +3,9 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -3,8 +3,9 @@ import axios from '~/lib/utils/axios_utils';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { handleLocationHash, historyPushState } from '~/lib/utils/common_utils'; import { handleLocationHash, historyPushState, scrollToElement } from '~/lib/utils/common_utils';
import { mergeUrlParams, getLocationHash } from '~/lib/utils/url_utility'; import { mergeUrlParams, getLocationHash } from '~/lib/utils/url_utility';
import eventHub from '../../notes/event_hub';
import { getDiffPositionByLineCode, getNoteFormData } from './utils'; import { getDiffPositionByLineCode, getNoteFormData } from './utils';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { import {
...@@ -53,6 +54,10 @@ export const assignDiscussionsToDiff = ( ...@@ -53,6 +54,10 @@ export const assignDiscussionsToDiff = (
diffPositionByLineCode, diffPositionByLineCode,
}); });
}); });
Vue.nextTick(() => {
eventHub.$emit('scrollToDiscussion');
});
}; };
export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => { export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => {
...@@ -60,6 +65,27 @@ export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => { ...@@ -60,6 +65,27 @@ export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => {
commit(types.REMOVE_LINE_DISCUSSIONS_FOR_FILE, { fileHash: file_hash, lineCode: line_code, id }); commit(types.REMOVE_LINE_DISCUSSIONS_FOR_FILE, { fileHash: file_hash, lineCode: line_code, id });
}; };
export const renderFileForDiscussionId = ({ commit, rootState, state }, discussionId) => {
const discussion = rootState.notes.discussions.find(d => d.id === discussionId);
if (discussion) {
const file = state.diffFiles.find(f => f.file_hash === discussion.diff_file.file_hash);
if (file) {
if (!file.renderIt) {
commit(types.RENDER_FILE, file);
}
if (file.collapsed) {
eventHub.$emit(`loadCollapsedDiff/${file.file_hash}`);
scrollToElement(document.getElementById(file.file_hash));
} else {
eventHub.$emit('scrollToDiscussion');
}
}
}
};
export const startRenderDiffsQueue = ({ state, commit }) => { export const startRenderDiffsQueue = ({ state, commit }) => {
const checkItem = () => const checkItem = () =>
new Promise(resolve => { new Promise(resolve => {
... ...
......
...@@ -123,22 +123,23 @@ export default { ...@@ -123,22 +123,23 @@ export default {
diffPosition: diffPositionByLineCode[line.line_code], diffPosition: diffPositionByLineCode[line.line_code],
latestDiff, latestDiff,
}); });
const mapDiscussions = (line, extraCheck = () => true) => ({
...line,
discussions: extraCheck()
? line.discussions
.filter(() => !line.discussions.some(({ id }) => discussion.id === id))
.concat(lineCheck(line) ? discussion : line.discussions)
: [],
});
state.diffFiles = state.diffFiles.map(diffFile => { state.diffFiles = state.diffFiles.map(diffFile => {
if (diffFile.file_hash === fileHash) { if (diffFile.file_hash === fileHash) {
const file = { ...diffFile }; const file = { ...diffFile };
if (file.highlighted_diff_lines) { if (file.highlighted_diff_lines) {
file.highlighted_diff_lines = file.highlighted_diff_lines.map(line => { file.highlighted_diff_lines = file.highlighted_diff_lines.map(line =>
if (!line.discussions.some(({ id }) => discussion.id === id) && lineCheck(line)) { mapDiscussions(line),
return { );
...line,
discussions: line.discussions.concat(discussion),
};
}
return line;
});
} }
if (file.parallel_diff_lines) { if (file.parallel_diff_lines) {
...@@ -148,20 +149,8 @@ export default { ...@@ -148,20 +149,8 @@ export default {
if (left || right) { if (left || right) {
return { return {
left: { left: line.left ? mapDiscussions(line.left) : null,
...line.left, right: line.right ? mapDiscussions(line.right, () => !left) : null,
discussions:
left && !line.left.discussions.some(({ id }) => id === discussion.id)
? line.left.discussions.concat(discussion)
: (line.left && line.left.discussions) || [],
},
right: {
...line.right,
discussions:
right && !left && !line.right.discussions.some(({ id }) => id === discussion.id)
? line.right.discussions.concat(discussion)
: (line.right && line.right.discussions) || [],
},
}; };
} }
...@@ -170,7 +159,7 @@ export default { ...@@ -170,7 +159,7 @@ export default {
} }
if (!file.parallel_diff_lines || !file.highlighted_diff_lines) { if (!file.parallel_diff_lines || !file.highlighted_diff_lines) {
file.discussions = file.discussions.concat(discussion); file.discussions = (file.discussions || []).concat(discussion);
} }
return file; return file;
...@@ -180,7 +169,7 @@ export default { ...@@ -180,7 +169,7 @@ export default {
}); });
}, },
[types.REMOVE_LINE_DISCUSSIONS_FOR_FILE](state, { fileHash, lineCode, id }) { [types.REMOVE_LINE_DISCUSSIONS_FOR_FILE](state, { fileHash, lineCode }) {
const selectedFile = state.diffFiles.find(f => f.file_hash === fileHash); const selectedFile = state.diffFiles.find(f => f.file_hash === fileHash);
if (selectedFile) { if (selectedFile) {
if (selectedFile.parallel_diff_lines) { if (selectedFile.parallel_diff_lines) {
...@@ -193,7 +182,7 @@ export default { ...@@ -193,7 +182,7 @@ export default {
const side = targetLine.left && targetLine.left.line_code === lineCode ? 'left' : 'right'; const side = targetLine.left && targetLine.left.line_code === lineCode ? 'left' : 'right';
Object.assign(targetLine[side], { Object.assign(targetLine[side], {
discussions: [], discussions: targetLine[side].discussions.filter(discussion => discussion.notes.length),
}); });
} }
} }
...@@ -205,14 +194,14 @@ export default { ...@@ -205,14 +194,14 @@ export default {
if (targetInlineLine) { if (targetInlineLine) {
Object.assign(targetInlineLine, { Object.assign(targetInlineLine, {
discussions: [], discussions: targetInlineLine.discussions.filter(discussion => discussion.notes.length),
}); });
} }
} }
if (selectedFile.discussions && selectedFile.discussions.length) { if (selectedFile.discussions && selectedFile.discussions.length) {
selectedFile.discussions = selectedFile.discussions.filter( selectedFile.discussions = selectedFile.discussions.filter(
discussion => discussion.id !== id, discussion => discussion.notes.length,
); );
} }
} }
... ...
......