From b17d20203449951f7113daa79fd6a7456439ddcc Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Tue, 16 Jul 2024 11:43:59 +0200 Subject: [PATCH 1/3] Removed unnecessary cards, and page improvements --- .../PublicationsDetailTemplate.module.css | 11 +- .../PublicationsDetailTemplate.tsx | 131 +++++------------- .../PublicationsTableTemplate.tsx | 4 +- pwa/src/translations/en.ts | 3 + pwa/src/translations/nl.ts | 3 + 5 files changed, 45 insertions(+), 107 deletions(-) diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css index 254369f6..22f8f8b5 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css @@ -185,14 +185,15 @@ grid-template-columns: 1fr 1fr; } -.cardsHeading { - flex: 1; -} - .cardsContainer { + display: grid; grid-template-columns: 1fr 1fr; } +.cardsHeading { + flex: 1; +} + .cardsContainer > :not(:last-child) { margin-block-end: var(--web-app-size-md); } @@ -292,7 +293,7 @@ } .cardsContainer { - display: flex; + display: grid; gap: var(--web-app-size-xl); } diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx index 693cbd55..2fa597c6 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx @@ -225,12 +225,12 @@ export const PublicationsDetailTemplate: React.FC
- {_getPublication?.data?.data?.title} + {_getPublication?.data?.title} @@ -416,46 +416,6 @@ 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} - - } - -
- } -
- }
@@ -646,64 +606,35 @@ export const PublicationsDetailTemplate: React.FC
- {t("Application")} + {t("MetaData")} {t("Organization")} - {t("Rating")}
- {getApplicationComponent.isLoading && ( -
- -
- )} - {getApplicationComponent.isSuccess && - (applicationComponent && applicationComponent.name !== _getPublication.data?.data?.name ? ( - - ) : ( - application && ( - - ) - ))} - {!getApplicationComponent.isLoading && !_getPublication?.data?.data?.embedded?.applicationSuite && ( - {t("No application found")} - )} + {_getPublication.data?.metaData && + + + {_getPublication.data.metaData?.title && + + {t("Title")} + {_getPublication.data.metaData.title ?? t("No title known")} + + } + {_getPublication.data.metaData?.version && + + {t("Version")} + {_getPublication.data.metaData.version ?? t("No version known") } + + } + {_getPublication.data.metaData?.description && + + {t("Description")} + {_getPublication.data.metaData.description ?? t("No description known") } + + } + +
+ } {organisation && ( {t("No organization found")} )} - @@ -785,9 +716,9 @@ export const PublicationsDetailTemplate: React.FC } layoutClassName={clsx(styles.infoCard, ratingFilter === "Commonground" && styles.infoCardCommonground)} - /> + /> */} - {isVisible && ( + {/* {isVisible && (
- )} + )} */}
{(_getPublication.data?.data?.embedded?.dependsOn?.embedded?.open || getConfigComponents.data?.results?.length > 0 || diff --git a/pwa/src/templates/templateParts/publicationsTable/PublicationsTableTemplate.tsx b/pwa/src/templates/templateParts/publicationsTable/PublicationsTableTemplate.tsx index 587b25d1..8d404e40 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?.data?.title} + + {publication?.title} diff --git a/pwa/src/translations/en.ts b/pwa/src/translations/en.ts index 05041ff7..f73af80e 100644 --- a/pwa/src/translations/en.ts +++ b/pwa/src/translations/en.ts @@ -96,6 +96,9 @@ export const en = { "Show metadata": "Show metadata", "Access url": "Access url", "Hide metadata": "Hide metadata", + "No title known": "No title known", + "No description known": "No description known", + "No version known": "No version known", "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 c432c515..5370d831 100644 --- a/pwa/src/translations/nl.ts +++ b/pwa/src/translations/nl.ts @@ -96,6 +96,9 @@ export const nl = { "View all components": "Bekijk alle componenten", "Show metadata": "Toon metadata", "Hide metadata": "Verberg metadata", + "No title known": "Geen titel bekend", + "No description known": "Geen description bekend", + "No version known": "Geen version bekend", "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", From 5768d04482f13f90a486665e861ee1cb7da331e9 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Tue, 16 Jul 2024 11:45:03 +0200 Subject: [PATCH 2/3] undo --- .../PublicationsDetailTemplate.module.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css index 22f8f8b5..ada7a021 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.module.css @@ -185,15 +185,15 @@ grid-template-columns: 1fr 1fr; } +.cardsHeading { + flex: 1; +} + .cardsContainer { display: grid; grid-template-columns: 1fr 1fr; } -.cardsHeading { - flex: 1; -} - .cardsContainer > :not(:last-child) { margin-block-end: var(--web-app-size-md); } From 29a15ab69278cc536ea5b2cca3bad17b9791976c Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Tue, 16 Jul 2024 11:59:32 +0200 Subject: [PATCH 3/3] Feedback fixes and unused code removed --- .../PublicationsDetailTemplate.tsx | 104 +----------------- 1 file changed, 3 insertions(+), 101 deletions(-) diff --git a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx index 2fa597c6..92e49cf3 100644 --- a/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx +++ b/pwa/src/templates/publicationDetail/PublicationsDetailTemplate.tsx @@ -18,7 +18,6 @@ import { } from "@utrecht/component-library-react/dist/css-module"; import { Container, - InfoCard, Tabs, TabList, Tab, @@ -28,16 +27,13 @@ import { HorizontalOverflowWrapper, } from "@conduction/components"; import { navigate } from "gatsby"; -import { IconExternalLink, IconArrowLeft, IconArrowRight } from "@tabler/icons-react"; +import { IconExternalLink, IconArrowLeft } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; import { Table, TableBody, TableCell, TableRow } from "@utrecht/component-library-react/dist/css-module"; import { QueryClient } from "react-query"; import { useComponent } from "../../hooks/components"; -import { RatingIndicatorTemplate } from "../templateParts/ratingIndicator/RatingIndicatorTemplate"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { - faMinus, - faArrowDown, faArrowLeft, faCircle, faGear, @@ -56,12 +52,11 @@ import { DependenciesTemplate } from "../templateParts/dependenciesTemplates/Com import { useResultDisplayLayoutContext } from "../../context/resultDisplayLayout"; import { ComponentCardsAccordionTemplate } from "../templateParts/componentCardsAccordion/ComponentCardsAccordionTemplate"; import { DownloadTemplate } from "../templateParts/download/DownloadTemplate"; -import { RatingOverview } from "../templateParts/ratingOverview/RatingOverview"; import { IDisplaySwitchButton } from "@conduction/components/lib/components/displaySwitch/DisplaySwitch"; import { ExpandableLeadParagraph } from "../../components/expandableLeadParagraph/ExpandableLeadParagraph"; import { TOOLTIP_ID } from "../../layout/Layout"; import { getStatusColor } from "../../services/getStatusColor"; -import { ApplicationCard, ComponentCard } from "../../components"; +import { ComponentCard } from "../../components"; import { getCommongroundRating } from "../../services/getCommongroundRating"; import { CommongroundRatingGold, @@ -85,14 +80,11 @@ export const PublicationsDetailTemplate: React.FC { tabsRef.current.scrollIntoView({ behavior: "smooth", inline: "start" }); @@ -117,9 +109,6 @@ export const PublicationsDetailTemplate: React.FC { const _maintenanceType = maintenanceTypes.find((__maintenanceType) => { @@ -129,18 +118,12 @@ export const PublicationsDetailTemplate: React.FCSomething went wrong...; const organisation = _getPublication?.data?.data?.organization; - const application = _getComponent?.data?.embedded?.applicationSuite; - const applicationComponent = getApplicationComponent?.data?.results[0]; - - const [isMetaDataVisible, setMetaDataIsVisible] = React.useState(false); const imageHasValidSource = (src: string): boolean => { try { @@ -188,8 +171,6 @@ export const PublicationsDetailTemplate: React.FC { switch (rating) { case 0: @@ -606,7 +587,7 @@ export const PublicationsDetailTemplate: React.FC
- {t("MetaData")} + MetaData {t("Organization")}
@@ -660,86 +641,7 @@ export const PublicationsDetailTemplate: React.FC{t("No organization found")} )} - {/* - {(ratingFilter === "OpenCatalogi" || ratingFilter === "false") && ( - <> - {_getPublication.data?.data?.embedded?.rating && ( - <> - - - { - e.preventDefault(), openModal(() => show()); - }} - href={`${_getPublication.data?.data?.id}/?openratingpopup`} - > - - - - {t("Rating")} - - - - )} - {!rating &&
{t("No rating available")}
} - - )} - {ratingFilter === "Commonground" && ( - <> -
- {getCommongroundImage( - _getPublication.data?.data?.embedded?.nl?.embedded?.commonground?.rating ?? "0", - )} -
- - )} - - } - layoutClassName={clsx(styles.infoCard, ratingFilter === "Commonground" && styles.infoCardCommonground)} - /> */} - {/* {isVisible && ( -
- } - primaryButton={{ - label: t("Score calculation"), - handleClick: () => { - navigate("/documentation/about#score-calculation"); - }, - }} - secondaryButton={{ - label: t("Close"), - icon: , - href: `${_getPublication.data?.data?.id}`, - handleClick: () => ({}), - }} - layoutClassName={styles.popup} - /> -
- )} */}
{(_getPublication.data?.data?.embedded?.dependsOn?.embedded?.open || getConfigComponents.data?.results?.length > 0 ||