1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

feat: application overview loading state (#6562)

This commit is contained in:
Mateusz Kwasniewski 2024-03-15 09:08:56 +01:00 committed by GitHub
parent 26ad9fc3f4
commit 4d78c6dadf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View File

@ -75,7 +75,6 @@ test('Display application overview without environments', async () => {
},
);
await screen.findByText('my-app');
await screen.findByText('No data available.');
});

View File

@ -1,6 +1,13 @@
import { usePageTitle } from 'hooks/usePageTitle';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import { Alert, Box, Button, Divider, styled } from '@mui/material';
import {
Alert,
Box,
Button,
Divider,
LinearProgress,
styled,
} from '@mui/material';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { useApplicationOverview } from 'hooks/api/getters/useApplicationOverview/useApplicationOverview';
import { ApplicationIssues } from './ApplicationIssues/ApplicationIssues';
@ -9,7 +16,7 @@ import TopicOutlinedIcon from '@mui/icons-material/TopicOutlined';
import { Badge } from '../common/Badge/Badge';
import { useNavigate } from 'react-router-dom';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { useEffect } from 'react';
import React, { useEffect } from 'react';
import { useFeedback } from '../feedbackNew/useFeedback';
import ReviewsOutlined from '@mui/icons-material/ReviewsOutlined';
@ -71,6 +78,15 @@ const ApplicationOverview = () => {
});
};
if (loading) {
return (
<div>
<p>Loading...</p>
<LinearProgress />
</div>
);
}
return (
<ConditionallyRender
condition={!loading && data.environments.length === 0}