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
62f1c400
Commit
62f1c400
authored
Nov 11, 2020
by
Christie Lenneville
Committed by
Nicolò Maria Mezzopera
Nov 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update delete environment modal to gl component
parent
6a0db429
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
23 deletions
+28
-23
app/assets/javascripts/environments/components/delete_environment_modal.vue
...ipts/environments/components/delete_environment_modal.vue
+22
-20
app/assets/javascripts/environments/components/environment_delete.vue
...avascripts/environments/components/environment_delete.vue
+3
-3
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/assets/javascripts/environments/components/delete_environment_modal.vue
View file @
62f1c400
<
script
>
import
{
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
GlModal
from
'
~/vue_shared/components/gl_modal.vue
'
;
import
{
GlTooltipDirective
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
id
:
'
delete-environment-modal
'
,
name
:
'
DeleteEnvironmentModal
'
,
components
:
{
GlModal
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
},
props
:
{
environment
:
{
type
:
Object
,
required
:
true
,
},
},
computed
:
{
primaryProps
()
{
return
{
text
:
s__
(
'
Environments|Delete environment
'
),
attributes
:
[{
variant
:
'
danger
'
}],
};
},
cancelProps
()
{
return
{
text
:
s__
(
'
Cancel
'
),
};
},
confirmDeleteMessage
()
{
return
sprintf
(
s__
(
...
...
@@ -35,8 +41,12 @@ export default {
false
,
);
},
modalTitle
()
{
return
sprintf
(
s__
(
`Environments|Delete '%{environmentName}'?`
),
{
environmentName
:
this
.
environment
.
name
,
});
},
},
methods
:
{
onSubmit
()
{
eventHub
.
$emit
(
'
deleteEnvironment
'
,
this
.
environment
);
...
...
@@ -47,20 +57,12 @@ export default {
<
template
>
<gl-modal
:id=
"$options.id"
:footer-primary-button-text=
"s__('Environments|Delete environment')"
footer-primary-button-variant=
"danger"
@
submit=
"onSubmit"
:modal-id=
"$options.id"
:action-primary=
"primaryProps"
:action-cancel=
"cancelProps"
:title=
"modalTitle"
@
primary=
"onSubmit"
>
<template
#header
>
<h4
class=
"modal-title d-flex mw-100"
>
{{
__
(
'
Delete
'
)
}}
<span
v-gl-tooltip
:title=
"environment.name"
class=
"text-truncate mx-1 flex-fill"
>
{{
environment
.
name
}}
?
</span>
</h4>
</
template
>
<p>
{{
confirmDeleteMessage
}}
</p>
</gl-modal>
</
template
>
app/assets/javascripts/environments/components/environment_delete.vue
View file @
62f1c400
...
...
@@ -4,7 +4,7 @@
* Used in the environments table.
*/
import
{
GlTooltipDirective
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlTooltipDirective
,
GlButton
,
GlModalDirective
}
from
'
@gitlab/ui
'
;
import
{
s__
}
from
'
~/locale
'
;
import
eventHub
from
'
../event_hub
'
;
...
...
@@ -14,6 +14,7 @@ export default {
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlModalDirective
,
},
props
:
{
environment
:
{
...
...
@@ -54,6 +55,7 @@ export default {
<
template
>
<gl-button
v-gl-tooltip=
"
{ id: $options.deleteEnvironmentTooltipId }"
v-gl-modal-directive="'delete-environment-modal'"
:loading="isLoading"
:title="title"
:aria-label="title"
...
...
@@ -61,8 +63,6 @@ export default {
variant="danger"
category="primary"
icon="remove"
data-toggle="modal"
data-target="#delete-environment-modal"
@click="onClick"
/>
</
template
>
locale/gitlab.pot
View file @
62f1c400
...
...
@@ -10411,6 +10411,9 @@ msgstr ""
msgid "Environments|Delete"
msgstr ""
msgid "Environments|Delete '%{environmentName}'?"
msgstr ""
msgid "Environments|Delete environment"
msgstr ""
...
...
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