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
ac393ade
Commit
ac393ade
authored
Apr 18, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensures disabled status while request is being made
parent
12bf940c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
34 deletions
+30
-34
app/assets/javascripts/pipelines/components/graph/action_component.vue
...vascripts/pipelines/components/graph/action_component.vue
+20
-9
app/assets/javascripts/pipelines/components/graph/graph_component.vue
...avascripts/pipelines/components/graph/graph_component.vue
+0
-6
app/assets/javascripts/pipelines/components/graph/job_component.vue
.../javascripts/pipelines/components/graph/job_component.vue
+0
-7
app/assets/javascripts/pipelines/components/graph/stage_column_component.vue
...pts/pipelines/components/graph/stage_column_component.vue
+0
-6
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+2
-6
app/assets/stylesheets/pages/pipelines.scss
app/assets/stylesheets/pages/pipelines.scss
+8
-0
No files found.
app/assets/javascripts/pipelines/components/graph/action_component.vue
View file @
ac393ade
...
@@ -31,29 +31,40 @@ export default {
...
@@ -31,29 +31,40 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
buttonDisabled
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
},
},
data
()
{
return
{
isDisabled
:
false
,
linkRequested
:
''
,
};
},
computed
:
{
computed
:
{
cssClass
()
{
cssClass
()
{
const
actionIconDash
=
dasherize
(
this
.
actionIcon
);
const
actionIconDash
=
dasherize
(
this
.
actionIcon
);
return
`
${
actionIconDash
}
js-icon-
${
actionIconDash
}
`
;
return
`
${
actionIconDash
}
js-icon-
${
actionIconDash
}
`
;
},
},
isDisabled
()
{
return
this
.
buttonDisabled
===
this
.
link
;
},
},
},
methods
:
{
methods
:
{
onClickAction
()
{
onClickAction
()
{
$
(
this
.
$el
).
tooltip
(
'
hide
'
);
$
(
this
.
$el
).
tooltip
(
'
hide
'
);
eventHub
.
$emit
(
'
graphAction
'
,
this
.
link
);
eventHub
.
$emit
(
'
graphAction
'
,
this
.
link
);
this
.
linkRequested
=
this
.
link
;
this
.
isDisabled
=
true
;
},
},
updateDisabled
(
actionUrl
)
{
if
(
actionUrl
===
this
.
linkRequested
)
{
this
.
isDisabled
=
false
;
}
}
},
},
created
()
{
eventHub
.
$on
(
'
graphActionFinished
'
,
this
.
updateDisabled
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
graphActionFinished
'
,
this
.
updateDisabled
);
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
...
...
app/assets/javascripts/pipelines/components/graph/graph_component.vue
View file @
ac393ade
...
@@ -17,11 +17,6 @@ export default {
...
@@ -17,11 +17,6 @@ export default {
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
actionDisabled
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
},
},
computed
:
{
computed
:
{
...
@@ -75,7 +70,6 @@ export default {
...
@@ -75,7 +70,6 @@ export default {
:key=
"stage.name"
:key=
"stage.name"
:stage-connector-class=
"stageConnectorClass(index, stage)"
:stage-connector-class=
"stageConnectorClass(index, stage)"
:is-first-column=
"isFirstColumn(index)"
:is-first-column=
"isFirstColumn(index)"
:action-disabled=
"actionDisabled"
/>
/>
</ul>
</ul>
</div>
</div>
...
...
app/assets/javascripts/pipelines/components/graph/job_component.vue
View file @
ac393ade
...
@@ -54,12 +54,6 @@ export default {
...
@@ -54,12 +54,6 @@ export default {
required
:
false
,
required
:
false
,
default
:
false
,
default
:
false
,
},
},
actionDisabled
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
},
},
computed
:
{
computed
:
{
...
@@ -136,7 +130,6 @@ export default {
...
@@ -136,7 +130,6 @@ export default {
:tooltip-text=
"status.action.title"
:tooltip-text=
"status.action.title"
:link=
"status.action.path"
:link=
"status.action.path"
:action-icon=
"status.action.icon"
:action-icon=
"status.action.icon"
:button-disabled=
"actionDisabled"
/>
/>
</div>
</div>
...
...
app/assets/javascripts/pipelines/components/graph/stage_column_component.vue
View file @
ac393ade
...
@@ -29,11 +29,6 @@ export default {
...
@@ -29,11 +29,6 @@ export default {
required
:
false
,
required
:
false
,
default
:
''
,
default
:
''
,
},
},
actionDisabled
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
},
},
methods
:
{
methods
:
{
...
@@ -74,7 +69,6 @@ export default {
...
@@ -74,7 +69,6 @@ export default {
v-if=
"job.size === 1"
v-if=
"job.size === 1"
:job=
"job"
:job=
"job"
css-class-job-name=
"build-content"
css-class-job-name=
"build-content"
:action-disabled=
"actionDisabled"
/>
/>
<dropdown-job-component
<dropdown-job-component
...
...
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
ac393ade
...
@@ -25,7 +25,6 @@ export default () => {
...
@@ -25,7 +25,6 @@ export default () => {
data
()
{
data
()
{
return
{
return
{
mediator
,
mediator
,
actionDisabled
:
null
,
};
};
},
},
created
()
{
created
()
{
...
@@ -36,16 +35,14 @@ export default () => {
...
@@ -36,16 +35,14 @@ export default () => {
},
},
methods
:
{
methods
:
{
postAction
(
action
)
{
postAction
(
action
)
{
this
.
actionDisabled
=
action
;
this
.
mediator
.
service
.
postAction
(
action
)
this
.
mediator
.
service
.
postAction
(
action
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
mediator
.
refreshPipeline
();
this
.
mediator
.
refreshPipeline
();
this
.
actionDisabled
=
null
;
eventHub
.
$emit
(
'
graphActionFinished
'
,
action
)
;
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
this
.
actionDisabled
=
null
;
Flash
(
__
(
'
An error occurred while making the request.
'
));
Flash
(
__
(
'
An error occurred while making the request.
'
));
eventHub
.
$emit
(
'
graphActionFinished
'
,
action
);
});
});
},
},
},
},
...
@@ -54,7 +51,6 @@ export default () => {
...
@@ -54,7 +51,6 @@ export default () => {
props
:
{
props
:
{
isLoading
:
this
.
mediator
.
state
.
isLoading
,
isLoading
:
this
.
mediator
.
state
.
isLoading
,
pipeline
:
this
.
mediator
.
store
.
state
.
pipeline
,
pipeline
:
this
.
mediator
.
store
.
state
.
pipeline
,
actionDisabled
:
this
.
actionDisabled
,
},
},
});
});
},
},
...
...
app/assets/stylesheets/pages/pipelines.scss
View file @
ac393ade
...
@@ -468,6 +468,14 @@
...
@@ -468,6 +468,14 @@
margin-bottom
:
10px
;
margin-bottom
:
10px
;
white-space
:
normal
;
white-space
:
normal
;
.ci-job-dropdown-container
{
// override dropdown.scss
.dropdown-menu
li
button
{
padding
:
0
;
text-align
:
center
;
}
}
// ensure .build-content has hover style when action-icon is hovered
// ensure .build-content has hover style when action-icon is hovered
.ci-job-dropdown-container
:hover
.build-content
{
.ci-job-dropdown-container
:hover
.build-content
{
@extend
.build-content
:hover
;
@extend
.build-content
:hover
;
...
...
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