Skip to content

Commit

Permalink
✨ Add assessment/review status to archetype table
Browse files Browse the repository at this point in the history
Review states:
1. Completed - a review exists
2. NotStarted

Assessment states:
1. Completed - all required assessments done (based on 'assessed' flag)
2. InProgress - some assessments done
3. NotStarted

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
  • Loading branch information
rszwajko committed Mar 8, 2024
1 parent 3e3d690 commit cca860b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions client/src/app/pages/archetypes/archetypes-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import {
} from "@app/rbac";
import { checkAccess } from "@app/utils/rbac-utils";
import keycloak from "@app/keycloak";
import { IconedStatus } from "@app/components/IconedStatus";

const Archetypes: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -193,6 +194,8 @@ const Archetypes: React.FC = () => {
tags: t("terms.tags"),
maintainers: t("terms.maintainers"),
applications: t("terms.applications"),
assessment: t("terms.assessment"),
review: t("terms.review"),
},

isFilterEnabled: true,
Expand Down Expand Up @@ -380,6 +383,11 @@ const Archetypes: React.FC = () => {
<Th {...getThProps({ columnKey: "tags" })} />
<Th {...getThProps({ columnKey: "maintainers" })} />
<Th {...getThProps({ columnKey: "applications" })} />
<Th
{...getThProps({ columnKey: "assessment" })}
width={10}
/>
<Th {...getThProps({ columnKey: "review" })} width={10} />
</TableHeaderContentWithControls>
</Tr>
</Thead>
Expand Down Expand Up @@ -427,6 +435,32 @@ const Archetypes: React.FC = () => {
<Td {...getTdProps({ columnKey: "applications" })}>
<ArchetypeApplicationsColumn archetype={archetype} />
</Td>
<Td
width={15}
modifier="truncate"
{...getTdProps({ columnKey: "assessment" })}
>
<IconedStatus
preset={
archetype.assessed
? "Completed"
: archetype?.assessments?.length
? "InProgress"
: "NotStarted"
}
/>
</Td>
<Td
width={15}
modifier="truncate"
{...getTdProps({ columnKey: "review" })}
>
<IconedStatus
preset={
archetype.review ? "Completed" : "NotStarted"
}
/>
</Td>
<Td isActionCell>
{(archetypeWriteAccess ||
assessmentWriteAccess ||
Expand Down

0 comments on commit cca860b

Please sign in to comment.