Update text and icon in modal
Update env_role status when it is deleted
This commit is contained in:
parent
eb617ef68a
commit
54f3c2f8ba
@ -57,6 +57,14 @@ class EnvironmentRoles(object):
|
|||||||
)
|
)
|
||||||
return existing_env_role
|
return existing_env_role
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _update_status(cls, environment_role, new_status):
|
||||||
|
environment_role.status = new_status
|
||||||
|
db.session.add(environment_role)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
return environment_role
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def delete(cls, application_role_id, environment_id):
|
def delete(cls, application_role_id, environment_id):
|
||||||
existing_env_role = EnvironmentRoles.get(application_role_id, environment_id)
|
existing_env_role = EnvironmentRoles.get(application_role_id, environment_id)
|
||||||
@ -64,6 +72,7 @@ class EnvironmentRoles(object):
|
|||||||
if existing_env_role:
|
if existing_env_role:
|
||||||
# TODO: Implement suspension
|
# TODO: Implement suspension
|
||||||
existing_env_role.deleted = True
|
existing_env_role.deleted = True
|
||||||
|
cls._update_status(existing_env_role, EnvironmentRole.Status.DISABLED)
|
||||||
db.session.add(existing_env_role)
|
db.session.add(existing_env_role)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return True
|
return True
|
||||||
|
@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M16 16h-2v-3.225l-3.919-.781C9.455 11.869 9 11.314 9 10.675V9.242c0-.477.236-.921.631-1.187C9.919 7.86 11 6.595 11 5c0-1.853-1.558-3-3-3-1.449 0-3 1.206-3 3 0 1.596 1.081 2.859 1.371 3.056.395.268.629.711.629 1.186v1.433c0 .64-.455 1.194-1.083 1.319l-3.916.783L2 16H0v-3.221c0-.951.677-1.776 1.609-1.963L5 10.139v-.623C4.235 8.839 3 7.136 3 5c0-3.088 2.595-5 5-5 2.757 0 5 2.243 5 5 0 2.134-1.234 3.837-2 4.516v.623l3.396.679c.929.187 1.604 1.01 1.604 1.957V16z"/></svg>
|
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="user" class="svg-inline--fa fa-user fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"></path></svg>
|
Before Width: | Height: | Size: 540 B After Width: | Height: | Size: 484 B |
@ -36,7 +36,7 @@
|
|||||||
{% set modal_name = "edit_member-{}".format(loop.index) %}
|
{% set modal_name = "edit_member-{}".format(loop.index) %}
|
||||||
{% call Modal(modal_name, classes="form-content--app-mem") %}
|
{% call Modal(modal_name, classes="form-content--app-mem") %}
|
||||||
<div class="modal__form--header">
|
<div class="modal__form--header">
|
||||||
<h1>{{ Icon('avatar') }} {{ member.user_name }}</h1>
|
<h1>{{ Icon('avatar') }} {{ "portfolios.applications.members.form.edit_access_header" | translate({ "user": member.user_name }) }}</h1>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<base-form inline-template>
|
<base-form inline-template>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from atst.domain.environment_roles import EnvironmentRoles
|
from atst.domain.environment_roles import EnvironmentRoles
|
||||||
|
from atst.models.environment_role import EnvironmentRole
|
||||||
|
|
||||||
from tests.factories import *
|
from tests.factories import *
|
||||||
|
|
||||||
@ -49,10 +50,12 @@ def test_get_by_user_and_environment(application_role, environment):
|
|||||||
|
|
||||||
|
|
||||||
def test_delete(application_role, environment, monkeypatch):
|
def test_delete(application_role, environment, monkeypatch):
|
||||||
EnvironmentRoleFactory.create(
|
env_role = EnvironmentRoleFactory.create(
|
||||||
application_role=application_role, environment=environment
|
application_role=application_role, environment=environment
|
||||||
)
|
)
|
||||||
assert EnvironmentRoles.delete(application_role.id, environment.id)
|
assert EnvironmentRoles.delete(application_role.id, environment.id)
|
||||||
|
assert env_role.status == EnvironmentRole.Status.DISABLED
|
||||||
|
assert env_role.deleted
|
||||||
assert not EnvironmentRoles.delete(application_role.id, environment.id)
|
assert not EnvironmentRoles.delete(application_role.id, environment.id)
|
||||||
|
|
||||||
|
|
||||||
|
@ -409,6 +409,9 @@ portfolios:
|
|||||||
app_perms:
|
app_perms:
|
||||||
title: Application Permissions
|
title: Application Permissions
|
||||||
description: Application permissions allow users to provision and modify applications and teams. <a href="#"> Learn More </a>
|
description: Application permissions allow users to provision and modify applications and teams. <a href="#"> Learn More </a>
|
||||||
|
edit_access_header: "Manage {user}'s Access"
|
||||||
|
env_access_text: "Add or revoke Environment access. Additional controls are available in the CSP console."
|
||||||
|
step_2_title: Set Permissions and Roles
|
||||||
add_member: Add Member
|
add_member: Add Member
|
||||||
menu:
|
menu:
|
||||||
edit: Edit Roles and Permissions
|
edit: Edit Roles and Permissions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user