From effd71ead2453ece89fb645d93bc960693e99ac3 Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Fri, 20 Jan 2023 11:36:09 +0100 Subject: [PATCH] Inline the content, no need for a separate component. Signed-off-by: Jussi Hallila --- .../src/components/EntitySplunkOnCallCard.tsx | 112 ++++++------------ 1 file changed, 39 insertions(+), 73 deletions(-) diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx index 0f32c925f0..54784b1f4e 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.tsx @@ -33,7 +33,7 @@ import { MissingApiKeyOrApiIdError } from './Errors'; import { EscalationPolicy } from './Escalation'; import { Incidents } from './Incident'; import { TriggerDialog } from './TriggerDialog'; -import { RoutingKey, Team, User } from './types'; +import { RoutingKey, User } from './types'; import { configApiRef, useApi } from '@backstage/core-plugin-api'; import { @@ -99,48 +99,6 @@ export const MissingEventsRestEndpoint = () => ( ); -const Content = ({ - team, - routingKey, - usersHashMap, - readOnly, - showDialog, - refreshIncidents, - actions, -}: { - team: Team | undefined; - routingKey: RoutingKey | undefined; - usersHashMap: any; - readOnly: boolean; - showDialog: boolean; - refreshIncidents: boolean; - actions: { - handleDialog: () => void; - handleRefresh: () => void; - }; -}) => { - const teamName = team?.name ?? ''; - - return ( - <> - - {usersHashMap && team && ( - - )} - - - ); -}; - /** @public */ export const isSplunkOnCallAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[SPLUNK_ON_CALL_TEAM]) || @@ -278,37 +236,45 @@ export const EntitySplunkOnCallCard = (props: EntitySplunkOnCallCardProps) => { return ( <> - {teams.map((team, i) => ( - - - Team: {team && team.name ? team.name : ''} - , - , - ]} - /> - - - { + const teamName = team?.name ?? ''; + return ( + + + Team: {team && team.name ? team.name : ''} + , + , + ]} /> - - - ))} + + + + {entityData?.usersHashMap && team && ( + + )} + + + + ); + })} ); };