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
fe225fd9
Commit
fe225fd9
authored
May 23, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set up mock data for stages
parent
4ae71c2b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
13 deletions
+40
-13
app/assets/javascripts/jobs/components/job_app.vue
app/assets/javascripts/jobs/components/job_app.vue
+7
-6
app/assets/javascripts/jobs/store/actions.js
app/assets/javascripts/jobs/store/actions.js
+1
-1
app/assets/javascripts/jobs/store/mutations.js
app/assets/javascripts/jobs/store/mutations.js
+5
-2
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/javascripts/jobs/mock_data.js
spec/javascripts/jobs/mock_data.js
+27
-1
No files found.
app/assets/javascripts/jobs/components/job_app.vue
View file @
fe225fd9
...
...
@@ -122,11 +122,13 @@ export default {
// fetch the stages for the dropdown on the sidebar
job
(
newVal
,
oldVal
)
{
if
(
_
.
isEmpty
(
oldVal
)
&&
!
_
.
isEmpty
(
newVal
.
pipeline
))
{
this
.
fetchJobsForStage
(
this
.
job
.
pipeline
.
details
.
stages
.
find
(
stage
=>
stage
&&
stage
.
name
===
this
.
selectedStage
,
),
);
const
stages
=
this
.
job
.
pipeline
.
details
.
stages
||
[];
const
defaultStage
=
stages
.
find
(
stage
=>
stage
&&
stage
.
name
===
this
.
selectedStage
);
if
(
defaultStage
)
{
this
.
fetchJobsForStage
(
defaultStage
);
}
}
if
(
newVal
.
archived
)
{
...
...
@@ -274,7 +276,6 @@ export default {
:class=
"
{ 'sticky-top border-bottom-0': hasTrace }"
>
<icon
name=
"lock"
class=
"align-text-bottom"
/>
{{
__
(
'
This job is archived. Only the complete pipeline can be retried.
'
)
}}
</div>
<!-- job log -->
...
...
app/assets/javascripts/jobs/store/actions.js
View file @
fe225fd9
...
...
@@ -185,7 +185,7 @@ export const requestJobsForStage = ({ commit }, stage) =>
commit
(
types
.
REQUEST_JOBS_FOR_STAGE
,
stage
);
// On stage click, set selected stage + fetch job
export
const
fetchJobsForStage
=
({
dispatch
},
stage
)
=>
{
export
const
fetchJobsForStage
=
({
dispatch
},
stage
=
{}
)
=>
{
dispatch
(
'
requestJobsForStage
'
,
stage
);
axios
...
...
app/assets/javascripts/jobs/store/mutations.js
View file @
fe225fd9
...
...
@@ -65,7 +65,10 @@ export default {
state
.
isLoading
=
false
;
state
.
job
=
job
;
state
.
stages
=
((
job
.
pipeline
||
{}).
details
||
{}).
stages
||
[];
state
.
stages
=
job
.
pipeline
&&
job
.
pipeline
.
details
&&
job
.
pipeline
.
details
.
stages
?
job
.
pipeline
.
details
.
stages
:
[];
/**
* We only update it on the first request
...
...
@@ -103,7 +106,7 @@ export default {
state
.
isScrolledToBottomBeforeReceivingTrace
=
toggle
;
},
[
types
.
REQUEST_JOBS_FOR_STAGE
](
state
,
stage
)
{
[
types
.
REQUEST_JOBS_FOR_STAGE
](
state
,
stage
=
{}
)
{
state
.
isLoadingJobs
=
true
;
state
.
selectedStage
=
stage
.
name
;
},
...
...
locale/gitlab.pot
View file @
fe225fd9
...
...
@@ -874,9 +874,6 @@ msgstr ""
msgid "An error occurred while fetching sidebar data"
msgstr ""
msgid "An error occurred while fetching stages."
msgstr ""
msgid "An error occurred while fetching the board lists. Please try again."
msgstr ""
...
...
spec/javascripts/jobs/mock_data.js
View file @
fe225fd9
...
...
@@ -995,7 +995,33 @@ export default {
},
duration
:
6
,
finished_at
:
'
2017-06-01T17:32:00.042Z
'
,
stages
,
stages
:
[
{
dropdown_path
:
'
/jashkenas/underscore/pipelines/16/stage.json?stage=build
'
,
name
:
'
build
'
,
path
:
'
/jashkenas/underscore/pipelines/16#build
'
,
status
:
{
icon
:
'
status_success
'
,
text
:
'
passed
'
,
label
:
'
passed
'
,
group
:
'
success
'
,
tooltip
:
'
passed
'
,
},
title
:
'
build: passed
'
,
},
{
dropdown_path
:
'
/jashkenas/underscore/pipelines/16/stage.json?stage=test
'
,
name
:
'
test
'
,
path
:
'
/jashkenas/underscore/pipelines/16#test
'
,
status
:
{
icon
:
'
status_warning
'
,
text
:
'
passed
'
,
label
:
'
passed with warnings
'
,
group
:
'
success-with-warnings
'
,
},
title
:
'
test: passed with warnings
'
,
},
],
},
ref
:
{
name
:
'
abc
'
,
...
...
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