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
07d90dbe
Commit
07d90dbe
authored
Jan 12, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve wording in reports in MR widget
parent
d7b67f69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
...javascripts/vue_merge_request_widget/mr_widget_options.js
+13
-13
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
+11
-11
No files found.
ee/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js
View file @
07d90dbe
...
@@ -115,39 +115,39 @@ export default {
...
@@ -115,39 +115,39 @@ export default {
securityText
()
{
securityText
()
{
if
(
this
.
mr
.
securityReport
.
length
)
{
if
(
this
.
mr
.
securityReport
.
length
)
{
return
n__
(
return
n__
(
'
%d security vulnerability detected
'
,
'
SAST detected %d security vulnerability
'
,
'
%d security vulnerabilities detected
'
,
'
SAST detected %d security vulnerabilities
'
,
this
.
mr
.
securityReport
.
length
,
this
.
mr
.
securityReport
.
length
,
);
);
}
}
return
'
N
o security vulnerabilities detected
'
;
return
'
SAST n
o security vulnerabilities detected
'
;
},
},
dockerText
()
{
dockerText
()
{
const
{
vulnerabilities
,
approved
,
unapproved
}
=
this
.
mr
.
dockerReport
;
const
{
vulnerabilities
,
approved
,
unapproved
}
=
this
.
mr
.
dockerReport
;
if
(
!
vulnerabilities
.
length
)
{
if
(
!
vulnerabilities
.
length
)
{
return
s__
(
'
ciReport|
N
o vulnerabilities were found
'
);
return
s__
(
'
ciReport|
SAST:container n
o vulnerabilities were found
'
);
}
}
if
(
!
unapproved
.
length
&&
approved
.
length
)
{
if
(
!
unapproved
.
length
&&
approved
.
length
)
{
return
n__
(
return
n__
(
'
F
ound %d approved vulnerability
'
,
'
SAST:container f
ound %d approved vulnerability
'
,
'
F
ound %d approved vulnerabilities
'
,
'
SAST:container f
ound %d approved vulnerabilities
'
,
approved
.
length
,
approved
.
length
,
);
);
}
else
if
(
unapproved
.
length
&&
!
approved
.
length
)
{
}
else
if
(
unapproved
.
length
&&
!
approved
.
length
)
{
return
n__
(
return
n__
(
'
F
ound %d vulnerability
'
,
'
SAST:container f
ound %d vulnerability
'
,
'
F
ound %d vulnerabilities
'
,
'
SAST:container f
ound %d vulnerabilities
'
,
unapproved
.
length
,
unapproved
.
length
,
);
);
}
}
return
`
${
n__
(
return
`
${
n__
(
'
F
ound %d vulnerability,
'
,
'
SAST:container f
ound %d vulnerability,
'
,
'
F
ound %d vulnerabilities,
'
,
'
SAST:container f
ound %d vulnerabilities,
'
,
vulnerabilities
.
length
,
vulnerabilities
.
length
,
)}
${
n__
(
)}
${
n__
(
'
of which %d is approved
'
,
'
of which %d is approved
'
,
...
@@ -159,13 +159,13 @@ export default {
...
@@ -159,13 +159,13 @@ export default {
dastText
()
{
dastText
()
{
if
(
this
.
mr
.
dastReport
.
length
)
{
if
(
this
.
mr
.
dastReport
.
length
)
{
return
n__
(
return
n__
(
'
%d DAST alert detected
by analyzing the review app
'
,
'
DAST detected%d alert
by analyzing the review app
'
,
'
%d DAST alerts detected
by analyzing the review app
'
,
'
DAST detected %d alerts
by analyzing the review app
'
,
this
.
mr
.
dastReport
.
length
,
this
.
mr
.
dastReport
.
length
,
);
);
}
}
return
s__
(
'
ciReport|
No DAST
alerts detected by analyzing the review app
'
);
return
s__
(
'
ciReport|
DAST no
alerts detected by analyzing the review app
'
);
},
},
codequalityStatus
()
{
codequalityStatus
()
{
...
...
spec/javascripts/vue_mr_widget/ee_mr_widget_options_spec.js
View file @
07d90dbe
...
@@ -71,7 +71,7 @@ describe('ee merge request widget options', () => {
...
@@ -71,7 +71,7 @@ describe('ee merge request widget options', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-sast-widget .js-code-text
'
).
textContent
.
trim
(),
vm
.
$el
.
querySelector
(
'
.js-sast-widget .js-code-text
'
).
textContent
.
trim
(),
).
toEqual
(
'
2 security vulnerabilities detected
'
);
).
toEqual
(
'
SAST detected 2 security vulnerabilities
'
);
done
();
done
();
},
0
);
},
0
);
});
});
...
@@ -94,7 +94,7 @@ describe('ee merge request widget options', () => {
...
@@ -94,7 +94,7 @@ describe('ee merge request widget options', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-sast-widget .js-code-text
'
).
textContent
.
trim
(),
vm
.
$el
.
querySelector
(
'
.js-sast-widget .js-code-text
'
).
textContent
.
trim
(),
).
toEqual
(
'
N
o security vulnerabilities detected
'
);
).
toEqual
(
'
SAST n
o security vulnerabilities detected
'
);
done
();
done
();
},
0
);
},
0
);
});
});
...
@@ -408,7 +408,7 @@ describe('ee merge request widget options', () => {
...
@@ -408,7 +408,7 @@ describe('ee merge request widget options', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-docker-widget .js-code-text
'
).
textContent
.
trim
(),
vm
.
$el
.
querySelector
(
'
.js-docker-widget .js-code-text
'
).
textContent
.
trim
(),
).
toEqual
(
'
F
ound 3 vulnerabilities, of which 1 is approved
'
);
).
toEqual
(
'
SAST:container f
ound 3 vulnerabilities, of which 1 is approved
'
);
vm
.
$el
.
querySelector
(
'
.js-docker-widget button
'
).
click
();
vm
.
$el
.
querySelector
(
'
.js-docker-widget button
'
).
click
();
...
@@ -494,7 +494,7 @@ describe('ee merge request widget options', () => {
...
@@ -494,7 +494,7 @@ describe('ee merge request widget options', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
expect
(
vm
.
$el
.
querySelector
(
'
.js-dast-widget .js-code-text
'
).
textContent
.
trim
(),
vm
.
$el
.
querySelector
(
'
.js-dast-widget .js-code-text
'
).
textContent
.
trim
(),
).
toEqual
(
'
2 DAST alerts detected
by analyzing the review app
'
);
).
toEqual
(
'
DAST detected 2 alerts
by analyzing the review app
'
);
vm
.
$el
.
querySelector
(
'
.js-dast-widget button
'
).
click
();
vm
.
$el
.
querySelector
(
'
.js-dast-widget button
'
).
click
();
...
@@ -585,7 +585,7 @@ describe('ee merge request widget options', () => {
...
@@ -585,7 +585,7 @@ describe('ee merge request widget options', () => {
describe
(
'
with no vulnerabilities
'
,
()
=>
{
describe
(
'
with no vulnerabilities
'
,
()
=>
{
it
(
'
returns No vulnerabilities found
'
,
()
=>
{
it
(
'
returns No vulnerabilities found
'
,
()
=>
{
expect
(
vm
.
dockerText
).
toEqual
(
'
N
o vulnerabilities were found
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container n
o vulnerabilities were found
'
);
});
});
});
});
...
@@ -604,7 +604,7 @@ describe('ee merge request widget options', () => {
...
@@ -604,7 +604,7 @@ describe('ee merge request widget options', () => {
}],
}],
unapproved
:
[],
unapproved
:
[],
};
};
expect
(
vm
.
dockerText
).
toEqual
(
'
F
ound 1 approved vulnerability
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container f
ound 1 approved vulnerability
'
);
});
});
it
(
'
returns approved information - plural
'
,
()
=>
{
it
(
'
returns approved information - plural
'
,
()
=>
{
...
@@ -628,7 +628,7 @@ describe('ee merge request widget options', () => {
...
@@ -628,7 +628,7 @@ describe('ee merge request widget options', () => {
],
],
unapproved
:
[],
unapproved
:
[],
};
};
expect
(
vm
.
dockerText
).
toEqual
(
'
F
ound 2 approved vulnerabilities
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container f
ound 2 approved vulnerabilities
'
);
});
});
});
});
...
@@ -649,7 +649,7 @@ describe('ee merge request widget options', () => {
...
@@ -649,7 +649,7 @@ describe('ee merge request widget options', () => {
],
],
approved
:
[],
approved
:
[],
};
};
expect
(
vm
.
dockerText
).
toEqual
(
'
F
ound 1 vulnerability
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container f
ound 1 vulnerability
'
);
});
});
it
(
'
returns number of vulnerabilities - plural
'
,
()
=>
{
it
(
'
returns number of vulnerabilities - plural
'
,
()
=>
{
...
@@ -673,7 +673,7 @@ describe('ee merge request widget options', () => {
...
@@ -673,7 +673,7 @@ describe('ee merge request widget options', () => {
],
],
approved
:
[],
approved
:
[],
};
};
expect
(
vm
.
dockerText
).
toEqual
(
'
F
ound 2 vulnerabilities
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container f
ound 2 vulnerabilities
'
);
});
});
});
});
...
@@ -701,7 +701,7 @@ describe('ee merge request widget options', () => {
...
@@ -701,7 +701,7 @@ describe('ee merge request widget options', () => {
],
],
};
};
expect
(
vm
.
dockerText
).
toEqual
(
'
F
ound 1 vulnerability, of which 1 is approved
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container f
ound 1 vulnerability, of which 1 is approved
'
);
});
});
it
(
'
returns message with information about both - plural
'
,
()
=>
{
it
(
'
returns message with information about both - plural
'
,
()
=>
{
...
@@ -743,7 +743,7 @@ describe('ee merge request widget options', () => {
...
@@ -743,7 +743,7 @@ describe('ee merge request widget options', () => {
},
},
],
],
};
};
expect
(
vm
.
dockerText
).
toEqual
(
'
F
ound 2 vulnerabilities, of which 2 are approved
'
);
expect
(
vm
.
dockerText
).
toEqual
(
'
SAST:container f
ound 2 vulnerabilities, of which 2 are approved
'
);
});
});
});
});
});
});
...
...
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