ImagesTable: Add error state
It is important we have an error state for times that we may need to bring the image builder service down for whatever reason.
This commit is contained in:
parent
d986b80883
commit
531369276c
1 changed files with 19 additions and 2 deletions
|
|
@ -16,6 +16,9 @@ import {
|
|||
EmptyStateActions,
|
||||
EmptyStateHeader,
|
||||
EmptyStateFooter,
|
||||
Alert,
|
||||
Spinner,
|
||||
Bullseye,
|
||||
} from '@patternfly/react-core';
|
||||
import { ExternalLinkAltIcon, PlusCircleIcon } from '@patternfly/react-icons';
|
||||
import {
|
||||
|
|
@ -71,7 +74,7 @@ const ImagesTable = () => {
|
|||
setPerPage(perPage);
|
||||
};
|
||||
|
||||
const { data, isSuccess } = useGetComposesQuery({
|
||||
const { data, isError, isSuccess } = useGetComposesQuery({
|
||||
limit: perPage,
|
||||
offset: perPage * (page - 1),
|
||||
ignoreImageTypes: [
|
||||
|
|
@ -83,7 +86,21 @@ const ImagesTable = () => {
|
|||
});
|
||||
|
||||
if (!isSuccess) {
|
||||
return undefined;
|
||||
if (isError) {
|
||||
return (
|
||||
<Alert variant="warning" title="Service unavailable">
|
||||
<p>
|
||||
The Images service is unavailable right now. We're working on
|
||||
it... please check back later.
|
||||
</p>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Bullseye>
|
||||
<Spinner />
|
||||
</Bullseye>
|
||||
);
|
||||
}
|
||||
|
||||
const composes = data.data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue