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
Léo-Paul Géneau
gitlab-ce
Commits
bfc2b8a3
Commit
bfc2b8a3
authored
Jan 22, 2018
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added realtime prop and corrected specs
parent
60424546
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
7 deletions
+44
-7
app/assets/javascripts/pages/projects/show/index.js
app/assets/javascripts/pages/projects/show/index.js
+19
-0
app/assets/javascripts/pages/projects/tree/show/index.js
app/assets/javascripts/pages/projects/tree/show/index.js
+1
-1
app/assets/javascripts/projects/tree/components/commit_pipeline_status_component.vue
...ects/tree/components/commit_pipeline_status_component.vue
+15
-4
app/assets/javascripts/projects/tree/services/commit_pipeline_service.js
...scripts/projects/tree/services/commit_pipeline_service.js
+0
-0
features/project/project.feature
features/project/project.feature
+1
-0
features/steps/shared/project.rb
features/steps/shared/project.rb
+1
-0
spec/javascripts/commit/commit_pipeline_status_component_spec.js
...vascripts/commit/commit_pipeline_status_component_spec.js
+7
-2
No files found.
app/assets/javascripts/pages/projects/show/index.js
View file @
bfc2b8a3
import
Vue
from
'
vue
'
;
import
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
UserCallout
from
'
~/user_callout
'
;
...
...
@@ -5,6 +6,7 @@ import TreeView from '~/tree';
import
BlobViewer
from
'
~/blob/viewer/index
'
;
import
Activities
from
'
~/activities
'
;
import
{
ajaxGet
}
from
'
~/lib/utils/common_utils
'
;
import
commitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
Star
from
'
../../../star
'
;
import
notificationsDropdown
from
'
../../../notifications_dropdown
'
;
...
...
@@ -24,4 +26,21 @@ export default () => {
$
(
'
#tree-slider
'
).
waitForImages
(()
=>
{
ajaxGet
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
logsPath
);
});
const
commitPipelineStatusEl
=
document
.
getElementById
(
'
commit-pipeline-status
'
);
// eslint-disable-next-line no-new
new
Vue
({
el
:
'
#commit-pipeline-status
'
,
components
:
{
commitPipelineStatus
,
},
render
(
createElement
)
{
return
createElement
(
'
commit-pipeline-status
'
,
{
props
:
{
endpoint
:
commitPipelineStatusEl
.
dataset
.
endpoint
,
realtime
:
false
,
},
});
},
});
};
app/assets/javascripts/pages/projects/tree/show/index.js
View file @
bfc2b8a3
import
Vue
from
'
vue
'
;
import
commitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
TreeView
from
'
../../../../tree
'
;
import
ShortcutsNavigation
from
'
../../../../shortcuts_navigation
'
;
import
BlobViewer
from
'
../../../../blob/viewer
'
;
import
NewCommitForm
from
'
../../../../new_commit_form
'
;
import
{
ajaxGet
}
from
'
../../../../lib/utils/common_utils
'
;
import
commitPipelineStatus
from
'
../components/commit_pipeline_status_component.vue
'
;
export
default
()
=>
{
new
ShortcutsNavigation
();
// eslint-disable-line no-new
...
...
app/assets/javascripts/p
ages/p
rojects/tree/components/commit_pipeline_status_component.vue
→
app/assets/javascripts/projects/tree/components/commit_pipeline_status_component.vue
View file @
bfc2b8a3
...
...
@@ -18,22 +18,33 @@
type
:
String
,
required
:
true
,
},
realtime
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
data
()
{
return
{
ciStatus
:
{},
isLoading
:
true
,
service
:
{},
stageTitle
:
''
,
};
},
mounted
()
{
this
.
service
=
new
CommitPipelineService
(
this
.
endpoint
);
this
.
initPolling
();
if
(
this
.
realtime
)
{
this
.
initPolling
();
}
else
{
this
.
fetchPipelineCommitData
();
}
},
methods
:
{
successCallback
(
res
)
{
if
(
res
.
data
.
pipelines
.
length
>
0
)
{
this
.
ciStatus
=
res
.
data
.
pipelines
[
0
].
details
.
status
;
this
.
ciStatus
=
res
.
data
.
pipelines
[
0
].
details
.
stages
[
0
].
status
;
this
.
stageTitle
=
res
.
data
.
pipelines
[
0
].
details
.
stages
[
0
].
title
;
this
.
isLoading
=
false
;
}
else
{
this
.
isLoading
=
true
;
...
...
@@ -86,8 +97,8 @@
>
<ci-icon
v-tooltip
:title=
"
ciStatus.text
"
:aria-label=
"
ciStatus.text
"
:title=
"
stageTitle
"
:aria-label=
"
stageTitle
"
data-container=
"body"
:status=
"ciStatus"
/>
...
...
app/assets/javascripts/p
ages/p
rojects/tree/services/commit_pipeline_service.js
→
app/assets/javascripts/projects/tree/services/commit_pipeline_service.js
View file @
bfc2b8a3
File moved
features/project/project.feature
View file @
bfc2b8a3
...
...
@@ -23,6 +23,7 @@ Feature: Project
And
I visit project
"Shop"
page
Then
I should see project
"Shop"
README
@javascript
Scenario
:
I
should see last commit with CI
Given
project
"Shop"
has CI enabled
Given
project
"Shop"
has CI build
...
...
features/steps/shared/project.rb
View file @
bfc2b8a3
...
...
@@ -218,6 +218,7 @@ module SharedProject
end
step
'I should see last commit with CI status'
do
sleep
2
page
.
within
".blob-commit-info"
do
expect
(
page
).
to
have_content
(
project
.
commit
.
sha
[
0
..
6
])
expect
(
page
).
to
have_link
(
"Commit: skipped"
)
...
...
spec/javascripts/commit/commit_pipeline_status_component_spec.js
View file @
bfc2b8a3
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
commitPipelineStatus
from
'
~/p
ages/p
rojects/tree/components/commit_pipeline_status_component.vue
'
;
import
commitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
mountComponent
from
'
../helpers/vue_mount_component_helper
'
;
describe
(
'
Commit pipeline status component
'
,
()
=>
{
...
...
@@ -25,7 +25,12 @@ describe('Commit pipeline status component', () => {
pipelines
:
[
{
details
:
{
status
:
mockCiStatus
,
stages
:
[
{
status
:
mockCiStatus
,
title
:
'
Commit: canceled
'
,
},
],
},
},
],
...
...
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