Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to avoid having resources nested under Prisma in navigation? #1736

Answered by dziraf
whatuserever asked this question in Q&A
Discussion options

I'm just getting started with AdminJS using Express and Prisma. Following the docs for adding Prisma resources, my AdminJSOptions looks as follows:

const options: AdminJSOptions = {
 componentLoader,
 rootPath: '/admin',
 resources: [
 {
 resource: { model: getModelByName('User'), client: prisma },
 },
 ],
};

However, this results in the resource being nested under Prisma:
image

I can't figure out how to avoid this. I tried the instructions here, but this simply renames Prisma to something else.

You must be logged in to vote
  1. Nesting under some name:
navigation: { name: 'xxx' }
  1. Nesting under some name with icon (this is the default conifguration where name is usually your ORM):
navigation: { name: 'xxx', icon: 'Activity' }
  1. Not nesting under anything:
navigation: null
  1. Not nesting but having an icon:
navigation: { icon: 'Activity' }

You can use PascalCase names of icons from: https://feathericons.com/

Replies: 1 comment 1 reply

Comment options

  1. Nesting under some name:
navigation: { name: 'xxx' }
  1. Nesting under some name with icon (this is the default conifguration where name is usually your ORM):
navigation: { name: 'xxx', icon: 'Activity' }
  1. Not nesting under anything:
navigation: null
  1. Not nesting but having an icon:
navigation: { icon: 'Activity' }

You can use PascalCase names of icons from: https://feathericons.com/

You must be logged in to vote
1 reply
Comment options

Thanks! Appreciate the quick the response :)

Though, I'm curious why the default behavior (aka without explicitly defining options or navigation) is equivalent to

navigation: {
 name: 'Prisma', // Adapter?
 icon: 'Archive',
},

instead of defaulting to

navigation: null
Answer selected by whatuserever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /