Skip to content

Commit

Permalink
Update component templates list to render empty prompt inside of cont…
Browse files Browse the repository at this point in the history
…ent container. Show detail panel when deep-linked, even if there are no component templates. (elastic#70633)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
cjcenizal and elasticmachine committed Jul 2, 2020
1 parent 6d86dfa commit fd397ce
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export const ComponentTemplateList: React.FunctionComponent<Props> = ({
trackMetric('loaded', UIM_COMPONENT_TEMPLATE_LIST_LOAD);
}, [trackMetric]);

if (data && data.length === 0) {
return <EmptyPrompt />;
}

let content: React.ReactNode;

if (isLoading) {
Expand All @@ -67,6 +63,8 @@ export const ComponentTemplateList: React.FunctionComponent<Props> = ({
history={history as ScopedHistory}
/>
);
} else if (data && data.length === 0) {
content = <EmptyPrompt />;
} else if (error) {
content = <LoadError onReloadClick={sendRequest} />;
}
Expand Down

0 comments on commit fd397ce

Please sign in to comment.