Project

General

Profile

Refactor #20607

Allow hiding fields which are missing from api output

Added by Tomáš Strachota over 1 year ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Team Backlog:
Fixed in Releases:
Found in Releases:

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.


Related issues

Related to Hammer CLI - Tracker #20605: Backward compatibility supportNew2017-08-15

Related to Hammer CLI - Tracker #14914: Tracker for output related issuesNew2016-05-03

Associated revisions

Revision f97d1981 (diff)
Added by Oleh Fedorenko 5 months ago

Fixes #20607 - Allow hiding fields which are missing from api output

History

#1 Updated by Tomáš Strachota over 1 year ago

#2 Updated by Tomáš Strachota over 1 year ago

#3 Updated by Oleh Fedorenko about 1 year ago

  • Assignee set to Oleh Fedorenko

#4 Updated by Oleh Fedorenko about 1 year ago

  • Status changed from New to Assigned

#5 Updated by The Foreman Bot about 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/256 added

#6 Updated by The Foreman Bot 11 months ago

  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/345 added

#7 Updated by Oleh Fedorenko 5 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#8 Updated by Tomer Brisker 3 months ago

  • Fixed in Releases hammer-cli 0.14.0 added

Also available in: Atom PDF