Skip to content

Commit

Permalink
Add Relationships to Tenants textual summary screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilda Stastna committed Jun 11, 2019
1 parent efd88f5 commit 3fac152
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/ops_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def features
def textual_group_list
[
%i[properties],
%i[smart_management]
%i[relationships smart_management]
]
end
helper_method :textual_group_list
Expand Down
19 changes: 19 additions & 0 deletions app/helpers/ops_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def textual_group_properties
TextualGroup.new(_('Properties'), %i[description parent groups subtenant project])
end

def textual_group_relationships
TextualGroup.new(_('Relationships'), %i[catalog_items automate_domains providers])
end

def textual_group_smart_management
TextualTags.new(_("Smart Management"), %i[tags])
end
Expand Down Expand Up @@ -177,6 +181,21 @@ def textual_project
{:label => _('Projects'), :value => subprojects_from_record}
end

# TODO render list view of relevant Cat Items and Bundles after clicking on the number
def textual_catalog_items
{:label => _('Catalog Items and Bundles'), :value => ServiceTemplate.where(:tenant => @record.id).count}
end

# TODO
def textual_automate_domains
{:label => _('Automate Domains')}
end

# TODO
def textual_providers
{:label => _('Providers')}
end

def groups_from_record
record_groups = []
@record.miq_groups.non_tenant_groups.sort_by { |group| group.name.downcase }.each do |g|
Expand Down

0 comments on commit 3fac152

Please sign in to comment.