Skip to content

Commit

Permalink
fixed attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Jul 11, 2024
1 parent 919bd5c commit e10355a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,11 @@ export const PublicationsDetailTemplate: React.FC<PublicationsDetailTemplateProp
</BadgeCounter>
</Tab>
)}
{_getPublication.data?.data?.attachments?.length > 0 && (
{_getPublication.data?.attachments?.length > 0 && (
<Tab>
<span>{t("Attachments")}</span>
<BadgeCounter className={styles.badgeLayout}>
{_getPublication.data?.data?.attachments?.length ?? 0}
{_getPublication.data?.attachments?.length ?? 0}
</BadgeCounter>
</Tab>
)}
Expand Down Expand Up @@ -1018,7 +1018,7 @@ export const PublicationsDetailTemplate: React.FC<PublicationsDetailTemplateProp
</div>
</TabPanel>
)}
{_getPublication.data?.data?.attachments?.length > 0 && (
{_getPublication.data?.attachments?.length > 0 && (
<TabPanel>
<HorizontalOverflowWrapper
ariaLabels={{
Expand All @@ -1039,20 +1039,20 @@ export const PublicationsDetailTemplate: React.FC<PublicationsDetailTemplateProp
</TableRow>
</TableHeader>
<TableBody className={styles.tableBody}>
{_getPublication?.data?.attachments.map((attachement: any) => {
return attachement.published === "false" ? (
{_getPublication?.data?.attachments.map((attachment: any) => {
return attachment.published === "false" ? (
<></>
) : (
<TableRow className={styles.tableRow}>
<TableCell className={styles.title}>{attachement.title}</TableCell>
<TableCell className={styles.title}>{attachment.title}</TableCell>
<TableCell className={styles.description}>
<div
data-tooltip-id={attachement.description.length > 100 && TOOLTIP_ID}
data-tooltip-content={attachement.description}
data-tooltip-id={attachment.description.length > 100 && TOOLTIP_ID}
data-tooltip-content={attachment.description}
>
{attachement.description.length > 100
? `${attachement.description.substring(0, 100)}...`
: attachement.description}
{attachment.description.length > 100
? `${attachment.description.substring(0, 100)}...`
: attachment.description}
</div>
</TableCell>
<TableCell>
Expand All @@ -1062,20 +1062,20 @@ export const PublicationsDetailTemplate: React.FC<PublicationsDetailTemplateProp
data-tooltip-content={t("License")}
>
<FontAwesomeIcon icon={faScroll} />
{attachement.license}
{attachment.license}
</DataBadge>
</TableCell>
<TableCell>{attachement.type}</TableCell>
<TableCell>{attachment.type}</TableCell>
<TableCell>
<span className={styles.date}>{attachement.published}</span>
<span className={styles.date}>{attachment.published}</span>
</TableCell>
<TableCell>
<span className={styles.date}>{attachement.modified}</span>
<span className={styles.date}>{attachment.modified}</span>
</TableCell>
<TableCell>
<Link
onClick={(e) => {
e.preventDefault(), open(attachement.downloadURL);
e.preventDefault(), open(attachment.downloadURL);
}}
href={`/publications/${_getPublication.data?.data?.id}`}
className={styles.tagWidth}
Expand Down

0 comments on commit e10355a

Please sign in to comment.