Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ changes.

### Added

-
- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)

### Fixed

Expand Down
48 changes: 48 additions & 0 deletions govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const DRepDetailsCard = ({
drepId,
votingPower,
isScriptBased,
metadataHash,
} = dRepData;

const groupedReferences = references?.reduce<Record<string, Reference[]>>(
Expand Down Expand Up @@ -235,6 +236,53 @@ export const DRepDetailsCard = ({
/>
)}
</DRepDetailsInfoItem>
{url && (
<DRepDetailsInfoItem
label={t("forms.dRepData.metadataUrl")}
dataTestId="metadata-url"
>
<Link
data-testid="metadata-url-link"
href={url}
target="_blank"
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
display: "flex",
gap: 1,
alignItems: "center",
}}
>
<Typography
color="primary"
fontWeight={400}
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{url}
</Typography>
<img
alt="link"
height={16}
src={ICONS.externalLinkIcon}
width={16}
/>
</Link>
</DRepDetailsInfoItem>
)}
{metadataHash && (
<DRepDetailsInfoItem
label={t("forms.dRepData.metadataHash")}
dataTestId="metadata-hash"
>
<CopyableText
value={metadataHash}
dataTestId="copy-metadata-hash"
/>
</DRepDetailsInfoItem>
)}
</>
)}
{/* CIP-119 DATA END */}
Expand Down
4 changes: 3 additions & 1 deletion govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@
"references": "References",
"referenceDescription": "Description",
"referenceDescriptionHelpfulText": "Limit: 80 characters",
"referenceURL": "URL"
"referenceURL": "URL",
"metadataUrl": "Metadata URL",
"metadataHash": "Metadata Hash"
},
"errors": {
"tooLongUrl": "Url must be less than 128 bytes",
Expand Down