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:
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col gap-4">
|
<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" />
|
<ServerSidebar :route="route" :nav-links="navLinks" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -18,7 +15,7 @@ import {
|
|||||||
VersionIcon,
|
VersionIcon,
|
||||||
WrenchIcon,
|
WrenchIcon,
|
||||||
} from '@modrinth/assets'
|
} 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 { isAdmin as isUserAdmin, type User } from '@modrinth/utils'
|
||||||
|
|
||||||
import ServerSidebar from '~/components/ui/servers/ServerSidebar.vue'
|
import ServerSidebar from '~/components/ui/servers/ServerSidebar.vue'
|
||||||
@@ -27,17 +24,7 @@ const route = useRoute()
|
|||||||
const serverId = route.params.id as string
|
const serverId = route.params.id as string
|
||||||
const auth = await useAuth()
|
const auth = await useAuth()
|
||||||
|
|
||||||
const { formatMessage } = useVIntl()
|
const { server } = injectModrinthServerContext()
|
||||||
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
|
|
||||||
})
|
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: `Options - ${server.value?.name ?? 'Server'} - Modrinth`,
|
title: `Options - ${server.value?.name ?? 'Server'} - Modrinth`,
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ export class LabrinthProjectsV2Module extends AbstractModule {
|
|||||||
params: {
|
params: {
|
||||||
...params,
|
...params,
|
||||||
facets: params.facets ? JSON.stringify(params.facets) : undefined,
|
facets: params.facets ? JSON.stringify(params.facets) : undefined,
|
||||||
|
new_filters: params.new_filters ?? undefined,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,6 +307,7 @@ export namespace Labrinth {
|
|||||||
export type ProjectSearchParams = {
|
export type ProjectSearchParams = {
|
||||||
query?: string
|
query?: string
|
||||||
facets?: string[][] // in the format of [["categories:forge"],["versions:1.17.1"]]
|
facets?: string[][] // in the format of [["categories:forge"],["versions:1.17.1"]]
|
||||||
|
new_filters?: string
|
||||||
filters?: string
|
filters?: string
|
||||||
index?: 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated'
|
index?: 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated'
|
||||||
offset?: number
|
offset?: number
|
||||||
|
|||||||
@@ -97,6 +97,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
|
<InlineBackupCreator
|
||||||
|
v-if="ctx.flowType === 'reset-server'"
|
||||||
|
backup-name="Before reinstall"
|
||||||
|
hide-shift-click-hint
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -106,6 +112,7 @@ import { computed, watch } from 'vue'
|
|||||||
|
|
||||||
import { useDebugLogger } from '#ui/composables/debug-logger'
|
import { useDebugLogger } from '#ui/composables/debug-logger'
|
||||||
|
|
||||||
|
import InlineBackupCreator from '../../../../layouts/shared/content-tab/components/modals/InlineBackupCreator.vue'
|
||||||
import { injectTags } from '../../../../providers'
|
import { injectTags } from '../../../../providers'
|
||||||
import Accordion from '../../../base/Accordion.vue'
|
import Accordion from '../../../base/Accordion.vue'
|
||||||
import Chips from '../../../base/Chips.vue'
|
import Chips from '../../../base/Chips.vue'
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
@click="setSetupType('vanilla')"
|
@click="setSetupType('vanilla')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<InlineBackupCreator v-if="ctx.flowType === 'reset-server'" backup-name="Before reinstall" />
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -69,7 +68,6 @@ import { BoxesIcon, BoxIcon, BoxImportIcon, PackageIcon } from '@modrinth/assets
|
|||||||
|
|
||||||
import { useDebugLogger } from '#ui/composables/debug-logger'
|
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 BigOptionButton from '../../../base/BigOptionButton.vue'
|
||||||
import { injectCreationFlowContext } from '../creation-flow-context'
|
import { injectCreationFlowContext } from '../creation-flow-context'
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ const serverLoaders = ['vanilla', 'fabric', 'neoforge', 'forge', 'quilt', 'paper
|
|||||||
async function searchModpacks(query: string, limit: number = 10) {
|
async function searchModpacks(query: string, limit: number = 10) {
|
||||||
return client.labrinth.projects_v2.search({
|
return client.labrinth.projects_v2.search({
|
||||||
query: query || undefined,
|
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,
|
limit,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
class="size-5 shrink-0 text-brand-orange hover:brightness-110"
|
class="size-5 shrink-0 text-brand-orange hover:brightness-110"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span class="text-secondary">
|
<span v-if="!props.hideShiftClickHint" class="text-secondary">
|
||||||
{{ formatMessage(messages.shiftClickHint) }}
|
{{ formatMessage(messages.shiftClickHint) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,6 +60,7 @@ import { useInlineBackup } from '../../composables/use-inline-backup'
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
backupName: string
|
backupName: string
|
||||||
|
hideShiftClickHint?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
@@ -3,15 +3,10 @@
|
|||||||
<div class="max-w-[500px]">
|
<div class="max-w-[500px]">
|
||||||
<div class="flex flex-col gap-4 p-4">
|
<div class="flex flex-col gap-4 p-4">
|
||||||
<Admonition :type="hasUnknownContent ? 'warning' : 'info'" :header="admonitionHeader">
|
<Admonition :type="hasUnknownContent ? 'warning' : 'info'" :header="admonitionHeader">
|
||||||
{{ description }}
|
<div class="flex flex-col gap-2">
|
||||||
</Admonition>
|
<span>{{ description }}</span>
|
||||||
|
<span v-if="hasUnknownContent">{{ formatMessage(messages.unknownContentBody) }}</span>
|
||||||
<Admonition
|
</div>
|
||||||
v-if="hasUnknownContent"
|
|
||||||
type="warning"
|
|
||||||
:header="formatMessage(messages.unknownContentHeader)"
|
|
||||||
>
|
|
||||||
{{ formatMessage(messages.unknownContentBody) }}
|
|
||||||
</Admonition>
|
</Admonition>
|
||||||
|
|
||||||
<div v-if="diffs.length" class="flex gap-2">
|
<div v-if="diffs.length" class="flex gap-2">
|
||||||
@@ -192,10 +187,6 @@ const messages = defineMessages({
|
|||||||
id: 'content.diff-modal.updated-count',
|
id: 'content.diff-modal.updated-count',
|
||||||
defaultMessage: '{count} updated',
|
defaultMessage: '{count} updated',
|
||||||
},
|
},
|
||||||
unknownContentHeader: {
|
|
||||||
id: 'content.diff-modal.unknown-content-header',
|
|
||||||
defaultMessage: 'Unknown content',
|
|
||||||
},
|
|
||||||
unknownContentBody: {
|
unknownContentBody: {
|
||||||
id: 'content.diff-modal.unknown-content-body',
|
id: 'content.diff-modal.unknown-content-body',
|
||||||
defaultMessage:
|
defaultMessage:
|
||||||
|
|||||||
@@ -263,9 +263,6 @@
|
|||||||
"content.diff-modal.unknown-content-body": {
|
"content.diff-modal.unknown-content-body": {
|
||||||
"defaultMessage": "Some content on your server could not be analyzed and may be affected by this change."
|
"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": {
|
"content.diff-modal.updated-count": {
|
||||||
"defaultMessage": "{count} updated"
|
"defaultMessage": "{count} updated"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user