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
5279a39e
Commit
5279a39e
authored
Jun 12, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Jun 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vue files for navigation tabs and buttons
parent
c165f39b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
75 deletions
+133
-75
app/assets/javascripts/pipelines/components/nav_controls.vue
app/assets/javascripts/pipelines/components/nav_controls.vue
+54
-0
app/assets/javascripts/pipelines/components/navigation_tabs.js
...ssets/javascripts/pipelines/components/navigation_tabs.js
+0
-72
app/assets/javascripts/pipelines/components/navigation_tabs.vue
...sets/javascripts/pipelines/components/navigation_tabs.vue
+76
-0
app/assets/javascripts/pipelines/pipelines.js
app/assets/javascripts/pipelines/pipelines.js
+2
-2
spec/javascripts/pipelines/nav_controls_spec.js
spec/javascripts/pipelines/nav_controls_spec.js
+1
-1
No files found.
app/assets/javascripts/pipelines/components/nav_controls.
js
→
app/assets/javascripts/pipelines/components/nav_controls.
vue
View file @
5279a39e
<
script
>
export
default
{
export
default
{
name
:
'
PipelineNavControls
'
,
props
:
{
props
:
{
newPipelinePath
:
{
newPipelinePath
:
{
type
:
String
,
type
:
String
,
...
@@ -25,28 +27,28 @@ export default {
...
@@ -25,28 +27,28 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
};
</
script
>
<
template
>
<div
class=
"nav-controls"
>
<a
v-if=
"canCreatePipeline"
:href=
"newPipelinePath"
class=
"btn btn-create"
>
Run Pipeline
</a>
template
:
`
<a
<div class="nav-controls">
v-if=
"!hasCiEnabled"
<a
:href=
"helpPagePath"
v-if="canCreatePipeline"
class=
"btn btn-info"
>
:href="newPipelinePath"
Get started with Pipelines
class="btn btn-create">
</a>
Run Pipeline
</a>
<a
v-if="!hasCiEnabled"
:href="helpPagePath"
class="btn btn-info">
Get started with Pipelines
</a>
<a
<a
:href="ciLintPath"
:href=
"ciLintPath"
class="btn btn-default">
class=
"btn btn-default"
>
CI Lint
CI Lint
</a>
</a>
</div>
</div>
`
,
</
template
>
};
app/assets/javascripts/pipelines/components/navigation_tabs.js
deleted
100644 → 0
View file @
c165f39b
export
default
{
props
:
{
scope
:
{
type
:
String
,
required
:
true
,
},
count
:
{
type
:
Object
,
required
:
true
,
},
paths
:
{
type
:
Object
,
required
:
true
,
},
},
mounted
()
{
$
(
document
).
trigger
(
'
init.scrolling-tabs
'
);
},
template
:
`
<ul class="nav-links scrolling-tabs">
<li
class="js-pipelines-tab-all"
:class="{ 'active': scope === 'all'}">
<a :href="paths.allPath">
All
<span class="badge js-totalbuilds-count">
{{count.all}}
</span>
</a>
</li>
<li class="js-pipelines-tab-pending"
:class="{ 'active': scope === 'pending'}">
<a :href="paths.pendingPath">
Pending
<span class="badge">
{{count.pending}}
</span>
</a>
</li>
<li class="js-pipelines-tab-running"
:class="{ 'active': scope === 'running'}">
<a :href="paths.runningPath">
Running
<span class="badge">
{{count.running}}
</span>
</a>
</li>
<li class="js-pipelines-tab-finished"
:class="{ 'active': scope === 'finished'}">
<a :href="paths.finishedPath">
Finished
<span class="badge">
{{count.finished}}
</span>
</a>
</li>
<li class="js-pipelines-tab-branches"
:class="{ 'active': scope === 'branches'}">
<a :href="paths.branchesPath">Branches</a>
</li>
<li class="js-pipelines-tab-tags"
:class="{ 'active': scope === 'tags'}">
<a :href="paths.tagsPath">Tags</a>
</li>
</ul>
`
,
};
app/assets/javascripts/pipelines/components/navigation_tabs.vue
0 → 100644
View file @
5279a39e
<
script
>
export
default
{
name
:
'
PipelineNavigationTabs
'
,
props
:
{
scope
:
{
type
:
String
,
required
:
true
,
},
count
:
{
type
:
Object
,
required
:
true
,
},
paths
:
{
type
:
Object
,
required
:
true
,
},
},
mounted
()
{
$
(
document
).
trigger
(
'
init.scrolling-tabs
'
);
},
};
</
script
>
<
template
>
<ul
class=
"nav-links scrolling-tabs"
>
<li
class=
"js-pipelines-tab-all"
:class=
"
{ active: scope === 'all'}">
<a
:href=
"paths.allPath"
>
All
<span
class=
"badge js-totalbuilds-count"
>
{{
count
.
all
}}
</span>
</a>
</li>
<li
class=
"js-pipelines-tab-pending"
:class=
"
{ active: scope === 'pending'}">
<a
:href=
"paths.pendingPath"
>
Pending
<span
class=
"badge"
>
{{
count
.
pending
}}
</span>
</a>
</li>
<li
class=
"js-pipelines-tab-running"
:class=
"
{ active: scope === 'running'}">
<a
:href=
"paths.runningPath"
>
Running
<span
class=
"badge"
>
{{
count
.
running
}}
</span>
</a>
</li>
<li
class=
"js-pipelines-tab-finished"
:class=
"
{ active: scope === 'finished'}">
<a
:href=
"paths.finishedPath"
>
Finished
<span
class=
"badge"
>
{{
count
.
finished
}}
</span>
</a>
</li>
<li
class=
"js-pipelines-tab-branches"
:class=
"
{ active: scope === 'branches'}">
<a
:href=
"paths.branchesPath"
>
Branches
</a>
</li>
<li
class=
"js-pipelines-tab-tags"
:class=
"
{ active: scope === 'tags'}">
<a
:href=
"paths.tagsPath"
>
Tags
</a>
</li>
</ul>
</
template
>
app/assets/javascripts/pipelines/pipelines.js
View file @
5279a39e
...
@@ -5,8 +5,8 @@ import pipelinesTableComponent from '../vue_shared/components/pipelines_table';
...
@@ -5,8 +5,8 @@ import pipelinesTableComponent from '../vue_shared/components/pipelines_table';
import
tablePagination
from
'
../vue_shared/components/table_pagination.vue
'
;
import
tablePagination
from
'
../vue_shared/components/table_pagination.vue
'
;
import
emptyState
from
'
./components/empty_state.vue
'
;
import
emptyState
from
'
./components/empty_state.vue
'
;
import
errorState
from
'
./components/error_state.vue
'
;
import
errorState
from
'
./components/error_state.vue
'
;
import
navigationTabs
from
'
./components/navigation_tabs
'
;
import
navigationTabs
from
'
./components/navigation_tabs
.vue
'
;
import
navigationControls
from
'
./components/nav_controls
'
;
import
navigationControls
from
'
./components/nav_controls
.vue
'
;
import
loadingIcon
from
'
../vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
../vue_shared/components/loading_icon.vue
'
;
import
Poll
from
'
../lib/utils/poll
'
;
import
Poll
from
'
../lib/utils/poll
'
;
...
...
spec/javascripts/pipelines/nav_controls_spec.js
View file @
5279a39e
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
navControlsComp
from
'
~/pipelines/components/nav_controls
'
;
import
navControlsComp
from
'
~/pipelines/components/nav_controls
.vue
'
;
describe
(
'
Pipelines Nav Controls
'
,
()
=>
{
describe
(
'
Pipelines Nav Controls
'
,
()
=>
{
let
NavControlsComponent
;
let
NavControlsComponent
;
...
...
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