Commit 8d836d76 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents b4203e70 f821a53b
...@@ -29,6 +29,11 @@ export default { ...@@ -29,6 +29,11 @@ export default {
type: Object, type: Object,
required: true, required: true,
}, },
helpPagePath: {
type: String,
required: false,
default: '',
},
}, },
computed: { computed: {
...mapState({ ...mapState({
...@@ -96,6 +101,7 @@ export default { ...@@ -96,6 +101,7 @@ export default {
:is-editing="true" :is-editing="true"
:line-code="line.line_code" :line-code="line.line_code"
:line="line" :line="line"
:help-page-path="helpPagePath"
save-button-title="Comment" save-button-title="Comment"
class="diff-comment-form" class="diff-comment-form"
@handleFormUpdateAddToReview="addToReview" @handleFormUpdateAddToReview="addToReview"
......
...@@ -54,6 +54,7 @@ export default { ...@@ -54,6 +54,7 @@ export default {
:diff-file-hash="diffFileHash" :diff-file-hash="diffFileHash"
:line="line" :line="line"
:note-target-line="line" :note-target-line="line"
:help-page-path="helpPagePath"
/> />
</div> </div>
</td> </td>
......
...@@ -101,6 +101,7 @@ export default { ...@@ -101,6 +101,7 @@ export default {
:diff-file-hash="diffFileHash" :diff-file-hash="diffFileHash"
:line="line.left" :line="line.left"
:note-target-line="line.left" :note-target-line="line.left"
:help-page-path="helpPagePath"
line-position="left" line-position="left"
/> />
</td> </td>
......
...@@ -182,9 +182,9 @@ export default { ...@@ -182,9 +182,9 @@ export default {
this.hasSuggestion = data.references.suggestions && data.references.suggestions.length; this.hasSuggestion = data.references.suggestions && data.references.suggestions.length;
} }
this.$nextTick(() => { this.$nextTick()
$(this.$refs['markdown-preview']).renderGFM(); .then(() => $(this.$refs['markdown-preview']).renderGFM())
}); .catch(() => new Flash(__('Error rendering markdown preview')));
}, },
versionedPreviewPath() { versionedPreviewPath() {
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
<div class="md-suggestion-header border-bottom-0 mt-2"> <div class="md-suggestion-header border-bottom-0 mt-2">
<div class="qa-suggestion-diff-header font-weight-bold"> <div class="qa-suggestion-diff-header font-weight-bold">
{{ __('Suggested change') }} {{ __('Suggested change') }}
<a v-if="helpPagePath" :href="helpPagePath" :aria-label="__('Help')"> <a v-if="helpPagePath" :href="helpPagePath" :aria-label="__('Help')" class="js-help-btn">
<icon name="question-o" css-classes="link-highlight" /> <icon name="question-o" css-classes="link-highlight" />
</a> </a>
</div> </div>
......
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
max-height: calc(100vh - 100px); max-height: calc(100vh - 100px);
} }
table { table:not(.js-syntax-highlight) {
@include markdown-table; @include markdown-table;
} }
} }
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
margin: 0 0 16px; margin: 0 0 16px;
} }
table { table:not(.js-syntax-highlight) {
@extend .table; @extend .table;
@extend .table-bordered; @extend .table-bordered;
margin: 16px 0; margin: 16px 0;
......
---
title: Fix syntax highlighting for suggested changes preview
merge_request: 24358
author:
type: fixed
...@@ -3521,6 +3521,9 @@ msgstr "" ...@@ -3521,6 +3521,9 @@ msgstr ""
msgid "Error occurred when toggling the notification subscription" msgid "Error occurred when toggling the notification subscription"
msgstr "" msgstr ""
msgid "Error rendering markdown preview"
msgstr ""
msgid "Error saving label update." msgid "Error saving label update."
msgstr "" msgstr ""
......
...@@ -31,6 +31,12 @@ describe('Suggestion Diff component', () => { ...@@ -31,6 +31,12 @@ describe('Suggestion Diff component', () => {
expect(header.innerHTML.includes('Suggested change')).toBe(true); expect(header.innerHTML.includes('Suggested change')).toBe(true);
}); });
it('renders a help button', () => {
const helpBtn = vm.$el.querySelector('.js-help-btn');
expect(helpBtn).not.toBeNull();
});
it('renders an apply button', () => { it('renders an apply button', () => {
const applyBtn = vm.$el.querySelector('.qa-apply-btn'); const applyBtn = vm.$el.querySelector('.qa-apply-btn');
......
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