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
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
Show 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 {
...
@@ -65,6 +65,14 @@ export default {
deployedText
()
{
deployedText
()
{
return
this
.
$options
.
deployedTextMap
[
this
.
deployment
.
status
];
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
()
{
shouldRenderDropdown
()
{
return
(
return
(
this
.
enableCiEnvironmentsStatusChanges
&&
this
.
enableCiEnvironmentsStatusChanges
&&
...
@@ -183,15 +191,23 @@ export default {
...
@@ -183,15 +191,23 @@ export default {
css-class=
"js-deploy-url js-deploy-url-feature-flag deploy-link btn btn-default btn-sm inlin"
css-class=
"js-deploy-url js-deploy-url-feature-flag deploy-link btn btn-default btn-sm inlin"
/>
/>
</template>
</template>
<
loading-button
<
span
v-if=
"deployment.stop_url"
v-if=
"deployment.stop_url"
v-tooltip
:title=
"deployInProgressTooltip"
class=
"d-inline-block"
tabindex=
"0"
>
<loading-button
:loading=
"isStopping"
:loading=
"isStopping"
container-class=
"btn btn-default btn-sm inline prepend-left-4"
:disabled=
"isDeployInProgress"
title=
"Stop environment"
:title=
"__('Stop environment')"
container-class=
"js-stop-env btn btn-default btn-sm inline prepend-left-4"
@
click=
"stopEnvironment"
@
click=
"stopEnvironment"
>
>
<icon
name=
"stop"
/>
<icon
name=
"stop"
/>
</loading-button>
</loading-button>
</span>
</div>
</div>
</div>
</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 ""
...
@@ -5847,6 +5847,9 @@ msgstr ""
msgid "Status"
msgid "Status"
msgstr ""
msgstr ""
msgid "Stop environment"
msgstr ""
msgid "Stop impersonation"
msgid "Stop impersonation"
msgstr ""
msgstr ""
...
@@ -5856,6 +5859,9 @@ msgstr ""
...
@@ -5856,6 +5859,9 @@ msgstr ""
msgid "Stopped"
msgid "Stopped"
msgstr ""
msgstr ""
msgid "Stopping this environment is currently not possible as a deployment is in progress"
msgstr ""
msgid "Storage"
msgid "Storage"
msgstr ""
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
...
@@ -38,7 +38,7 @@ describe 'Merge request > User sees deployment widget', :js do
end
end
it
'does start build when stop button clicked'
do
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'
)
expect
(
page
).
to
have_content
(
'close_app'
)
end
end
...
@@ -47,7 +47,7 @@ describe 'Merge request > User sees deployment widget', :js do
...
@@ -47,7 +47,7 @@ describe 'Merge request > User sees deployment widget', :js do
let
(
:role
)
{
:reporter
}
let
(
:role
)
{
:reporter
}
it
'does not show stop button'
do
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
end
end
end
...
...
spec/javascripts/vue_mr_widget/components/deployment_spec.js
View file @
0cf721bd
...
@@ -242,6 +242,10 @@ describe('Deployment component', () => {
...
@@ -242,6 +242,10 @@ describe('Deployment component', () => {
it
(
'
renders information about running deployment
'
,
()
=>
{
it
(
'
renders information about running deployment
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-deployment-info
'
).
textContent
).
toContain
(
'
Deploying to
'
);
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
'
,
()
=>
{
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