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
f1826bcf
Commit
f1826bcf
authored
May 15, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix JS specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
9a38c2dc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
155 deletions
+0
-155
app/assets/javascripts/pipelines/components/stage.js
app/assets/javascripts/pipelines/components/stage.js
+0
-104
app/assets/javascripts/vue_shared/ci_status_icons.js
app/assets/javascripts/vue_shared/ci_status_icons.js
+0
-15
app/assets/javascripts/vue_shared/components/ci_icon.vue
app/assets/javascripts/vue_shared/components/ci_icon.vue
+0
-9
spec/javascripts/vue_shared/components/ci_icon_spec.js
spec/javascripts/vue_shared/components/ci_icon_spec.js
+0
-27
No files found.
app/assets/javascripts/pipelines/components/stage.js
deleted
100644 → 0
View file @
9a38c2dc
/* global Flash */
import
{
borderlessStatusIconEntityMap
}
from
'
../../vue_shared/ci_status_icons
'
;
export
default
{
data
()
{
return
{
builds
:
''
,
spinner
:
'
<span class="fa fa-spinner fa-spin"></span>
'
,
};
},
props
:
{
stage
:
{
type
:
Object
,
required
:
true
,
},
},
updated
()
{
if
(
this
.
builds
)
{
this
.
stopDropdownClickPropagation
();
}
},
methods
:
{
fetchBuilds
(
e
)
{
const
ariaExpanded
=
e
.
currentTarget
.
attributes
[
'
aria-expanded
'
];
if
(
ariaExpanded
&&
(
ariaExpanded
.
textContent
===
'
true
'
))
return
null
;
return
this
.
$http
.
get
(
this
.
stage
.
dropdown_path
)
.
then
((
response
)
=>
{
this
.
builds
=
JSON
.
parse
(
response
.
body
).
html
;
},
()
=>
{
const
flash
=
new
Flash
(
'
Something went wrong on our end.
'
);
return
flash
;
});
},
/**
* When the user right clicks or cmd/ctrl + click in the job name
* the dropdown should not be closed and the link should open in another tab,
* so we stop propagation of the click event inside the dropdown.
*
* Since this component is rendered multiple times per page we need to guarantee we only
* target the click event of this component.
*/
stopDropdownClickPropagation
()
{
$
(
this
.
$el
.
querySelectorAll
(
'
.js-builds-dropdown-list a.mini-pipeline-graph-dropdown-item
'
)).
on
(
'
click
'
,
(
e
)
=>
{
e
.
stopPropagation
();
});
},
},
computed
:
{
buildsOrSpinner
()
{
return
this
.
builds
?
this
.
builds
:
this
.
spinner
;
},
dropdownClass
()
{
if
(
this
.
builds
)
return
'
js-builds-dropdown-container
'
;
return
'
js-builds-dropdown-loading builds-dropdown-loading
'
;
},
buildStatus
()
{
return
`Build:
${
this
.
stage
.
status
.
label
}
`
;
},
tooltip
()
{
return
`has-tooltip ci-status-icon ci-status-icon-
${
this
.
stage
.
status
.
group
}
`
;
},
triggerButtonClass
()
{
return
`mini-pipeline-graph-dropdown-toggle has-tooltip js-builds-dropdown-button ci-status-icon-
${
this
.
stage
.
status
.
group
}
`
;
},
svgHTML
()
{
return
borderlessStatusIconEntityMap
[
this
.
stage
.
status
.
icon
];
},
},
watch
:
{
'
stage.title
'
:
function
stageTitle
()
{
$
(
this
.
$refs
.
button
).
tooltip
(
'
destroy
'
).
tooltip
();
},
},
template
:
`
<div>
<button
@click="fetchBuilds($event)"
:class="triggerButtonClass"
:title="stage.title"
data-placement="top"
data-toggle="dropdown"
type="button"
ref="button"
:aria-label="stage.title">
<span v-html="svgHTML" aria-hidden="true"></span>
<i class="fa fa-caret-down" aria-hidden="true"></i>
</button>
<ul class="dropdown-menu mini-pipeline-graph-dropdown-menu js-builds-dropdown-container">
<div class="arrow-up" aria-hidden="true"></div>
<div
:class="dropdownClass"
class="js-builds-dropdown-list scrollable-menu"
v-html="buildsOrSpinner">
</div>
</ul>
</div>
`
,
};
app/assets/javascripts/vue_shared/ci_status_icons.js
View file @
f1826bcf
...
...
@@ -41,18 +41,3 @@ export const statusIconEntityMap = {
icon_status_success
:
SUCCESS_SVG
,
icon_status_warning
:
WARNING_SVG
,
};
<<<<<<<
HEAD
export
const
statusCssClasses
=
{
icon_status_canceled
:
'
canceled
'
,
icon_status_created
:
'
created
'
,
icon_status_failed
:
'
failed
'
,
icon_status_manual
:
'
manual
'
,
icon_status_pending
:
'
pending
'
,
icon_status_running
:
'
running
'
,
icon_status_skipped
:
'
skipped
'
,
icon_status_success
:
'
success
'
,
icon_status_warning
:
'
warning
'
,
};
=======
>>>>>>>
origin
/
master
app/assets/javascripts/vue_shared/components/ci_icon.vue
View file @
f1826bcf
<
script
>
<<<<<<<
HEAD
import
{
statusIconEntityMap
,
statusCssClasses
}
from
'
../../vue_shared/ci_status_icons
'
;
=======
import
{
statusIconEntityMap
}
from
'
../ci_status_icons
'
;
/**
...
...
@@ -26,7 +22,6 @@
* - Jobs show view header
* - Jobs show view sidebar
*/
>>>>>>>
origin
/
master
export
default
{
props
:
{
status
:
{
...
...
@@ -41,11 +36,7 @@
},
cssClass
()
{
<<<<<<<
HEAD
const
status
=
statusCssClasses
[
this
.
status
.
icon
];
=======
const
status
=
this
.
status
.
group
;
>>>>>>>
origin
/
master
return
`ci-status-icon ci-status-icon-
${
status
}
js-ci-status-icon-
${
status
}
`
;
},
},
...
...
spec/javascripts/vue_shared/components/ci_icon_spec.js
View file @
f1826bcf
...
...
@@ -25,10 +25,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_success
'
,
<<<<<<<
HEAD
=======
group
:
'
success
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -41,10 +38,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_failed
'
,
<<<<<<<
HEAD
=======
group
:
'
failed
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -57,10 +51,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_warning
'
,
<<<<<<<
HEAD
=======
group
:
'
warning
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -73,10 +64,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_pending
'
,
<<<<<<<
HEAD
=======
group
:
'
pending
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -89,10 +77,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_running
'
,
<<<<<<<
HEAD
=======
group
:
'
running
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -105,10 +90,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_created
'
,
<<<<<<<
HEAD
=======
group
:
'
created
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -121,10 +103,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_skipped
'
,
<<<<<<<
HEAD
=======
group
:
'
skipped
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -137,10 +116,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_canceled
'
,
<<<<<<<
HEAD
=======
group
:
'
canceled
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
@@ -153,10 +129,7 @@ describe('CI Icon component', () => {
propsData
:
{
status
:
{
icon
:
'
icon_status_manual
'
,
<<<<<<<
HEAD
=======
group
:
'
manual
'
,
>>>>>>>
origin
/
master
},
},
}).
$mount
();
...
...
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