Commit ae9b2905 authored by Phil Hughes's avatar Phil Hughes

Remove safe HTML from diff rows

The diffs get sanitized on the backend before we
recieve any data so this removes that directive
to help increase rendering performance.

Also removed some data getting set on the state when it shouldn't be.
parent 743959dd
<script> <script>
import { GlTooltipDirective, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; /* eslint-disable vue/no-v-html */
import { GlTooltipDirective } from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants'; import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
...@@ -21,7 +22,6 @@ export default { ...@@ -21,7 +22,6 @@ export default {
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
SafeHtml,
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
props: { props: {
...@@ -256,7 +256,7 @@ export default { ...@@ -256,7 +256,7 @@ export default {
@mousedown="handleParallelLineMouseDown" @mousedown="handleParallelLineMouseDown"
> >
<strong v-if="isLeftConflictMarker">{{ conflictText(line.left) }}</strong> <strong v-if="isLeftConflictMarker">{{ conflictText(line.left) }}</strong>
<span v-else v-safe-html="line.left.rich_text"></span> <span v-else v-html="line.left.rich_text"></span>
</div> </div>
</template> </template>
<template v-else-if="!inline || (line.left && line.left.type === $options.CONFLICT_MARKER)"> <template v-else-if="!inline || (line.left && line.left.type === $options.CONFLICT_MARKER)">
...@@ -345,7 +345,6 @@ export default { ...@@ -345,7 +345,6 @@ export default {
<div <div
:id="line.right.line_code" :id="line.right.line_code"
:key="line.right.rich_text" :key="line.right.rich_text"
v-safe-html="line.right.rich_text"
:class="[ :class="[
line.right.type, line.right.type,
{ {
...@@ -360,7 +359,7 @@ export default { ...@@ -360,7 +359,7 @@ export default {
<strong v-if="line.right.type === $options.CONFLICT_MARKER_THEIR">{{ <strong v-if="line.right.type === $options.CONFLICT_MARKER_THEIR">{{
conflictText(line.right) conflictText(line.right)
}}</strong> }}</strong>
<span v-else v-safe-html="line.right.rich_text"></span> <span v-else v-html="line.right.rich_text"></span>
</div> </div>
</template> </template>
<template v-else> <template v-else>
......
...@@ -77,15 +77,10 @@ export default { ...@@ -77,15 +77,10 @@ export default {
}, },
[types.SET_DIFF_DATA_BATCH](state, data) { [types.SET_DIFF_DATA_BATCH](state, data) {
const files = prepareDiffData({ state.diffFiles = prepareDiffData({
diff: data, diff: data,
priorFiles: state.diffFiles, priorFiles: state.diffFiles,
}); });
Object.assign(state, {
...convertObjectPropsToCamelCase(data),
});
updateDiffFilesInState(state, files);
}, },
[types.SET_COVERAGE_DATA](state, coverageFiles) { [types.SET_COVERAGE_DATA](state, coverageFiles) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment