-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add consent code descriptions to ncpi catalog (anvilproject/anv…
…il-portal#2665) (#3354) feat: add consent code descriptions to ncpi catalog (anvil#2665)
- Loading branch information
Showing
11 changed files
with
88 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
explorer/app/components/Detail/components/ConsentTooltip/consentTooltip.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Tooltip } from "@mui/material"; | ||
|
||
interface ConsentTooltipProps { | ||
consentCode: string; | ||
consentLongName: string; | ||
} | ||
|
||
export const ConsentTooltip = ({ | ||
consentCode, | ||
consentLongName, | ||
}: ConsentTooltipProps): JSX.Element => { | ||
if (/^unspecified$|^error/i.test(consentLongName)) consentLongName = ""; | ||
return ( | ||
<Tooltip arrow={true} placement="top" title={consentLongName}> | ||
<span>{consentCode}</span> | ||
</Tooltip> | ||
); | ||
}; |
22 changes: 22 additions & 0 deletions
22
explorer/app/components/Index/components/ConsentCodesCell/consentCodesCell.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ConsentTooltip, NTagCell } from "app/components"; | ||
|
||
interface ConsentCodesCellProps { | ||
consentCode: string[]; | ||
consentLongName: string[]; | ||
label: string; | ||
} | ||
|
||
export const ConsentCodesCell = ({ | ||
consentCode, | ||
consentLongName, | ||
label, | ||
}: ConsentCodesCellProps): JSX.Element => { | ||
return consentCode.length === 1 ? ( | ||
<ConsentTooltip | ||
consentCode={consentCode[0]} | ||
consentLongName={consentLongName[0]} | ||
/> | ||
) : ( | ||
<NTagCell label={label} values={consentCode} /> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters