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
12bf940c
Commit
12bf940c
authored
Apr 18, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dropdown to not close when action is clicked
parent
8103c99f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
58 deletions
+59
-58
app/assets/javascripts/pipelines/components/graph/action_component.vue
...vascripts/pipelines/components/graph/action_component.vue
+1
-1
app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue
...pts/pipelines/components/graph/dropdown_job_component.vue
+58
-57
No files found.
app/assets/javascripts/pipelines/components/graph/action_component.vue
View file @
12bf940c
...
@@ -62,7 +62,7 @@ export default {
...
@@ -62,7 +62,7 @@ export default {
@
click=
"onClickAction"
@
click=
"onClickAction"
v-tooltip
v-tooltip
:title=
"tooltipText"
:title=
"tooltipText"
class=
"btn btn-blank btn-transparent ci-action-icon-container ci-action-icon-wrapper"
class=
"
js-ci-action
btn btn-blank btn-transparent ci-action-icon-container ci-action-icon-wrapper"
:class=
"cssClass"
:class=
"cssClass"
data-container=
"body"
data-container=
"body"
:disabled=
"isDisabled"
:disabled=
"isDisabled"
...
...
app/assets/javascripts/pipelines/components/graph/dropdown_job_component.vue
View file @
12bf940c
<
script
>
<
script
>
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
j
obNameComponent
from
'
./job_name_component.vue
'
;
import
J
obNameComponent
from
'
./job_name_component.vue
'
;
import
j
obComponent
from
'
./job_component.vue
'
;
import
J
obComponent
from
'
./job_component.vue
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
/**
/**
* Renders the dropdown for the pipeline graph.
* Renders the dropdown for the pipeline graph.
*
*
* The following object should be provided as `job`:
* The following object should be provided as `job`:
*
*
* {
* {
* "id": 4256,
* "id": 4256,
* "name": "test",
* "name": "test",
* "status": {
* "status": {
* "icon": "icon_status_success",
* "icon": "icon_status_success",
* "text": "passed",
* "text": "passed",
* "label": "passed",
* "label": "passed",
* "group": "success",
* "group": "success",
* "details_path": "/root/ci-mock/builds/4256",
* "details_path": "/root/ci-mock/builds/4256",
* "action": {
* "action": {
* "icon": "retry",
* "icon": "retry",
* "title": "Retry",
* "title": "Retry",
* "path": "/root/ci-mock/builds/4256/retry",
* "path": "/root/ci-mock/builds/4256/retry",
* "method": "post"
* "method": "post"
* }
* }
* }
* }
* }
* }
*/
*/
export
default
{
export
default
{
directives
:
{
directives
:
{
tooltip
,
tooltip
,
},
},
components
:
{
components
:
{
j
obComponent
,
J
obComponent
,
j
obNameComponent
,
J
obNameComponent
,
},
},
props
:
{
props
:
{
job
:
{
job
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
},
},
computed
:
{
computed
:
{
tooltipText
()
{
tooltipText
()
{
return
`
${
this
.
job
.
name
}
-
${
this
.
job
.
status
.
label
}
`
;
return
`
${
this
.
job
.
name
}
-
${
this
.
job
.
status
.
label
}
`
;
},
},
},
},
mounted
()
{
mounted
()
{
this
.
stopDropdownClickPropagation
();
this
.
stopDropdownClickPropagation
();
},
},
methods
:
{
methods
:
{
/**
/**
* When the user right clicks or cmd/ctrl + click in the job name
* 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,
* 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.
* so we stop propagation of the click event inside the dropdown.
...
@@ -63,15 +63,16 @@
...
@@ -63,15 +63,16 @@
* Since this component is rendered multiple times per page we need to guarantee we only
* Since this component is rendered multiple times per page we need to guarantee we only
* target the click event of this component.
* target the click event of this component.
*/
*/
stopDropdownClickPropagation
()
{
stopDropdownClickPropagation
()
{
$
(
this
.
$el
$
(
.
querySelectorAll
(
'
.js-grouped-pipeline-dropdown a.mini-pipeline-graph-dropdown-item
'
))
'
.js-grouped-pipeline-dropdown button, .js-grouped-pipeline-dropdown a.mini-pipeline-graph-dropdown-item
'
,
.
on
(
'
click
'
,
(
e
)
=>
{
this
.
$el
,
e
.
stopPropagation
();
).
on
(
'
click
'
,
e
=>
{
}
);
e
.
stopPropagation
(
);
}
,
}
);
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"ci-job-dropdown-container"
>
<div
class=
"ci-job-dropdown-container"
>
...
...
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