diff --git a/js/components/forms/edit_environment_role.js b/js/components/forms/edit_environment_role.js index 468fb8f9..45a3506a 100644 --- a/js/components/forms/edit_environment_role.js +++ b/js/components/forms/edit_environment_role.js @@ -20,7 +20,7 @@ export default { props: { choices: Array, initialData: String, - revoke: Boolean, + projectId: String }, data: function () { @@ -29,6 +29,10 @@ export default { } }, + mounted: function() { + this.$root.$on('revoke-' + this.projectId, this.revoke) + }, + methods: { change: function (e) { this.new_role = e.target.value @@ -36,13 +40,8 @@ export default { cancel: function () { this.new_role = this.initialData }, - }, - - watch: { - revoke: function (val) { - if (val) { - this.new_role = "" - } + revoke: function () { + this.new_role = "" } }, diff --git a/js/components/forms/edit_project_roles.js b/js/components/forms/edit_project_roles.js index 59cfaf70..d1c5107c 100644 --- a/js/components/forms/edit_project_roles.js +++ b/js/components/forms/edit_project_roles.js @@ -14,19 +14,13 @@ export default { }, props: { - name: String - }, - - data: function() { - return { revoke: false } + name: String, + id: String }, 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) + this.$root.$emit('revoke-' + this.id) } } } diff --git a/templates/workspaces/members/edit.html b/templates/workspaces/members/edit.html index 5f3d4c89..deeeec75 100644 --- a/templates/workspaces/members/edit.html +++ b/templates/workspaces/members/edit.html @@ -52,7 +52,7 @@ {% for project in projects %} {% set revoke_modal_name = project.name + 'RevokeModal' %} - +