fix: new PAT not in list and cmp revenue (#5614)

* fix cmp info revenue not showing #5610

* fix use head referencing undefined

* fix new PAT not pushed to list and use new modal

* remove flex wrap in header nav
This commit is contained in:
Truman Gao
2026-03-18 17:06:35 -07:00
committed by GitHub
parent 1d10af09f5
commit 922b72d1a4
6 changed files with 68 additions and 52 deletions

View File

@@ -69,7 +69,7 @@
</NuxtLink> </NuxtLink>
</div> </div>
<div <div
class="col-span-2 row-start-2 flex flex-wrap justify-center lg:col-span-1 lg:row-start-auto" class="col-span-2 row-start-2 flex justify-center lg:col-span-1 lg:row-start-auto"
:class="{ 'gap-4': !flags.projectTypesPrimaryNav }" :class="{ 'gap-4': !flags.projectTypesPrimaryNav }"
> >
<template v-if="flags.projectTypesPrimaryNav"> <template v-if="flags.projectTypesPrimaryNav">

View File

@@ -195,6 +195,8 @@ const { data: transparencyInformation } = useQuery({
queryFn: () => client.labrinth.payouts_v3.getPlatformRevenue(), queryFn: () => client.labrinth.payouts_v3.getPlatformRevenue(),
}) })
const platformRevenue = (transparencyInformation.value as any)?.all_time const platformRevenue = computed(() => (transparencyInformation.value as any)?.all_time)
const platformRevenueData = (transparencyInformation.value as any)?.data?.slice(0, 5) ?? [] const platformRevenueData = computed(
() => (transparencyInformation.value as any)?.data?.slice(0, 5) ?? [],
)
</script> </script>

View File

@@ -283,10 +283,6 @@ definePageMeta({
middleware: 'auth', middleware: 'auth',
}) })
useHead({
title: () => `${formatMessage(messages.headTitle)} - Modrinth`,
})
const messages = defineMessages({ const messages = defineMessages({
headTitle: { headTitle: {
id: 'settings.applications.head-title', id: 'settings.applications.head-title',
@@ -420,6 +416,10 @@ const messages = defineMessages({
}, },
}) })
useHead({
title: () => `${formatMessage(messages.headTitle)} - Modrinth`,
})
const { scopesToLabels } = useScopes() const { scopesToLabels } = useScopes()
const scopeCategories = computed(() => { const scopeCategories = computed(() => {

View File

@@ -193,13 +193,13 @@ import MessageBanner from '~/components/ui/MessageBanner.vue'
import type { DisplayLocation } from '~/plugins/cosmetics' import type { DisplayLocation } from '~/plugins/cosmetics'
import { isDarkTheme, type Theme } from '~/plugins/theme/index.ts' import { isDarkTheme, type Theme } from '~/plugins/theme/index.ts'
const { addNotification } = injectNotificationManager()
const { formatMessage } = useVIntl()
useHead({ useHead({
title: () => `${formatMessage(messages.headTitle)} - Modrinth`, title: () => `${formatMessage(messages.headTitle)} - Modrinth`,
}) })
const { addNotification } = injectNotificationManager()
const { formatMessage } = useVIntl()
const messages = defineMessages({ const messages = defineMessages({
headTitle: { headTitle: {
id: 'settings.head-title', id: 'settings.head-title',

View File

@@ -7,51 +7,65 @@
:proceed-label="formatMessage(deleteModalMessages.action)" :proceed-label="formatMessage(deleteModalMessages.action)"
@proceed="removePat(deletePatIndex)" @proceed="removePat(deletePatIndex)"
/> />
<Modal <NewModal
ref="patModal" ref="patModal"
:header=" :header="
editPatId !== null editPatId !== null
? formatMessage(createModalMessages.editTitle) ? formatMessage(createModalMessages.editTitle)
: formatMessage(createModalMessages.createTitle) : formatMessage(createModalMessages.createTitle)
" "
:width="'550px'"
> >
<div class="universal-modal"> <div class="flex flex-col gap-4">
<label for="pat-name"> <div class="flex w-full flex-col">
<span class="label__title">{{ formatMessage(createModalMessages.nameLabel) }}</span> <label for="pat-name">
</label> <span class="label__title">{{ formatMessage(createModalMessages.nameLabel) }}</span>
<StyledInput </label>
id="pat-name" <StyledInput
v-model="name" id="pat-name"
:maxlength="2048" v-model="name"
:placeholder="formatMessage(createModalMessages.namePlaceholder)" :maxlength="2048"
/> :placeholder="formatMessage(createModalMessages.namePlaceholder)"
<label for="pat-scopes"> />
<span class="label__title">{{ formatMessage(commonMessages.scopesLabel) }}</span> </div>
</label>
<div <div class="flex w-full flex-col">
id="pat-scopes" <label for="pat-scopes">
class="scope-items mt-2 grid grid-cols-1 gap-x-6 gap-y-4 min-[600px]:grid-cols-2" <span class="label__title">{{ formatMessage(commonMessages.scopesLabel) }}</span>
> </label>
<div v-for="category in scopeCategories" :key="category.name" class="flex flex-col gap-2"> <div
<h4 class="m-0 border-b border-divider pb-1 text-base font-bold text-contrast"> id="pat-scopes"
{{ category.name }} class="scope-items mt-2 grid grid-cols-1 gap-x-6 gap-y-4 min-[600px]:grid-cols-2"
</h4> >
<div class="flex flex-col gap-2"> <div
<Checkbox v-for="category in scopeCategories"
v-for="scope in category.scopes" :key="category.name"
:key="scope" class="flex flex-col gap-2"
:label="scopesToLabels(getScopeValue(scope)).join(', ')" >
:model-value="hasScope(scopesVal, scope)" <h4 class="m-0 border-b border-divider pb-1 text-base font-bold text-contrast">
@update:model-value="scopesVal = toggleScope(scopesVal, scope)" {{ category.name }}
/> </h4>
<div class="flex flex-col gap-2">
<Checkbox
v-for="scope in category.scopes"
:key="scope"
:label="scopesToLabels(getScopeValue(scope)).join(', ')"
:model-value="hasScope(scopesVal, scope)"
@update:model-value="scopesVal = toggleScope(scopesVal, scope)"
/>
</div>
</div> </div>
</div> </div>
</div> </div>
<label for="pat-name" class="mt-4">
<span class="label__title">{{ formatMessage(createModalMessages.expiresLabel) }}</span> <div class="flex w-full flex-col">
</label> <label for="pat-expires">
<StyledInput id="pat-expires" v-model="expires" type="date" /> <span class="label__title">{{ formatMessage(createModalMessages.expiresLabel) }}</span>
<p></p> </label>
<StyledInput id="pat-expires" v-model="expires" type="date" />
<p></p>
</div>
<div class="input-group push-right"> <div class="input-group push-right">
<button class="iconified-button" @click="$refs.patModal.hide()"> <button class="iconified-button" @click="$refs.patModal.hide()">
<XIcon /> <XIcon />
@@ -79,7 +93,7 @@
</button> </button>
</div> </div>
</div> </div>
</Modal> </NewModal>
<div class="header__row"> <div class="header__row">
<div class="header__title"> <div class="header__title">
@@ -199,6 +213,7 @@ import {
injectModrinthClient, injectModrinthClient,
injectNotificationManager, injectNotificationManager,
IntlFormatted, IntlFormatted,
NewModal,
StyledInput, StyledInput,
useFormatDateTime, useFormatDateTime,
useRelativeTime, useRelativeTime,
@@ -206,7 +221,6 @@ import {
} from '@modrinth/ui' } from '@modrinth/ui'
import { useQuery, useQueryClient } from '@tanstack/vue-query' import { useQuery, useQueryClient } from '@tanstack/vue-query'
import Modal from '~/components/ui/Modal.vue'
import { import {
getScopeValue, getScopeValue,
hasScope, hasScope,
@@ -403,7 +417,7 @@ async function createPat() {
scopes: Number(scopesVal.value), scopes: Number(scopesVal.value),
expires: data.$dayjs(expires.value).toISOString(), expires: data.$dayjs(expires.value).toISOString(),
}) })
pats.value.push(res) queryClient.setQueryData(['pat'], (old) => [...(old || []), res])
patModal.value.hide() patModal.value.hide()
} catch (err) { } catch (err) {
addNotification({ addNotification({

View File

@@ -99,10 +99,6 @@ import {
const { addNotification } = injectNotificationManager() const { addNotification } = injectNotificationManager()
const { formatMessage } = useVIntl() const { formatMessage } = useVIntl()
useHead({
title: () => `${formatMessage(messages.headTitle)} - Modrinth`,
})
definePageMeta({ definePageMeta({
middleware: 'auth', middleware: 'auth',
}) })
@@ -139,6 +135,10 @@ const messages = defineMessages({
}, },
}) })
useHead({
title: () => `${formatMessage(messages.headTitle)} - Modrinth`,
})
const auth = await useAuth() const auth = await useAuth()
// Avatar state (separate from useSavable) // Avatar state (separate from useSavable)