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
6532a096
Commit
6532a096
authored
Apr 09, 2020
by
Alan (Maciej) Paruszewski
Committed by
Kushal Pandya
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide Request subtitle when Threat Monitoring has no data
parent
eb021719
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
ee/app/assets/javascripts/threat_monitoring/components/threat_monitoring_section.vue
...hreat_monitoring/components/threat_monitoring_section.vue
+2
-2
ee/changelogs/unreleased/14707-hide-subtitle-for-empty-waf-charts.yml
...s/unreleased/14707-hide-subtitle-for-empty-waf-charts.yml
+5
-0
ee/spec/frontend/threat_monitoring/components/threat_monitoring_section_spec.js
...t_monitoring/components/threat_monitoring_section_spec.js
+26
-0
No files found.
ee/app/assets/javascripts/threat_monitoring/components/threat_monitoring_section.vue
View file @
6532a096
...
@@ -101,12 +101,12 @@ export default {
...
@@ -101,12 +101,12 @@ export default {
<
template
>
<
template
>
<div
class=
"my-3"
>
<div
class=
"my-3"
>
<h4
class=
"h4"
>
{{
title
}}
</h4>
<h4
ref=
"chartTitle"
class=
"h4"
>
{{
title
}}
</h4>
<h5
class=
"h5"
>
{{
subtitle
}}
</h5>
<loading-skeleton
v-if=
"isLoading"
class=
"mt-3"
/>
<loading-skeleton
v-if=
"isLoading"
class=
"mt-3"
/>
<template
v-else-if=
"hasHistory"
>
<template
v-else-if=
"hasHistory"
>
<h5
ref=
"chartSubtitle"
class=
"h5"
>
{{
subtitle
}}
</h5>
<statistics-summary
class=
"mt-3"
:data=
"summary"
/>
<statistics-summary
class=
"mt-3"
:data=
"summary"
/>
<statistics-history
class=
"mt-3"
:data=
"chart"
:y-legend=
"yLegend"
/>
<statistics-history
class=
"mt-3"
:data=
"chart"
:y-legend=
"yLegend"
/>
</
template
>
</
template
>
...
...
ee/changelogs/unreleased/14707-hide-subtitle-for-empty-waf-charts.yml
0 → 100644
View file @
6532a096
---
title
:
Hide Request subtitle when Threat Monitoring has no data
merge_request
:
28760
author
:
type
:
fixed
ee/spec/frontend/threat_monitoring/components/threat_monitoring_section_spec.js
View file @
6532a096
...
@@ -55,6 +55,8 @@ describe('ThreatMonitoringSection component', () => {
...
@@ -55,6 +55,8 @@ describe('ThreatMonitoringSection component', () => {
const
findStatisticsHistory
=
()
=>
wrapper
.
find
(
StatisticsHistory
);
const
findStatisticsHistory
=
()
=>
wrapper
.
find
(
StatisticsHistory
);
const
findStatisticsSummary
=
()
=>
wrapper
.
find
(
StatisticsSummary
);
const
findStatisticsSummary
=
()
=>
wrapper
.
find
(
StatisticsSummary
);
const
findChartEmptyState
=
()
=>
wrapper
.
find
({
ref
:
'
chartEmptyState
'
});
const
findChartEmptyState
=
()
=>
wrapper
.
find
({
ref
:
'
chartEmptyState
'
});
const
findChartTitle
=
()
=>
wrapper
.
find
({
ref
:
'
chartTitle
'
});
const
findChartSubtitle
=
()
=>
wrapper
.
find
({
ref
:
'
chartSubtitle
'
});
beforeEach
(()
=>
{
beforeEach
(()
=>
{
factory
({});
factory
({});
...
@@ -96,6 +98,14 @@ describe('ThreatMonitoringSection component', () => {
...
@@ -96,6 +98,14 @@ describe('ThreatMonitoringSection component', () => {
expect
(
chart
.
props
(
'
yLegend
'
)).
toEqual
(
'
Requests
'
);
expect
(
chart
.
props
(
'
yLegend
'
)).
toEqual
(
'
Requests
'
);
});
});
it
(
'
shows the chart title
'
,
()
=>
{
expect
(
findChartTitle
().
exists
()).
toBe
(
true
);
});
it
(
'
shows the chart subtitle
'
,
()
=>
{
expect
(
findChartSubtitle
().
exists
()).
toBe
(
true
);
});
it
(
'
does not show the chart empty state
'
,
()
=>
{
it
(
'
does not show the chart empty state
'
,
()
=>
{
expect
(
findChartEmptyState
().
exists
()).
toBe
(
false
);
expect
(
findChartEmptyState
().
exists
()).
toBe
(
false
);
});
});
...
@@ -116,6 +126,14 @@ describe('ThreatMonitoringSection component', () => {
...
@@ -116,6 +126,14 @@ describe('ThreatMonitoringSection component', () => {
expect
(
findStatisticsHistory
().
exists
()).
toBe
(
false
);
expect
(
findStatisticsHistory
().
exists
()).
toBe
(
false
);
});
});
it
(
'
shows the chart title
'
,
()
=>
{
expect
(
findChartTitle
().
exists
()).
toBe
(
true
);
});
it
(
'
does not show the chart subtitle
'
,
()
=>
{
expect
(
findChartSubtitle
().
exists
()).
toBe
(
false
);
});
it
(
'
does not show the chart empty state
'
,
()
=>
{
it
(
'
does not show the chart empty state
'
,
()
=>
{
expect
(
findChartEmptyState
().
exists
()).
toBe
(
false
);
expect
(
findChartEmptyState
().
exists
()).
toBe
(
false
);
});
});
...
@@ -143,6 +161,14 @@ describe('ThreatMonitoringSection component', () => {
...
@@ -143,6 +161,14 @@ describe('ThreatMonitoringSection component', () => {
expect
(
findStatisticsHistory
().
exists
()).
toBe
(
false
);
expect
(
findStatisticsHistory
().
exists
()).
toBe
(
false
);
});
});
it
(
'
shows the chart title
'
,
()
=>
{
expect
(
findChartTitle
().
exists
()).
toBe
(
true
);
});
it
(
'
does not show the chart subtitle
'
,
()
=>
{
expect
(
findChartSubtitle
().
exists
()).
toBe
(
false
);
});
it
(
'
shows the chart empty state
'
,
()
=>
{
it
(
'
shows the chart empty state
'
,
()
=>
{
expect
(
findChartEmptyState
().
element
).
toMatchSnapshot
();
expect
(
findChartEmptyState
().
element
).
toMatchSnapshot
();
});
});
...
...
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