-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Describe the bug
When setting the visible or hide option for a field in using configure block in the base section, the options will be overridden in the children sections e.g show/edit/list if we explicitly declare the field.
Reproduction steps
config.model "User" do
configure :email do
hide { true }
end
edit do
field :email
end
end
email will NOT be hidden the edit section
Expected behavior
hide option should be applied for the email field in the edit section and be hidden.
Other option e.g pretty_value doesn't get this problem and work as expected
Additional context
railsversion: 7.1.5.2rails_adminversion: 3.2.0
This is probably caused by this field.show at
| field.show if field && !field.instance_variable_get("@#{field.name}_registered").is_a?(Proc) |
Is it possible to add an additional constraint that
@visible_registered have not been defined before calling field.show
Side note: I looked through the code and did not see where this @#{field.name}_registered instance variable is set, not sure if the !field.instance_variable_get("@#{field.name}_registered").is_a?(Proc) is still relevant.
Metadata
Metadata
Assignees
Labels
No labels