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
Jérome Perrin
gitlab-ce
Commits
ccf31a13
Commit
ccf31a13
authored
Oct 09, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Oct 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move cycle analytics banner into a vue file
parent
91f1d652
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
12 deletions
+101
-12
app/assets/javascripts/cycle_analytics/components/banner.vue
app/assets/javascripts/cycle_analytics/components/banner.vue
+55
-0
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
...ets/javascripts/cycle_analytics/cycle_analytics_bundle.js
+2
-0
app/views/projects/cycle_analytics/show.html.haml
app/views/projects/cycle_analytics/show.html.haml
+3
-12
spec/javascripts/cycle_analytics/banner_spec.js
spec/javascripts/cycle_analytics/banner_spec.js
+41
-0
No files found.
app/assets/javascripts/cycle_analytics/components/banner.vue
0 → 100644
View file @
ccf31a13
<
script
>
import
iconCycleAnalyticsSplash
from
'
icons/_icon_cycle_analytics_splash.svg
'
;
export
default
{
props
:
{
documentationLink
:
{
type
:
String
,
required
:
true
,
},
},
computed
:
{
iconCycleAnalyticsSplash
()
{
return
iconCycleAnalyticsSplash
;
},
},
methods
:
{
dismissOverviewDialog
()
{
this
.
$emit
(
'
dismiss-overview-dialog
'
);
},
},
};
</
script
>
<
template
>
<div
class=
"landing content-block"
>
<button
class=
"js-ca-dismiss-button dismiss-button"
type=
"button"
:aria-label=
"__('Dismiss Cycle Analytics introduction box')"
@
click=
"dismissOverviewDialog"
>
<i
class=
"fa fa-times"
aria-hidden=
"true"
>
</i>
</button>
<div
class=
"svg-container"
v-html=
"iconCycleAnalyticsSplash"
>
</div>
<div
class=
"inner-content"
>
<h4>
{{
__
(
'
Introducing Cycle Analytics
'
)
}}
</h4>
<p>
{{
__
(
'
Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.
'
)
}}
</p>
<p>
<a
:href=
"documentationLink"
target=
"_blank"
rel=
"nofollow"
class=
"btn"
>
{{
__
(
'
Read more
'
)
}}
</a>
</p>
</div>
</div>
</
template
>
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
View file @
ccf31a13
...
...
@@ -3,6 +3,7 @@
import
Vue
from
'
vue
'
;
import
Cookies
from
'
js-cookie
'
;
import
Translate
from
'
../vue_shared/translate
'
;
import
banner
from
'
./components/banner.vue
'
;
import
stageCodeComponent
from
'
./components/stage_code_component.vue
'
;
import
stagePlanComponent
from
'
./components/stage_plan_component.vue
'
;
import
stageComponent
from
'
./components/stage_component.vue
'
;
...
...
@@ -44,6 +45,7 @@ $(() => {
},
},
components
:
{
banner
,
'
stage-issue-component
'
:
stageComponent
,
'
stage-plan-component
'
:
stagePlanComponent
,
'
stage-code-component
'
:
stageCodeComponent
,
...
...
app/views/projects/cycle_analytics/show.html.haml
View file @
ccf31a13
...
...
@@ -6,18 +6,9 @@
#cycle-analytics
{
class:
container_class
,
"v-cloak"
=>
"true"
,
data:
{
request_path:
project_cycle_analytics_path
(
@project
)
}
}
-
if
@cycle_analytics_no_data
.landing.content-block
{
"v-if"
=>
"!isOverviewDialogDismissed"
}
%button
.dismiss-button
{
type:
'button'
,
'aria-label'
:
'Dismiss Cycle Analytics introduction box'
,
"@click"
=>
"dismissOverviewDialog()"
}
=
icon
(
"times"
)
.svg-container
=
custom_icon
(
'icon_cycle_analytics_splash'
)
.inner-content
%h4
{{ __('Introducing Cycle Analytics') }}
%p
{{ __('Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.') }}
%p
=
link_to
_
(
'Read more'
),
help_page_path
(
'user/project/cycle_analytics'
),
target:
'_blank'
,
class:
'btn'
%banner
{
"v-if"
=>
"!isOverviewDialogDismissed"
,
"documentation-link"
:
help_page_path
(
'user/project/cycle_analytics'
),
"v-on:dismiss-overview-dialog"
=>
"dismissOverviewDialog()"
}
=
icon
(
"spinner spin"
,
"v-show"
=>
"isLoading"
)
.wrapper
{
"v-show"
=>
"!isLoading && !hasError"
}
.panel.panel-default
...
...
spec/javascripts/cycle_analytics/banner_spec.js
0 → 100644
View file @
ccf31a13
import
Vue
from
'
vue
'
;
import
banner
from
'
~/cycle_analytics/components/banner.vue
'
;
import
mountComponent
from
'
../helpers/vue_mount_component_helper
'
;
describe
(
'
Cycle analytics banner
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
banner
);
vm
=
mountComponent
(
Component
,
{
documentationLink
:
'
path
'
,
});
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
should render cycle analytics information
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
h4
'
).
textContent
.
trim
(),
).
toEqual
(
'
Introducing Cycle Analytics
'
);
expect
(
vm
.
$el
.
querySelector
(
'
p
'
).
textContent
.
trim
(),
).
toContain
(
'
Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.
'
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
textContent
.
trim
(),
).
toEqual
(
'
Read more
'
);
expect
(
vm
.
$el
.
querySelector
(
'
a
'
).
getAttribute
(
'
href
'
),
).
toEqual
(
'
path
'
);
});
it
(
'
should emit an event when close button is clicked
'
,
()
=>
{
spyOn
(
vm
,
'
$emit
'
);
vm
.
$el
.
querySelector
(
'
.js-ca-dismiss-button
'
).
click
();
expect
(
vm
.
$emit
).
toHaveBeenCalled
();
});
});
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