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
e0c5deaf
Commit
e0c5deaf
authored
May 28, 2019
by
Adriel Santiago
Committed by
Kushal Pandya
May 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add expand/collapse button
Add ability to expand/collapse operation settings
parent
4dbf1016
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
app/assets/javascripts/operation_settings/components/external_dashboard.vue
...ipts/operation_settings/components/external_dashboard.vue
+6
-1
spec/frontend/operation_settings/components/external_dashboard_spec.js
.../operation_settings/components/external_dashboard_spec.js
+15
-0
No files found.
app/assets/javascripts/operation_settings/components/external_dashboard.vue
View file @
e0c5deaf
<
script
>
<
script
>
import
{
GlButton
,
GlFormGroup
,
GlFormInput
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlFormGroup
,
GlFormInput
,
GlLink
}
from
'
@gitlab/ui
'
;
import
initSettingsPanels
from
'
~/settings_panels
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -19,15 +20,19 @@ export default {
...
@@ -19,15 +20,19 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
mounted
()
{
initSettingsPanels
();
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<section
class=
"settings
expanded
"
>
<section
class=
"settings
no-animate
"
>
<div
class=
"settings-header"
>
<div
class=
"settings-header"
>
<h4
class=
"js-section-header"
>
<h4
class=
"js-section-header"
>
{{
s__
(
'
ExternalMetrics|External Dashboard
'
)
}}
{{
s__
(
'
ExternalMetrics|External Dashboard
'
)
}}
</h4>
</h4>
<gl-button
class=
"js-settings-toggle"
>
{{
__
(
'
Expand
'
)
}}
</gl-button>
<p
class=
"js-section-sub-header"
>
<p
class=
"js-section-sub-header"
>
{{
{{
s__
(
s__
(
...
...
spec/frontend/operation_settings/components/external_dashboard_spec.js
View file @
e0c5deaf
...
@@ -2,6 +2,9 @@ import { shallowMount } from '@vue/test-utils';
...
@@ -2,6 +2,9 @@ import { shallowMount } from '@vue/test-utils';
import
{
GlButton
,
GlLink
,
GlFormGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLink
,
GlFormGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
ExternalDashboard
from
'
~/operation_settings/components/external_dashboard.vue
'
;
import
ExternalDashboard
from
'
~/operation_settings/components/external_dashboard.vue
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
initSettingsPanels
from
'
~/settings_panels
'
;
jest
.
mock
(
'
~/settings_panels
'
);
describe
(
'
operation settings external dashboard component
'
,
()
=>
{
describe
(
'
operation settings external dashboard component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -21,6 +24,18 @@ describe('operation settings external dashboard component', () => {
...
@@ -21,6 +24,18 @@ describe('operation settings external dashboard component', () => {
expect
(
wrapper
.
find
(
'
.js-section-header
'
).
text
()).
toBe
(
'
External Dashboard
'
);
expect
(
wrapper
.
find
(
'
.js-section-header
'
).
text
()).
toBe
(
'
External Dashboard
'
);
});
});
describe
(
'
expand/collapse button
'
,
()
=>
{
it
(
'
is properly instantiated as a settings panel
'
,
()
=>
{
expect
(
initSettingsPanels
).
toHaveBeenCalled
();
});
it
(
'
defaults to collapsed state
'
,
()
=>
{
const
button
=
wrapper
.
find
(
GlButton
);
expect
(
button
.
text
()).
toBe
(
'
Expand
'
);
});
});
describe
(
'
sub-header
'
,
()
=>
{
describe
(
'
sub-header
'
,
()
=>
{
let
subHeader
;
let
subHeader
;
...
...
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