review pass 1
This commit is contained in:
parent
210b1f5ee4
commit
d94cac6376
25 changed files with 56 additions and 292 deletions
|
|
@ -1,95 +0,0 @@
|
|||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
import Select from 'src/components/select/select.vue'
|
||||
import Status from 'src/components/status/status.vue'
|
||||
|
||||
import { parseStatus } from 'src/services/entity_normalizer/entity_normalizer.service.js'
|
||||
|
||||
const AdminStatusCard = {
|
||||
props: {
|
||||
statusDetails: {
|
||||
type: Object,
|
||||
required: true,
|
||||
validator(u) {
|
||||
return typeof u.id === 'string'
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonExpanded: false,
|
||||
statusCache: undefined,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isSensitive() {
|
||||
return this.statusDetails.sensitive === true
|
||||
},
|
||||
visibility() {
|
||||
return this.statusDetails.visibility
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeSensitivity(v) {
|
||||
this.$store
|
||||
.dispatch('adminChangeStatusScope', {
|
||||
opts: { id: this.statusDetails.id, sensitive: v },
|
||||
})
|
||||
.then((res) => parseStatus(res))
|
||||
.then((s) => (this.statusCache = s))
|
||||
},
|
||||
changeVisibility(v) {
|
||||
this.$store
|
||||
.dispatch('adminChangeStatusScope', {
|
||||
opts: { id: this.statusDetails.id, visibility: v },
|
||||
})
|
||||
.then((res) => parseStatus(res))
|
||||
.then((s) => (this.statusCache = s))
|
||||
},
|
||||
/**
|
||||
* show the confirmation box for bulk actions.
|
||||
* @param {string} box ref name specified for the confirm component
|
||||
*/
|
||||
confirmSelection(box) {
|
||||
this.$refs[box].show()
|
||||
this.$refs.dropdown.hidePopover()
|
||||
},
|
||||
/**
|
||||
* called when a bulk action was confirmed
|
||||
* @param {string} action
|
||||
*/
|
||||
selectionConfirmed(action, opts) {
|
||||
const restricted = []
|
||||
const s = this.$refs.userList.getSelected()
|
||||
s.forEach((u) => {
|
||||
if (
|
||||
restricted.includes(action) !== false ||
|
||||
u.id !== this.$store.state.users.currentUser.id
|
||||
) {
|
||||
this.$store.dispatch(action, {
|
||||
id: this.statusDetails.id,
|
||||
...(opts || {}),
|
||||
})
|
||||
}
|
||||
})
|
||||
this.reset()
|
||||
},
|
||||
},
|
||||
components: {
|
||||
Checkbox,
|
||||
Select,
|
||||
Status,
|
||||
},
|
||||
/**
|
||||
* fetch and cache status info
|
||||
*/
|
||||
mounted() {
|
||||
this.$store
|
||||
.dispatch('adminChangeStatusScope', {
|
||||
opts: { id: this.statusDetails.id },
|
||||
})
|
||||
.then((res) => parseStatus(res))
|
||||
.then((s) => (this.statusCache = s))
|
||||
},
|
||||
}
|
||||
|
||||
export default AdminStatusCard
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
<template>
|
||||
<div class="setting-item">
|
||||
<h2> {{ $t('admin_dash.users.title_info') }}: </h2>
|
||||
<ul
|
||||
class="setting-list"
|
||||
>
|
||||
<li>
|
||||
<span> {{ $t('admin_dash.users.status_id') }}: {{ statusDetails.id }} </span>
|
||||
</li>
|
||||
<li>
|
||||
<span> {{ $t('admin_dash.users.created_at') }}: {{ new Date(statusDetails.created_at).toLocaleString() }} </span>
|
||||
</li>
|
||||
<li>
|
||||
<span v-if="statusDetails.edited_at !== null"> {{ $t('admin_dash.users.edited_at') }}: {{ new Date(statusDetails.edited_at).toLocaleString() }} </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2> {{ $t('admin_dash.users.title_content') }}: </h2>
|
||||
<ul
|
||||
class="setting-list"
|
||||
>
|
||||
<li>
|
||||
<Status
|
||||
v-if="typeof(statusCache) !== 'undefined'"
|
||||
class="Notification"
|
||||
:compact="true"
|
||||
:statusoid="statusCache"
|
||||
@interacted="false"
|
||||
/>
|
||||
</li>
|
||||
<p> action dropdown thingy </p>
|
||||
<!--
|
||||
<li>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="deleteStatus(status.id)"
|
||||
>
|
||||
{{ $t('admin_dash.users.delete_status') }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<Checkbox
|
||||
:model-value="isSensitive"
|
||||
@update:model-value="v => changeSensitivity(v)"
|
||||
>
|
||||
{{ $t('admin_dash.users.content_nsfw') }}
|
||||
</Checkbox>
|
||||
</li>
|
||||
<li>
|
||||
<Select
|
||||
:model-value="visibility"
|
||||
@update:model-value="v => changeVisibility(v)"
|
||||
>
|
||||
<option
|
||||
value="public"
|
||||
>
|
||||
{{ $t('admin_dash.users.scope_public') }}
|
||||
</option>
|
||||
<option
|
||||
value="unlisted"
|
||||
>
|
||||
{{ $t('admin_dash.users.scope_unlisted') }}
|
||||
</option>
|
||||
<option
|
||||
value="private"
|
||||
>
|
||||
{{ $t('admin_dash.users.scope_private') }}
|
||||
</option>
|
||||
<option
|
||||
value="direct"
|
||||
>
|
||||
{{ $t('admin_dash.users.scope_direct') }}
|
||||
</option>
|
||||
</Select>
|
||||
</li>
|
||||
<li>
|
||||
<a :href="statusDetails.url"> {{ $t('admin_dash.users.link_source') }} </a>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
<!--
|
||||
<div v-if="!jsonExpanded">
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="jsonExpanded = !jsonExpanded"
|
||||
>
|
||||
{{ $t('admin_dash.users.expand_raw_info') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<button
|
||||
class="button button-default btn"
|
||||
type="button"
|
||||
@click="jsonExpanded = !jsonExpanded"
|
||||
>
|
||||
{{ $t('admin_dash.users.collapse_raw_info') }}
|
||||
</button>
|
||||
<h2> {{ $t('admin_dash.users.title_details') }} </h2>
|
||||
<pre> {{ JSON.stringify(statusDetails, null, 2) }} </pre>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script src="./admin_status_card.js"></script>
|
||||
|
|
@ -3,7 +3,7 @@ import { defineAsyncComponent } from 'vue'
|
|||
import BasicUserCard from 'src/components/basic_user_card/basic_user_card.vue'
|
||||
import ModerationTools from 'src/components/moderation_tools/moderation_tools.vue'
|
||||
|
||||
const AdminCard = {
|
||||
const AdminUserCard = {
|
||||
props: {
|
||||
userId: {
|
||||
type: String,
|
||||
|
|
@ -17,9 +17,6 @@ const AdminCard = {
|
|||
user() {
|
||||
return this.$store.getters.findUser(this.userId)
|
||||
},
|
||||
relationship() {
|
||||
return this.$store.getters.relationship(this.userId)
|
||||
},
|
||||
isAdmin() {
|
||||
return this.user.rights.admin
|
||||
},
|
||||
|
|
@ -32,4 +29,4 @@ const AdminCard = {
|
|||
},
|
||||
}
|
||||
|
||||
export default AdminCard
|
||||
export default AdminUserCard
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
.AdminCard {
|
||||
.AdminUserCard {
|
||||
width: 100%;
|
||||
|
||||
.right-side {
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
</template>
|
||||
<template v-else>
|
||||
<BasicUserCard
|
||||
class="AdminCard"
|
||||
class="AdminUserCard"
|
||||
:user="user"
|
||||
show-line-labels
|
||||
>
|
||||
|
|
@ -102,6 +102,6 @@
|
|||
</template>
|
||||
</template>
|
||||
|
||||
<script src="./admin_card.js"></script>
|
||||
<script src="./admin_user_card.js"></script>
|
||||
|
||||
<style lang="scss" src="./admin_card.scss"></style>
|
||||
<style lang="scss" src="./admin_user_card.scss"></style>
|
||||
|
|
@ -105,7 +105,7 @@ const FrontendsTab = {
|
|||
const ref = suggestRef || this.getSuggestedRef(frontend)
|
||||
const { name } = frontend
|
||||
|
||||
useAdminSettingsStore.updateAdminDraft({
|
||||
useAdminSettingsStore().updateAdminDraft({
|
||||
path: [':pleroma', ':frontends', ':primary'],
|
||||
value: { name, ref },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -112,19 +112,19 @@ const LinksTab = {
|
|||
},
|
||||
methods: {
|
||||
checkRel(e) {
|
||||
useAdminSettingsStore.updateAdminDraft({
|
||||
useAdminSettingsStore().updateAdminDraft({
|
||||
path: [':pleroma', 'Pleroma.Formatter', ':rel'],
|
||||
value: e ? '' : false,
|
||||
})
|
||||
},
|
||||
checkClass(e) {
|
||||
useAdminSettingsStore.updateAdminDraft({
|
||||
useAdminSettingsStore().updateAdminDraft({
|
||||
path: [':pleroma', 'Pleroma.Formatter', ':class'],
|
||||
value: e ? '' : false,
|
||||
})
|
||||
},
|
||||
checkTruncate(e) {
|
||||
useAdminSettingsStore.updateAdminDraft({
|
||||
useAdminSettingsStore().updateAdminDraft({
|
||||
path: [':pleroma', 'Pleroma.Formatter', ':truncate'],
|
||||
value: e ? 20 : false,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ import Checkbox from 'src/components/checkbox/checkbox.vue'
|
|||
import GenericConfirm from 'src/components/confirm_modal/generic_confirm.vue'
|
||||
import List from 'src/components/list/list.vue'
|
||||
import ModerationTools from 'src/components/moderation_tools/moderation_tools.vue'
|
||||
import ProgressButton from 'src/components/progress_button/progress_button.vue'
|
||||
import Select from 'src/components/select/select.vue'
|
||||
import AdminCard from 'src/components/settings_modal/admin_tabs/admin_card.vue'
|
||||
import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
|
||||
import AdminUserCard from 'src/components/settings_modal/admin_tabs/admin_user_card.vue'
|
||||
|
||||
import { useAdminSettingsStore } from 'src/stores/admin_settings.js'
|
||||
|
||||
|
|
@ -18,18 +16,10 @@ const UsersTab = {
|
|||
Select,
|
||||
BasicUserCard,
|
||||
List,
|
||||
ProgressButton,
|
||||
AdminCard,
|
||||
TabSwitcher,
|
||||
AdminUserCard,
|
||||
ModerationTools,
|
||||
GenericConfirm,
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
defaultDraftMode: true,
|
||||
defaultSource: 'admin',
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filtersOrigin: 'local',
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
<ModerationTools :users="selected" />
|
||||
</template>
|
||||
<template #item="{item}">
|
||||
<AdminCard :user-id="item.id" />
|
||||
<AdminUserCard :user-id="item.id" />
|
||||
</template>
|
||||
<template #load>
|
||||
<span> loading </span>
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export default {
|
|||
},
|
||||
set(value) {
|
||||
if (this.realSource === 'admin' || this.path == null) {
|
||||
useAdminSettingsStore.updateAdminDraft({
|
||||
useAdminSettingsStore().updateAdminDraft({
|
||||
path: this.canonPath,
|
||||
value,
|
||||
})
|
||||
|
|
@ -254,7 +254,7 @@ export default {
|
|||
this.$store.dispatch('setProfileOption', { name: k, value: v })
|
||||
case 'admin':
|
||||
return (k, v) =>
|
||||
useAdminSettingsStore.pushAdminSetting({ path: k, value: v })
|
||||
useAdminSettingsStore().pushAdminSetting({ path: k, value: v })
|
||||
default:
|
||||
return (readPath, value) => {
|
||||
const writePath = `${readPath}`
|
||||
|
|
|
|||
|
|
@ -233,10 +233,10 @@ const SettingsModal = {
|
|||
return clone
|
||||
},
|
||||
resetAdminDraft() {
|
||||
useAdminSettingsStore.resetAdminDraft()
|
||||
useAdminSettingsStore().resetAdminDraft()
|
||||
},
|
||||
pushAdminDraft() {
|
||||
useAdminSettingsStore.pushAdminDraft()
|
||||
useAdminSettingsStore().pushAdminDraft()
|
||||
},
|
||||
...mapActions(useInterfaceStore, [
|
||||
'temporaryChangesRevert',
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
ref="tabSwitcher"
|
||||
class="settings-admin-content settings_tab-switcher"
|
||||
:side-tab-bar="true"
|
||||
:scrollable-tabs="true"
|
||||
:scrollable-tabs
|
||||
:render-only-focused="true"
|
||||
:body-scroll-lock="bodyLock"
|
||||
>
|
||||
|
|
@ -50,7 +50,6 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
v-if="adminDbLoaded"
|
||||
:label="$t('admin_dash.tabs.users')"
|
||||
icon="user"
|
||||
data-tab-name="users"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<vertical-tab-switcher
|
||||
ref="tabSwitcher"
|
||||
class="settings_tab-switcher"
|
||||
:scrollable-tabs="true"
|
||||
:scrollable-tabs
|
||||
:body-scroll-lock="bodyLock"
|
||||
:hide-header="navHideHeader"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -16,15 +16,6 @@ const MutesAndBlocks = {
|
|||
data() {
|
||||
return {
|
||||
activeTab: 'profile',
|
||||
mutesLoading: false,
|
||||
mutesError: null,
|
||||
mutesBottomedOut: false,
|
||||
blocksLoading: false,
|
||||
blocksError: null,
|
||||
blocksBottomedOut: false,
|
||||
domainsLoading: false,
|
||||
domainsError: null,
|
||||
domainsBottomedOut: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<tab-switcher
|
||||
class="mutes-and-blocks-tab"
|
||||
:scrollable-tabs="true"
|
||||
:scrollable-tabs
|
||||
>
|
||||
<div
|
||||
class="blocks"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue