Filter with new implementation of roles list
This commit is contained in:
parent
3e1c813ceb
commit
471d98e650
@ -4,6 +4,7 @@ export default {
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
members: Array,
|
members: Array,
|
||||||
|
choices: Array,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
@ -21,8 +22,8 @@ export default {
|
|||||||
member.status === this.status | this.status === 'all'
|
member.status === this.status | this.status === 'all'
|
||||||
: true
|
: true
|
||||||
).filter(
|
).filter(
|
||||||
member => this.role ?
|
member => this.role ? (
|
||||||
member.role.toLowerCase() === this.role | this.role === 'all'
|
this.getRoleFromDisplayName(member.role) === this.role | this.role === 'all')
|
||||||
: true
|
: true
|
||||||
).filter(
|
).filter(
|
||||||
member => this.searchValue ? member.name.toLowerCase()
|
member => this.searchValue ? member.name.toLowerCase()
|
||||||
@ -30,4 +31,10 @@ export default {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getRoleFromDisplayName: function (role) {
|
||||||
|
return this.choices.find(choice => choice.display_name === role).name
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<members-list inline-template id="search-template" v-bind:members='{{ members | tojson}}'>
|
<members-list inline-template id="search-template" v-bind:members='{{ members | tojson}}' v-bind:choices='{{ choices | tojson}}'>
|
||||||
<div>
|
<div>
|
||||||
<form class='search-bar' @submit.prevent>
|
<form class='search-bar' @submit.prevent>
|
||||||
<div class='usa-input search-input'>
|
<div class='usa-input search-input'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user