admin: remove NavBar Admin Panel link, make users list-only

- Remove redundant Admin Panel link from top navigation bar. The
  sidebar already has the full admin model tree and the Dashboard
  shows a Proclamations card for Staff+ users.
- Add listOnly: true to users admin config. Users are created via
  registration, not the admin panel. RUD operations still work.
This commit is contained in:
NeilClack
2026-07-07 13:07:34 -05:00
parent 27aae18b3a
commit faacbab1de
2 changed files with 82 additions and 17 deletions
+63 -9
View File
@@ -7,6 +7,7 @@ const models: AdminModelConfig[] = [
modelName: 'User',
displayName: 'Users',
displayNameSingular: 'User',
listOnly: true,
idType: 'String',
include: { role: true, profile: true, licenseKeys: true },
listFields: ['name', 'email', 'emailVerified', 'role.name', 'createdAt'],
@@ -96,17 +97,36 @@ const models: AdminModelConfig[] = [
displayName: 'Proclamations',
displayNameSingular: 'Proclamation',
idType: 'String',
include: { solfeggioFrequency: true, category: { include: { parent: true } } },
listFields: ['name', 'category.displayName', 'solfeggioFrequency.name', 'price'],
include: {
solfeggioFrequency: true,
category: { include: { parent: true } },
subscriptionLevel: true
},
listFields: [
'name',
'category.name',
'solfeggioFrequency.name',
'subscriptionLevel.name'
],
searchFields: ['name', 'content'],
formFields: ['name', 'solfeggioFrequencyId', 'categoryId', 'price', 'content'],
formFields: [
'name',
'solfeggioFrequencyId',
'parentCategoryId',
'categoryId',
'subscriptionLevelId',
'content'
],
readonlyFields: ['id'],
dataOnlyFields: ['parentCategoryId'],
cascadeFields: { categoryId: { parentField: 'parentCategoryId' } },
fieldTypes: {
name: 'String',
content: 'Tiptap',
solfeggioFrequencyId: 'Int',
parentCategoryId: 'Int',
categoryId: 'Int',
price: 'Float'
subscriptionLevelId: 'Int'
},
relationOptions: {
solfeggioFrequencyId: {
@@ -114,10 +134,20 @@ const models: AdminModelConfig[] = [
labelField: 'name',
valueField: 'id'
},
parentCategoryId: {
model: 'ProclamationCategory',
labelField: 'name',
valueField: 'id'
},
categoryId: {
model: 'ProclamationCategory',
labelField: 'name',
valueField: 'id'
},
subscriptionLevelId: {
model: 'SubscriptionLevel',
labelField: 'name',
valueField: 'id'
}
}
},
@@ -134,14 +164,39 @@ const models: AdminModelConfig[] = [
readonlyFields: ['id'],
fieldTypes: {
name: 'String',
value: 'Float'
value: 'Int'
},
relatedRecords: [
{
relationKey: 'proclamations',
label: 'Proclamations',
type: 'has-many',
displayFields: ['name', 'price'],
displayFields: ['name'],
editSlug: 'proclamations'
}
]
},
{
slug: 'subscription-levels',
modelName: 'SubscriptionLevel',
displayName: 'Subscription Levels',
displayNameSingular: 'Subscription Level',
idType: 'Int',
include: { proclamations: true },
listFields: ['id', 'name', 'description'],
searchFields: ['name', 'description'],
formFields: ['name', 'description'],
readonlyFields: ['id'],
fieldTypes: {
name: 'String',
description: 'String'
},
relatedRecords: [
{
relationKey: 'proclamations',
label: 'Proclamations',
type: 'has-many',
displayFields: ['name'],
editSlug: 'proclamations'
}
]
@@ -153,7 +208,7 @@ const models: AdminModelConfig[] = [
displayNameSingular: 'Proclamation Category',
idType: 'Int',
include: { proclamations: true, children: true, parent: true },
listFields: ['displayName', 'parent.name'],
listFields: ['name', 'parent.name'],
searchFields: ['name'],
formFields: ['name', 'parentId'],
readonlyFields: ['id'],
@@ -169,7 +224,7 @@ const models: AdminModelConfig[] = [
relationKey: 'proclamations',
label: 'Proclamations',
type: 'has-many',
displayFields: ['name', 'price'],
displayFields: ['name'],
editSlug: 'proclamations'
},
{
@@ -188,7 +243,6 @@ const models: AdminModelConfig[] = [
displayNameSingular: 'License Key',
idType: 'String',
include: { user: true },
listOnly: true,
listFields: ['key', 'active', 'level', 'user.name'],
searchFields: ['key', 'level'],
formFields: ['active', 'level', 'userId'],