Allow roles to be revoked many times
This commit is contained in:
@@ -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
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user