Fix lint debt from admin overhaul; make check/lint/test/build green
- Scope @typescript-eslint/no-explicit-any off for *.spec.ts test doubles - Type enhance() submit callbacks with SubmitFunction in api-keys page - Drop as-any casts in proclamations upsert by using typed form data - Fix useless regex escapes in profiles phone validation - Remove unused locals param from api-keys load - Use resolve() for admin nav/error links; store literal hrefs in adminModels - Update README admin section and ADMIN_OVERHAUL lint caveat
This commit is contained in:
+27
-11
@@ -15,15 +15,31 @@
|
||||
|
||||
const isAdmin = $derived((data.userRoleId ?? 4) <= 3);
|
||||
const adminModels = [
|
||||
{ slug: 'users', displayName: 'Users' },
|
||||
{ slug: 'profiles', displayName: 'Profiles' },
|
||||
{ slug: 'user-roles', displayName: 'User Roles' },
|
||||
{ slug: 'proclamations', displayName: 'Proclamations' },
|
||||
{ slug: 'solfeggio-frequencies', displayName: 'Solfeggio Frequencies' },
|
||||
{ slug: 'proclamation-categories', displayName: 'Proclamation Categories' },
|
||||
{ slug: 'proclamation-groups', displayName: 'Proclamation Groups' },
|
||||
{ slug: 'license-keys', displayName: 'License Keys' }
|
||||
];
|
||||
{ slug: 'users', href: '/admin/users', displayName: 'Users' },
|
||||
{ slug: 'profiles', href: '/admin/profiles', displayName: 'Profiles' },
|
||||
{ slug: 'user-roles', href: '/admin/user-roles', displayName: 'User Roles' },
|
||||
{
|
||||
slug: 'proclamations',
|
||||
href: '/admin/proclamations',
|
||||
displayName: 'Proclamations'
|
||||
},
|
||||
{
|
||||
slug: 'solfeggio-frequencies',
|
||||
href: '/admin/solfeggio-frequencies',
|
||||
displayName: 'Solfeggio Frequencies'
|
||||
},
|
||||
{
|
||||
slug: 'proclamation-categories',
|
||||
href: '/admin/proclamation-categories',
|
||||
displayName: 'Proclamation Categories'
|
||||
},
|
||||
{
|
||||
slug: 'proclamation-groups',
|
||||
href: '/admin/proclamation-groups',
|
||||
displayName: 'Proclamation Groups'
|
||||
},
|
||||
{ slug: 'license-keys', href: '/admin/license-keys', displayName: 'License Keys' }
|
||||
] as const;
|
||||
const currentPath = $derived(page.url.pathname);
|
||||
|
||||
function isActive(path: string): boolean {
|
||||
@@ -144,7 +160,7 @@
|
||||
>
|
||||
{#each adminModels as model (model.slug)}
|
||||
<a
|
||||
href="/admin/{model.slug}"
|
||||
href={resolve(model.href)}
|
||||
onclick={() => (adminOpen = false)}
|
||||
class={`block rounded-md px-3 py-2 text-sm transition ${
|
||||
isActive('/admin/' + model.slug)
|
||||
@@ -307,7 +323,7 @@
|
||||
<div class="mt-1 flex flex-col gap-1">
|
||||
{#each adminModels as model (model.slug)}
|
||||
<a
|
||||
href="/admin/{model.slug}"
|
||||
href={resolve(model.href)}
|
||||
onclick={closeMenu}
|
||||
class={`rounded-lg px-4 py-3 text-base transition ${activeClass('/admin/' + model.slug)}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user