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
1
Merge Requests
1
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
nexedi
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
ShortcutsNavigation
from
'
~/shortcuts_navigation
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
UserCallout
from
'
~/user_callout
'
;
import
UserCallout
from
'
~/user_callout
'
;
...
@@ -5,6 +6,7 @@ import TreeView from '~/tree';
...
@@ -5,6 +6,7 @@ import TreeView from '~/tree';
import
BlobViewer
from
'
~/blob/viewer/index
'
;
import
BlobViewer
from
'
~/blob/viewer/index
'
;
import
Activities
from
'
~/activities
'
;
import
Activities
from
'
~/activities
'
;
import
{
ajaxGet
}
from
'
~/lib/utils/common_utils
'
;
import
{
ajaxGet
}
from
'
~/lib/utils/common_utils
'
;
import
commitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
Star
from
'
../../../star
'
;
import
Star
from
'
../../../star
'
;
import
notificationsDropdown
from
'
../../../notifications_dropdown
'
;
import
notificationsDropdown
from
'
../../../notifications_dropdown
'
;
...
@@ -24,4 +26,21 @@ export default () => {
...
@@ -24,4 +26,21 @@ export default () => {
$
(
'
#tree-slider
'
).
waitForImages
(()
=>
{
$
(
'
#tree-slider
'
).
waitForImages
(()
=>
{
ajaxGet
(
document
.
querySelector
(
'
.js-tree-content
'
).
dataset
.
logsPath
);
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
Vue
from
'
vue
'
;
import
commitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
TreeView
from
'
../../../../tree
'
;
import
TreeView
from
'
../../../../tree
'
;
import
ShortcutsNavigation
from
'
../../../../shortcuts_navigation
'
;
import
ShortcutsNavigation
from
'
../../../../shortcuts_navigation
'
;
import
BlobViewer
from
'
../../../../blob/viewer
'
;
import
BlobViewer
from
'
../../../../blob/viewer
'
;
import
NewCommitForm
from
'
../../../../new_commit_form
'
;
import
NewCommitForm
from
'
../../../../new_commit_form
'
;
import
{
ajaxGet
}
from
'
../../../../lib/utils/common_utils
'
;
import
{
ajaxGet
}
from
'
../../../../lib/utils/common_utils
'
;
import
commitPipelineStatus
from
'
../components/commit_pipeline_status_component.vue
'
;
export
default
()
=>
{
export
default
()
=>
{
new
ShortcutsNavigation
();
// eslint-disable-line no-new
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 @@
...
@@ -18,22 +18,33 @@
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
realtime
:
{
type
:
Boolean
,
required
:
false
,
default
:
true
,
},
},
},
data
()
{
data
()
{
return
{
return
{
ciStatus
:
{},
ciStatus
:
{},
isLoading
:
true
,
isLoading
:
true
,
service
:
{},
service
:
{},
stageTitle
:
''
,
};
};
},
},
mounted
()
{
mounted
()
{
this
.
service
=
new
CommitPipelineService
(
this
.
endpoint
);
this
.
service
=
new
CommitPipelineService
(
this
.
endpoint
);
this
.
initPolling
();
if
(
this
.
realtime
)
{
this
.
initPolling
();
}
else
{
this
.
fetchPipelineCommitData
();
}
},
},
methods
:
{
methods
:
{
successCallback
(
res
)
{
successCallback
(
res
)
{
if
(
res
.
data
.
pipelines
.
length
>
0
)
{
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
;
this
.
isLoading
=
false
;
}
else
{
}
else
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
...
@@ -86,8 +97,8 @@
...
@@ -86,8 +97,8 @@
>
>
<ci-icon
<ci-icon
v-tooltip
v-tooltip
:title=
"
ciStatus.text
"
:title=
"
stageTitle
"
:aria-label=
"
ciStatus.text
"
:aria-label=
"
stageTitle
"
data-container=
"body"
data-container=
"body"
:status=
"ciStatus"
: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
...
@@ -23,6 +23,7 @@ Feature: Project
And
I visit project
"Shop"
page
And
I visit project
"Shop"
page
Then
I should see project
"Shop"
README
Then
I should see project
"Shop"
README
@javascript
Scenario
:
I
should see last commit with CI
Scenario
:
I
should see last commit with CI
Given
project
"Shop"
has CI enabled
Given
project
"Shop"
has CI enabled
Given
project
"Shop"
has CI build
Given
project
"Shop"
has CI build
...
...
features/steps/shared/project.rb
View file @
bfc2b8a3
...
@@ -218,6 +218,7 @@ module SharedProject
...
@@ -218,6 +218,7 @@ module SharedProject
end
end
step
'I should see last commit with CI status'
do
step
'I should see last commit with CI status'
do
sleep
2
page
.
within
".blob-commit-info"
do
page
.
within
".blob-commit-info"
do
expect
(
page
).
to
have_content
(
project
.
commit
.
sha
[
0
..
6
])
expect
(
page
).
to
have_content
(
project
.
commit
.
sha
[
0
..
6
])
expect
(
page
).
to
have_link
(
"Commit: skipped"
)
expect
(
page
).
to
have_link
(
"Commit: skipped"
)
...
...
spec/javascripts/commit/commit_pipeline_status_component_spec.js
View file @
bfc2b8a3
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
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
'
;
import
mountComponent
from
'
../helpers/vue_mount_component_helper
'
;
describe
(
'
Commit pipeline status component
'
,
()
=>
{
describe
(
'
Commit pipeline status component
'
,
()
=>
{
...
@@ -25,7 +25,12 @@ describe('Commit pipeline status component', () => {
...
@@ -25,7 +25,12 @@ describe('Commit pipeline status component', () => {
pipelines
:
[
pipelines
:
[
{
{
details
:
{
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