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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
b1257951
Commit
b1257951
authored
Feb 04, 2019
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ee_else_ce alias for monitoring_bundle
parent
35bc3906
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+3
-3
app/assets/javascripts/pages/projects/environments/metrics/index.js
.../javascripts/pages/projects/environments/metrics/index.js
+1
-1
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+7
-9
No files found.
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
b1257951
...
...
@@ -160,7 +160,8 @@ export default {
{{
s__
(
'
Metrics|Environment
'
)
}}
<div
class=
"dropdown prepend-left-10"
>
<button
class=
"dropdown-menu-toggle"
data-toggle=
"dropdown"
type=
"button"
>
<span>
{{
currentEnvironmentName
}}
</span>
<icon
name=
"chevron-down"
/>
<span>
{{
currentEnvironmentName
}}
</span>
<icon
name=
"chevron-down"
/>
</button>
<div
v-if=
"store.environmentsData.length > 0"
...
...
@@ -172,9 +173,8 @@ export default {
:href=
"environment.metrics_path"
:class=
"
{ 'is-active': environment.name == currentEnvironmentName }"
class="dropdown-item"
>
{{
environment
.
name
}}
</a
>
{{
environment
.
name
}}
</a>
</li>
</ul>
</div>
...
...
app/assets/javascripts/pages/projects/environments/metrics/index.js
View file @
b1257951
import
monitoringBundle
from
'
~
/monitoring/monitoring_bundle
'
;
import
monitoringBundle
from
'
ee_else_ce
/monitoring/monitoring_bundle
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
monitoringBundle
);
spec/javascripts/monitoring/dashboard_spec.js
View file @
b1257951
...
...
@@ -25,15 +25,22 @@ export default propsData;
describe
(
'
Dashboard
'
,
()
=>
{
let
DashboardComponent
;
let
mock
;
beforeEach
(()
=>
{
setFixtures
(
`
<div class="prometheus-graphs"></div>
<div class="layout-page"></div>
`
);
mock
=
new
MockAdapter
(
axios
);
DashboardComponent
=
Vue
.
extend
(
Dashboard
);
});
afterEach
(()
=>
{
mock
.
restore
();
});
describe
(
'
no metrics are available yet
'
,
()
=>
{
it
(
'
shows a getting started empty state when no metrics are present
'
,
()
=>
{
const
component
=
new
DashboardComponent
({
...
...
@@ -47,16 +54,10 @@ describe('Dashboard', () => {
});
describe
(
'
requests information to the server
'
,
()
=>
{
let
mock
;
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
mockApiEndpoint
).
reply
(
200
,
metricsGroupsAPIResponse
);
});
afterEach
(()
=>
{
mock
.
restore
();
});
it
(
'
shows up a loading state
'
,
done
=>
{
const
component
=
new
DashboardComponent
({
el
:
document
.
querySelector
(
'
.prometheus-graphs
'
),
...
...
@@ -152,15 +153,12 @@ describe('Dashboard', () => {
});
describe
(
'
when the window resizes
'
,
()
=>
{
let
mock
;
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
mockApiEndpoint
).
reply
(
200
,
metricsGroupsAPIResponse
);
jasmine
.
clock
().
install
();
});
afterEach
(()
=>
{
mock
.
restore
();
jasmine
.
clock
().
uninstall
();
});
...
...
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