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
866a7f49
Commit
866a7f49
authored
Mar 27, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves popover button to it's own component
parent
98b294e0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
44 deletions
+58
-44
ee/app/assets/javascripts/vue_shared/security_reports/components/error_row.vue
...ipts/vue_shared/security_reports/components/error_row.vue
+2
-2
ee/app/assets/javascripts/vue_shared/security_reports/components/help_popover.vue
...s/vue_shared/security_reports/components/help_popover.vue
+42
-0
ee/app/assets/javascripts/vue_shared/security_reports/components/loading_row.vue
...ts/vue_shared/security_reports/components/loading_row.vue
+2
-2
ee/app/assets/javascripts/vue_shared/security_reports/components/summary_row.vue
...ts/vue_shared/security_reports/components/summary_row.vue
+8
-33
spec/javascripts/vue_shared/security_reports/components/summary_row_spec.js
...ue_shared/security_reports/components/summary_row_spec.js
+4
-7
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/error_row.vue
View file @
866a7f49
...
...
@@ -20,8 +20,8 @@ export default {
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue"
>
<div
class=
"report-block-list-icon append-right-10 prepend-left-
10
"
>
<div
class=
"report-block-list-issue
prepend-left-default append-right-default
"
>
<div
class=
"report-block-list-icon append-right-10 prepend-left-
5
"
>
<ci-icon
:status=
"iconStatus"
/>
</div>
<div
class=
"report-block-list-issue-description"
>
...
...
ee/app/assets/javascripts/vue_shared/security_reports/components/help_popover.vue
0 → 100644
View file @
866a7f49
<
script
>
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
popover
from
'
~/vue_shared/directives/popover
'
;
export
default
{
name
:
'
SecurityReportsHelpPopover
'
,
components
:
{
Icon
,
},
directives
:
{
popover
,
},
props
:
{
options
:
{
type
:
Object
,
required
:
true
,
},
},
computed
:
{
popoverOptions
()
{
return
{
html
:
true
,
trigger
:
'
focus
'
,
placement
:
'
top
'
,
template
:
'
<div class="popover" role="tooltip"><div class="arrow"></div><p class="popover-title"></p><div class="popover-content"></div></div>
'
,
...
this
.
options
,
};
},
},
};
</
script
>
<
template
>
<button
type=
"button"
class=
"btn-transparent btn-blank"
v-popover=
"popoverOptions"
tabindex=
"0"
>
<icon
name=
"question"
/>
</button>
</
template
>
ee/app/assets/javascripts/vue_shared/security_reports/components/loading_row.vue
View file @
866a7f49
...
...
@@ -13,8 +13,8 @@ export default {
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue"
>
<div
class=
"report-block-list-icon append-right-1
5 prepend-left-10
"
>
<div
class=
"report-block-list-issue
prepend-left-default append-right-default
"
>
<div
class=
"report-block-list-icon append-right-1
0 prepend-left-5
"
>
<loading-icon
/>
</div>
<div
class=
"report-block-list-issue-description"
>
...
...
ee/app/assets/javascripts/vue_shared/security_reports/components/summary_row.vue
View file @
866a7f49
<
script
>
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
CiIcon
from
'
~/vue_shared/components/ci_icon.vue
'
;
import
popover
from
'
~/vue_shared/directives/popover
'
;
import
Popover
from
'
./help_popover.vue
'
;
/**
* Renders the summary row for each security report
...
...
@@ -10,11 +9,8 @@ import popover from '~/vue_shared/directives/popover';
export
default
{
name
:
'
SecuritySummaryRow
'
,
components
:
{
Icon
,
CiIcon
,
},
directives
:
{
popover
,
Popover
,
},
props
:
{
summary
:
{
...
...
@@ -25,26 +21,12 @@ export default {
type
:
String
,
required
:
true
,
},
popoverTitle
:
{
type
:
String
,
required
:
true
,
},
popoverContent
:
{
type
:
String
,
popoverOptions
:
{
type
:
Object
,
required
:
true
,
},
},
computed
:
{
popoverOptions
()
{
return
{
html
:
true
,
trigger
:
'
focus
'
,
placement
:
'
top
'
,
title
:
this
.
popoverTitle
,
content
:
this
.
popoverContent
,
template
:
'
<div class="popover" role="tooltip"><div class="arrow"></div><p class="popover-title"></p><div class="popover-content"></div></div>
'
,
};
},
iconStatus
()
{
return
{
group
:
this
.
statusIcon
,
...
...
@@ -55,24 +37,17 @@ export default {
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue"
>
<div
class=
"report-block-list-icon append-right-10 prepend-left-
10
"
>
<div
class=
"report-block-list-issue
prepend-left-default append-right-default
"
>
<div
class=
"report-block-list-icon append-right-10 prepend-left-
5
"
>
<ci-icon
:status=
"iconStatus"
/>
</div>
<div
class=
"report-block-list-issue-description"
>
<div
class=
"report-block-list-issue-description
prepend-top-5 append-bottom-5
"
>
<div
class=
"report-block-list-issue-description-text append-right-5"
>
{{
summary
}}
</div>
<button
type=
"button"
class=
"btn-transparent btn-blank"
v-popover=
"popoverOptions"
tabindex=
"0"
>
<icon
name=
"question"
/>
</button>
<popover
:options=
"popoverOptions"
/>
</div>
</div>
</
template
>
spec/javascripts/vue_shared/security_reports/components/summary_row_spec.js
View file @
866a7f49
...
...
@@ -8,8 +8,10 @@ describe('Summary row', () => {
const
props
=
{
summary
:
'
SAST detected 1 new vulnerability and 1 fixed vulnerability
'
,
popoverTitle
:
'
Static Application Security Testing (SAST)
'
,
popoverContent
:
'
<a>Learn more about SAST</a>
'
,
popoverOptions
:
{
title
:
'
Static Application Security Testing (SAST)
'
,
content
:
'
<a>Learn more about SAST</a>
'
,
},
statusIcon
:
'
warning
'
,
};
...
...
@@ -32,9 +34,4 @@ describe('Summary row', () => {
'
js-ci-status-icon-warning
'
,
);
});
it
(
'
renders tooltip with provided title and content
'
,
()
=>
{
expect
(
vm
.
popoverOptions
.
title
).
toEqual
(
props
.
popoverTitle
);
expect
(
vm
.
popoverOptions
.
content
).
toEqual
(
props
.
popoverContent
);
});
});
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