Merge pull request #806 from dod-ccpo/delete-environment
Delete environments from an application
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
{% from "components/delete_confirmation.html" import DeleteConfirmation %}
|
||||
{% from "components/icon.html" import Icon %}
|
||||
{% from "components/toggle_list.html" import ToggleButton, ToggleSection %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/modal.html" import Modal %}
|
||||
{% from "components/save_button.html" import SaveButton %}
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/toggle_list.html" import ToggleButton, ToggleSection %}
|
||||
|
||||
{% macro RolePanel(users=[], role='no_access') %}
|
||||
{% if role == 'no_access' %}
|
||||
@@ -52,6 +54,7 @@
|
||||
{% set member_count = env['members_form'].data['team_roles'] | length %}
|
||||
{% set members_by_role = env['members'] %}
|
||||
{% set unassigned = members_by_role['no_access'] %}
|
||||
{% set delete_environment_modal_id = "delete_modal_environment{}".format(env['id']) %}
|
||||
|
||||
<toggler inline-template {% if edit_form.errors %}initial-selected-section="edit"{% endif %}>
|
||||
<li class="accordion-table__item">
|
||||
@@ -75,7 +78,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="col col--grow">
|
||||
<span class="icon-link icon-link--danger">
|
||||
<span class="icon-link icon-link--danger" alt="Delete environment" v-on:click="openModal('{{ delete_environment_modal_id }}')">
|
||||
{{ Icon('trash') }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -122,6 +125,27 @@
|
||||
{% endcall %}
|
||||
</li>
|
||||
</toggler>
|
||||
|
||||
{% call Modal(name=delete_environment_modal_id, dismissable=True) %}
|
||||
<h1>Are you sure you want to delete this environment?</h1>
|
||||
|
||||
{{
|
||||
Alert(
|
||||
level="warning",
|
||||
title="Warning! This action is permanent",
|
||||
message="You will no longer be able to access this environment",
|
||||
)
|
||||
}}
|
||||
|
||||
{{
|
||||
DeleteConfirmation(
|
||||
modal_id=delete_modal_environment_id,
|
||||
delete_text=('portfolios.applications.environments.delete.button' | translate),
|
||||
delete_action= url_for('applications.delete_environment', environment_id=env['id']),
|
||||
form=form
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user