mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Fix missing details message in Topology view.
This commit is contained in:
@@ -47,7 +47,7 @@ function MeshGraph({ data, showLegend, zoom, setShowZoomControls }) {
|
|||||||
const [simulationProgress, setSimulationProgress] = useState(null);
|
const [simulationProgress, setSimulationProgress] = useState(null);
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const {
|
const {
|
||||||
result: { instance, instanceGroups },
|
result: { instance = {}, instanceGroups },
|
||||||
error: fetchError,
|
error: fetchError,
|
||||||
isLoading,
|
isLoading,
|
||||||
request: fetchDetails,
|
request: fetchDetails,
|
||||||
@@ -68,12 +68,13 @@ function MeshGraph({ data, showLegend, zoom, setShowZoomControls }) {
|
|||||||
result: {},
|
result: {},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const { error: fetchInstanceError, dismissError } =
|
const { error: fetchInstanceError, dismissError } =
|
||||||
useDismissableError(fetchError);
|
useDismissableError(fetchError);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchDetails();
|
if (selectedNode) {
|
||||||
|
fetchDetails();
|
||||||
|
}
|
||||||
}, [selectedNode, fetchDetails]);
|
}, [selectedNode, fetchDetails]);
|
||||||
|
|
||||||
function updateNodeSVG(nodes) {
|
function updateNodeSVG(nodes) {
|
||||||
@@ -383,33 +384,31 @@ function MeshGraph({ data, showLegend, zoom, setShowZoomControls }) {
|
|||||||
<div id="chart" style={{ position: 'relative', height: '100%' }}>
|
<div id="chart" style={{ position: 'relative', height: '100%' }}>
|
||||||
{showLegend && <Legend />}
|
{showLegend && <Legend />}
|
||||||
{instance && (
|
{instance && (
|
||||||
<>
|
<Tooltip
|
||||||
{fetchInstanceError && (
|
isNodeSelected={isNodeSelected}
|
||||||
<AlertModal
|
renderNodeIcon={renderNodeIcon(selectedNode)}
|
||||||
variant="error"
|
selectedNode={selectedNode}
|
||||||
title={t`Error!`}
|
fetchInstance={fetchDetails}
|
||||||
isOpen
|
instanceGroups={instanceGroups}
|
||||||
onClose={dismissError}
|
instanceDetail={instance}
|
||||||
>
|
isLoading={isLoading}
|
||||||
{t`Failed to update instance.`}
|
redirectToDetailsPage={() =>
|
||||||
<ErrorDetail error={fetchInstanceError} />
|
redirectToDetailsPage(selectedNode, history)
|
||||||
</AlertModal>
|
}
|
||||||
)}
|
/>
|
||||||
<Tooltip
|
|
||||||
isNodeSelected={isNodeSelected}
|
|
||||||
renderNodeIcon={renderNodeIcon(selectedNode)}
|
|
||||||
selectedNode={selectedNode}
|
|
||||||
fetchInstance={fetchDetails}
|
|
||||||
instanceGroups={instanceGroups}
|
|
||||||
instanceDetail={instance}
|
|
||||||
isLoading={isLoading}
|
|
||||||
redirectToDetailsPage={() =>
|
|
||||||
redirectToDetailsPage(selectedNode, history)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
<Loader className="simulation-loader" progress={simulationProgress} />
|
<Loader className="simulation-loader" progress={simulationProgress} />
|
||||||
|
{fetchInstanceError && (
|
||||||
|
<AlertModal
|
||||||
|
variant="error"
|
||||||
|
title={t`Error!`}
|
||||||
|
isOpen
|
||||||
|
onClose={dismissError}
|
||||||
|
>
|
||||||
|
{t`Failed to get instance.`}
|
||||||
|
<ErrorDetail error={fetchInstanceError} />
|
||||||
|
</AlertModal>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user