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
20f74fe7
Commit
20f74fe7
authored
Dec 08, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make Vue render with null commit object - handle scope and page in different tabs
parent
813be933
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
24 deletions
+36
-24
pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+31
-7
pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+5
-17
No files found.
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
View file @
20f74fe7
...
...
@@ -66,6 +66,8 @@
},
methods: {
changepage(e) {
const scope = getParameterByName('scope');
if (scope) this.apiScope = scope;
const text = e.target.innerText;
const { totalPages, nextPage, previousPage } = this.pageInfo;
if (text === SPREAD) return;
...
...
@@ -74,14 +76,21 @@
if (text === NEXT) this.pagenum = nextPage;
if (text === PREV) this.pagenum = previousPage;
if (text === FIRST) this.pagenum = 1;
window.history.pushState({}, null, `?p=${this.pagenum}`);
window.history.pushState({}, null, `?scope=${this.apiScope}&p=${this.pagenum}`);
clearInterval(this.timeLoopInterval);
this.pageRequest = true;
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope);
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope
, this.apiScope
);
},
author(pipeline) {
const { commit } = pipeline;
if (!commit) {
return ({
avatar_url: '',
web_url: '',
username: '',
});
}
const author = commit.author;
if (author) return author;
...
...
@@ -105,6 +114,21 @@
addTimeInterval(id, start) {
this.allTimeIntervals.push({ id, start });
},
commitTitle(pipeline) {
const { commit } = pipeline;
if (commit) return commit.title;
return '';
},
commitSha(pipeline) {
const { commit } = pipeline;
if (commit) return commit.short_id;
return '';
},
commitUrl(pipeline) {
const { commit } = pipeline;
if (commit) return commit.commit_url;
return '';
},
},
template: `
<div>
...
...
@@ -122,10 +146,10 @@
<commit
:author='author(pipeline)'
:tag="pipeline.ref['tag?']"
:title='
pipeline.commit.title
'
:title='
commitTitle(pipeline)
'
:commit_ref='ref(pipeline)'
:short_sha='
pipeline.commit.short_id
'
:commit_url='
pipeline.commit.commit_url
'
:short_sha='
commitSha(pipeline)
'
:commit_url='
commitUrl(pipeline)
'
>
</commit>
</td>
...
...
@@ -143,7 +167,7 @@
<i class="fa fa-spinner fa-spin"></i>
</div>
<gl-pagination
v-if='pageInfo.total >
30
'
v-if='pageInfo.total >
pageInfo.perPage
'
:pagenum='pagenum'
:changepage='changepage'
:count='count.all'
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
20f74fe7
...
...
@@ -25,22 +25,7 @@ describe "Pipelines", feature: true, js: true do
)
end
[
:pipelines
].
each
do
|
scope
|
context
"displaying
#{
scope
}
"
do
let
(
:project
)
{
create
(
:project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
do
wait_for_vue_resource
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
end
end
end
[
:running
,
:branches
].
each
do
|
scope
|
[
:all
,
:running
,
:branches
].
each
do
|
scope
|
context
"displaying
#{
scope
}
"
do
let
(
:project
)
{
create
(
:project
)
}
...
...
@@ -51,7 +36,10 @@ describe "Pipelines", feature: true, js: true do
)
end
it
{
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
}
it
do
wait_for_vue_resource
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
end
end
end
...
...
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