You've already forked AstralRinth
forked from didirus/AstralRinth
Remove mod inbox (#1661)
This commit is contained in:
@@ -367,37 +367,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
v-if="currentMember && project.moderator_message"
|
|
||||||
class="universal-card moderation-card"
|
|
||||||
>
|
|
||||||
<h2 class="card-header">Message from the moderators:</h2>
|
|
||||||
<div v-if="project.moderator_message.body">
|
|
||||||
<p v-if="project.moderator_message.message" class="mod-message__title">
|
|
||||||
{{ project.moderator_message.message }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="markdown-body"
|
|
||||||
v-html="
|
|
||||||
renderString(
|
|
||||||
project.moderator_message.body
|
|
||||||
? project.moderator_message.body
|
|
||||||
: project.moderator_message.message
|
|
||||||
)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<div class="buttons status-buttons">
|
|
||||||
<button
|
|
||||||
v-if="tags.approvedStatuses.includes(project.status)"
|
|
||||||
class="iconified-button"
|
|
||||||
@click="clearMessage"
|
|
||||||
>
|
|
||||||
<ClearIcon />
|
|
||||||
Clear message
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<section class="normal-page__content">
|
<section class="normal-page__content">
|
||||||
<ProjectMemberHeader
|
<ProjectMemberHeader
|
||||||
@@ -461,7 +430,9 @@
|
|||||||
href: `/${project.project_type}/${
|
href: `/${project.project_type}/${
|
||||||
project.slug ? project.slug : project.id
|
project.slug ? project.slug : project.id
|
||||||
}/moderation`,
|
}/moderation`,
|
||||||
shown: !!currentMember,
|
shown:
|
||||||
|
!!currentMember &&
|
||||||
|
(isRejected(project) || isUnderReview(project) || isStaff(auth.user)),
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
@@ -770,10 +741,12 @@ import {
|
|||||||
Checkbox,
|
Checkbox,
|
||||||
ChartIcon,
|
ChartIcon,
|
||||||
renderString,
|
renderString,
|
||||||
|
isRejected,
|
||||||
|
isUnderReview,
|
||||||
|
isStaff,
|
||||||
} from 'omorphia'
|
} from 'omorphia'
|
||||||
import CrownIcon from '~/assets/images/utils/crown.svg'
|
import CrownIcon from '~/assets/images/utils/crown.svg'
|
||||||
import CalendarIcon from '~/assets/images/utils/calendar.svg'
|
import CalendarIcon from '~/assets/images/utils/calendar.svg'
|
||||||
import ClearIcon from '~/assets/images/utils/clear.svg'
|
|
||||||
import DownloadIcon from '~/assets/images/utils/download.svg'
|
import DownloadIcon from '~/assets/images/utils/download.svg'
|
||||||
import UpdateIcon from '~/assets/images/utils/updated.svg'
|
import UpdateIcon from '~/assets/images/utils/updated.svg'
|
||||||
import QueuedIcon from '~/assets/images/utils/list-end.svg'
|
import QueuedIcon from '~/assets/images/utils/list-end.svg'
|
||||||
@@ -1042,31 +1015,6 @@ if (!route.name.startsWith('type-id-settings')) {
|
|||||||
|
|
||||||
const onUserCollectProject = useClientTry(userCollectProject)
|
const onUserCollectProject = useClientTry(userCollectProject)
|
||||||
|
|
||||||
async function clearMessage() {
|
|
||||||
startLoading()
|
|
||||||
|
|
||||||
try {
|
|
||||||
await useBaseFetch(`project/${project.value.id}`, {
|
|
||||||
method: 'PATCH',
|
|
||||||
body: {
|
|
||||||
moderation_message: null,
|
|
||||||
moderation_message_body: null,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
project.value.moderator_message = null
|
|
||||||
} catch (err) {
|
|
||||||
data.$notify({
|
|
||||||
group: 'main',
|
|
||||||
title: 'An error occurred',
|
|
||||||
text: err.data.description,
|
|
||||||
type: 'error',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
stopLoading()
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setProcessing() {
|
async function setProcessing() {
|
||||||
startLoading()
|
startLoading()
|
||||||
|
|
||||||
|
|||||||
@@ -75,8 +75,9 @@
|
|||||||
<h2>Messages</h2>
|
<h2>Messages</h2>
|
||||||
<p>
|
<p>
|
||||||
This is a private conversation thread with the Modrinth moderators. They may message you
|
This is a private conversation thread with the Modrinth moderators. They may message you
|
||||||
with issues concerning this project. Additionally, you are welcome to start a discussion
|
with issues concerning this project. This thread is only checked when you submit your
|
||||||
here regarding this project and its status.
|
project for review. For additional inquiries, contact
|
||||||
|
<a href="https://support.modrinth.com">Modrinth support</a>.
|
||||||
</p>
|
</p>
|
||||||
<ConversationThread
|
<ConversationThread
|
||||||
v-if="thread"
|
v-if="thread"
|
||||||
@@ -124,7 +125,6 @@ const props = defineProps({
|
|||||||
|
|
||||||
const app = useNuxtApp()
|
const app = useNuxtApp()
|
||||||
const auth = await useAuth()
|
const auth = await useAuth()
|
||||||
const tags = useTags()
|
|
||||||
|
|
||||||
const { data: thread } = await useAsyncData(`thread/${props.project.thread_id}`, () =>
|
const { data: thread } = await useAsyncData(`thread/${props.project.thread_id}`, () =>
|
||||||
useBaseFetch(`thread/${props.project.thread_id}`)
|
useBaseFetch(`thread/${props.project.thread_id}`)
|
||||||
@@ -140,13 +140,6 @@ async function setStatus(status) {
|
|||||||
body: data,
|
body: data,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (tags.value.staffRoles.includes(auth.value.user.role)) {
|
|
||||||
await useBaseFetch(`thread/${props.project.thread_id}/read`, {
|
|
||||||
method: 'POST',
|
|
||||||
body: data,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const project = props.project
|
const project = props.project
|
||||||
project.status = status
|
project.status = status
|
||||||
await props.resetProject()
|
await props.resetProject()
|
||||||
|
|||||||
@@ -10,9 +10,6 @@
|
|||||||
<NavStackItem link="/moderation/review" label="Review projects">
|
<NavStackItem link="/moderation/review" label="Review projects">
|
||||||
<ModerationIcon />
|
<ModerationIcon />
|
||||||
</NavStackItem>
|
</NavStackItem>
|
||||||
<NavStackItem link="/moderation/messages" label="Messages">
|
|
||||||
<MessageIcon />
|
|
||||||
</NavStackItem>
|
|
||||||
<NavStackItem link="/moderation/reports" label="Reports">
|
<NavStackItem link="/moderation/reports" label="Reports">
|
||||||
<ReportIcon />
|
<ReportIcon />
|
||||||
</NavStackItem>
|
</NavStackItem>
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<section class="universal-card">
|
|
||||||
<h2>Messages</h2>
|
|
||||||
|
|
||||||
<ThreadSummary
|
|
||||||
v-for="thread in inbox"
|
|
||||||
:key="thread.id"
|
|
||||||
:thread="thread"
|
|
||||||
:link="getLink(thread)"
|
|
||||||
:auth="auth"
|
|
||||||
/>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import ThreadSummary from '~/components/ui/thread/ThreadSummary.vue'
|
|
||||||
|
|
||||||
useHead({
|
|
||||||
title: 'Moderation inbox - Modrinth',
|
|
||||||
})
|
|
||||||
|
|
||||||
const auth = await useAuth()
|
|
||||||
const { data: inbox } = await useAsyncData('thread/inbox', () => useBaseFetch('thread/inbox'))
|
|
||||||
|
|
||||||
function getLink(thread) {
|
|
||||||
if (thread.report_id) {
|
|
||||||
return `/moderation/report/${thread.report_id}`
|
|
||||||
} else if (thread.project_id) {
|
|
||||||
return `/project/${thread.project_id}/moderation`
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.thread-summary:not(:last-child) {
|
|
||||||
margin-bottom: var(--spacing-card-md);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user