Skip to content
2 changes: 1 addition & 1 deletion ui-cra/src/components/Applications/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useListAutomations } from '@weaveworks/weave-gitops';

export const useApplicationsCount = (): number => {
const { data } = useListAutomations();
const { data } = useListAutomations(undefined, {})
return data?.result?.length || 0;
};
17 changes: 10 additions & 7 deletions ui-cra/src/components/Layout/AlertListErrors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { theme } from '@weaveworks/weave-gitops';
import Alert from '@material-ui/lab/Alert';
import AlertTitle from '@material-ui/lab/AlertTitle';
import { createStyles, makeStyles } from '@material-ui/styles';
import { ListItem } from '@material-ui/core';
import { ListItem, ListItemText } from '@material-ui/core';

const useStyles = makeStyles(() =>
createStyles({
Expand All @@ -29,16 +29,19 @@ export const AlertListErrors: FC<{ errors?: ListError[] }> = ({ errors }) => {
if (!errors || !errors.length) {
return null;
}
const err = `Something went wrong`;

return (
<>
<Alert className={classes.alertWrapper} severity="error">
<AlertTitle>
There were errors while listing some resources:
</AlertTitle>
{errors?.map((item: ListError) => (
<ListItem key={item.clusterName}>
• error='{item.message}' cluster='{item.clusterName}' namespace='{item.namespace}'
<AlertTitle>There were errors while listing some resources:</AlertTitle>
{errors?.map((item: ListError, index: number) => (
<ListItem key={index} dense={true}>
<ListItemText
style={{display:'list-item'}}
primary={item.message || err}
secondary={`${item.clusterName} / ${item.namespace}`}
/>
</ListItem>
))}
</Alert>
Expand Down