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