diff --git a/js/components/forms/edit_environment_role.js b/js/components/forms/edit_environment_role.js index 02e24211..468fb8f9 100644 --- a/js/components/forms/edit_environment_role.js +++ b/js/components/forms/edit_environment_role.js @@ -31,14 +31,21 @@ export default { methods: { change: function (e) { - e.preventDefault() - this.new_role = this.revoke ? "" : e.target.value + this.new_role = e.target.value }, cancel: function () { this.new_role = this.initialData }, }, + watch: { + revoke: function (val) { + if (val) { + this.new_role = "" + } + } + }, + computed: { displayName: function () { const newRole = this.newRole @@ -53,7 +60,7 @@ export default { "label" : "label label--success" }, newRole: function () { - return this.revoke ? "" : this.new_role + return this.new_role } }, } diff --git a/js/components/forms/edit_project_roles.js b/js/components/forms/edit_project_roles.js index 86d7f243..59cfaf70 100644 --- a/js/components/forms/edit_project_roles.js +++ b/js/components/forms/edit_project_roles.js @@ -18,6 +18,15 @@ export default { }, data: function() { - return { revoke: false } + return { revoke: false } + }, + + methods: { + doRevoke: function () { + // This is being used to send an event to the edit-environment-role child component. + // We'll toggle this back on the next line so that it can be used again. + this.revoke = true + setTimeout(() => { this.revoke = false }, 25) + } } } diff --git a/templates/workspaces/members/edit.html b/templates/workspaces/members/edit.html index 728682aa..5f3d4c89 100644 --- a/templates/workspaces/members/edit.html +++ b/templates/workspaces/members/edit.html @@ -70,7 +70,7 @@ Confirming will revoke access for {{ member.user.full_name }} to any environments associated with {{ project.name }}.
@@ -106,11 +106,11 @@