Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions apps/frontend/src/components/ui/moderation/ModerationQueueCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@
</span>
</div>
<div
v-if="queueEntry.project.requested_status"
class="flex items-center gap-2 rounded-full border border-solid border-surface-5 bg-surface-4 px-2.5 py-1"
>
<span class="text-sm text-secondary">Requesting</span>
<Badge :type="queueEntry.project.requested_status" class="text-sm" />
<Badge
:type="
queueEntry.project.visibility === 'public'
? 'approved'
: queueEntry.project.visibility
"
class="text-sm"
/>
</div>
<div
v-if="showExternalDependencies"
Expand Down Expand Up @@ -106,7 +112,8 @@
v-tooltip="`First submitted ${formatDateTimeFull(initialQueuedDate.toDate())}`"
class="text-sm text-secondary"
>
First submitted {{ formatRelativeTime(initialQueuedDate.toISOString()) }}
First submitted
{{ formatRelativeTime(initialQueuedDate.toISOString()) }}
</span>
</div>

Expand Down
5 changes: 3 additions & 2 deletions apps/frontend/src/components/ui/thread/ConversationThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,8 @@ const replyMutation = useMutation({
const assertCurrent = () => {
if (props.thread.id !== threadId) throw new Error(formatMessage(messages.changedThread))
}
if (replyBody.value.trim()) {
const reviewReason = replyBody.value.trim() || undefined
if (reviewReason) {
const reply = {
threadId,
body: replyBody.value,
Expand Down Expand Up @@ -910,7 +911,7 @@ const replyMutation = useMutation({
queryKey: ['project', projectId, 'validation'],
})
assertCurrent()
if (status !== null) return (await props.setStatus(status)) !== false
if (status !== null) return (await props.setStatus(status, reviewReason)) !== false
return true
},
onError: (error) =>
Expand Down
8 changes: 6 additions & 2 deletions apps/frontend/src/pages/[type]/[project]/moderation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ function updateThread(newThread: Labrinth.Threads.v3.Thread | null | undefined)
)
}

async function setStatus(status: Labrinth.Projects.v2.ProjectStatus) {
async function setStatus(status: Labrinth.Projects.v2.ProjectStatus, reviewReason?: string) {
if (status === 'processing') {
return await setProcessing()
}
Expand All @@ -541,7 +541,11 @@ async function setStatus(status: Labrinth.Projects.v2.ProjectStatus) {
await verifyThreadIssuesForApproval(threadId, client, () => {
if (project.value.id !== projectId) throw new Error(formatMessage(messages.projectChanged))
})
await client.labrinth.projects_v3.edit(projectId, { status })

await client.labrinth.projects_v3.edit(projectId, {
status,
review_reason: reviewReason,
})
await invalidate()
await queryClient.invalidateQueries({ queryKey: ['thread', threadId] })
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export async function applyReviewDecision(
} else if (decision.status) {
await client.labrinth.projects_v3.edit(decision.projectId, {
status: decision.status,
review_reason: decision.body.trim() || undefined,
})
}
assertCurrent()
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading