diff --git a/src/components/mod_modal/mod_modal.scss b/src/components/mod_modal/mod_modal.scss
index 4821df74..b4f5db5c 100644
--- a/src/components/mod_modal/mod_modal.scss
+++ b/src/components/mod_modal/mod_modal.scss
@@ -39,6 +39,7 @@
.panel-body {
height: inherit;
+ overflow-y: hidden;
}
}
}
diff --git a/src/components/mod_modal/mod_modal.vue b/src/components/mod_modal/mod_modal.vue
index 64bbf021..f6b529a0 100644
--- a/src/components/mod_modal/mod_modal.vue
+++ b/src/components/mod_modal/mod_modal.vue
@@ -35,6 +35,9 @@
+
diff --git a/src/components/mod_modal/tabs/users_tab/users_tab.js b/src/components/mod_modal/tabs/users_tab/users_tab.js
index 025334e2..03447742 100644
--- a/src/components/mod_modal/tabs/users_tab/users_tab.js
+++ b/src/components/mod_modal/tabs/users_tab/users_tab.js
@@ -1,6 +1,8 @@
+import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue'
+import ModerationTools from 'src/components/moderation_tools/moderation_tools.vue'
import Popover from 'src/components/popover/popover.vue'
-import { forEach } from 'lodash'
+import { forEach, every, findKey } from 'lodash'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@@ -16,53 +18,91 @@ library.add(
const UsersTab = {
data () {
return {
+ searchTerm: null,
+ page: 1,
accountType: {
local: true,
- external: false,
- all: false
+ external: false
},
status: {
active: true,
deactivated: false,
- pending: false,
- unconfirmed: false,
- all: false
+ need_approval: false,
+ unconfirmed: false
},
actorType: {
- person: true,
- bot: true,
- application: true,
- all: true
+ Person: false,
+ Service: false,
+ Application: false
}
}
},
components: {
+ BasicUserCard,
+ ModerationTools,
Popover
},
+ created () {
+ this.query()
+ },
+ computed: {
+ users () { return this.$store.state.users.adminUsers },
+ isActive () {
+ const tabSwitcher = this.$parent
+ console.log(this.users)
+ return tabSwitcher ? tabSwitcher.isActive('users') : false
+ }
+ },
methods: {
- setAccountType (type) {
- if (type === 'all') {
- forEach(this.accountType, (k, v) => { this.accountType[v] = true })
- } else {
- forEach(this.accountType, (k, v) => { this.accountType[v] = false })
+ all (filter) { return every(filter, _ => !_) },
+ setAccountType (type = false) {
+ forEach(this.accountType, (k, v) => { this.accountType[v] = false })
+ if (type) {
this.accountType[type] = true
}
+
+ this.query()
},
- setStatus (status) {
- if (status === 'all') {
- forEach(this.status, (k, v) => { this.status[v] = true })
- } else {
- forEach(this.status, (k, v) => { this.status[v] = false })
+ setStatus (status = false) {
+ forEach(this.status, (k, v) => { this.status[v] = false })
+ if (status) {
this.status[status] = true
}
+
+ this.query()
},
- setActorType (type) {
- if (type === 'all') {
- forEach(this.actorType, (k, v) => { this.actorType[v] = true })
- } else {
- forEach(this.actorType, (k, v) => { this.actorType[v] = false })
+ setActorType (type = false) {
+ forEach(this.actorType, (k, v) => { this.actorType[v] = false })
+ if (type) {
this.actorType[type] = true
}
+
+ this.query()
+ },
+ prevPage () {
+ this.page--
+ this.query()
+ },
+ nextPage () {
+ this.page++
+ this.query()
+ },
+ query () {
+ const params = {}
+ params.actorTypes = [findKey(this.actorType, _ => _)].filter(Boolean)
+ params.filters = [
+ findKey(this.status, _ => _),
+ findKey(this.accountType, _ => _)
+ ].filter(Boolean)
+
+ if (this.searchTerm) {
+ params.name = this.searchTerm
+ }
+ if (this.page > 1) {
+ params.page = this.page
+ }
+
+ this.$store.dispatch('fetchUsers', params)
}
}
}
diff --git a/src/components/mod_modal/tabs/users_tab/users_tab.vue b/src/components/mod_modal/tabs/users_tab/users_tab.vue
index b540fb00..cd3d77b6 100644
--- a/src/components/mod_modal/tabs/users_tab/users_tab.vue
+++ b/src/components/mod_modal/tabs/users_tab/users_tab.vue
@@ -15,7 +15,7 @@
v-model="searchTerm"
class="search-input"
:placeholder="$t('nav.search')"
- @keyup.enter="newQuery(searchTerm)"
+ @keyup.enter="query()"
/>
{{ $t('moderation.users.filter.local') }}
{{ $t('moderation.users.filter.active') }}
+
+
+
+
+
+
+
diff --git a/src/i18n/en.json b/src/i18n/en.json
index fb4cf9e3..588127d9 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -294,6 +294,8 @@
"tags": "Set post restrictions"
},
"statuses": "Posts",
+ "next": "Next page",
+ "previous": "Previous page",
"users": {
"users": "Users",
"filter": {