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
e3251a40
Commit
e3251a40
authored
Mar 05, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes after review
parent
8ec0fd0a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
46 deletions
+35
-46
app/assets/javascripts/commit/pipelines/pipelines_table.vue
app/assets/javascripts/commit/pipelines/pipelines_table.vue
+1
-1
app/assets/javascripts/pages/projects/pipelines/index/index.js
...ssets/javascripts/pages/projects/pipelines/index/index.js
+4
-5
app/assets/javascripts/pipelines/components/empty_state.vue
app/assets/javascripts/pipelines/components/empty_state.vue
+1
-1
app/assets/javascripts/pipelines/components/pipelines.vue
app/assets/javascripts/pipelines/components/pipelines.vue
+1
-1
app/assets/javascripts/pipelines/stores/pipelines_store.js
app/assets/javascripts/pipelines/stores/pipelines_store.js
+1
-6
spec/javascripts/pipelines/pipelines_spec.js
spec/javascripts/pipelines/pipelines_spec.js
+26
-26
spec/javascripts/pipelines/pipelines_store_spec.js
spec/javascripts/pipelines/pipelines_store_spec.js
+1
-6
No files found.
app/assets/javascripts/commit/pipelines/pipelines_table.vue
View file @
e3251a40
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
<svg-blank-state
<svg-blank-state
v-else-if=
"shouldRenderErrorState"
v-else-if=
"shouldRenderErrorState"
:svg-path=
"errorStateSvgPath"
:svg-path=
"errorStateSvgPath"
:message=
"s__(`Pipelines|There was an error
with
fetching the pipelines.
:message=
"s__(`Pipelines|There was an error fetching the pipelines.
Try again in a few moments or contact your support team.`)"
Try again in a few moments or contact your support team.`)"
/>
/>
...
...
app/assets/javascripts/pages/projects/pipelines/index/index.js
View file @
e3251a40
...
@@ -12,14 +12,13 @@ document.addEventListener('DOMContentLoaded', () => new Vue({
...
@@ -12,14 +12,13 @@ document.addEventListener('DOMContentLoaded', () => new Vue({
pipelinesComponent
,
pipelinesComponent
,
},
},
data
()
{
data
()
{
const
store
=
new
PipelinesStore
();
return
{
return
{
store
,
store
:
new
PipelinesStore
(),
dataset
:
document
.
querySelector
(
this
.
$options
.
el
).
dataset
,
};
};
},
},
created
()
{
this
.
dataset
=
document
.
querySelector
(
this
.
$options
.
el
).
dataset
;
},
render
(
createElement
)
{
render
(
createElement
)
{
return
createElement
(
'
pipelines-component
'
,
{
return
createElement
(
'
pipelines-component
'
,
{
props
:
{
props
:
{
...
...
app/assets/javascripts/pipelines/components/empty_state.vue
View file @
e3251a40
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<div
class=
"text-center"
>
<div
class=
"text-center"
>
<a
<a
:href=
"helpPagePath"
:href=
"helpPagePath"
class=
"btn btn-
info
js-get-started-pipelines"
class=
"btn btn-
primary
js-get-started-pipelines"
>
>
{{
s__
(
'
Pipelines|Get started with Pipelines
'
)
}}
{{
s__
(
'
Pipelines|Get started with Pipelines
'
)
}}
</a>
</a>
...
...
app/assets/javascripts/pipelines/components/pipelines.vue
View file @
e3251a40
...
@@ -323,7 +323,7 @@
...
@@ -323,7 +323,7 @@
<svg-blank-state
<svg-blank-state
v-else-if=
"stateToRender === $options.stateMap.error"
v-else-if=
"stateToRender === $options.stateMap.error"
:svg-path=
"errorStateSvgPath"
:svg-path=
"errorStateSvgPath"
:message=
"s__(`Pipelines|There was an error
with
fetching the pipelines.
:message=
"s__(`Pipelines|There was an error fetching the pipelines.
Try again in a few moments or contact your support team.`)"
Try again in a few moments or contact your support team.`)"
/>
/>
...
...
app/assets/javascripts/pipelines/stores/pipelines_store.js
View file @
e3251a40
...
@@ -5,12 +5,7 @@ export default class PipelinesStore {
...
@@ -5,12 +5,7 @@ export default class PipelinesStore {
this
.
state
=
{};
this
.
state
=
{};
this
.
state
.
pipelines
=
[];
this
.
state
.
pipelines
=
[];
this
.
state
.
count
=
{
this
.
state
.
count
=
{};
all
:
0
,
finished
:
0
,
pending
:
0
,
running
:
0
,
};
this
.
state
.
pageInfo
=
{};
this
.
state
.
pageInfo
=
{};
}
}
...
...
spec/javascripts/pipelines/pipelines_spec.js
View file @
e3251a40
...
@@ -183,10 +183,10 @@ describe('Pipelines', () => {
...
@@ -183,10 +183,10 @@ describe('Pipelines', () => {
});
});
it
(
'
does not render tabs nor buttons
'
,
()
=>
{
it
(
'
does not render tabs nor buttons
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-pipelines-tab-all
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-pipelines-tab-all
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
Null
(
);
});
});
});
});
...
@@ -222,7 +222,7 @@ describe('Pipelines', () => {
...
@@ -222,7 +222,7 @@ describe('Pipelines', () => {
});
});
it
(
'
renders error state
'
,
()
=>
{
it
(
'
renders error state
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.empty-state
'
).
textContent
.
trim
()).
toContain
(
'
There was an error
with
fetching the pipelines.
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.empty-state
'
).
textContent
.
trim
()).
toContain
(
'
There was an error fetching the pipelines.
'
);
});
});
});
});
});
});
...
@@ -254,9 +254,9 @@ describe('Pipelines', () => {
...
@@ -254,9 +254,9 @@ describe('Pipelines', () => {
});
});
it
(
'
does not render buttons
'
,
()
=>
{
it
(
'
does not render buttons
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
Null
(
);
});
});
it
(
'
renders pipelines table
'
,
()
=>
{
it
(
'
renders pipelines table
'
,
()
=>
{
...
@@ -291,9 +291,9 @@ describe('Pipelines', () => {
...
@@ -291,9 +291,9 @@ describe('Pipelines', () => {
});
});
it
(
'
does not render buttons
'
,
()
=>
{
it
(
'
does not render buttons
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
Null
(
);
});
});
it
(
'
renders tab empty state
'
,
()
=>
{
it
(
'
renders tab empty state
'
,
()
=>
{
...
@@ -324,14 +324,14 @@ describe('Pipelines', () => {
...
@@ -324,14 +324,14 @@ describe('Pipelines', () => {
it
(
'
renders empty state without button to set CI
'
,
()
=>
{
it
(
'
renders empty state without button to set CI
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-empty-state
'
).
textContent
.
trim
()).
toEqual
(
'
This project is not currently set up to run pipelines.
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-empty-state
'
).
textContent
.
trim
()).
toEqual
(
'
This project is not currently set up to run pipelines.
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-get-started-pipelines
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-get-started-pipelines
'
)).
toBe
Null
(
);
});
});
it
(
'
does not render tabs
n
or buttons
'
,
()
=>
{
it
(
'
does not render tabs or buttons
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-pipelines-tab-all
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-pipelines-tab-all
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
Null
(
);
});
});
});
});
...
@@ -361,13 +361,13 @@ describe('Pipelines', () => {
...
@@ -361,13 +361,13 @@ describe('Pipelines', () => {
});
});
it
(
'
does not renders buttons
'
,
()
=>
{
it
(
'
does not renders buttons
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-run-pipeline
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-ci-lint
'
)).
toBe
Null
(
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-clear-cache
'
)).
toBe
Null
(
);
});
});
it
(
'
renders error state
'
,
()
=>
{
it
(
'
renders error state
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.empty-state
'
).
textContent
.
trim
()).
toContain
(
'
There was an error
with
fetching the pipelines.
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.empty-state
'
).
textContent
.
trim
()).
toContain
(
'
There was an error fetching the pipelines.
'
);
});
});
});
});
});
});
...
@@ -527,10 +527,10 @@ describe('Pipelines', () => {
...
@@ -527,10 +527,10 @@ describe('Pipelines', () => {
describe
(
'
tabs
'
,
()
=>
{
describe
(
'
tabs
'
,
()
=>
{
it
(
'
returns default tabs
'
,
()
=>
{
it
(
'
returns default tabs
'
,
()
=>
{
expect
(
vm
.
tabs
).
toEqual
([
expect
(
vm
.
tabs
).
toEqual
([
{
name
:
'
All
'
,
scope
:
'
all
'
,
count
:
0
,
isActive
:
true
},
{
name
:
'
All
'
,
scope
:
'
all
'
,
count
:
undefined
,
isActive
:
true
},
{
name
:
'
Pending
'
,
scope
:
'
pending
'
,
count
:
0
,
isActive
:
false
},
{
name
:
'
Pending
'
,
scope
:
'
pending
'
,
count
:
undefined
,
isActive
:
false
},
{
name
:
'
Running
'
,
scope
:
'
running
'
,
count
:
0
,
isActive
:
false
},
{
name
:
'
Running
'
,
scope
:
'
running
'
,
count
:
undefined
,
isActive
:
false
},
{
name
:
'
Finished
'
,
scope
:
'
finished
'
,
count
:
0
,
isActive
:
false
},
{
name
:
'
Finished
'
,
scope
:
'
finished
'
,
count
:
undefined
,
isActive
:
false
},
{
name
:
'
Branches
'
,
scope
:
'
branches
'
,
isActive
:
false
},
{
name
:
'
Branches
'
,
scope
:
'
branches
'
,
isActive
:
false
},
{
name
:
'
Tags
'
,
scope
:
'
tags
'
,
isActive
:
false
},
{
name
:
'
Tags
'
,
scope
:
'
tags
'
,
isActive
:
false
},
]);
]);
...
@@ -646,7 +646,7 @@ describe('Pipelines', () => {
...
@@ -646,7 +646,7 @@ describe('Pipelines', () => {
});
});
});
});
it
(
'
returs true when state is empty tab & has already made the first request
'
,
(
done
)
=>
{
it
(
'
retur
n
s true when state is empty tab & has already made the first request
'
,
(
done
)
=>
{
vm
.
isLoading
=
false
;
vm
.
isLoading
=
false
;
vm
.
state
.
count
.
all
=
10
;
vm
.
state
.
count
.
all
=
10
;
vm
.
hasMadeRequest
=
true
;
vm
.
hasMadeRequest
=
true
;
...
...
spec/javascripts/pipelines/pipelines_store_spec.js
View file @
e3251a40
...
@@ -9,12 +9,7 @@ describe('Pipelines Store', () => {
...
@@ -9,12 +9,7 @@ describe('Pipelines Store', () => {
it
(
'
should be initialized with an empty state
'
,
()
=>
{
it
(
'
should be initialized with an empty state
'
,
()
=>
{
expect
(
store
.
state
.
pipelines
).
toEqual
([]);
expect
(
store
.
state
.
pipelines
).
toEqual
([]);
expect
(
store
.
state
.
count
).
toEqual
({
expect
(
store
.
state
.
count
).
toEqual
({});
all
:
0
,
finished
:
0
,
pending
:
0
,
running
:
0
,
});
expect
(
store
.
state
.
pageInfo
).
toEqual
({});
expect
(
store
.
state
.
pageInfo
).
toEqual
({});
});
});
...
...
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