From 389877e0c521649ff202e68da3b1a7c2d74d9820 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Mon, 15 Jul 2024 15:19:16 +0200 Subject: [PATCH 1/3] Publication page changes and improvements --- .../OrganizationCard.module.css | 4 ++ .../organizationCard/OrganizationCard.tsx | 12 +++- .../PublicationsDetailTemplate.tsx | 64 +++++++++++++++++-- .../PublicationsTableTemplate.tsx | 4 +- pwa/src/translations/en.ts | 3 + pwa/src/translations/nl.ts | 3 + 6 files changed, 80 insertions(+), 10 deletions(-) diff --git a/pwa/src/components/organizationCard/OrganizationCard.module.css b/pwa/src/components/organizationCard/OrganizationCard.module.css index 5c164f137..a2ce8ebe4 100644 --- a/pwa/src/components/organizationCard/OrganizationCard.module.css +++ b/pwa/src/components/organizationCard/OrganizationCard.module.css @@ -59,3 +59,7 @@ height: 100%; object-fit: contain; } + +.contactParagraph { + margin-block-start: var(--web-app-size-md); +} diff --git a/pwa/src/components/organizationCard/OrganizationCard.tsx b/pwa/src/components/organizationCard/OrganizationCard.tsx index 83bc8d600..2292c6c3c 100644 --- a/pwa/src/components/organizationCard/OrganizationCard.tsx +++ b/pwa/src/components/organizationCard/OrganizationCard.tsx @@ -30,6 +30,10 @@ export interface OrganizationCardProps { gitHub?: string; gitLab?: string; layoutClassName?: string; + contactInfo?: { + name?: string; + email?: string; + }; } export const OrganizationCard: React.FC = ({ @@ -42,6 +46,7 @@ export const OrganizationCard: React.FC = ({ gitHub, gitLab, layoutClassName, + contactInfo, }) => { const { t } = useTranslation(); @@ -61,7 +66,12 @@ export const OrganizationCard: React.FC = ({ - {description} + {contactInfo && + {contactInfo?.name}
{contactInfo?.email}
+ } + {!contactInfo && + {description} + } {logo && ( diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx index 027453062..d38d009e7 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx @@ -36,6 +36,8 @@ import { useComponent } from "../../hooks/components"; import { RatingIndicatorTemplate } from "../templateParts/ratingIndicator/RatingIndicatorTemplate"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { + faMinus, + faArrowDown, faArrowLeft, faCircle, faGear, @@ -138,6 +140,12 @@ export const PublicationsDetailTemplate: React.FC { + setMetaDataIsVisible(!isMetaDataVisible); + }; + const imageHasValidSource = (src: string): boolean => { try { const url = new URL(src); @@ -221,12 +229,12 @@ export const PublicationsDetailTemplate: React.FC
- {_getPublication.data?.title} + {_getPublication?.data?.data?.title} @@ -412,6 +420,46 @@ export const PublicationsDetailTemplate: React.FC ))}
+ + + {_getPublication.data?.metaData && +
+ + {isMetaDataVisible && + + + {_getPublication.data.metaData?.title && + + {t("Title")} + {_getPublication.data.metaData.title} + + } + {_getPublication.data.metaData?.version && + + {t("Version")} + {_getPublication.data.metaData.version} + + } + {_getPublication.data.metaData?.description && + + {t("Description")} + {_getPublication.data.metaData.description} + + } + {_getPublication.data.metaData?.properties && + + {t("Properties")} + {_getPublication.data.metaData.properties} + + } + +
+ } +
+ }
@@ -679,6 +727,7 @@ export const PublicationsDetailTemplate: React.FC )} {!_getPublication?.data?.data?.organization && ( @@ -833,7 +882,7 @@ export const PublicationsDetailTemplate: React.FC - {t("Data")} + {t("Extensies")} )} @@ -1035,7 +1084,7 @@ export const PublicationsDetailTemplate: React.FC{t("Type")} {t("Published")} {t("Modified")} - {t("Download")} + {t("Access url")} @@ -1080,7 +1129,7 @@ export const PublicationsDetailTemplate: React.FC - {t("Toegangs url")} + {t("Access url")} @@ -1101,7 +1150,8 @@ export const PublicationsDetailTemplate: React.FC - {publicationData?.contactPoint && ( + {/* Keep commented out for reverting purposes */} + {/* {publicationData?.contactPoint && ( Contact: @@ -1111,7 +1161,7 @@ export const PublicationsDetailTemplate: React.FC - )} + )} */} {publicationData?.qualifiedAttribution && ( diff --git a/pwa/src/templates/templateParts/publicationsTable/PublicationsTableTemplate.tsx b/pwa/src/templates/templateParts/publicationsTable/PublicationsTableTemplate.tsx index d66f31d27..587b25d18 100644 --- a/pwa/src/templates/templateParts/publicationsTable/PublicationsTableTemplate.tsx +++ b/pwa/src/templates/templateParts/publicationsTable/PublicationsTableTemplate.tsx @@ -64,8 +64,8 @@ export const PublicationsTableTemplate: React.FC onClick={() => navigate(`/publications/${publication.id}`)} > - - {publication.title} + + {publication?.data?.title} diff --git a/pwa/src/translations/en.ts b/pwa/src/translations/en.ts index 66369cc63..05c07029f 100644 --- a/pwa/src/translations/en.ts +++ b/pwa/src/translations/en.ts @@ -92,6 +92,9 @@ export const en = { "Privacy declaration": "Privacy declaration", "All Open Catalog components": "All Open Catalog components", "View all components": "View all components", + "Show metadata": "Show metadata", + "Access url": "Access url", + "Hide metadata": "Hide metadata", "One central place for reuse of information technology within the government": "One central place for reuse of information technology within the government", "No components found with active filters": "No components found with active filters", diff --git a/pwa/src/translations/nl.ts b/pwa/src/translations/nl.ts index 157edd84b..aa5cc52df 100644 --- a/pwa/src/translations/nl.ts +++ b/pwa/src/translations/nl.ts @@ -93,6 +93,9 @@ export const nl = { "Privacy declaration": "Privacyverklaring", "All Open Catalog components": "Alle OpenCatalogi componenten", "View all components": "Bekijk alle componenten", + "Show metadata": "Toon metadata", + "Hide metadata": "Verberg metadata", + "Access url": "Toegangsurl", "One central place for reuse of information technology within the government": "Eén centrale plek voor hergebruik van informatietechnologie binnen de overheid", "No components found with active filters": "Geen componenten gevonden met actieve filters", From 92d472c7434841bb1fed48edf8e74220543fb6cf Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Mon, 15 Jul 2024 16:47:06 +0200 Subject: [PATCH 2/3] Unnecessary function removed --- .../publicationDetail/PublicationsDetailTemplate.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx index d38d009e7..4242b380d 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx @@ -142,10 +142,6 @@ export const PublicationsDetailTemplate: React.FC { - setMetaDataIsVisible(!isMetaDataVisible); - }; - const imageHasValidSource = (src: string): boolean => { try { const url = new URL(src); @@ -424,7 +420,7 @@ export const PublicationsDetailTemplate: React.FC - From 71bda058eaf53a0726b5a0f04e2be0786ffd4a4d Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Mon, 15 Jul 2024 16:54:04 +0200 Subject: [PATCH 3/3] Small fixes --- .../PublicationsDetailTemplate.tsx | 14 +------------- pwa/src/translations/en.ts | 1 + pwa/src/translations/nl.ts | 1 + 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx index 4242b380d..693cbd558 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx @@ -878,7 +878,7 @@ export const PublicationsDetailTemplate: React.FC - {t("Extensies")} + {t("Extensions")} )} @@ -1146,18 +1146,6 @@ export const PublicationsDetailTemplate: React.FC
- {/* Keep commented out for reverting purposes */} - {/* {publicationData?.contactPoint && ( - - Contact: - -
- {`${t("Name")}: ${publicationData?.contactPoint?.name}`} - {`${t("Email")}: ${publicationData?.contactPoint?.email}`} -
-
-
- )} */} {publicationData?.qualifiedAttribution && ( diff --git a/pwa/src/translations/en.ts b/pwa/src/translations/en.ts index 05c07029f..05041ff7f 100644 --- a/pwa/src/translations/en.ts +++ b/pwa/src/translations/en.ts @@ -83,6 +83,7 @@ export const en = { Portal: "Portal", Reference: "Reference", Pagination: "Pagination", + Extensions: "Extensions", "Open Catalogs": "Open Catalogs", "Reusable components within the government": "Reusable components within the government", "Information Models": "Information Models", diff --git a/pwa/src/translations/nl.ts b/pwa/src/translations/nl.ts index aa5cc52df..c432c5154 100644 --- a/pwa/src/translations/nl.ts +++ b/pwa/src/translations/nl.ts @@ -86,6 +86,7 @@ export const nl = { Portal: "Portaal", Reference: "Referentie", Pagination: "Paginering", + Extensions: "Extensies", "Open Catalogs": "OpenCatalogi", "Reusable components within the government": "Herbruikbare componenten binnen de overheid", "Information Models": "Informatiemodellen",