From 2688dfeba69882e114742bd350fe8d867b0afe05 Mon Sep 17 00:00:00 2001 From: Remko Huisman <43807324+remko48@users.noreply.github.com> Date: Wed, 29 Nov 2023 14:56:02 +0100 Subject: [PATCH] Revert "Feature/XW-127/api-changes" --- .github/workflows/woo-page-deploy.yml | 17 +--- pwa/package-lock.json | 57 +++++++------- pwa/package.json | 12 +-- .../apiService/resources/availableFilters.ts | 4 +- pwa/src/apiService/resources/openWoo.ts | 6 +- pwa/src/services/isUUID.ts | 5 ++ pwa/src/templates/landing/LandingTemplate.tsx | 2 +- .../CardsResultsTemplate.tsx | 10 ++- .../TableResultsTemplate.tsx | 10 ++- .../WOOItemDetailTemplate.tsx | 78 +++++++++---------- pwa/static/configFiles/albrandswaard.json | 2 +- pwa/static/configFiles/barendrecht.json | 2 +- pwa/static/configFiles/buren.json | 2 +- pwa/static/configFiles/hoeksche-waard.json | 2 +- pwa/static/configFiles/lansingerland.json | 2 +- pwa/static/configFiles/ridderkerk.json | 2 +- pwa/static/configFiles/rijssen-holten.json | 2 +- pwa/static/configFiles/stede-broec.json | 2 +- pwa/static/configFiles/texel.json | 2 +- pwa/static/configFiles/waddinxveen.json | 2 +- 20 files changed, 103 insertions(+), 118 deletions(-) create mode 100644 pwa/src/services/isUUID.ts diff --git a/.github/workflows/woo-page-deploy.yml b/.github/workflows/woo-page-deploy.yml index 678ce22b..0fd20047 100644 --- a/.github/workflows/woo-page-deploy.yml +++ b/.github/workflows/woo-page-deploy.yml @@ -9,18 +9,13 @@ env: # Change these to your preferences any image url can also be a base encoded GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }} API_BASE_URL: "https://api.gateway.commonground.nu/api" NL_DESIGN_THEME_CLASSNAME: "conduction-theme" - DEV_ENVIRONMENT: "true" - SHOW_CATEGORY: "true" - SHOW_ORGANIZATION: "true" FAVICON_URL: "https://conduction.nl/wp-content/uploads/2021/07/cropped-favicon-32x32.png" HEADER_LOGO_URL: "https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png" ORGANISATION_NAME: "Conduction" JUMBOTRON_IMAGE_URL: "https://www.conduction.nl/wp-content/uploads/2021/07/cropped-Conduction_HOME_0000_afb1-1.png" FOOTER_LOGO_URL: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICAgICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICAgd2lkdGg9IjcxLjAwMDAwMHB0IiBoZWlnaHQ9IjcwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgNzEuMDAwMDAwIDcwLjAwMDAwMCIKICAgICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCiAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCw3MC4wMDAwMDApIHNjYWxlKDAuMTAwMDAwLC0wLjEwMDAwMCkiCiAgICAgICBmaWxsPSIjNDM3NkZDIiBzdHJva2U9Im5vbmUiPgogICAgICAgIDxwYXRoIGQ9Ik0yMTggNTkyIGwtMTM3IC03NyAwIC0xNjUgMCAtMTY1IDEzMSAtNzQgYzcyIC00MSAxMzcgLTc0IDE0MyAtNzQgNgowIDcwIDMzIDE0MyA3NCBsMTMxIDc0IDEgMTY1IDAgMTY1IC02OCAzNyBjLTM3IDIxIC05OSA1NiAtMTM3IDc3IGwtNzEgNDAKLTEzNiAtNzd6IG0yOTUgLTg1IGw1NyAtMzIgMCAtMTI1IDAgLTEyNSAtMTA2IC02MCBjLTU4IC0zMyAtMTA4IC02MCAtMTExCi01OSAtMyAwIC01MiAyNyAtMTA5IDYwIGwtMTAzIDU5IDAgMTI1IDAgMTI1IDEwNyA2MSAxMDcgNjIgNTAgLTI5IGMyNyAtMTYKNzYgLTQ0IDEwOCAtNjJ6Ii8+CiAgICAgICAgPHBhdGggZD0iTTI3OCA0NzIgbC02OCAtMzcgMCAtODUgMCAtODUgNzMgLTM5IDczIC0zOSA2MiAzNCBjMzQgMTggNjIgMzcgNjIKNDEgMCA0IC0xNCAxNSAtMzEgMjMgLTI4IDE1IC0zMyAxNSAtNTQgMSAtMzEgLTIwIC00NiAtMjAgLTg0IDIgLTI3IDE1IC0zMQoyMiAtMzEgNjIgMCA0MCA0IDQ3IDMxIDYzIDM4IDIxIDUzIDIxIDg0IDEgMjEgLTE0IDI2IC0xNCA1NCAxIDE3IDggMzEgMTkgMzEKMjMgMCA4IC0xMTMgNzIgLTEyNiA3MiAtNSAwIC0zOSAtMTcgLTc2IC0zOHoiLz4KICAgIDwvZz4KPC9zdmc+Cg==" - FOOTER_LOGO_HREF: "https://conduction.nl/", - FOOTER_CONTENT: "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/pwa/src/templates/templateParts/footer/FooterContent.json" + FOOTER_LOGO_HREF: "https://conduction.nl/" # OIDN_NUMBER: " " - ENV_VARS_SET: "true" on: push: @@ -46,18 +41,13 @@ jobs: envkey_USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX: ${{ env.USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX }} envkey_GATSBY_API_BASE_URL: ${{ env.API_BASE_URL }} envkey_GATSBY_NL_DESIGN_THEME_CLASSNAME: ${{ env.NL_DESIGN_THEME_CLASSNAME }} - envkey_GATSBY_DEV_ENVIRONMENT: ${{ env.DEV_ENVIRONMENT }} - envkey_GATSBY_SHOW_CATEGORY: ${{ env.SHOW_CATEGORY }} - envkey_GATSBY_SHOW_ORGANIZATION: ${{ env.SHOW_ORGANIZATION }} envkey_GATSBY_FAVICON_URL: ${{ env.FAVICON_URL }} envkey_GATSBY_HEADER_LOGO_URL: ${{ env.HEADER_LOGO_URL }} envkey_GATSBY_ORGANISATION_NAME: ${{ env.ORGANISATION_NAME }} envkey_GATSBY_JUMBOTRON_IMAGE_URL: ${{ env.JUMBOTRON_IMAGE_URL }} envkey_GATSBY_FOOTER_LOGO_URL: ${{ env.FOOTER_LOGO_URL }} envkey_GATSBY_FOOTER_LOGO_HREF: ${{ env.FOOTER_LOGO_HREF }} - envkey_GATSBY_FOOTER_CONTENT: ${{ env.FOOTER_CONTENT }} # envkey_GATSBY_OIDN_NUMBER: ${{ env.OIDN_NUMBER }} - envkey_GATSBY_ENV_VARS_SET: ${{ env.ENV_VARS_SET }} directory: pwa/static file_name: .env.production fail_on_empty: true @@ -66,14 +56,11 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 with: - node-version: 18 + node-version: 14 - name: Install dependencies run: cd pwa && npm install - - name: Install parcel/watcher - run: cd pwa && npm install @parcel/watcher - - name: Remove old Gatsby cache run: rm -rf pwa/.cache diff --git a/pwa/package-lock.json b/pwa/package-lock.json index 4ac09021..3cda7d28 100644 --- a/pwa/package-lock.json +++ b/pwa/package-lock.json @@ -9,11 +9,11 @@ "version": "1.0.0", "dependencies": { "@conduction/components": "2.2.36", - "@conduction/theme": "1.0.56", - "@fortawesome/fontawesome-svg-core": "^6.5.0", - "@fortawesome/free-brands-svg-icons": "6.5.0", - "@fortawesome/free-regular-svg-icons": "6.5.0", - "@fortawesome/free-solid-svg-icons": "^6.5.0", + "@conduction/theme": "1.0.55", + "@fortawesome/fontawesome-svg-core": "^6.4.2", + "@fortawesome/free-brands-svg-icons": "6.4.2", + "@fortawesome/free-regular-svg-icons": "6.4.2", + "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.2.0", "@nl-design-system-unstable/amsterdam-design-tokens": "^1.0.0-alpha.128", "@nl-design-system-unstable/bodegraven-reeuwijk-design-tokens": "^1.0.0-alpha.121", @@ -55,7 +55,7 @@ "gatsby-plugin-breadcrumb": "^12.3.2", "gatsby-plugin-layout": "^4.12.0", "html-react-parser": "^5.0.6", - "i18next": "^23.7.7", + "i18next": "^23.7.6", "jwt-decode": "^4.0.0", "lodash": "^4.17.21", "qs": "^6.11.2", @@ -2156,9 +2156,9 @@ } }, "node_modules/@conduction/theme": { - "version": "1.0.56", - "resolved": "https://registry.npmjs.org/@conduction/theme/-/theme-1.0.56.tgz", - "integrity": "sha512-h1nIUMkQdnSeD0zBfepLH4Jb27tI7/lLev07RBpWmVkwei2DGeUwG3bfEJ2HChTPu5EyfItHu/37UnqRE7ADNg==", + "version": "1.0.55", + "resolved": "https://registry.npmjs.org/@conduction/theme/-/theme-1.0.55.tgz", + "integrity": "sha512-GCk9v3HyAy/3exE2G7VpJF8g8m8g5l0do9i0AaWz4u12I5UMoY581tXmX3YUkh1wawS+TCgL7jvB/t2C6tl+1g==", "dependencies": { "@nl-design-system-unstable/rotterdam-design-tokens": "^1.0.0-alpha.100" } @@ -2338,57 +2338,52 @@ "license": "MIT" }, "node_modules/@fortawesome/fontawesome-common-types": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.0.tgz", - "integrity": "sha512-vYC8oN2l8meu05sRi1j3Iie/HNFAeIxpitYFhsUrBc11TxiMken9QdXnSQ0q16FYsOSt/6soxs5ghdk+VYGiog==", + "version": "6.4.2", "hasInstallScript": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.0.tgz", - "integrity": "sha512-5DrR+oxQr+ruRQ3CEVV8DSCT/q8Atm56+FzAs0P6eW/epW47OmecSpSwc/YTlJ3u5BfPKUBSGyPR2qjZ+5eIgA==", + "version": "6.4.2", "hasInstallScript": true, + "license": "MIT", "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.0" + "@fortawesome/fontawesome-common-types": "6.4.2" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-brands-svg-icons": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.5.0.tgz", - "integrity": "sha512-LwIl3b5cH0xjmBS7mcy8+SsSsl/7J4xi3aP+Tr4rDUf2Tab8r1c8NcqC8wP5c+bgphGstyG3QPx7l4b9WtcO5Q==", + "version": "6.4.2", "hasInstallScript": true, + "license": "(CC-BY-4.0 AND MIT)", "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.0" + "@fortawesome/fontawesome-common-types": "6.4.2" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-regular-svg-icons": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.0.tgz", - "integrity": "sha512-RaBW/y0jKcCyEPM+NYuBs3bQXuLYZHnXABQPmg6qwuRxNb2EUmyCcVUECUH2dkFmMjggh/xvl6n6y62Pl19JkA==", + "version": "6.4.2", "hasInstallScript": true, + "license": "(CC-BY-4.0 AND MIT)", "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.0" + "@fortawesome/fontawesome-common-types": "6.4.2" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-solid-svg-icons": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.0.tgz", - "integrity": "sha512-6ZPq8mme67Q7O9Fbp2O+Z7mPZbcWTsRv555JLftLaTodiV0Wq+99YgMhyQ8O6mgNQfComqS9OEvqs7M8ySA92g==", + "version": "6.4.2", "hasInstallScript": true, + "license": "(CC-BY-4.0 AND MIT)", "dependencies": { - "@fortawesome/fontawesome-common-types": "6.5.0" + "@fortawesome/fontawesome-common-types": "6.4.2" }, "engines": { "node": ">=6" @@ -10464,9 +10459,9 @@ } }, "node_modules/i18next": { - "version": "23.7.7", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.7.7.tgz", - "integrity": "sha512-peTvdT+Lma+o0LfLFD7IC2M37N9DJ04dH0IJYOyOHRhDfLo6nK36v7LkrQH35C2l8NHiiXZqGirhKESlEb/5PA==", + "version": "23.7.6", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.7.6.tgz", + "integrity": "sha512-O66BhXBw0fH4bEJMA0/klQKPEbcwAp5wjXEL803pdAynNbg2f4qhLIYlNHJyE7icrL6XmSZKPYaaXwy11kJ6YQ==", "funding": [ { "type": "individual", diff --git a/pwa/package.json b/pwa/package.json index 0337d0d8..1b24c3ff 100644 --- a/pwa/package.json +++ b/pwa/package.json @@ -23,11 +23,11 @@ }, "dependencies": { "@conduction/components": "2.2.36", - "@conduction/theme": "1.0.56", - "@fortawesome/fontawesome-svg-core": "^6.5.0", - "@fortawesome/free-brands-svg-icons": "6.5.0", - "@fortawesome/free-regular-svg-icons": "6.5.0", - "@fortawesome/free-solid-svg-icons": "^6.5.0", + "@conduction/theme": "1.0.55", + "@fortawesome/fontawesome-svg-core": "^6.4.2", + "@fortawesome/free-brands-svg-icons": "6.4.2", + "@fortawesome/free-regular-svg-icons": "6.4.2", + "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.2.0", "@nl-design-system-unstable/amsterdam-design-tokens": "^1.0.0-alpha.128", "@nl-design-system-unstable/bodegraven-reeuwijk-design-tokens": "^1.0.0-alpha.121", @@ -69,7 +69,7 @@ "gatsby-plugin-breadcrumb": "^12.3.2", "gatsby-plugin-layout": "^4.12.0", "html-react-parser": "^5.0.6", - "i18next": "^23.7.7", + "i18next": "^23.7.6", "jwt-decode": "^4.0.0", "lodash": "^4.17.21", "qs": "^6.11.2", diff --git a/pwa/src/apiService/resources/availableFilters.ts b/pwa/src/apiService/resources/availableFilters.ts index 8d7dac8a..21444fd9 100644 --- a/pwa/src/apiService/resources/availableFilters.ts +++ b/pwa/src/apiService/resources/availableFilters.ts @@ -11,10 +11,10 @@ export default class AvailableFilters { } public getCategories = async (): Promise => { - let endpoint = "/publicaties?_queries[]=categorie"; + let endpoint = "/openWOO?_queries[]=categorie"; if (window.sessionStorage.getItem("OIDN_NUMBER")) { - endpoint += `&organisatie.oin=${window.sessionStorage.getItem("OIDN_NUMBER")}`; + endpoint += `&embedded.behandelendBestuursorgaan.oidn=${window.sessionStorage.getItem("OIDN_NUMBER")}`; } const { data } = await this._send(this._instance, "GET", endpoint); diff --git a/pwa/src/apiService/resources/openWoo.ts b/pwa/src/apiService/resources/openWoo.ts index 183d7fd4..99a05a27 100644 --- a/pwa/src/apiService/resources/openWoo.ts +++ b/pwa/src/apiService/resources/openWoo.ts @@ -15,12 +15,12 @@ export default class OpenWoo { } public getAll = async (filters: IFiltersContext, currentPage: number, limit: number): Promise => { - let endpoint = `/publicaties?extend[]=all${filtersToQueryParams( + let endpoint = `/openWOO?extend[]=all${filtersToQueryParams( filters, )}&_order[publicatiedatum]=desc&_limit=${limit}&_page=${currentPage}`; if (window.sessionStorage.getItem("OIDN_NUMBER")) { - endpoint += `&organisatie.oin=${window.sessionStorage.getItem("OIDN_NUMBER")}`; + endpoint += `&embedded.behandelendBestuursorgaan.oidn=${window.sessionStorage.getItem("OIDN_NUMBER")}`; } const { data } = await this._send(this._instance, "GET", endpoint); @@ -29,7 +29,7 @@ export default class OpenWoo { }; public getOne = async (id: string): Promise => { - const { data } = await this._send(this._instance, "GET", `/publicaties/${id}`); + const { data } = await this._send(this._instance, "GET", `/openWOO/${id}`); return data; }; diff --git a/pwa/src/services/isUUID.ts b/pwa/src/services/isUUID.ts new file mode 100644 index 00000000..875cb770 --- /dev/null +++ b/pwa/src/services/isUUID.ts @@ -0,0 +1,5 @@ +export const isUUID = (id: string): boolean => { + const regexExp = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi; + + return regexExp.test(id); +}; diff --git a/pwa/src/templates/landing/LandingTemplate.tsx b/pwa/src/templates/landing/LandingTemplate.tsx index ebb60f28..6b554faf 100644 --- a/pwa/src/templates/landing/LandingTemplate.tsx +++ b/pwa/src/templates/landing/LandingTemplate.tsx @@ -1,12 +1,12 @@ import * as React from "react"; import * as styles from "./LandingTemplate.module.css"; -import Skeleton from "react-loading-skeleton"; import { Page, PageContent } from "@utrecht/component-library-react/dist/css-module"; import { FiltersTemplate } from "../templateParts/filters/FiltersTemplate"; import { ResultsDisplayTemplate } from "../templateParts/resultsDisplayTemplate/ResultsDisplayTemplate"; import { JumbotronTemplate } from "../jumbotronTemplate/JumbotronTemplate"; import { useOpenWoo } from "../../hooks/openWoo"; import { useFiltersContext } from "../../context/filters"; +import Skeleton from "react-loading-skeleton"; import { QueryClient } from "react-query"; import { Pagination } from "@conduction/components"; import { usePaginationContext } from "../../context/pagination"; diff --git a/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx b/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx index b691ce4d..ca8bca40 100644 --- a/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/cardsResultsTemplate/CardsResultsTemplate.tsx @@ -19,14 +19,16 @@ export const CardsResultsTemplate: React.FC = ({ requ
{requests.map((request) => ( navigate(request._id)} + onClick={() => navigate(request._self.id)} tabIndex={0} aria-label={`${ request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A") }, ${request.titel}, ${request.samenvatting} ${ - window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" ? `,${request.organisatie?.naam}` : "" + window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" + ? `,${request.embedded?.behandelendBestuursorgaan?.naam}` + : "" } ${ window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ? `, ${t("Category")}, ${request.categorie}` @@ -50,7 +52,7 @@ export const CardsResultsTemplate: React.FC = ({ requ {window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && ( - {request.organisatie?.naam} + {request.embedded?.behandelendBestuursorgaan?.naam} )} diff --git a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx index 760b15d6..c3f6c92e 100644 --- a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx @@ -51,13 +51,15 @@ export const TableResultsTemplate: React.FC = ({ requ {requests.map((request) => ( navigate(request._id)} + key={request._self.id} + onClick={() => navigate(request._self.id)} tabIndex={0} aria-label={`${request.titel}, ${ request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A") } ${ - window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" ? `,${request.organisatie?.naam}` : "" + window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" + ? `,${request.embedded?.behandelendBestuursorgaan?.naam}` + : "" } ${window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ? `, ${request.categorie}` : ""}, ${ request.samenvatting }`} @@ -73,7 +75,7 @@ export const TableResultsTemplate: React.FC = ({ requ <> {window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && ( - {request.organisatie?.naam ?? t("No municipality available")} + {request.embedded?.behandelendBestuursorgaan?.naam ?? t("No municipality available")} )} {window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && ( diff --git a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx index 59d593de..a5dbf859 100644 --- a/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx +++ b/pwa/src/templates/wooItemDetailTemplate/WOOItemDetailTemplate.tsx @@ -1,7 +1,5 @@ import * as React from "react"; import * as styles from "./WOOItemDetailTemplate.module.css"; -import _ from "lodash"; -import Skeleton from "react-loading-skeleton"; import { Page, PageContent, @@ -21,7 +19,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faArrowLeft } from "@fortawesome/free-solid-svg-icons"; import { QueryClient } from "react-query"; import { useOpenWoo } from "../../hooks/openWoo"; +import Skeleton from "react-loading-skeleton"; import { getPDFName } from "../../services/getPDFName"; +import { isUUID } from "../../services/isUUID"; import { HorizontalOverflowWrapper } from "@conduction/components"; interface WOOItemDetailTemplateProps { @@ -53,7 +53,7 @@ export const WOOItemDetailTemplate: React.FC = ({ wo {getItems.isSuccess && ( <> - {getItems.data?.titel !== "" ? getItems.data?.titel : t("No title available")} + {getItems.data.titel !== "" ? getItems.data.titel : t("No title available")} = ({ wo > - {getItems.data?.id && ( + {getItems.data.id && ( {t("Feature")} - {getItems.data?.id} + + {isUUID(getItems.data._self.id) ? getItems.data.id : getItems.data._self.id} + )} - {getItems.data?.titel && ( + {getItems.data.titel && ( {t("Category")} {getItems.data.categorie ?? "-"} )} - {getItems.data?.samenvatting && ( + {getItems.data.samenvatting && ( {t("Summary")} {getItems.data.samenvatting} )} - {getItems.data?.beschrijving && ( + {getItems.data.beschrijving && ( {t("Description")} {getItems.data.beschrijving} )} - {getItems.data?.metadata?.verzoek?.termijnoverschrijding && ( + {getItems.data.termijnoverschrijding && ( {t("Exceeding the term")} - {getItems.data?.metadata?.verzoek?.termijnoverschrijding} + {getItems.data.termijnoverschrijding} )} - {getItems.data?.publicatiedatum && ( + {getItems.data.publicatiedatum && ( {t("Publication date")} - {getItems.data?.publicatiedatum - ? translateDate(i18n.language, getItems.data?.publicatiedatum) + {getItems.data.publicatiedatum + ? translateDate(i18n.language, getItems.data.publicatiedatum) : "-"} )} - {getItems.data?.metadata?.verzoek?.ontvangstdatum && ( + {getItems.data.ontvangstdatum && ( {t("Registration date")} - - {translateDate(i18n.language, getItems.data?.metadata?.verzoek?.ontvangstdatum) ?? "-"} - + {translateDate(i18n.language, getItems.data.ontvangstdatum) ?? "-"} )} - {getItems.data?.metadata?.besluitdatum && ( + {getItems.data.embedded?.metadata?.besluitdatum && ( {t("Decision date")} - {translateDate(i18n.language, getItems.data?.metadata?.besluitdatum) ?? "-"} + {translateDate(i18n.language, getItems.data.embedded?.metadata?.besluitdatum) ?? "-"} )} - {!_.isEmpty(getItems.data?.themas) && ( + {getItems.data?.embedded?.themas && ( {t("Themes")} - {getItems.data?.themas.map((thema: any, idx: number) => ( + {getItems.data?.embedded?.themas.map((thema: any, idx: number) => ( - {thema.hoofdthema + (idx !== getItems.data?.themas?.length - 1 ? ", " : "")} + {thema.hoofdthema + (idx !== getItems.data?.embedded?.themas?.length - 1 ? ", " : "")} ))} )} - {getItems.data?.metadata?.verzoek?.informatieverzoek && ( + {getItems.data?.embedded?.informatieverzoek && ( {t("Information request")} - - {getItems.data?.metadata?.verzoek?.informatieverzoek?.titel ?? - getPDFName(getItems.data?.metadata?.verzoek?.informatieverzoek?.url)} + + {getItems.data?.embedded?.informatieverzoek?.titel} )} - {(getItems.data?.metadata?.verzoek?.besluit || - (getItems.data?.metadata?.verzoek?.besluit ?? getItems.data?.metadata?.verzoek?.besluit?.url)) && ( + {(getItems.data?.besluit || + (getItems.data?.embedded?.besluit ?? getItems.data?.embedded?.besluit?.url)) && ( {t("Decision")} - {(getItems.data?.metadata?.verzoek?.besluit ?? - getItems.data?.metadata?.verzoek?.besluit?.url) && ( + {(getItems.data?.embedded?.besluit ?? getItems.data?.embedded?.besluit?.url) && ( - {getItems.data?.metadata?.verzoek?.besluit?.titel ?? - getPDFName(getItems.data?.metadata?.verzoek?.besluit?.url)} + {getItems.data?.embedded?.besluit?.titel ?? + getPDFName(getItems.data?.embedded?.besluit?.url)} )} )} - {getItems.data?.metadata.verzoek?.inventarisatielijst && ( + {getItems.data?.embedded?.inventarisatielijst && ( {t("Inventory list")} - - {getItems.data?.metadata.verzoek?.inventarisatielijst?.titel ?? - getPDFName(getItems.data?.metadata?.verzoek?.inventarisatielijst?.url)} + + {getItems.data?.embedded?.inventarisatielijst?.titel} )} - {!_.isEmpty(getItems.data?.bijlagen) && ( + {getItems.data?.embedded?.bijlagen && ( {t("Attachments")} - {getItems.data?.bijlagen.map( + {getItems.data?.embedded?.bijlagen.map( (bijlage: any, idx: number) => bijlage.titel && ( diff --git a/pwa/static/configFiles/albrandswaard.json b/pwa/static/configFiles/albrandswaard.json index 239cd057..5705bd9a 100644 --- a/pwa/static/configFiles/albrandswaard.json +++ b/pwa/static/configFiles/albrandswaard.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.albrandswaard.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001006825515000", + "GATSBY_OIDN_NUMBER": "albrandswaard", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/barendrecht.json b/pwa/static/configFiles/barendrecht.json index ee81bd22..82b4430b 100644 --- a/pwa/static/configFiles/barendrecht.json +++ b/pwa/static/configFiles/barendrecht.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.barendrecht.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001001876946000", + "GATSBY_OIDN_NUMBER": "barendrecht", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/buren.json b/pwa/static/configFiles/buren.json index 00ef2317..0a8f5e5c 100644 --- a/pwa/static/configFiles/buren.json +++ b/pwa/static/configFiles/buren.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.buren.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001807287684000", + "GATSBY_OIDN_NUMBER": "buren", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/hoeksche-waard.json b/pwa/static/configFiles/hoeksche-waard.json index eb10ade0..d017c654 100644 --- a/pwa/static/configFiles/hoeksche-waard.json +++ b/pwa/static/configFiles/hoeksche-waard.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.gemeentehw.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001825766096000", + "GATSBY_OIDN_NUMBER": "hoeksche-waard", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/lansingerland.json b/pwa/static/configFiles/lansingerland.json index 1b45bbbd..a859a2b6 100644 --- a/pwa/static/configFiles/lansingerland.json +++ b/pwa/static/configFiles/lansingerland.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.lansingerland.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001817291295000", + "GATSBY_OIDN_NUMBER": "lansingerland", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/ridderkerk.json b/pwa/static/configFiles/ridderkerk.json index 4c44cb77..4bb0870e 100644 --- a/pwa/static/configFiles/ridderkerk.json +++ b/pwa/static/configFiles/ridderkerk.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.ridderkerk.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001001877410000", + "GATSBY_OIDN_NUMBER": "ridderkerk", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/rijssen-holten.json b/pwa/static/configFiles/rijssen-holten.json index 31a5a565..42706b7d 100644 --- a/pwa/static/configFiles/rijssen-holten.json +++ b/pwa/static/configFiles/rijssen-holten.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.rijssen-holten.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001001584169000", + "GATSBY_OIDN_NUMBER": "rijssen-holten", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/stede-broec.json b/pwa/static/configFiles/stede-broec.json index 425493cf..c469f248 100644 --- a/pwa/static/configFiles/stede-broec.json +++ b/pwa/static/configFiles/stede-broec.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.stedebroec.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001004620732000", + "GATSBY_OIDN_NUMBER": "stedebroec", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/texel.json b/pwa/static/configFiles/texel.json index 69148f3d..036c3622 100644 --- a/pwa/static/configFiles/texel.json +++ b/pwa/static/configFiles/texel.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.texel.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001002000155000", + "GATSBY_OIDN_NUMBER": "texel", "GATSBY_SHOW_CATEGORY": "true", "GATSBY_SHOW_ORGANIZATION": "" } diff --git a/pwa/static/configFiles/waddinxveen.json b/pwa/static/configFiles/waddinxveen.json index 201f659e..556574f4 100644 --- a/pwa/static/configFiles/waddinxveen.json +++ b/pwa/static/configFiles/waddinxveen.json @@ -8,7 +8,7 @@ "GATSBY_FOOTER_LOGO_HREF": "https://www.waddinxveen.nl/", "GATSBY_FOOTER_CONTENT": "https://raw.githubusercontent.com/ConductionNL/woo-website-template/main/docs/FooterContent.json", "GATSBY_FOOTER_CONTENT_HEADER": "", - "GATSBY_OIDN_NUMBER": "00000001001998389000", + "GATSBY_OIDN_NUMBER": "waddinxveen", "GATSBY_SHOW_CATEGORY": "", "GATSBY_SHOW_ORGANIZATION": "" }