diff --git a/client/src/app/pages/applications/applications-table/applications-table.tsx b/client/src/app/pages/applications/applications-table/applications-table.tsx index ff7c364c1b..26c9b4d4dc 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -211,8 +211,9 @@ export const ApplicationsTable: React.FC = () => { refetch: fetchApplications, } = useFetchApplications(); - const { assessments } = useFetchAssessments(); - const { archetypes } = useFetchArchetypes(); + const { assessments, isFetching: isFetchingAssesments } = + useFetchAssessments(); + const { archetypes, isFetching: isFetchingArchetypes } = useFetchArchetypes(); const onDeleteApplicationSuccess = (appIDCount: number) => { pushNotification({ @@ -894,6 +895,11 @@ export const ApplicationsTable: React.FC = () => { application={application} assessments={assessments} archetypes={archetypes} + isLoading={ + isFetchingApplications || + isFetchingArchetypes || + isFetchingAssesments + } key={`${application?.id}-assessment-status`} /> diff --git a/client/src/app/pages/applications/components/application-assessment-status/application-assessment-status.tsx b/client/src/app/pages/applications/components/application-assessment-status/application-assessment-status.tsx index 40f6c7d227..a6a0df6ab7 100644 --- a/client/src/app/pages/applications/components/application-assessment-status/application-assessment-status.tsx +++ b/client/src/app/pages/applications/components/application-assessment-status/application-assessment-status.tsx @@ -1,8 +1,8 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { EmptyTextMessage } from "@app/components/EmptyTextMessage"; import { Application, Archetype, Assessment } from "@app/api/models"; import { IconedStatus, IconedStatusPreset } from "@app/components/IconedStatus"; +import { Spinner } from "@patternfly/react-core"; interface ApplicationAssessmentStatusProps { application: Application; assessments: Assessment[]; @@ -12,7 +12,7 @@ interface ApplicationAssessmentStatusProps { export const ApplicationAssessmentStatus: React.FC< ApplicationAssessmentStatusProps -> = ({ application, assessments, archetypes }) => { +> = ({ application, assessments, archetypes, isLoading }) => { const { t } = useTranslation(); const applicationAssessments = assessments?.filter( @@ -87,8 +87,8 @@ export const ApplicationAssessmentStatus: React.FC< }; }, [inheritedArchetypes, assessments]); - if (archetypes?.length === 0 || assessments?.length === 0) { - return ; + if (isLoading) { + return ; } let statusPreset: IconedStatusPreset = "NotStarted"; // Default status