Skip to content

Commit

Permalink
feat(vue): Display User and Manager groups before other groups
Browse files Browse the repository at this point in the history
  • Loading branch information
zak39 committed Oct 22, 2024
1 parent 4421ab7 commit 08fb4c6
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/UserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
</td>
<td class="workspace-td"> {{ t('workspace', $store.getters.isSpaceAdmin(user, $route.params.space) ? 'admin' : 'user') }} </td>
<td class="workspace-td"> {{ user.groups.map(group => $store.getters.groupName($route.params.space, group)).join(', ') }} </td>
<td class="workspace-td"> {{ sortGroups(user.groups) }} </td>
<td class="workspace-td">
<div class="user-actions">
<NcActions>
Expand Down Expand Up @@ -140,6 +140,34 @@ export default {
},
},
methods: {
sortGroups(groups) {

Check failure on line 143 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 tabs but found 4 spaces
const spacename = this.$route.params.space

Check failure on line 144 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 3 tabs but found 6 spaces
const groupsSorted = this.sortedGroups([...groups], spacename)

Check failure on line 145 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 3 tabs but found 6 spaces
return groupsSorted.map(group => this.$store.getters.groupName(spacename, group)).join(', ')

Check failure on line 146 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 3 tabs but found 6 spaces
},

Check failure on line 147 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 tabs but found 4 spaces
sortedGroups(groups, spacename) {

Check failure on line 148 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 2 tabs but found 4 spaces
groups.sort((groupCurrent, groupNext) => {

Check failure on line 149 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 3 tabs but found 6 spaces

Check failure on line 149 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Array.prototype.sort() expects a value to be returned at the end of arrow function
// Makes sure the GE- group is first in the list

Check failure on line 150 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 4 tabs but found 8 spaces
// These tests must happen before the tests for the U- group

Check failure on line 151 in src/UserTable.vue

View workflow job for this annotation

GitHub Actions / lint

Expected indentation of 4 tabs but found 8 spaces
const GEGroup = this.$store.getters.GEGroup(spacename)
if (groupCurrent === GEGroup) {
return -1
}
if (groupNext === GEGroup) {
return 1
}
// Makes sure the U- group is second in the list
// These tests must be done after the tests for the GE- group
const UGroup = this.$store.getters.UGroup(spacename)
if (groupCurrent === UGroup) {
return -1
}
if (groupNext === UGroup) {
return 1
}
})
return groups
},
// Removes a user from a workspace
deleteUser(user) {
const space = this.$store.state.spaces[this.$route.params.space]
Expand Down

0 comments on commit 08fb4c6

Please sign in to comment.