adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

[Bug]: Field visibility in create is not working properly

Open SophiseTech opened this issue 1 year ago • 1 comments

Contact Details

No response

What happened?

When configuring a field in AdminJS to be visible only in the create action by setting isVisible.create: true and isVisible.edit: false, the field does not appear in the create form. However, if isVisible.edit: true is also set, the field becomes visible in the create form. This behavior suggests that the visibility of fields in the create form is incorrectly linked to the edit form's visibility setting.

Bug prevalence

Whenever i visit the page

AdminJS dependencies version

"@adminjs/express": "^6.1.0",
"@adminjs/mongoose": "^4.1.0",
"@adminjs/upload": "^4.0.2",

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

resources: [
    {
      resource: User,
      options: {
        properties: {
          resetToken: { isVisible: false },
          resetExpires: { isVisible: false },
          profileImage: { isVisible: false },
          status: { isVisible: false },
          createdAt: { isVisible: showListHideRest },
          password: { isVisible: { create: true, show: false, edit: false, list: false, filter: false } }
        }
      }
    },
]

SophiseTech avatar Sep 03 '24 14:09 SophiseTech

isVisible doesn't have a create setting. new and edit forms currently share configuration

dziraf avatar Sep 03 '24 14:09 dziraf