Skip to content

Commit

Permalink
✨ Add question mark icon for archetype assessed indicator (#1561)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored Nov 23, 2023
1 parent 375db82 commit 82a704c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
4 changes: 4 additions & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@
"archetypeApplicationCount": "{{count}} application",
"archetypeApplicationCount_plural": "{{count}} applications",
"archetypeNoApplications": "No applications currently match the criteria tags.",
"archetypeAlreadyAssessed": "An assessment for one or more of the archetypes this application is associated with exists.",
"archetypeAlreadyReviewed": "A review for one or more of the archetypes this application is associated with exists. Open the details drawer to view the review(s).",
"appNotAssesedTitle": "Assessment has not been completed",
"appNotAssessedBody": "In order to review an application it must be assessed first. Assess the application and try again.",
"assessmentStakeholderHeader": "Select the stakeholder(s) or stakeholder group(s) associated with this assessment.",
Expand Down Expand Up @@ -251,6 +253,7 @@
"artifact": "Artifact",
"artifactAssociated": "Associated artifact",
"artifactNotAssociated": "No associated artifact",
"assessedArchetype": "Archetype assessed",
"assessment": "Assessment",
"assessmentQuestionnaires": "Assessment questionnaires",
"assessmentNotes": "Assessment notes",
Expand Down Expand Up @@ -368,6 +371,7 @@
"repositoryType": "Repository type",
"review": "Review",
"reviewedArchetype": "Archetype reviewed",

"reviews": "Reviews",
"reviewComments": "Review comments",
"risk": "Risk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import {
MenuToggle,
MenuToggleElement,
Modal,
Tooltip,
Grid,
GridItem,
Flex,
FlexItem,
} from "@patternfly/react-core";
import { PencilAltIcon, TagIcon, EllipsisVIcon } from "@patternfly/react-icons";
import {
Expand Down Expand Up @@ -841,6 +840,10 @@ export const ApplicationsTable: React.FC = () => {
(archetype) => !!archetype?.review
);

const hasAssessedArchetype = applicationArchetypes?.some(
(archetype) => !!archetype?.assessments?.length
);
console.log("hasassessed", hasAssessedArchetype);
return (
<Tr
key={application.name}
Expand Down Expand Up @@ -870,40 +873,50 @@ export const ApplicationsTable: React.FC = () => {
)}
</Td>
<Td
width={10}
width={15}
modifier="truncate"
{...getTdProps({ columnKey: "assessment" })}
>
<ApplicationAssessmentStatus
application={application}
/>
<Flex alignItems={{ default: "alignItemsCenter" }}>
<FlexItem>
<ApplicationAssessmentStatus
application={application}
/>
</FlexItem>
<FlexItem>
<ConditionalTooltip
isTooltipEnabled={hasAssessedArchetype || false}
content={t("message.archetypeAlreadyAssessed")}
>
<QuestionCircleIcon />
</ConditionalTooltip>
</FlexItem>
</Flex>
</Td>
<Td
width={10}
width={15}
modifier="truncate"
{...getTdProps({ columnKey: "review" })}
>
<Grid>
<GridItem span={10}>
<Flex alignItems={{ default: "alignItemsCenter" }}>
<FlexItem>
<IconedStatus
preset={
isAppReviewed || hasReviewedArchetype
? "Completed"
: "NotStarted"
}
/>
</GridItem>
<GridItem span={2}>
{hasReviewedArchetype ? (
<Tooltip
content={t("terms.reviewedArchetype")}
aria-label="review"
>
<QuestionCircleIcon />
</Tooltip>
) : null}
</GridItem>
</Grid>
</FlexItem>
<FlexItem>
<ConditionalTooltip
isTooltipEnabled={hasReviewedArchetype || false}
content={t("message.archetypeAlreadyReviewed")}
>
<QuestionCircleIcon />
</ConditionalTooltip>
</FlexItem>
</Flex>
</Td>
<Td
width={10}
Expand Down

0 comments on commit 82a704c

Please sign in to comment.