File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed
x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections
agent_policy/details_page Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,18 @@ export const AgentPolicyDetailsPage: React.FunctionComponent = () => {
7575 < EuiFlexItem >
7676 < EuiText className = "eui-textBreakWord" >
7777 < h1 >
78- { ( agentPolicy && agentPolicy . name ) || (
79- < FormattedMessage
80- id = "xpack.ingestManager.policyDetails.policyDetailsTitle"
81- defaultMessage = "Policy '{id}'"
82- values = { {
83- id : policyId ,
84- } }
85- />
78+ { isLoading ? (
79+ < Loading />
80+ ) : (
81+ ( agentPolicy && agentPolicy . name ) || (
82+ < FormattedMessage
83+ id = "xpack.ingestManager.policyDetails.policyDetailsTitle"
84+ defaultMessage = "Policy '{id}'"
85+ values = { {
86+ id : policyId ,
87+ } }
88+ />
89+ )
8690 ) }
8791 </ h1 >
8892 </ EuiText >
@@ -98,7 +102,7 @@ export const AgentPolicyDetailsPage: React.FunctionComponent = () => {
98102 ) : null }
99103 </ EuiFlexGroup >
100104 ) ,
101- [ getHref , agentPolicy , policyId ]
105+ [ getHref , isLoading , agentPolicy , policyId ]
102106 ) ;
103107
104108 const enrollmentCancelClickHandler = useCallback ( ( ) => {
Original file line number Diff line number Diff line change @@ -97,8 +97,10 @@ export const AgentDetailsPage: React.FunctionComponent = () => {
9797 < EuiFlexItem >
9898 < EuiText >
9999 < h1 >
100- { typeof agentData ?. item ?. local_metadata ?. host === 'object' &&
101- typeof agentData ?. item ?. local_metadata ?. host ?. hostname === 'string' ? (
100+ { isLoading ? (
101+ < Loading />
102+ ) : typeof agentData ?. item ?. local_metadata ?. host === 'object' &&
103+ typeof agentData ?. item ?. local_metadata ?. host ?. hostname === 'string' ? (
102104 agentData . item . local_metadata . host . hostname
103105 ) : (
104106 < FormattedMessage
@@ -114,8 +116,7 @@ export const AgentDetailsPage: React.FunctionComponent = () => {
114116 </ EuiFlexItem >
115117 </ EuiFlexGroup >
116118 ) ,
117- /* eslint-disable-next-line react-hooks/exhaustive-deps */
118- [ agentData , agentId , getHref ]
119+ [ agentData ?. item ?. local_metadata ?. host , agentId , getHref , isLoading ]
119120 ) ;
120121
121122 const headerRightContent = useMemo (
You can’t perform that action at this time.
0 commit comments