fix: defaut ui triage (#4802)
* fix: theme-aware payment paths, auto-group validation, route guards, perf group filtering - Add common.ThemeAwarePath to generate correct redirect URLs based on active theme (default vs classic), replacing hardcoded /console/* paths in 7 controllers and service/quota.go (#4765) - Validate auto-group availability against getUserGroups before defaulting form values; playground falls back to 'default' group when 'auto' is unavailable (#4796, #4799) - Enforce HeaderNavModules settings in rankings route (frontend + backend API) and SidebarModulesAdmin in playground route to block direct URL access when features are disabled (#4704, #4512) - Filter perf_metrics API response to only include currently configured groups, hiding stale data from deleted groups (#4790) - Preserve query params (pay=success/fail) in /console/topup → /wallet frontend redirect * fix: update hero section text and localization strings for clarity
This commit is contained in:
@@ -16,11 +16,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
||||
import { Main } from '@/components/layout'
|
||||
import { Playground } from '@/features/playground'
|
||||
import { isSidebarModuleEnabled } from '@/lib/nav-modules'
|
||||
|
||||
export const Route = createFileRoute('/_authenticated/playground/')({
|
||||
beforeLoad: () => {
|
||||
if (!isSidebarModuleEnabled('chat', 'playground')) {
|
||||
throw redirect({ to: '/dashboard' })
|
||||
}
|
||||
},
|
||||
component: PlaygroundPage,
|
||||
})
|
||||
|
||||
|
||||
+6
-2
@@ -16,13 +16,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import z from 'zod'
|
||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
||||
|
||||
const topupSearchSchema = z.record(z.string(), z.unknown()).catch({})
|
||||
|
||||
export const Route = createFileRoute('/console/topup')({
|
||||
beforeLoad: () => {
|
||||
validateSearch: topupSearchSchema,
|
||||
beforeLoad: ({ search }) => {
|
||||
throw redirect({
|
||||
to: '/wallet',
|
||||
search: { show_history: true },
|
||||
search: { show_history: true, ...search },
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
+15
-1
@@ -17,8 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import z from 'zod'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
||||
import { Rankings } from '@/features/rankings'
|
||||
import { getModuleAccess } from '@/lib/nav-modules'
|
||||
import { useAuthStore } from '@/stores/auth-store'
|
||||
|
||||
const rankingsSearchSchema = z.object({
|
||||
period: z
|
||||
@@ -29,5 +31,17 @@ const rankingsSearchSchema = z.object({
|
||||
|
||||
export const Route = createFileRoute('/rankings/')({
|
||||
validateSearch: rankingsSearchSchema,
|
||||
beforeLoad: () => {
|
||||
const access = getModuleAccess('rankings')
|
||||
if (!access.enabled) {
|
||||
throw redirect({ to: '/' })
|
||||
}
|
||||
if (access.requireAuth) {
|
||||
const { auth } = useAuthStore.getState()
|
||||
if (!auth.user) {
|
||||
throw redirect({ to: '/sign-in', search: { redirect: '/rankings' } })
|
||||
}
|
||||
}
|
||||
},
|
||||
component: Rankings,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user