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
04f29d6e
Commit
04f29d6e
authored
Apr 06, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert pipeline async_button component to vue template
parent
4cc88f59
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
25 deletions
+27
-25
app/assets/javascripts/vue_pipelines_index/components/async_button.vue
...vascripts/vue_pipelines_index/components/async_button.vue
+25
-23
app/assets/javascripts/vue_shared/components/pipelines_table_row.js
.../javascripts/vue_shared/components/pipelines_table_row.js
+1
-1
spec/javascripts/vue_pipelines_index/async_button_spec.js
spec/javascripts/vue_pipelines_index/async_button_spec.js
+1
-1
No files found.
app/assets/javascripts/vue_pipelines_index/components/async_button.
js
→
app/assets/javascripts/vue_pipelines_index/components/async_button.
vue
View file @
04f29d6e
<
script
>
/* eslint-disable no-new, no-alert */
/* global Flash */
import
'
~/flash
'
;
...
...
@@ -65,29 +66,30 @@ export default {
this
.
isLoading
=
true
;
this
.
service
.
postAction
(
this
.
endpoint
)
.
then
(()
=>
{
this
.
isLoading
=
false
;
eventHub
.
$emit
(
'
refreshPipelines
'
);
})
.
catch
(()
=>
{
this
.
isLoading
=
false
;
new
Flash
(
'
An error occured while making the request.
'
);
});
.
then
(()
=>
{
this
.
isLoading
=
false
;
eventHub
.
$emit
(
'
refreshPipelines
'
);
})
.
catch
(()
=>
{
this
.
isLoading
=
false
;
new
Flash
(
'
An error occured while making the request.
'
);
});
},
},
template
:
`
<button
type="button"
@click="onClick"
:class="buttonClass"
:title="title"
:aria-label="title"
data-container="body"
data-placement="top"
:disabled="isLoading">
<i :class="iconClass" aria-hidden="true"/>
<i class="fa fa-spinner fa-spin" aria-hidden="true" v-if="isLoading" />
</button>
`
,
};
</
script
>
<
template
>
<button
type=
"button"
@
click=
"onClick"
:class=
"buttonClass"
:title=
"title"
:aria-label=
"title"
data-container=
"body"
data-placement=
"top"
:disabled=
"isLoading"
>
<i
:class=
"iconClass"
aria-hidden=
"true"
/>
<i
class=
"fa fa-spinner fa-spin"
aria-hidden=
"true"
v-if=
"isLoading"
/>
</
template
>
app/assets/javascripts/vue_shared/components/pipelines_table_row.js
View file @
04f29d6e
/* eslint-disable no-param-reassign */
import
AsyncButtonComponent
from
'
../../vue_pipelines_index/components/async_button
'
;
import
AsyncButtonComponent
from
'
../../vue_pipelines_index/components/async_button
.vue
'
;
import
PipelinesActionsComponent
from
'
../../vue_pipelines_index/components/pipelines_actions
'
;
import
PipelinesArtifactsComponent
from
'
../../vue_pipelines_index/components/pipelines_artifacts
'
;
import
PipelinesStatusComponent
from
'
../../vue_pipelines_index/components/status
'
;
...
...
spec/javascripts/vue_pipelines_index/async_button_spec.js
View file @
04f29d6e
import
Vue
from
'
vue
'
;
import
asyncButtonComp
from
'
~/vue_pipelines_index/components/async_button
'
;
import
asyncButtonComp
from
'
~/vue_pipelines_index/components/async_button
.vue
'
;
describe
(
'
Pipelines Async Button
'
,
()
=>
{
let
component
;
...
...
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