aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/components/UserList.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings/src/components/UserList.vue')
-rw-r--r--apps/settings/src/components/UserList.vue50
1 files changed, 27 insertions, 23 deletions
diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue
index 4fc9ee5b70f..459548fad26 100644
--- a/apps/settings/src/components/UserList.vue
+++ b/apps/settings/src/components/UserList.vue
@@ -19,7 +19,7 @@
<NcLoadingIcon v-if="isInitialLoad && loading.users"
:name="t('settings', 'Loading accounts …')"
:size="64" />
- <NcIconSvgWrapper v-else :path="mdiAccountGroup" :size="64" />
+ <NcIconSvgWrapper v-else :path="mdiAccountGroupOutline" :size="64" />
</template>
</NcEmptyContent>
@@ -34,8 +34,6 @@
users,
settings,
hasObfuscated,
- groups,
- subAdminsGroups,
quotaOptions,
languages,
externalActions,
@@ -60,15 +58,15 @@
</template>
<script>
-import { mdiAccountGroup } from '@mdi/js'
+import { mdiAccountGroupOutline } from '@mdi/js'
import { showError } from '@nextcloud/dialogs'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { Fragment } from 'vue-frag'
import Vue from 'vue'
-import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
-import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
-import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
+import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
+import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
+import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import VirtualList from './Users/VirtualList.vue'
import NewUserDialog from './Users/NewUserDialog.vue'
@@ -122,7 +120,7 @@ export default {
setup() {
// non reactive properties
return {
- mdiAccountGroup,
+ mdiAccountGroupOutline,
rowHeight: 55,
UserRow,
@@ -169,23 +167,12 @@ export default {
if (this.selectedGroup === 'disabled') {
return this.users.filter(user => user.enabled === false)
}
- if (!this.settings.isAdmin) {
- // we don't want subadmins to edit themselves
- return this.users.filter(user => user.enabled !== false)
- }
return this.users.filter(user => user.enabled !== false)
},
groups() {
- // data provided php side + remove the disabled group
- return this.$store.getters.getGroups
- .filter(group => group.id !== 'disabled')
- .sort((a, b) => a.name.localeCompare(b.name))
- },
-
- subAdminsGroups() {
- // data provided php side
- return this.$store.getters.getSubadminGroups
+ return this.$store.getters.getSortedGroups
+ .filter(group => group.id !== '__nc_internal_recent' && group.id !== 'disabled')
},
quotaOptions() {
@@ -298,6 +285,12 @@ export default {
limit: this.disabledUsersLimit,
search: this.searchQuery,
})
+ } else if (this.selectedGroup === '__nc_internal_recent') {
+ await this.$store.dispatch('getRecentUsers', {
+ offset: this.usersOffset,
+ limit: this.usersLimit,
+ search: this.searchQuery,
+ })
} else {
await this.$store.dispatch('getUsers', {
offset: this.usersOffset,
@@ -355,7 +348,18 @@ export default {
},
setNewUserDefaultGroup(value) {
- if (value && value.length > 0) {
+ // Is no value set, but user is a line manager we set their group as this is a requirement for line manager
+ if (!value && !this.settings.isAdmin && !this.settings.isDelegatedAdmin) {
+ const groups = this.$store.getters.getSubAdminGroups
+ // if there are multiple groups we do not know which to add,
+ // so we cannot make the managers life easier by preselecting it.
+ if (groups.length === 1) {
+ this.newUser.groups = [...groups]
+ }
+ return
+ }
+
+ if (value) {
// setting new account default group to the current selected one
const currentGroup = this.groups.find(group => group.id === value)
if (currentGroup) {
@@ -387,7 +391,7 @@ export default {
</script>
<style lang="scss" scoped>
-@import './Users/shared/styles.scss';
+@use './Users/shared/styles' as *;
.empty {
:deep {