properly render <Missing* /> components

Corrects logic ensuring `<MissingAnnotation />` and `<MissingEventsRestEndpoint />`
render correctly. Previously, neither component would render from
within the `<Content />` component.

Signed-off-by: Mike Ball <mikedball@gmail.com>
This commit is contained in:
Mike Ball
2022-02-03 16:45:42 -05:00
parent 0dfbb30a5d
commit 52bb1807db
@@ -152,6 +152,14 @@ export const EntitySplunkOnCallCard = () => {
return { usersHashMap, foundTeams };
});
if (!teamAnnotation && !routingKeyAnnotation) {
return <MissingAnnotation />;
}
if (!eventsRestEndpoint) {
return <MissingEventsRestEndpoint />;
}
if (error instanceof UnauthorizedError) {
return <MissingApiKeyOrApiIdError />;
}
@@ -175,10 +183,6 @@ export const EntitySplunkOnCallCard = () => {
team: Team | undefined;
usersHashMap: any | undefined;
}) => {
if (!teamAnnotation && !routingKeyAnnotation) {
return <MissingAnnotation />;
}
if (!team) {
return (
<InvalidTeamAnnotation
@@ -187,10 +191,6 @@ export const EntitySplunkOnCallCard = () => {
);
}
if (!eventsRestEndpoint) {
return <MissingEventsRestEndpoint />;
}
const teamName = team.name || '';
return (