Actions
Refactor #20607
closedAllow hiding fields which are missing from api output
Difficulty:
Triaged:
No
Pull request:
Team Backlog:
Description
Currently fields in hammer have :hide_blank option, that enables hiding fields from output when their source is nil (in case of the basic field) or empty (in case of container fields):
field :description, _("Description"), Fields::LongText, :hide_blank => true
This clears the difference between the situation when api returns empty array or hash (eg. locations enabled but no location is assigned)
{ organization_ids: [], location_ids: [] }
and when it doesn't return it at all (vs. locations disabled)
{ organization_ids: [] }
Hammer should provide also :hide_missing to hide fields that are missing from the api responses. This option is also important for hiding fields that are available only in newer versions in Foreman to keep backwards compatibility. Therefore it should probably default to true and fields that are missing in the api response should normally be hidden.
Actions