Display 'no access' when role is revoked
This commit is contained in:
@@ -4,6 +4,7 @@ import Selector from '../selector'
|
||||
import Modal from '../../mixins/modal'
|
||||
import toggler from '../toggler'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'edit-environment-role',
|
||||
|
||||
@@ -36,23 +37,27 @@ export default {
|
||||
cancel: function () {
|
||||
this.new_role = this.initialData
|
||||
},
|
||||
actualRole: function () {
|
||||
return this.revoke ? null : this.new_role
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
displayName: function () {
|
||||
const roleName = this.actualRole()
|
||||
for (var arr in this.choices) {
|
||||
if (this.choices[arr][0] == this.new_role) {
|
||||
if (this.choices[arr][0] == roleName) {
|
||||
return this.choices[arr][1].name
|
||||
}
|
||||
}
|
||||
return this.new_role ? this.new_role : "no access"
|
||||
return roleName ? roleName : "no access"
|
||||
},
|
||||
label_class: function () {
|
||||
return this.displayName === "no access" ?
|
||||
"label" : "label label--success"
|
||||
},
|
||||
newRole: function () {
|
||||
return this.actualRole()
|
||||
}
|
||||
},
|
||||
newRole: function () {
|
||||
return this.revoke ? "" : this.new_role
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user