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
0eb13627
Commit
0eb13627
authored
Apr 28, 2021
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maintainer feedback changes
* Tweak styles * Refactor diff_utils
parent
f5aa8ce3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/diff.vue
.../vulnerabilities/components/generic_report/types/diff.vue
+5
-5
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/diff_utils.js
...erabilities/components/generic_report/types/diff_utils.js
+8
-10
No files found.
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/diff.vue
View file @
0eb13627
...
...
@@ -36,13 +36,13 @@ export default {
return
this
.
diffData
.
filter
(
this
.
shouldShowLine
);
},
isDiffView
()
{
return
this
.
view
===
VIEW_TYPES
.
DIFF
;
return
this
.
view
===
this
.
$options
.
viewTypes
.
DIFF
;
},
isBeforeView
()
{
return
this
.
view
===
VIEW_TYPES
.
BEFORE
;
return
this
.
view
===
this
.
$options
.
viewTypes
.
BEFORE
;
},
isAfterView
()
{
return
this
.
view
===
VIEW_TYPES
.
AFTER
;
return
this
.
view
===
this
.
$options
.
viewTypes
.
AFTER
;
},
},
methods
:
{
...
...
@@ -110,10 +110,10 @@ export default {
class=
"line_holder"
data-testid=
"diffLine"
>
<td
class=
"diff-line-num
old_line
gl-border-t-0 gl-border-b-0"
:class=
"changeClass(line)"
>
<td
class=
"diff-line-num gl-border-t-0 gl-border-b-0"
:class=
"changeClass(line)"
>
{{
line
.
oldLine
}}
</td>
<td
class=
"diff-line-num
new_line
gl-border-t-0 gl-border-b-0"
:class=
"changeClass(line)"
>
<td
class=
"diff-line-num gl-border-t-0 gl-border-b-0"
:class=
"changeClass(line)"
>
{{
line
.
newLine
}}
</td>
<td
data-testid=
"diffContent"
class=
"line_content"
:class=
"changeClass(line)"
>
...
...
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/diff_utils.js
View file @
0eb13627
...
...
@@ -8,11 +8,11 @@ import { LINE_TYPES } from './constants';
export
function
splitAction
(
action
)
{
const
splitValues
=
action
.
value
.
split
(
/
(\n)
/
);
if
(
splitValues
.
length
>=
2
&&
splitValues
[
splitValues
.
length
-
1
]
===
''
&&
splitValues
[
splitValues
.
length
-
2
]
===
'
\n
'
)
{
const
isEmptyCharacter
=
splitValues
[
splitValues
.
length
-
1
]
===
''
;
const
isNewLine
=
splitValues
[
splitValues
.
length
-
2
]
===
'
\n
'
;
if
(
splitValues
.
length
>=
2
&&
isEmptyCharacter
&&
isNewLine
)
{
splitValues
.
pop
();
}
return
splitValues
.
map
((
splitValue
)
=>
({
...
...
@@ -110,14 +110,12 @@ function splitLinesInline(lines) {
export
function
groupActionsByLines
(
actions
)
{
const
res
=
[];
let
currLine
=
null
;
let
currLine
=
{
actions
:
[]
};
const
newLine
=
()
=>
{
if
(
currLine
!==
null
)
{
res
.
push
(
currLine
);
}
currLine
=
{
actions
:
[]
};
};
newLine
();
actions
.
forEach
((
action
)
=>
{
if
(
action
.
added
)
{
...
...
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