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
cdd10bf7
Commit
cdd10bf7
authored
Jun 25, 2020
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code to use less CSS
- use humanize method to prepare strings - remove unnecessary backticks
parent
17aa74e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
ee/app/assets/javascripts/vue_shared/security_reports/store/utils/convert_report_type.js
...hared/security_reports/store/utils/convert_report_type.js
+3
-3
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_list.vue
...scripts/vulnerabilities/components/vulnerability_list.vue
+1
-1
ee/spec/frontend/vue_shared/security_reports/store/utils_spec.js
.../frontend/vue_shared/security_reports/store/utils_spec.js
+3
-3
ee/spec/frontend/vulnerabilities/vulnerability_list_spec.js
ee/spec/frontend/vulnerabilities/vulnerability_list_spec.js
+1
-1
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/store/utils/convert_report_type.js
View file @
cdd10bf7
import
{
REPORT_TYPES
}
from
'
ee/security_dashboard/store/constants
'
;
import
{
humanize
}
from
'
~/lib/utils/text_utility
'
;
/**
* Takes the report type, that is not human-readable and converts it to be human-readable
* @param {string} reportType that is not human-readable
* @returns {string} the conversion from REPORT_TYPES or a lowercase version without '_' in it to
* be paired with the CSS class `text-capitalize`
* @returns {string} a human-readable version of the report type
*/
const
convertReportType
=
reportType
=>
{
if
(
!
reportType
)
return
''
;
const
lowerCaseType
=
reportType
.
toLowerCase
();
return
REPORT_TYPES
[
lowerCaseType
]
||
lowerCaseType
.
split
(
'
_
'
).
join
(
'
'
);
return
REPORT_TYPES
[
lowerCaseType
]
||
humanize
(
lowerCaseType
);
};
export
default
convertReportType
;
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_list.vue
View file @
cdd10bf7
...
...
@@ -112,7 +112,7 @@ export default {
key
:
'
reportType
'
,
class
:
this
.
reportTypeClass
,
label
:
s__
(
'
Reports|Scanner
'
),
thClass
:
`
${
commonThClass
}
`
,
thClass
:
commonThClass
,
},
];
},
...
...
ee/spec/frontend/vue_shared/security_reports/store/utils_spec.js
View file @
cdd10bf7
...
...
@@ -50,9 +50,9 @@ describe('security reports utils', () => {
[
'
sast
'
,
'
SAST
'
],
[
'
dependency_scanning
'
,
'
Dependency Scanning
'
],
[
'
CONTAINER_SCANNING
'
,
'
Container Scanning
'
],
[
'
CUSTOM_SCANNER
'
,
'
c
ustom scanner
'
],
[
'
mast
'
,
'
m
ast
'
],
[
'
TAST
'
,
'
t
ast
'
],
[
'
CUSTOM_SCANNER
'
,
'
C
ustom scanner
'
],
[
'
mast
'
,
'
M
ast
'
],
[
'
TAST
'
,
'
T
ast
'
],
[
undefined
,
''
],
])(
'
converts the report type "%s" to the human-readable string "%s"
'
,
(
input
,
output
)
=>
{
expect
(
convertReportType
(
input
)).
toEqual
(
output
);
...
...
ee/spec/frontend/vulnerabilities/vulnerability_list_spec.js
View file @
cdd10bf7
...
...
@@ -194,7 +194,7 @@ describe('Vulnerability list component', () => {
const
cells
=
findCells
(
'
reportType
'
);
expect
(
cells
.
wrappers
[
0
].
text
()).
toBe
(
'
SAST
'
);
expect
(
cells
.
wrappers
[
1
].
text
()).
toBe
(
'
Dependency Scanning
'
);
expect
(
cells
.
wrappers
[
2
].
text
()).
toBe
(
'
c
ustom scanner without translation
'
);
expect
(
cells
.
wrappers
[
2
].
text
()).
toBe
(
'
C
ustom scanner without translation
'
);
expect
(
cells
.
wrappers
[
3
].
text
()).
toBe
(
''
);
});
});
...
...
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