From a82b5f83ed23c66c9fe6d8fb0bb7005ad23a2503 Mon Sep 17 00:00:00 2001 From: nimrodshn Date: Tue, 14 Mar 2017 18:01:31 +0200 Subject: [PATCH] Add UI support for Pod to PV relationship refactored small mistakes --- app/helpers/persistent_volume_helper/textual_summary.rb | 8 +++++++- app/views/persistent_volume/show.html.haml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/persistent_volume_helper/textual_summary.rb b/app/helpers/persistent_volume_helper/textual_summary.rb index 3118976a0f34..7b32c3dfc684 100644 --- a/app/helpers/persistent_volume_helper/textual_summary.rb +++ b/app/helpers/persistent_volume_helper/textual_summary.rb @@ -23,7 +23,7 @@ def textual_group_claim_properties end def textual_group_relationships - TextualGroup.new(_("Relationships"), %i(parent)) + TextualGroup.new(_("Relationships"), %i(parent pods_using_persistent_volume)) end def textual_group_smart_management @@ -40,6 +40,12 @@ def textual_group_capacity # # Items # + def textual_pods_using_persistent_volume + byebug + link = url_for_only_path(:id => @record.id, :action => "show", :display => "container_groups") + textual_link(@record.container_groups, :as => ContainerGroup, :link => link) + end + def textual_resource_version @record.resource_version end diff --git a/app/views/persistent_volume/show.html.haml b/app/views/persistent_volume/show.html.haml index 4300d07738d4..6bff7a812587 100644 --- a/app/views/persistent_volume/show.html.haml +++ b/app/views/persistent_volume/show.html.haml @@ -1,4 +1,4 @@ -- if @display == 'containers' +- if %w(containers, container_groups).include?(@display) = render :partial => "layouts/gtl", :locals => {:action_url => "show/#{@record.id}"} - elsif @showtype == 'main' = render :partial => "layouts/textual_groups_generic"