diff --git a/src/components/dialog_modal/dialog_modal.vue b/src/components/dialog_modal/dialog_modal.vue
index 0feef27b..0042d057 100644
--- a/src/components/dialog_modal/dialog_modal.vue
+++ b/src/components/dialog_modal/dialog_modal.vue
@@ -69,7 +69,7 @@
padding: 1rem 1rem;
background-color: $fallback--bg;
background-color: var(--bg, $fallback--bg);
- white-space: normal;
+ white-space: pre-wrap;
}
.dialog-modal-footer {
diff --git a/src/components/mod_modal/mod_modal.scss b/src/components/mod_modal/mod_modal.scss
index 4821df74..f0882f97 100644
--- a/src/components/mod_modal/mod_modal.scss
+++ b/src/components/mod_modal/mod_modal.scss
@@ -24,7 +24,6 @@
}
.mod-modal-panel {
- overflow: hidden;
transition: transform;
transition-timing-function: ease-in-out;
transition-duration: 300ms;
@@ -39,6 +38,16 @@
.panel-body {
height: inherit;
+ overflow-y: hidden;
+ }
+
+ .pagination-container {
+ display: flex;
+ justify-content: right;
+
+ .btn {
+ margin-left: 0.6em;
+ }
}
}
}
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/mod_modal_content.js b/src/components/mod_modal/mod_modal_content.js
index e0ba6259..f1637e73 100644
--- a/src/components/mod_modal/mod_modal_content.js
+++ b/src/components/mod_modal/mod_modal_content.js
@@ -2,7 +2,7 @@ import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import ReportsTab from './tabs/reports_tab/reports_tab.vue'
// import StatusesTab from './tabs/statuses_tab.vue'
-// import UsersTab from './tabs/users_tab.vue'
+import UsersTab from './tabs/users_tab/users_tab.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@@ -21,9 +21,9 @@ const ModModalContent = {
components: {
TabSwitcher,
- ReportsTab
+ ReportsTab,
// StatusesTab,
- // UsersTab
+ UsersTab
},
computed: {
open () {
diff --git a/src/components/mod_modal/mod_modal_content.vue b/src/components/mod_modal/mod_modal_content.vue
index 6fa32be1..c4b964b9 100644
--- a/src/components/mod_modal/mod_modal_content.vue
+++ b/src/components/mod_modal/mod_modal_content.vue
@@ -13,6 +13,13 @@
>
+
+
+
diff --git a/src/components/mod_modal/tabs/users_tab/users_tab.js b/src/components/mod_modal/tabs/users_tab/users_tab.js
new file mode 100644
index 00000000..ca7dd924
--- /dev/null
+++ b/src/components/mod_modal/tabs/users_tab/users_tab.js
@@ -0,0 +1,116 @@
+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, every, findKey } from 'lodash'
+
+import { library } from '@fortawesome/fontawesome-svg-core'
+import {
+ faFilter,
+ faSearch
+} from '@fortawesome/free-solid-svg-icons'
+
+library.add(
+ faFilter,
+ faSearch
+)
+
+const UsersTab = {
+ data () {
+ return {
+ searchTerm: null,
+ page: 1,
+ accountType: {
+ local: true,
+ external: false
+ },
+ status: {
+ active: true,
+ deactivated: false,
+ need_approval: false,
+ unconfirmed: false
+ },
+ actorType: {
+ 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
+ return tabSwitcher ? tabSwitcher.isActive('users') : false
+ }
+ },
+ methods: {
+ all (filter) { return every(filter, _ => !_) },
+ setAccountType (type = false) {
+ forEach(this.accountType, (k, v) => { this.accountType[v] = false })
+ if (type) {
+ this.accountType[type] = true
+ }
+
+ this.page = 1
+ this.query()
+ },
+ setStatus (status = false) {
+ forEach(this.status, (k, v) => { this.status[v] = false })
+ if (status) {
+ this.status[status] = true
+ }
+
+ this.page = 1
+ this.query()
+ },
+ setActorType (type = false) {
+ forEach(this.actorType, (k, v) => { this.actorType[v] = false })
+ if (type) {
+ this.actorType[type] = true
+ }
+
+ this.page = 1
+ this.query()
+ },
+ search () {
+ this.page = 1
+ 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)
+ }
+ }
+}
+
+export default UsersTab
diff --git a/src/components/mod_modal/tabs/users_tab/users_tab.scss b/src/components/mod_modal/tabs/users_tab/users_tab.scss
new file mode 100644
index 00000000..d11c241e
--- /dev/null
+++ b/src/components/mod_modal/tabs/users_tab/users_tab.scss
@@ -0,0 +1,60 @@
+@import '../../../../_variables.scss';
+
+.users-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .right-side {
+ display: flex;
+ align-items: center;
+
+ .search-input-container {
+ padding: 0.8rem;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .search-input {
+ width: 100%;
+ line-height: 1.125rem;
+ font-size: 1rem;
+ padding: 0.5rem;
+ box-sizing: border-box;
+ }
+
+ .search-icon {
+ margin-right: 0.3em;
+ }
+ }
+ }
+}
+
+.users .user {
+ display: flex;
+ flex-direction: row;
+
+ .user-moderation {
+ padding-top: 0.6em;
+ position: relative;
+
+ .popover {
+ right: 0;
+ }
+ }
+
+ .user-information {
+ display: flex;
+ flex-direction: column;
+ padding-bottom: 0.6em;
+ flex: 1;
+
+ .basic-user-card {
+ padding-bottom: 0;
+ }
+
+ .registration-reason {
+ padding-left: 5.2em;
+ }
+ }
+}
diff --git a/src/components/mod_modal/tabs/users_tab/users_tab.vue b/src/components/mod_modal/tabs/users_tab/users_tab.vue
new file mode 100644
index 00000000..647dc4ec
--- /dev/null
+++ b/src/components/mod_modal/tabs/users_tab/users_tab.vue
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
{{ $t('moderation.users.no_results') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js
index 2469327a..51f084df 100644
--- a/src/components/moderation_tools/moderation_tools.js
+++ b/src/components/moderation_tools/moderation_tools.js
@@ -16,7 +16,8 @@ const QUARANTINE = 'mrf_tag:quarantine'
const ModerationTools = {
props: [
- 'user'
+ 'user',
+ 'extended'
],
data () {
return {
@@ -30,7 +31,10 @@ const ModerationTools = {
QUARANTINE
},
showDeleteUserDialog: false,
- toggled: false
+ showPasswordTokenDialog: false,
+ toggled: false,
+ passwordResetToken: {},
+ bot: this.user.bot
}
},
components: {
@@ -83,6 +87,9 @@ const ModerationTools = {
deleteUserDialog (show) {
this.showDeleteUserDialog = show
},
+ passwordTokenDialog (show) {
+ this.showPasswordTokenDialog = show
+ },
deleteUser () {
const store = this.$store
const user = this.user
@@ -97,6 +104,32 @@ const ModerationTools = {
}
})
},
+ approveAccount () {
+ this.$store.state.api.backendInteractor.approveAccount({ nickname: this.user.screen_name })
+ },
+ getPasswordResetToken () {
+ this.$store.state.api.backendInteractor.getPasswordResetToken({ nickname: this.user.screen_name })
+ .then(data => {
+ this.passwordResetToken = data
+ this.passwordTokenDialog(true)
+ })
+ },
+ forcePasswordReset () {
+ this.$store.state.api.backendInteractor.forcePasswordReset({ nickname: this.user.screen_name })
+ },
+ forceDisableMFA () {
+ this.$store.state.api.backendInteractor.forceDisableMFA({ nickname: this.user.screen_name })
+ },
+ toggleBot () {
+ const params = { bot: !this.bot }
+
+ this.$store.state.api.backendInteractor
+ .updateProfile({ params })
+ .then((user) => {
+ this.$store.commit('addNewUsers', [user])
+ this.bot = !this.bot
+ })
+ },
setToggled (value) {
this.toggled = value
}
diff --git a/src/components/moderation_tools/moderation_tools.vue b/src/components/moderation_tools/moderation_tools.vue
index 75ea08cc..513f2c7b 100644
--- a/src/components/moderation_tools/moderation_tools.vue
+++ b/src/components/moderation_tools/moderation_tools.vue
@@ -5,6 +5,7 @@
class="moderation-tools-popover"
placement="bottom"
:offset="{ y: 5 }"
+ :noCenter="extended"
@show="setToggled(true)"
@close="setToggled(false)"
>
@@ -28,6 +29,25 @@
class="dropdown-divider"
/>
+
+
+
+
+