From 7ba19bd7beb24d8f01fa90c3635bebf406e38aab Mon Sep 17 00:00:00 2001 From: Jeremy Lenz Date: Fri, 22 Nov 2024 12:23:19 -0500 Subject: [PATCH] Refs #38028 - update Registration Details card for load balanced smart proxies --- .../api/v2/content_facet/base.json.rabl | 3 +- .../DetailsTabCards/RegistrationCard.js | 30 +++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/views/katello/api/v2/content_facet/base.json.rabl b/app/views/katello/api/v2/content_facet/base.json.rabl index cc7cb976f66..399bf8b278a 100644 --- a/app/views/katello/api/v2/content_facet/base.json.rabl +++ b/app/views/katello/api/v2/content_facet/base.json.rabl @@ -61,7 +61,8 @@ node :lifecycle_environment do |content_facet| end child :content_source => :content_source do - attributes :id, :name, :url + attributes :id, :name, :url, :registration_host + node(:load_balanced) { |content_source| content_source.load_balanced? } end child :kickstart_repository => :kickstart_repository do diff --git a/webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js b/webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js index cb9cddda82c..7d02b1a194d 100644 --- a/webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js +++ b/webpack/components/extensions/HostDetails/DetailsTabCards/RegistrationCard.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { FormattedMessage } from 'react-intl'; import { translate as __ } from 'foremanReact/common/I18n'; import { DescriptionList, @@ -55,12 +56,14 @@ const RegistrationCard = ({ isExpandedGlobal, hostDetails }) => { const subscriptionFacetAttributes = propsToCamelCase(hostDetails?.subscription_facet_attributes || {}); const { - registeredAt, activationKeys, user, + registeredAt, registeredThrough, activationKeys, user, } = subscriptionFacetAttributes; const contentFacetAttributes = propsToCamelCase(hostDetails?.content_facet_attributes || {}); const { contentSourceName } = contentFacetAttributes; + const { contentSource } = propsToCamelCase(contentFacetAttributes || {}); + const { loadBalanced, registrationHost } = propsToCamelCase(contentSource || {}); const login = user?.login; if (!registeredAt) return null; return ( @@ -79,9 +82,32 @@ const RegistrationCard = ({ isExpandedGlobal, hostDetails }) => { {__('Registered by')} + + {__('Registered to')} + {registeredThrough} + + {loadBalanced && ( + + {__('Load balancer')} + {registrationHost} + + )} {__('Content source')} - {contentSourceName} + {!loadBalanced && ( + {contentSourceName} + )} + {loadBalanced && ( + + {contentSourceName}, + }} + /> + + )}