Skip to content

Commit

Permalink
✨ Add archetype risk to drawer
Browse files Browse the repository at this point in the history
Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 committed Nov 6, 2023
1 parent fdad869 commit 3684d20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/app/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,4 +760,5 @@ export interface Archetype {
assessments?: Ref[];
assessed?: boolean;
review?: Ref;
risk?: Risk;
}
2 changes: 1 addition & 1 deletion client/src/app/components/PageDrawerContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const PageDrawerContent: React.FC<IPageDrawerContentProps> = ({
// If the drawer is already expanded describing app A, then the user clicks app B, we want to send focus back to the drawer.
React.useEffect(() => {
drawerFocusRef?.current?.focus();
}, [drawerFocusRef, focusKey]);
}, [focusKey]);

React.useEffect(() => {
const drawerHead = header === null ? children : header;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { PageDrawerContent } from "@app/components/PageDrawerContext";
import { dedupeArrayOfObjects } from "@app/utils/utils";
import { LabelsFromItems } from "@app/components/labels-from-items/labels-from-items";
import { ReviewFields } from "@app/pages/applications/components/application-detail-drawer/review-fields";
import { RiskLabel } from "@app/components/RiskLabel";

export interface IArchetypeDetailDrawerProps {
onCloseClick: () => void;
Expand Down Expand Up @@ -198,6 +199,14 @@ const ArchetypeDetailDrawer: React.FC<IArchetypeDetailDrawerProps> = ({
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
<TextContent className={spacing.mtLg}>
<Title headingLevel="h3" size="md">
{t("terms.riskFromApplication")}
</Title>
<Text component="small" cy-data="comments">
<RiskLabel risk={archetype?.risk || "unknown"} />
</Text>
</TextContent>
</Tab>
<Tab
eventKey={TabKey.Reviews}
Expand Down

0 comments on commit 3684d20

Please sign in to comment.