diff options
| author | Shpuld Shpludson <shp@cock.li> | 2021-03-01 18:15:46 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2021-03-01 18:15:46 +0000 |
| commit | c3fcbbd918ddef4e3f574a464fd10f4899bb2dce (patch) | |
| tree | 695ccbd352c82cb0f08fc78ff85bf23888561a8e /src/components/staff_panel/staff_panel.js | |
| parent | 320418d524a33c20d7d769c8d67a25be81f251ec (diff) | |
| parent | 0ac34b3014a1499ef5f3de7d3c321119dd10ab26 (diff) | |
Merge branch 'rc/2.3.0' into 'master'
2.3.0 to MASTER
See merge request pleroma/pleroma-fe!1366
Diffstat (limited to 'src/components/staff_panel/staff_panel.js')
| -rw-r--r-- | src/components/staff_panel/staff_panel.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/components/staff_panel/staff_panel.js b/src/components/staff_panel/staff_panel.js index 8665648a..b9561bf1 100644 --- a/src/components/staff_panel/staff_panel.js +++ b/src/components/staff_panel/staff_panel.js @@ -1,4 +1,6 @@ import map from 'lodash/map' +import groupBy from 'lodash/groupBy' +import { mapGetters, mapState } from 'vuex' import BasicUserCard from '../basic_user_card/basic_user_card.vue' const StaffPanel = { @@ -10,9 +12,21 @@ const StaffPanel = { BasicUserCard }, computed: { - staffAccounts () { - return map(this.$store.state.instance.staffAccounts, nickname => this.$store.getters.findUser(nickname)).filter(_ => _) - } + groupedStaffAccounts () { + const staffAccounts = map(this.staffAccounts, this.findUser).filter(_ => _) + const groupedStaffAccounts = groupBy(staffAccounts, 'role') + + return [ + { role: 'admin', users: groupedStaffAccounts['admin'] }, + { role: 'moderator', users: groupedStaffAccounts['moderator'] } + ].filter(group => group.users) + }, + ...mapGetters([ + 'findUser' + ]), + ...mapState({ + staffAccounts: state => state.instance.staffAccounts + }) } } |
