feat: content tab QA fixes for panel pre-release (#5588)

* feat: use new_filters + other qa fixes

* fix: double admons + lint
This commit is contained in:
Calum H.
2026-03-17 17:47:58 +00:00
committed by GitHub
parent 496bbae8a0
commit 63ea8230ba
9 changed files with 19 additions and 35 deletions

View File

@@ -1,8 +1,5 @@
<template>
<div class="flex flex-col gap-4">
<Admonition v-if="backupBusyReason" type="warning" :header="backupBusyReason">
Some options may not be editable while the operation is in progress.
</Admonition>
<ServerSidebar :route="route" :nav-links="navLinks" />
</div>
</template>
@@ -18,7 +15,7 @@ import {
VersionIcon,
WrenchIcon,
} from '@modrinth/assets'
import { Admonition, injectModrinthServerContext, useVIntl } from '@modrinth/ui'
import { injectModrinthServerContext } from '@modrinth/ui'
import { isAdmin as isUserAdmin, type User } from '@modrinth/utils'
import ServerSidebar from '~/components/ui/servers/ServerSidebar.vue'
@@ -27,17 +24,7 @@ const route = useRoute()
const serverId = route.params.id as string
const auth = await useAuth()
const { formatMessage } = useVIntl()
const { server, busyReasons } = injectModrinthServerContext()
const backupBusyReason = computed(() => {
const reason = busyReasons.value.find(
(r) =>
r.reason.id === 'servers.busy.backup-creating' ||
r.reason.id === 'servers.busy.backup-restoring',
)
return reason ? formatMessage(reason.reason) : null
})
const { server } = injectModrinthServerContext()
useHead({
title: `Options - ${server.value?.name ?? 'Server'} - Modrinth`,

View File

@@ -71,6 +71,7 @@ export class LabrinthProjectsV2Module extends AbstractModule {
params: {
...params,
facets: params.facets ? JSON.stringify(params.facets) : undefined,
new_filters: params.new_filters ?? undefined,
},
})
}

View File

@@ -307,6 +307,7 @@ export namespace Labrinth {
export type ProjectSearchParams = {
query?: string
facets?: string[][] // in the format of [["categories:forge"],["versions:1.17.1"]]
new_filters?: string
filters?: string
index?: 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated'
offset?: number

View File

@@ -97,6 +97,12 @@
</div>
</div>
</Accordion>
<InlineBackupCreator
v-if="ctx.flowType === 'reset-server'"
backup-name="Before reinstall"
hide-shift-click-hint
/>
</div>
</template>
@@ -106,6 +112,7 @@ import { computed, watch } from 'vue'
import { useDebugLogger } from '#ui/composables/debug-logger'
import InlineBackupCreator from '../../../../layouts/shared/content-tab/components/modals/InlineBackupCreator.vue'
import { injectTags } from '../../../../providers'
import Accordion from '../../../base/Accordion.vue'
import Chips from '../../../base/Chips.vue'

View File

@@ -59,7 +59,6 @@
@click="setSetupType('vanilla')"
/>
</div>
<InlineBackupCreator v-if="ctx.flowType === 'reset-server'" backup-name="Before reinstall" />
</template>
</div>
</template>
@@ -69,7 +68,6 @@ import { BoxesIcon, BoxIcon, BoxImportIcon, PackageIcon } from '@modrinth/assets
import { useDebugLogger } from '#ui/composables/debug-logger'
import InlineBackupCreator from '../../../../layouts/shared/content-tab/components/modals/InlineBackupCreator.vue'
import BigOptionButton from '../../../base/BigOptionButton.vue'
import { injectCreationFlowContext } from '../creation-flow-context'

View File

@@ -82,7 +82,8 @@ const serverLoaders = ['vanilla', 'fabric', 'neoforge', 'forge', 'quilt', 'paper
async function searchModpacks(query: string, limit: number = 10) {
return client.labrinth.projects_v2.search({
query: query || undefined,
facets: [['project_type:modpack'], ['client_side:required'], ['server_side:required']],
new_filters:
'project_types = "modpack" AND (client_side = "optional" OR client_side = "required") AND server_side = "required"',
limit,
})
}

View File

@@ -43,7 +43,7 @@
class="size-5 shrink-0 text-brand-orange hover:brightness-110"
/>
</div>
<span class="text-secondary">
<span v-if="!props.hideShiftClickHint" class="text-secondary">
{{ formatMessage(messages.shiftClickHint) }}
</span>
</div>
@@ -60,6 +60,7 @@ import { useInlineBackup } from '../../composables/use-inline-backup'
const props = defineProps<{
backupName: string
hideShiftClickHint?: boolean
}>()
const emit = defineEmits<{

View File

@@ -3,15 +3,10 @@
<div class="max-w-[500px]">
<div class="flex flex-col gap-4 p-4">
<Admonition :type="hasUnknownContent ? 'warning' : 'info'" :header="admonitionHeader">
{{ description }}
</Admonition>
<Admonition
v-if="hasUnknownContent"
type="warning"
:header="formatMessage(messages.unknownContentHeader)"
>
{{ formatMessage(messages.unknownContentBody) }}
<div class="flex flex-col gap-2">
<span>{{ description }}</span>
<span v-if="hasUnknownContent">{{ formatMessage(messages.unknownContentBody) }}</span>
</div>
</Admonition>
<div v-if="diffs.length" class="flex gap-2">
@@ -192,10 +187,6 @@ const messages = defineMessages({
id: 'content.diff-modal.updated-count',
defaultMessage: '{count} updated',
},
unknownContentHeader: {
id: 'content.diff-modal.unknown-content-header',
defaultMessage: 'Unknown content',
},
unknownContentBody: {
id: 'content.diff-modal.unknown-content-body',
defaultMessage:

View File

@@ -263,9 +263,6 @@
"content.diff-modal.unknown-content-body": {
"defaultMessage": "Some content on your server could not be analyzed and may be affected by this change."
},
"content.diff-modal.unknown-content-header": {
"defaultMessage": "Unknown content"
},
"content.diff-modal.updated-count": {
"defaultMessage": "{count} updated"
},