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 {
...
@@ -36,13 +36,13 @@ export default {
return
this
.
diffData
.
filter
(
this
.
shouldShowLine
);
return
this
.
diffData
.
filter
(
this
.
shouldShowLine
);
},
},
isDiffView
()
{
isDiffView
()
{
return
this
.
view
===
VIEW_TYPES
.
DIFF
;
return
this
.
view
===
this
.
$options
.
viewTypes
.
DIFF
;
},
},
isBeforeView
()
{
isBeforeView
()
{
return
this
.
view
===
VIEW_TYPES
.
BEFORE
;
return
this
.
view
===
this
.
$options
.
viewTypes
.
BEFORE
;
},
},
isAfterView
()
{
isAfterView
()
{
return
this
.
view
===
VIEW_TYPES
.
AFTER
;
return
this
.
view
===
this
.
$options
.
viewTypes
.
AFTER
;
},
},
},
},
methods
:
{
methods
:
{
...
@@ -110,10 +110,10 @@ export default {
...
@@ -110,10 +110,10 @@ export default {
class=
"line_holder"
class=
"line_holder"
data-testid=
"diffLine"
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
}}
{{
line
.
oldLine
}}
</td>
</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
}}
{{
line
.
newLine
}}
</td>
</td>
<td
data-testid=
"diffContent"
class=
"line_content"
:class=
"changeClass(line)"
>
<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';
...
@@ -8,11 +8,11 @@ import { LINE_TYPES } from './constants';
export
function
splitAction
(
action
)
{
export
function
splitAction
(
action
)
{
const
splitValues
=
action
.
value
.
split
(
/
(\n)
/
);
const
splitValues
=
action
.
value
.
split
(
/
(\n)
/
);
if
(
splitValues
.
length
>=
2
&&
const
isEmptyCharacter
=
splitValues
[
splitValues
.
length
-
1
]
===
''
;
splitValues
[
splitValues
.
length
-
1
]
===
''
&&
const
isNewLine
=
splitValues
[
splitValues
.
length
-
2
]
===
'
\n
'
;
splitValues
[
splitValues
.
length
-
2
]
===
'
\n
'
)
{
if
(
splitValues
.
length
>=
2
&&
isEmptyCharacter
&&
isNewLine
)
{
splitValues
.
pop
();
splitValues
.
pop
();
}
}
return
splitValues
.
map
((
splitValue
)
=>
({
return
splitValues
.
map
((
splitValue
)
=>
({
...
@@ -110,14 +110,12 @@ function splitLinesInline(lines) {
...
@@ -110,14 +110,12 @@ function splitLinesInline(lines) {
export
function
groupActionsByLines
(
actions
)
{
export
function
groupActionsByLines
(
actions
)
{
const
res
=
[];
const
res
=
[];
let
currLine
=
null
;
let
currLine
=
{
actions
:
[]
};
const
newLine
=
()
=>
{
const
newLine
=
()
=>
{
if
(
currLine
!==
null
)
{
res
.
push
(
currLine
);
res
.
push
(
currLine
);
}
currLine
=
{
actions
:
[]
};
currLine
=
{
actions
:
[]
};
};
};
newLine
();
actions
.
forEach
((
action
)
=>
{
actions
.
forEach
((
action
)
=>
{
if
(
action
.
added
)
{
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