BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
660ba032
Commit
660ba032
authored
Aug 14, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move callout to vue file and remove svg from data function to improve performance
parent
12cdc461
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
15 deletions
+31
-15
pipeline_schedules_callout.vue
...eline_schedules/components/pipeline_schedules_callout.vue
+23
-13
pipeline_schedules_index_bundle.js
...pts/pipeline_schedules/pipeline_schedules_index_bundle.js
+1
-1
34371-pipeline-schedule-vue-files.yml
changelogs/unreleased/34371-pipeline-schedule-vue-files.yml
+6
-0
pipeline_schedule_callout_spec.js
...ipts/pipeline_schedules/pipeline_schedule_callout_spec.js
+1
-1
No files found.
app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_callout.
js
→
app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_callout.
vue
View file @
660ba032
import
Vue
from
'vue'
;
import
Cookies
from
'js-cookie'
;
import
Translate
from
'../../vue_shared/translate'
;
import
illustrationSvg
from
'../icons/intro_illustration.svg'
;
<
script
>
import
Vue
from
'vue'
;
import
Cookies
from
'js-cookie'
;
import
Translate
from
'../../vue_shared/translate'
;
import
illustrationSvg
from
'../icons/intro_illustration.svg'
;
Vue
.
use
(
Translate
);
Vue
.
use
(
Translate
);
const
cookieKey
=
'pipeline_schedules_callout_dismissed'
;
const
cookieKey
=
'pipeline_schedules_callout_dismissed'
;
export
default
{
export
default
{
name
:
'PipelineSchedulesCallout'
,
data
()
{
return
{
docsUrl
:
document
.
getElementById
(
'pipeline-schedules-callout'
).
dataset
.
docsUrl
,
illustrationSvg
,
calloutDismissed
:
Cookies
.
get
(
cookieKey
)
===
'true'
,
};
},
...
...
@@ -22,14 +22,24 @@ export default {
Cookies
.
set
(
cookieKey
,
this
.
calloutDismissed
,
{
expires
:
365
});
},
},
template
:
`
<div v-if="!calloutDismissed" class="pipeline-schedules-user-callout user-callout">
created
()
{
this
.
illustrationSvg
=
illustrationSvg
;
},
};
</
script
>
<
template
>
<div
v-if=
"!calloutDismissed"
class=
"pipeline-schedules-user-callout user-callout"
>
<div
class=
"bordered-box landing content-block"
>
<button
id=
"dismiss-callout-btn"
class=
"btn btn-default close"
@
click=
"dismissCallout"
>
<i class="fa fa-times"></i>
<i
aria-hidden=
"true"
class=
"fa fa-times"
>
</i>
</button>
<div
class=
"svg-container"
v-html=
"illustrationSvg"
></div>
<div
class=
"user-callout-copy"
>
...
...
@@ -46,5 +56,4 @@ export default {
</div>
</div>
</div>
`
,
};
</
template
>
\ No newline at end of file
app/assets/javascripts/pipeline_schedules/pipeline_schedules_index_bundle.js
View file @
660ba032
import
Vue
from
'vue'
;
import
PipelineSchedulesCallout
from
'./components/pipeline_schedules_callout'
;
import
PipelineSchedulesCallout
from
'./components/pipeline_schedules_callout
.vue
'
;
document
.
addEventListener
(
'DOMContentLoaded'
,
()
=>
new
Vue
({
el
:
'#pipeline-schedules-callout'
,
...
...
changelogs/unreleased/34371-pipeline-schedule-vue-files.yml
0 → 100644
View file @
660ba032
---
title
:
Improves performance of vue code by using vue files and moving svg out of data
function in pipeline schedule callout
merge_request
:
author
:
type
:
other
spec/javascripts/pipeline_schedules/pipeline_schedule_callout_spec.js
View file @
660ba032
import
Vue
from
'vue'
;
import
Cookies
from
'js-cookie'
;
import
PipelineSchedulesCallout
from
'~/pipeline_schedules/components/pipeline_schedules_callout'
;
import
PipelineSchedulesCallout
from
'~/pipeline_schedules/components/pipeline_schedules_callout
.vue
'
;
const
PipelineSchedulesCalloutComponent
=
Vue
.
extend
(
PipelineSchedulesCallout
);
const
cookieKey
=
'pipeline_schedules_callout_dismissed'
;
...
...
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