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
7bed22b0
Commit
7bed22b0
authored
Mar 26, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds new components for grouped report in MR widget view
parent
80221cd4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
0 deletions
+221
-0
ee/app/assets/javascripts/vue_shared/security_reports/components/error_row.vue
...ipts/vue_shared/security_reports/components/error_row.vue
+31
-0
ee/app/assets/javascripts/vue_shared/security_reports/components/loading_row.vue
...ts/vue_shared/security_reports/components/loading_row.vue
+24
-0
ee/app/assets/javascripts/vue_shared/security_reports/components/summary_row.vue
...ts/vue_shared/security_reports/components/summary_row.vue
+78
-0
spec/javascripts/vue_shared/security_reports/components/error_row_spec.js
.../vue_shared/security_reports/components/error_row_spec.js
+25
-0
spec/javascripts/vue_shared/security_reports/components/loading_row_spec.js
...ue_shared/security_reports/components/loading_row_spec.js
+23
-0
spec/javascripts/vue_shared/security_reports/components/summary_row_spec.js
...ue_shared/security_reports/components/summary_row_spec.js
+40
-0
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/components/error_row.vue
0 → 100644
View file @
7bed22b0
<
script
>
import
CiIcon
from
'
~/vue_shared/components/ci_icon.vue
'
;
/**
* Renders the error row for each security report
*/
export
default
{
name
:
'
SecurityErrorRow
'
,
components
:
{
CiIcon
,
},
computed
:
{
iconStatus
()
{
return
{
group
:
'
warning
'
,
icon
:
'
status_warning
'
,
};
},
},
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue"
>
<div
class=
"report-block-list-icon append-right-10 prepend-left-10"
>
<ci-icon
:status=
"iconStatus"
/>
</div>
<div
class=
"report-block-list-issue-description"
>
{{
__
(
"
There was an error loading results
"
)
}}
</div>
</div>
</
template
>
ee/app/assets/javascripts/vue_shared/security_reports/components/loading_row.vue
0 → 100644
View file @
7bed22b0
<
script
>
import
LoadingIcon
from
'
~/vue_shared/components/loading_icon.vue
'
;
/**
* Renders the loading row for each security report
*/
export
default
{
name
:
'
SecurityLoadingRow
'
,
components
:
{
LoadingIcon
,
},
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue"
>
<div
class=
"report-block-list-icon append-right-15 prepend-left-10"
>
<loading-icon
/>
</div>
<div
class=
"report-block-list-issue-description"
>
{{
__
(
"
in progress
"
)
}}
</div>
</div>
</
template
>
ee/app/assets/javascripts/vue_shared/security_reports/components/summary_row.vue
0 → 100644
View file @
7bed22b0
<
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
'
;
/**
* Renders the summary row for each security report
*/
export
default
{
name
:
'
SecuritySummaryRow
'
,
components
:
{
Icon
,
CiIcon
,
},
directives
:
{
popover
,
},
props
:
{
summary
:
{
type
:
String
,
required
:
true
,
},
statusIcon
:
{
type
:
String
,
required
:
true
,
},
popoverTitle
:
{
type
:
String
,
required
:
true
,
},
popoverContent
:
{
type
:
String
,
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
,
icon
:
`status_
${
this
.
statusIcon
}
`
,
};
},
},
};
</
script
>
<
template
>
<div
class=
"report-block-list-issue"
>
<div
class=
"report-block-list-icon append-right-10 prepend-left-10"
>
<ci-icon
:status=
"iconStatus"
/>
</div>
<div
class=
"report-block-list-issue-description"
>
<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>
</div>
</div>
</
template
>
spec/javascripts/vue_shared/security_reports/components/error_row_spec.js
0 → 100644
View file @
7bed22b0
import
Vue
from
'
vue
'
;
import
component
from
'
ee/vue_shared/security_reports/components/error_row.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
loading row
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
vm
;
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders warning icon with error message
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.report-block-list-icon span
'
).
classList
).
toContain
(
'
js-ci-status-icon-warning
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.report-block-list-issue-description
'
).
textContent
.
trim
()).
toEqual
(
'
There was an error loading results
'
,
);
});
});
spec/javascripts/vue_shared/security_reports/components/loading_row_spec.js
0 → 100644
View file @
7bed22b0
import
Vue
from
'
vue
'
;
import
component
from
'
ee/vue_shared/security_reports/components/loading_row.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
loading row
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
vm
;
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders loading icon with message
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.report-block-list-icon i
'
).
classList
).
toContain
(
'
fa-spin
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.report-block-list-issue-description
'
).
textContent
.
trim
()).
toEqual
(
'
in progress
'
,
);
});
});
spec/javascripts/vue_shared/security_reports/components/summary_row_spec.js
0 → 100644
View file @
7bed22b0
import
Vue
from
'
vue
'
;
import
component
from
'
ee/vue_shared/security_reports/components/summary_row.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
describe
(
'
Summary row
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
vm
;
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>
'
,
statusIcon
:
'
warning
'
,
};
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
props
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders provided summary
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.report-block-list-issue-description-text
'
).
textContent
.
trim
(),
).
toEqual
(
props
.
summary
);
});
it
(
'
renders provided icon
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.report-block-list-icon span
'
).
classList
).
toContain
(
'
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