Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f3b9eda9
Commit
f3b9eda9
authored
Jan 15, 2019
by
Jacques Erasmus
Committed by
Kushal Pandya
Jan 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add syntax highlighting to suggestion preview
parent
cbad001c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
6 deletions
+28
-6
app/assets/javascripts/diffs/components/diff_line_note_form.vue
...sets/javascripts/diffs/components/diff_line_note_form.vue
+6
-0
app/assets/javascripts/diffs/components/inline_diff_comment_row.vue
.../javascripts/diffs/components/inline_diff_comment_row.vue
+1
-0
app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue
...avascripts/diffs/components/parallel_diff_comment_row.vue
+1
-0
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+3
-3
app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
...vue_shared/components/markdown/suggestion_diff_header.vue
+1
-1
app/assets/stylesheets/framework/markdown_area.scss
app/assets/stylesheets/framework/markdown_area.scss
+1
-1
app/assets/stylesheets/framework/typography.scss
app/assets/stylesheets/framework/typography.scss
+1
-1
changelogs/unreleased/55945-suggested-change-preview-highlight.yml
...s/unreleased/55945-suggested-change-preview-highlight.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/javascripts/vue_shared/components/markdown/suggestion_diff_header_spec.js
...shared/components/markdown/suggestion_diff_header_spec.js
+6
-0
No files found.
app/assets/javascripts/diffs/components/diff_line_note_form.vue
View file @
f3b9eda9
...
...
@@ -28,6 +28,11 @@ export default {
type
:
Object
,
required
:
true
,
},
helpPagePath
:
{
type
:
String
,
required
:
false
,
default
:
''
,
},
},
computed
:
{
...
mapState
({
...
...
@@ -95,6 +100,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"
@
cancelForm=
"handleCancelCommentForm"
...
...
app/assets/javascripts/diffs/components/inline_diff_comment_row.vue
View file @
f3b9eda9
...
...
@@ -54,6 +54,7 @@ export default {
:diff-file-hash=
"diffFileHash"
:line=
"line"
:note-target-line=
"line"
:help-page-path=
"helpPagePath"
/>
</div>
</td>
...
...
app/assets/javascripts/diffs/components/parallel_diff_comment_row.vue
View file @
f3b9eda9
...
...
@@ -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>
...
...
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
f3b9eda9
...
...
@@ -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
()
{
...
...
app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
View file @
f3b9eda9
...
...
@@ -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>
...
...
app/assets/stylesheets/framework/markdown_area.scss
View file @
f3b9eda9
...
...
@@ -158,7 +158,7 @@
max-height
:
calc
(
100vh
-
100px
);
}
table
{
table
:not
(
.js-syntax-highlight
)
{
@include
markdown-table
;
}
}
...
...
app/assets/stylesheets/framework/typography.scss
View file @
f3b9eda9
...
...
@@ -143,7 +143,7 @@
margin
:
0
0
16px
;
}
table
{
table
:not
(
.js-syntax-highlight
)
{
@extend
.table
;
@extend
.table-bordered
;
margin
:
16px
0
;
...
...
changelogs/unreleased/55945-suggested-change-preview-highlight.yml
0 → 100644
View file @
f3b9eda9
---
title
:
Fix syntax highlighting for suggested changes preview
merge_request
:
24358
author
:
type
:
fixed
locale/gitlab.pot
View file @
f3b9eda9
...
...
@@ -2956,6 +2956,9 @@ msgstr ""
msgid "Error occurred when toggling the notification subscription"
msgstr ""
msgid "Error rendering markdown preview"
msgstr ""
msgid "Error saving label update."
msgstr ""
...
...
spec/javascripts/vue_shared/components/markdown/suggestion_diff_header_spec.js
View file @
f3b9eda9
...
...
@@ -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
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment