Skip to content

Commit 63ea823

Browse files
authored
feat: content tab QA fixes for panel pre-release (#5588)
* feat: use new_filters + other qa fixes * fix: double admons + lint
1 parent 496bbae commit 63ea823

9 files changed

Lines changed: 19 additions & 35 deletions

File tree

apps/frontend/src/pages/hosting/manage/[id]/options.vue

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<template>
22
<div class="flex flex-col gap-4">
3-
<Admonition v-if="backupBusyReason" type="warning" :header="backupBusyReason">
4-
Some options may not be editable while the operation is in progress.
5-
</Admonition>
63
<ServerSidebar :route="route" :nav-links="navLinks" />
74
</div>
85
</template>
@@ -18,7 +15,7 @@ import {
1815
VersionIcon,
1916
WrenchIcon,
2017
} from '@modrinth/assets'
21-
import { Admonition, injectModrinthServerContext, useVIntl } from '@modrinth/ui'
18+
import { injectModrinthServerContext } from '@modrinth/ui'
2219
import { isAdmin as isUserAdmin, type User } from '@modrinth/utils'
2320
2421
import ServerSidebar from '~/components/ui/servers/ServerSidebar.vue'
@@ -27,17 +24,7 @@ const route = useRoute()
2724
const serverId = route.params.id as string
2825
const auth = await useAuth()
2926
30-
const { formatMessage } = useVIntl()
31-
const { server, busyReasons } = injectModrinthServerContext()
32-
33-
const backupBusyReason = computed(() => {
34-
const reason = busyReasons.value.find(
35-
(r) =>
36-
r.reason.id === 'servers.busy.backup-creating' ||
37-
r.reason.id === 'servers.busy.backup-restoring',
38-
)
39-
return reason ? formatMessage(reason.reason) : null
40-
})
27+
const { server } = injectModrinthServerContext()
4128
4229
useHead({
4330
title: `Options - ${server.value?.name ?? 'Server'} - Modrinth`,

packages/api-client/src/modules/labrinth/projects/v2.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export class LabrinthProjectsV2Module extends AbstractModule {
7171
params: {
7272
...params,
7373
facets: params.facets ? JSON.stringify(params.facets) : undefined,
74+
new_filters: params.new_filters ?? undefined,
7475
},
7576
})
7677
}

packages/api-client/src/modules/labrinth/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ export namespace Labrinth {
307307
export type ProjectSearchParams = {
308308
query?: string
309309
facets?: string[][] // in the format of [["categories:forge"],["versions:1.17.1"]]
310+
new_filters?: string
310311
filters?: string
311312
index?: 'relevance' | 'downloads' | 'follows' | 'newest' | 'updated'
312313
offset?: number

packages/ui/src/components/flows/creation-flow-modal/components/FinalConfigStage.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@
9797
</div>
9898
</div>
9999
</Accordion>
100+
101+
<InlineBackupCreator
102+
v-if="ctx.flowType === 'reset-server'"
103+
backup-name="Before reinstall"
104+
hide-shift-click-hint
105+
/>
100106
</div>
101107
</template>
102108

@@ -106,6 +112,7 @@ import { computed, watch } from 'vue'
106112
107113
import { useDebugLogger } from '#ui/composables/debug-logger'
108114
115+
import InlineBackupCreator from '../../../../layouts/shared/content-tab/components/modals/InlineBackupCreator.vue'
109116
import { injectTags } from '../../../../providers'
110117
import Accordion from '../../../base/Accordion.vue'
111118
import Chips from '../../../base/Chips.vue'

packages/ui/src/components/flows/creation-flow-modal/components/SetupTypeStage.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
@click="setSetupType('vanilla')"
6060
/>
6161
</div>
62-
<InlineBackupCreator v-if="ctx.flowType === 'reset-server'" backup-name="Before reinstall" />
6362
</template>
6463
</div>
6564
</template>
@@ -69,7 +68,6 @@ import { BoxesIcon, BoxIcon, BoxImportIcon, PackageIcon } from '@modrinth/assets
6968
7069
import { useDebugLogger } from '#ui/composables/debug-logger'
7170
72-
import InlineBackupCreator from '../../../../layouts/shared/content-tab/components/modals/InlineBackupCreator.vue'
7371
import BigOptionButton from '../../../base/BigOptionButton.vue'
7472
import { injectCreationFlowContext } from '../creation-flow-context'
7573

packages/ui/src/components/servers/ServerSetupModal.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ const serverLoaders = ['vanilla', 'fabric', 'neoforge', 'forge', 'quilt', 'paper
8282
async function searchModpacks(query: string, limit: number = 10) {
8383
return client.labrinth.projects_v2.search({
8484
query: query || undefined,
85-
facets: [['project_type:modpack'], ['client_side:required'], ['server_side:required']],
85+
new_filters:
86+
'project_types = "modpack" AND (client_side = "optional" OR client_side = "required") AND server_side = "required"',
8687
limit,
8788
})
8889
}

packages/ui/src/layouts/shared/content-tab/components/modals/InlineBackupCreator.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
class="size-5 shrink-0 text-brand-orange hover:brightness-110"
4444
/>
4545
</div>
46-
<span class="text-secondary">
46+
<span v-if="!props.hideShiftClickHint" class="text-secondary">
4747
{{ formatMessage(messages.shiftClickHint) }}
4848
</span>
4949
</div>
@@ -60,6 +60,7 @@ import { useInlineBackup } from '../../composables/use-inline-backup'
6060
6161
const props = defineProps<{
6262
backupName: string
63+
hideShiftClickHint?: boolean
6364
}>()
6465
6566
const emit = defineEmits<{

packages/ui/src/layouts/shared/installation-settings/components/ContentDiffModal.vue

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
<div class="max-w-[500px]">
44
<div class="flex flex-col gap-4 p-4">
55
<Admonition :type="hasUnknownContent ? 'warning' : 'info'" :header="admonitionHeader">
6-
{{ description }}
7-
</Admonition>
8-
9-
<Admonition
10-
v-if="hasUnknownContent"
11-
type="warning"
12-
:header="formatMessage(messages.unknownContentHeader)"
13-
>
14-
{{ formatMessage(messages.unknownContentBody) }}
6+
<div class="flex flex-col gap-2">
7+
<span>{{ description }}</span>
8+
<span v-if="hasUnknownContent">{{ formatMessage(messages.unknownContentBody) }}</span>
9+
</div>
1510
</Admonition>
1611

1712
<div v-if="diffs.length" class="flex gap-2">
@@ -192,10 +187,6 @@ const messages = defineMessages({
192187
id: 'content.diff-modal.updated-count',
193188
defaultMessage: '{count} updated',
194189
},
195-
unknownContentHeader: {
196-
id: 'content.diff-modal.unknown-content-header',
197-
defaultMessage: 'Unknown content',
198-
},
199190
unknownContentBody: {
200191
id: 'content.diff-modal.unknown-content-body',
201192
defaultMessage:

packages/ui/src/locales/en-US/index.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,6 @@
263263
"content.diff-modal.unknown-content-body": {
264264
"defaultMessage": "Some content on your server could not be analyzed and may be affected by this change."
265265
},
266-
"content.diff-modal.unknown-content-header": {
267-
"defaultMessage": "Unknown content"
268-
},
269266
"content.diff-modal.updated-count": {
270267
"defaultMessage": "{count} updated"
271268
},

0 commit comments

Comments
 (0)