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
0cf721bd
Commit
0cf721bd
authored
Nov 06, 2018
by
Filipa Lacerda
Committed by
Phil Hughes
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable stop environment button while deployment is running
parent
e232ebf7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
9 deletions
+40
-9
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
...cripts/vue_merge_request_widget/components/deployment.vue
+23
-7
changelogs/unreleased/25140-disable-stop-button.yml
changelogs/unreleased/25140-disable-stop-button.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+6
-0
spec/features/merge_request/user_sees_deployment_widget_spec.rb
...eatures/merge_request/user_sees_deployment_widget_spec.rb
+2
-2
spec/javascripts/vue_mr_widget/components/deployment_spec.js
spec/javascripts/vue_mr_widget/components/deployment_spec.js
+4
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
View file @
0cf721bd
...
...
@@ -65,6 +65,14 @@ export default {
deployedText
()
{
return
this
.
$options
.
deployedTextMap
[
this
.
deployment
.
status
];
},
isDeployInProgress
()
{
return
this
.
deployment
.
status
===
'
running
'
;
},
deployInProgressTooltip
()
{
return
this
.
isDeployInProgress
?
__
(
'
Stopping this environment is currently not possible as a deployment is in progress
'
)
:
''
;
},
shouldRenderDropdown
()
{
return
(
this
.
enableCiEnvironmentsStatusChanges
&&
...
...
@@ -183,15 +191,23 @@ export default {
css-class=
"js-deploy-url js-deploy-url-feature-flag deploy-link btn btn-default btn-sm inlin"
/>
</template>
<
loading-button
<
span
v-if=
"deployment.stop_url"
:loading=
"isStopping"
container-class=
"btn btn-default btn-sm inline prepend-left-4
"
title=
"Stop environment"
@
click=
"stopEnvironment
"
v-tooltip
:title=
"deployInProgressTooltip
"
class=
"d-inline-block"
tabindex=
"0
"
>
<icon
name=
"stop"
/>
</loading-button>
<loading-button
:loading=
"isStopping"
:disabled=
"isDeployInProgress"
:title=
"__('Stop environment')"
container-class=
"js-stop-env btn btn-default btn-sm inline prepend-left-4"
@
click=
"stopEnvironment"
>
<icon
name=
"stop"
/>
</loading-button>
</span>
</div>
</div>
</div>
...
...
changelogs/unreleased/25140-disable-stop-button.yml
0 → 100644
View file @
0cf721bd
---
title
:
Disables stop environment button while the deploy is in progress
merge_request
:
author
:
type
:
other
locale/gitlab.pot
View file @
0cf721bd
...
...
@@ -5847,6 +5847,9 @@ msgstr ""
msgid "Status"
msgstr ""
msgid "Stop environment"
msgstr ""
msgid "Stop impersonation"
msgstr ""
...
...
@@ -5856,6 +5859,9 @@ msgstr ""
msgid "Stopped"
msgstr ""
msgid "Stopping this environment is currently not possible as a deployment is in progress"
msgstr ""
msgid "Storage"
msgstr ""
...
...
spec/features/merge_request/user_sees_deployment_widget_spec.rb
View file @
0cf721bd
...
...
@@ -38,7 +38,7 @@ describe 'Merge request > User sees deployment widget', :js do
end
it
'does start build when stop button clicked'
do
accept_confirm
{
click_button
(
'Stop environment'
)
}
accept_confirm
{
find
(
'.js-stop-env'
).
click
}
expect
(
page
).
to
have_content
(
'close_app'
)
end
...
...
@@ -47,7 +47,7 @@ describe 'Merge request > User sees deployment widget', :js do
let
(
:role
)
{
:reporter
}
it
'does not show stop button'
do
expect
(
page
).
not_to
have_
button
(
'Stop environment
'
)
expect
(
page
).
not_to
have_
selector
(
'.js-stop-env
'
)
end
end
end
...
...
spec/javascripts/vue_mr_widget/components/deployment_spec.js
View file @
0cf721bd
...
...
@@ -242,6 +242,10 @@ describe('Deployment component', () => {
it
(
'
renders information about running deployment
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-deployment-info
'
).
textContent
).
toContain
(
'
Deploying to
'
);
});
it
(
'
renders disabled stop button
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-stop-env
'
).
getAttribute
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
});
});
describe
(
'
success
'
,
()
=>
{
...
...
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