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
307e024c
Commit
307e024c
authored
Dec 07, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed remove deploy key loading icon not being removed after canceling
Closes #37595
parent
28c983db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
4 deletions
+31
-4
app/assets/javascripts/deploy_keys/components/action_btn.vue
app/assets/javascripts/deploy_keys/components/action_btn.vue
+7
-2
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+4
-1
changelogs/unreleased/deploy-keys-loading-icon.yml
changelogs/unreleased/deploy-keys-loading-icon.yml
+5
-0
spec/javascripts/deploy_keys/components/action_btn_spec.js
spec/javascripts/deploy_keys/components/action_btn_spec.js
+1
-1
spec/javascripts/deploy_keys/components/app_spec.js
spec/javascripts/deploy_keys/components/app_spec.js
+14
-0
No files found.
app/assets/javascripts/deploy_keys/components/action_btn.vue
View file @
307e024c
...
@@ -32,7 +32,9 @@
...
@@ -32,7 +32,9 @@
doAction
()
{
doAction
()
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
eventHub
.
$emit
(
`
${
this
.
type
}
.key`
,
this
.
deployKey
);
eventHub
.
$emit
(
`
${
this
.
type
}
.key`
,
this
.
deployKey
,
()
=>
{
this
.
isLoading
=
false
;
});
},
},
},
},
computed
:
{
computed
:
{
...
@@ -50,6 +52,9 @@
...
@@ -50,6 +52,9 @@
:disabled="isLoading"
:disabled="isLoading"
@click="doAction">
@click="doAction">
{{
text
}}
{{
text
}}
<loading-icon
v-if=
"isLoading"
/>
<loading-icon
v-if=
"isLoading"
:inline=
"true"
/>
</button>
</button>
</
template
>
</
template
>
app/assets/javascripts/deploy_keys/components/app.vue
View file @
307e024c
...
@@ -47,12 +47,15 @@
...
@@ -47,12 +47,15 @@
.
then
(()
=>
this
.
fetchKeys
())
.
then
(()
=>
this
.
fetchKeys
())
.
catch
(()
=>
new
Flash
(
'
Error enabling deploy key
'
));
.
catch
(()
=>
new
Flash
(
'
Error enabling deploy key
'
));
},
},
disableKey
(
deployKey
)
{
disableKey
(
deployKey
,
callback
)
{
// eslint-disable-next-line no-alert
// eslint-disable-next-line no-alert
if
(
confirm
(
'
You are going to remove this deploy key. Are you sure?
'
))
{
if
(
confirm
(
'
You are going to remove this deploy key. Are you sure?
'
))
{
this
.
service
.
disableKey
(
deployKey
.
id
)
this
.
service
.
disableKey
(
deployKey
.
id
)
.
then
(()
=>
this
.
fetchKeys
())
.
then
(()
=>
this
.
fetchKeys
())
.
then
(
callback
)
.
catch
(()
=>
new
Flash
(
'
Error removing deploy key
'
));
.
catch
(()
=>
new
Flash
(
'
Error removing deploy key
'
));
}
else
{
callback
();
}
}
},
},
},
},
...
...
changelogs/unreleased/deploy-keys-loading-icon.yml
0 → 100644
View file @
307e024c
---
title
:
Fixed deploy keys remove button loading state not resetting
merge_request
:
author
:
type
:
fixed
spec/javascripts/deploy_keys/components/action_btn_spec.js
View file @
307e024c
...
@@ -34,7 +34,7 @@ describe('Deploy keys action btn', () => {
...
@@ -34,7 +34,7 @@ describe('Deploy keys action btn', () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
expect
(
expect
(
eventHub
.
$emit
,
eventHub
.
$emit
,
).
toHaveBeenCalledWith
(
'
enable.key
'
,
deployKey
);
).
toHaveBeenCalledWith
(
'
enable.key
'
,
deployKey
,
jasmine
.
anything
()
);
done
();
done
();
});
});
...
...
spec/javascripts/deploy_keys/components/app_spec.js
View file @
307e024c
...
@@ -139,4 +139,18 @@ describe('Deploy keys app component', () => {
...
@@ -139,4 +139,18 @@ describe('Deploy keys app component', () => {
it
(
'
hasKeys returns true when there are keys
'
,
()
=>
{
it
(
'
hasKeys returns true when there are keys
'
,
()
=>
{
expect
(
vm
.
hasKeys
).
toEqual
(
3
);
expect
(
vm
.
hasKeys
).
toEqual
(
3
);
});
});
it
(
'
resets remove button loading state
'
,
(
done
)
=>
{
spyOn
(
window
,
'
confirm
'
).
and
.
returnValue
(
false
);
const
btn
=
vm
.
$el
.
querySelector
(
'
.btn-warning
'
);
btn
.
click
();
Vue
.
nextTick
(()
=>
{
expect
(
btn
.
querySelector
(
'
.fa
'
)).
toBeNull
();
done
();
});
});
});
});
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