diff --git a/Dockerfile b/Dockerfile index 4fe65a578..e99dedc11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ ARG \ SENTRY_PROJECT="" -FROM node:20.16-alpine AS node +FROM node:20.18-alpine AS node # Always install security updated e.g. https://pythonspeed.com/articles/security-updates-in-docker/ # Update local cache so that other stages don't need to update cache @@ -66,9 +66,12 @@ RUN pnpm fetch COPY *.yaml *.json ./ COPY packages/commons-ui-core/package.json ./packages/commons-ui-core/package.json COPY packages/commons-ui-next/package.json ./packages/commons-ui-next/package.json +COPY packages/commons-ui-payload/package.json ./packages/commons-ui-payload/package.json +COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json +COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json # Next.js lints when doing production build COPY packages/eslint-config-commons-ui/package.json ./packages/eslint-config-commons-ui/package.json -# TODO(kilemensi): Figure out why this is needed (charterafrica, codeforafrica) +# TODO(kilemensi): Figure out why this is needed (charterafrica, codeforafrica, etc.) COPY packages/commons-ui-testing-library/package.json ./packages/commons-ui-testing-library/package.json RUN pnpm --filter "./packages/**" install --offline --frozen-lockfile @@ -98,7 +101,7 @@ ARG NEXT_TELEMETRY_DISABLED \ NEXT_PUBLIC_SEO_DISABLED \ NEXT_PUBLIC_GOOGLE_ANALYTICS \ PORT \ - SENTRY_ENV + SENTRY_ENVIRONMENT ENV NODE_ENV=production \ NEXT_TELEMETRY_DISABLED=${NEXT_TELEMETRY_DISABLED} \ @@ -231,235 +234,233 @@ CMD ["node", "dist/server.js"] # ============================================================================ -# Climate Mapped Africa +# CivicSignal Blog # ============================================================================ # -# climatemappedafrica-deps: image with all climatemappedafrica dependencies -# ------------------------------------------------------------------------- +# civicsignalblog-desp: image with all codeforafrica dependencies +# ------------------------------------------------------------- -FROM base-deps AS climatemappedafrica-deps +FROM base-deps AS civicsignalblog-deps -COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json -COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json -COPY apps/climatemappedafrica/package.json ./apps/climatemappedafrica/package.json -COPY packages/commons-ui-payload/package.json ./packages/commons-ui-payload/package.json +COPY apps/civicsignalblog/package.json ./apps/civicsignalblog/package.json -# Use virtual store: https://pnpm.io/cli/fetch#usage-scenario -RUN pnpm --filter "./apps/climatemappedafrica" install --offline --frozen-lockfile +RUN pnpm --filter "./apps/civicsignalblog/" install --offline --frozen-lockfile # -# climatemappedafrica-builder: image that uses deps to build shippable output -# --------------------------------------------------------------------------- +# civicsignalblog-builder: image that uses deps to build shippable output +# --------------------------------------------------------------------- -FROM base-builder AS climatemappedafrica-builder +FROM base-builder AS civicsignalblog-builder ARG NEXT_TELEMETRY_DISABLED \ # Next.js / Payload (build time) PORT \ # Next.js (runtime) - NEXT_PUBLIC_APP_NAME=Climate Mapped Africa \ + NEXT_PUBLIC_APP_NAME="Code for Africa" \ NEXT_PUBLIC_APP_URL \ NEXT_PUBLIC_SENTRY_DSN \ - NEXT_PUBLIC_SEO_DISABLED \ - NEXT_PUBLIC_IMAGE_DOMAINS="cms.dev.codeforafrica.org,hurumap-v2.s3.amazonaws.com" \ - NEXT_PUBLIC_IMAGE_SCALE_FACTOR=2 \ - NEXT_PUBLIC_GOOGLE_ANALYTICS \ # Payload (runtime) + # TODO(koech): Standadise naming of Mongo DB URL. Our options: + # - MONGODB_URL (codeforafrica) + # - MONGO_URL (charterafrica, civicsignalblog, roboshield) MONGO_URL \ PAYLOAD_SECRET \ # Sentry (build time) SENTRY_AUTH_TOKEN \ SENTRY_ENVIRONMENT \ SENTRY_ORG \ - SENTRY_PROJECT \ - # Custom (runtime) - HURUMAP_API_URL + SENTRY_PROJECT # This is in app-builder instead of base-builder just incase app-deps adds deps -COPY --from=climatemappedafrica-deps /workspace/node_modules ./node_modules +COPY --from=civicsignalblog-deps /workspace/node_modules ./node_modules -COPY --from=climatemappedafrica-deps /workspace/apps/climatemappedafrica/node_modules ./apps/climatemappedafrica/node_modules +COPY --from=civicsignalblog-deps /workspace/apps/civicsignalblog/node_modules ./apps/civicsignalblog/node_modules -COPY apps/climatemappedafrica ./apps/climatemappedafrica +COPY apps/civicsignalblog ./apps/civicsignalblog/ # When building Next.js app, Next.js needs to connect to local Payload ENV PAYLOAD_PUBLIC_APP_URL=http://localhost:3000 -ENV NEXT_PUBLIC_SEO_DISABLED=${NEXT_PUBLIC_SEO_DISABLED} RUN --mount=type=secret,id=sentry_auth_token,env=SENTRY_AUTH_TOKEN \ - pnpm --filter "./apps/climatemappedafrica" build-next + pnpm --filter "./apps/civicsignalblog/" build-next # When building Payload app, Payload needs to have final app URL ENV PAYLOAD_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} -RUN pnpm --filter "./apps/climatemappedafrica" build-payload +RUN pnpm --filter "./apps/civicsignalblog/" build-payload # -# climatemappedafrica-runner: final deployable image -# -------------------------------------------------- +# civicsignalblog-runner: final deployable image +# -------------------------------------------- -FROM base-runner AS climatemappedafrica-runner +FROM base-runner AS civicsignalblog-runner -ARG PAYLOAD_CONFIG_PATH="dist/payload.config.js" \ +ARG NEXT_PUBLIC_APP_LOGO_URL \ + PAYLOAD_CONFIG_PATH="dist/payload.config.js" \ PAYLOAD_PUBLIC_APP_URL -# DO NOT initialise ENV vars using ARG for secrets!!!! -# These include: -# i. Mongo DB URL -# ii. Payload Secret -# ENV are persisted in the image & may lead to security issues -ENV PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} \ +# TODO(koech): Standadise naming of GA MEASUREMENT ID. Our options: +# - GA_MEASUREMENT_ID (charterafrica) +# - GOOGLE_ANALYTICS_ID (pesayetu, vpnmanager) +# This is only needed at runtime +# TODO(koech): Completely remove the use of ENV vars for Google Analytics +# for those app that have CMS. Measurement id should be set +# in the Settings part of a site. +ENV NEXT_PUBLIC_APP_LOGO_URL=${NEXT_PUBLIC_APP_LOGO_URL} \ + PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} \ PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH} RUN set -ex \ # Create nextjs cache dir w/ correct permissions - && mkdir -p ./apps/climatemappedafrica/.next \ - && chown nextjs:nodejs ./apps/climatemappedafrica/.next + && mkdir -p ./apps/civicsignalblog/.next \ + && chown nextjs:nodejs ./apps/civicsignalblog/.next + +# Node +# Subpath imports definitions +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/package.json ./apps/civicsignalblog/package.json # PNPM # symlink some dependencies -COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules # Since we can't use output: "standalone", copy all app's dependencies -COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/node_modules ./apps/climatemappedafrica/node_modules -COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/next.config.js ./apps/climatemappedafrica/next.config.js -COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/.env ./apps/climatemappedafrica/.env +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/node_modules ./apps/civicsignalblog/node_modules +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/next.config.js ./apps/civicsignalblog/next.config.js +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/.env ./apps/civicsignalblog/.env +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/migrations ./apps/civicsignalblog/migrations # Next.js # Public assets -COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/public ./apps/climatemappedafrica/public +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/public ./apps/civicsignalblog/public # Since we can't use output: "standalone", copy the whole app's .next folder # TODO(kilemensi): Figure out which files in .next folder are not needed -COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/.next ./apps/climatemappedafrica/.next +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/.next ./apps/civicsignalblog/.next # Payload -COPY --from=climatemappedafrica-builder /workspace/apps/climatemappedafrica/dist ./apps/climatemappedafrica/dist -COPY --from=climatemappedafrica-builder /workspace/apps/climatemappedafrica/build ./apps/climatemappedafrica/build +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/dist ./apps/civicsignalblog/dist +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/build ./apps/civicsignalblog/build # Since we can't use output: "standalone", switch to specific app's folder -WORKDIR /workspace/apps/climatemappedafrica +WORKDIR /workspace/apps/civicsignalblog USER nextjs # Custom server to run Payload and Next.js in the same app CMD ["node", "dist/server.js"] + # ============================================================================ -# CivicSignal Blog +# Climate Mapped Africa # ============================================================================ # -# civicsignalblog-desp: image with all codeforafrica dependencies -# ------------------------------------------------------------- - -FROM base-deps AS civicsignalblog-deps +# climatemappedafrica-deps: image with all climatemappedafrica dependencies +# ------------------------------------------------------------------------- -# TODO(kilemensi): Figure out why this is needed -COPY packages/commons-ui-testing-library/package.json ./packages/commons-ui-testing-library/package.json +FROM base-deps AS climatemappedafrica-deps -COPY apps/civicsignalblog/package.json ./apps/civicsignalblog/package.json +COPY apps/climatemappedafrica/package.json ./apps/climatemappedafrica/package.json -RUN pnpm --filter "./apps/civicsignalblog/" install --offline --frozen-lockfile +# Use virtual store: https://pnpm.io/cli/fetch#usage-scenario +RUN pnpm --filter "./apps/climatemappedafrica" install --offline --frozen-lockfile # -# civicsignalblog-builder: image that uses deps to build shippable output -# --------------------------------------------------------------------- +# climatemappedafrica-builder: image that uses deps to build shippable output +# --------------------------------------------------------------------------- -FROM base-builder AS civicsignalblog-builder +FROM base-builder AS climatemappedafrica-builder ARG NEXT_TELEMETRY_DISABLED \ # Next.js / Payload (build time) PORT \ # Next.js (runtime) - NEXT_PUBLIC_APP_NAME="Code for Africa" \ + NEXT_PUBLIC_APP_NAME=Climate Mapped Africa \ NEXT_PUBLIC_APP_URL \ NEXT_PUBLIC_SENTRY_DSN \ + NEXT_PUBLIC_SEO_DISABLED \ + NEXT_PUBLIC_IMAGE_DOMAINS="cms.dev.codeforafrica.org,hurumap-v2.s3.amazonaws.com" \ + NEXT_PUBLIC_IMAGE_SCALE_FACTOR=2 \ + NEXT_PUBLIC_GOOGLE_ANALYTICS \ # Payload (runtime) - # TODO(koech): Standadise naming of Mongo DB URL. Our options: - # - MONGODB_URL (codeforafrica) - # - MONGO_URL (charterafrica, civicsignalblog, roboshield) MONGO_URL \ PAYLOAD_SECRET \ # Sentry (build time) SENTRY_AUTH_TOKEN \ SENTRY_ENVIRONMENT \ SENTRY_ORG \ - SENTRY_PROJECT + SENTRY_PROJECT \ + # Custom (runtime) + HURUMAP_API_URL # This is in app-builder instead of base-builder just incase app-deps adds deps -COPY --from=civicsignalblog-deps /workspace/node_modules ./node_modules +COPY --from=climatemappedafrica-deps /workspace/node_modules ./node_modules -COPY --from=civicsignalblog-deps /workspace/apps/civicsignalblog/node_modules ./apps/civicsignalblog/node_modules +COPY --from=climatemappedafrica-deps /workspace/apps/climatemappedafrica/node_modules ./apps/climatemappedafrica/node_modules -COPY apps/civicsignalblog ./apps/civicsignalblog/ +COPY apps/climatemappedafrica ./apps/climatemappedafrica # When building Next.js app, Next.js needs to connect to local Payload ENV PAYLOAD_PUBLIC_APP_URL=http://localhost:3000 +ENV NEXT_PUBLIC_SEO_DISABLED=${NEXT_PUBLIC_SEO_DISABLED} RUN --mount=type=secret,id=sentry_auth_token,env=SENTRY_AUTH_TOKEN \ - pnpm --filter "./apps/civicsignalblog/" build-next + pnpm --filter "./apps/climatemappedafrica" build-next # When building Payload app, Payload needs to have final app URL ENV PAYLOAD_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} -RUN pnpm --filter "./apps/civicsignalblog/" build-payload +RUN pnpm --filter "./apps/climatemappedafrica" build-payload # -# civicsignalblog-runner: final deployable image -# -------------------------------------------- +# climatemappedafrica-runner: final deployable image +# -------------------------------------------------- -FROM base-runner AS civicsignalblog-runner +FROM base-runner AS climatemappedafrica-runner -ARG NEXT_PUBLIC_APP_LOGO_URL \ - PAYLOAD_CONFIG_PATH="dist/payload.config.js" \ +ARG PAYLOAD_CONFIG_PATH="dist/payload.config.js" \ PAYLOAD_PUBLIC_APP_URL -# TODO(koech): Standadise naming of GA MEASUREMENT ID. Our options: -# - GA_MEASUREMENT_ID (charterafrica) -# - GOOGLE_ANALYTICS_ID (pesayetu, vpnmanager) -# This is only needed at runtime -# TODO(koech): Completely remove the use of ENV vars for Google Analytics -# for those app that have CMS. Measurement id should be set -# in the Settings part of a site. -ENV NEXT_PUBLIC_APP_LOGO_URL=${NEXT_PUBLIC_APP_LOGO_URL} \ - PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} \ +# DO NOT initialise ENV vars using ARG for secrets!!!! +# These include: +# i. Mongo DB URL +# ii. Payload Secret +# ENV are persisted in the image & may lead to security issues +ENV PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} \ PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH} RUN set -ex \ # Create nextjs cache dir w/ correct permissions - && mkdir -p ./apps/civicsignalblog/.next \ - && chown nextjs:nodejs ./apps/civicsignalblog/.next - -# Node -# Subpath imports definitions -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/package.json ./apps/civicsignalblog/package.json + && mkdir -p ./apps/climatemappedafrica/.next \ + && chown nextjs:nodejs ./apps/climatemappedafrica/.next # PNPM # symlink some dependencies -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules # Since we can't use output: "standalone", copy all app's dependencies -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/node_modules ./apps/civicsignalblog/node_modules -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/next.config.js ./apps/civicsignalblog/next.config.js -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/.env ./apps/civicsignalblog/.env -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/migrations ./apps/civicsignalblog/migrations +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/node_modules ./apps/climatemappedafrica/node_modules +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/next.config.js ./apps/climatemappedafrica/next.config.js +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/.env ./apps/climatemappedafrica/.env # Next.js # Public assets -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/public ./apps/civicsignalblog/public +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/public ./apps/climatemappedafrica/public +# Custom next/image loader +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/payload.image.loader.js ./apps/climatemappedafrica/payload.image.loader.js # Since we can't use output: "standalone", copy the whole app's .next folder # TODO(kilemensi): Figure out which files in .next folder are not needed -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/.next ./apps/civicsignalblog/.next +COPY --from=climatemappedafrica-builder --chown=nextjs:nodejs /workspace/apps/climatemappedafrica/.next ./apps/climatemappedafrica/.next # Payload -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/dist ./apps/civicsignalblog/dist -COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/build ./apps/civicsignalblog/build +COPY --from=climatemappedafrica-builder /workspace/apps/climatemappedafrica/dist ./apps/climatemappedafrica/dist +COPY --from=climatemappedafrica-builder /workspace/apps/climatemappedafrica/build ./apps/climatemappedafrica/build # Since we can't use output: "standalone", switch to specific app's folder -WORKDIR /workspace/apps/civicsignalblog +WORKDIR /workspace/apps/climatemappedafrica USER nextjs # Custom server to run Payload and Next.js in the same app CMD ["node", "dist/server.js"] + # ============================================================================ # Code for Africa # ============================================================================ @@ -566,6 +567,7 @@ USER nextjs # Custom server to run Payload and Next.js in the same app CMD ["node", "dist/server.js"] + # ============================================================================ # PesaYetu # ============================================================================ @@ -576,8 +578,6 @@ CMD ["node", "dist/server.js"] FROM base-deps AS pesayetu-deps -COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json -COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json COPY apps/pesayetu/package.json ./apps/pesayetu/package.json # Use virtual store: https://pnpm.io/cli/fetch#usage-scenario @@ -666,6 +666,7 @@ USER nextjs # https://nextjs.org/docs/pages/api-reference/next-config-js/output CMD ["node", "apps/pesayetu/server.js"] + # ============================================================================ # Roboshield # ============================================================================ @@ -762,6 +763,7 @@ USER nextjs # Custom server to run Payload and Next.js in the same app CMD ["node", "dist/server.js"] + # ============================================================================ # Techlab Blog # ============================================================================ @@ -836,6 +838,7 @@ USER nextjs # https://nextjs.org/docs/pages/api-reference/next-config-js/output CMD ["node", "apps/techlabblog/server.js"] + # ============================================================================ # VPN Manager # ============================================================================ diff --git a/apps/climatemappedafrica/.env b/apps/climatemappedafrica/.env index af29ff3b9..f52a0287f 100644 --- a/apps/climatemappedafrica/.env +++ b/apps/climatemappedafrica/.env @@ -1,3 +1,3 @@ SENTRY_ENVIRONMENT=local SENTRY_ORG=code-for-africa -SENTRY_PROJECT=hurumapclimate +SENTRY_PROJECT=climatemapafrica diff --git a/apps/climatemappedafrica/next.config.js b/apps/climatemappedafrica/next.config.js index f48c38659..80cee9b09 100644 --- a/apps/climatemappedafrica/next.config.js +++ b/apps/climatemappedafrica/next.config.js @@ -25,7 +25,6 @@ module.exports = { transform: "@mui/material/{{member}}", }, }, - output: "standalone", reactStrictMode: false, transpilePackages: [ "@commons-ui/core", diff --git a/apps/climatemappedafrica/package.json b/apps/climatemappedafrica/package.json index fe349f0d4..f81410a61 100644 --- a/apps/climatemappedafrica/package.json +++ b/apps/climatemappedafrica/package.json @@ -34,7 +34,8 @@ }, "dependencies": { "@apollo/client": "catalog:", - "@commons-ui/core": "catalog:", + "@commons-ui/core": "workspace:*", + "@commons-ui/legacy": "catalog:", "@commons-ui/next": "workspace:*", "@commons-ui/payload": "workspace:*", "@emotion/react": "catalog:", diff --git a/apps/climatemappedafrica/payload.image.loader.js b/apps/climatemappedafrica/payload.image.loader.js index acb0916bc..5a0421ac7 100644 --- a/apps/climatemappedafrica/payload.image.loader.js +++ b/apps/climatemappedafrica/payload.image.loader.js @@ -3,9 +3,10 @@ import site from "@/climatemappedafrica/utils/site"; export default function payloadImageLoader({ src }) { - // Handle relative paths (/media) only + // Handle relative paths (i.e. `/media`) only if (src?.startsWith("/media")) { - return `${site.url}${src}`; + // site.url has a trailing `/` + return `${site.url}${src.substring(1)}`; } return src; } diff --git a/apps/climatemappedafrica/src/components/Card/Card.js b/apps/climatemappedafrica/src/components/Card/Card.js index 455d17b43..552e97356 100644 --- a/apps/climatemappedafrica/src/components/Card/Card.js +++ b/apps/climatemappedafrica/src/components/Card/Card.js @@ -124,7 +124,7 @@ Card.propTypes = { descriptionProps: PropTypes.shape({}), embed: PropTypes.string, href: PropTypes.string, - image: PropTypes.string, + image: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({})]), imageProps: PropTypes.shape({}), linkProps: PropTypes.shape({}), media: PropTypes.string, diff --git a/apps/climatemappedafrica/src/components/Card/Content.js b/apps/climatemappedafrica/src/components/Card/Content.js index ebcbfccaf..26f057b04 100644 --- a/apps/climatemappedafrica/src/components/Card/Content.js +++ b/apps/climatemappedafrica/src/components/Card/Content.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import { RichText } from "@commons-ui/payload"; import { CardContent } from "@mui/material"; import makeStyles from "@mui/styles/makeStyles"; diff --git a/apps/climatemappedafrica/src/components/Card/Media.js b/apps/climatemappedafrica/src/components/Card/Media.js index fd48d0659..0a0fcae70 100644 --- a/apps/climatemappedafrica/src/components/Card/Media.js +++ b/apps/climatemappedafrica/src/components/Card/Media.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import makeStyles from "@mui/styles/makeStyles"; import PropTypes from "prop-types"; import React from "react"; diff --git a/apps/climatemappedafrica/src/components/DataIndicators/IndicatorPanel.js b/apps/climatemappedafrica/src/components/DataIndicators/IndicatorPanel.js index 40849baa4..2f063a9f2 100644 --- a/apps/climatemappedafrica/src/components/DataIndicators/IndicatorPanel.js +++ b/apps/climatemappedafrica/src/components/DataIndicators/IndicatorPanel.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import { RichText } from "@commons-ui/payload"; import { ButtonBase, Slide } from "@mui/material"; import PropTypes from "prop-types"; diff --git a/apps/climatemappedafrica/src/components/DataVisualisationGuide/index.js b/apps/climatemappedafrica/src/components/DataVisualisationGuide/index.js index 55b86a7fd..db769dfd7 100644 --- a/apps/climatemappedafrica/src/components/DataVisualisationGuide/index.js +++ b/apps/climatemappedafrica/src/components/DataVisualisationGuide/index.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import { useMediaQuery, Box, Grid } from "@mui/material"; import PropTypes from "prop-types"; import React from "react"; @@ -83,7 +83,7 @@ DataVisualisationGuide.propTypes = { title: PropTypes.string, items: PropTypes.arrayOf( PropTypes.shape({ - description: PropTypes.string || PropTypes.array, + description: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({})]), image: PropTypes.string, }), ), diff --git a/apps/climatemappedafrica/src/components/Footer/index.js b/apps/climatemappedafrica/src/components/Footer/index.js index aa58eba96..c23980096 100644 --- a/apps/climatemappedafrica/src/components/Footer/index.js +++ b/apps/climatemappedafrica/src/components/Footer/index.js @@ -1,4 +1,4 @@ -import { QuickLinks, Copyright } from "@commons-ui/core"; +import { QuickLinks, Copyright } from "@commons-ui/legacy"; import { Link, StayInTouch } from "@commons-ui/next"; import { RichText } from "@commons-ui/payload"; import { Box, Grid } from "@mui/material"; diff --git a/apps/climatemappedafrica/src/components/HURUmap/CategoryHeader/index.js b/apps/climatemappedafrica/src/components/HURUmap/CategoryHeader/index.js index 7299564cb..a354b90d0 100644 --- a/apps/climatemappedafrica/src/components/HURUmap/CategoryHeader/index.js +++ b/apps/climatemappedafrica/src/components/HURUmap/CategoryHeader/index.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import { Typography } from "@mui/material"; import PropTypes from "prop-types"; import React from "react"; diff --git a/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js b/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js index 9425926bb..dbca624eb 100644 --- a/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js +++ b/apps/climatemappedafrica/src/components/HURUmap/Chart/index.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import { ChartTooltip, IndicatorTitle, Download, Share } from "@hurumap/core"; import { Source } from "@hurumap/next"; import { useMediaQuery, useTheme } from "@mui/material"; diff --git a/apps/climatemappedafrica/src/components/HURUmap/SubcategoryHeader/index.js b/apps/climatemappedafrica/src/components/HURUmap/SubcategoryHeader/index.js index b6c19ab3b..ba5067077 100644 --- a/apps/climatemappedafrica/src/components/HURUmap/SubcategoryHeader/index.js +++ b/apps/climatemappedafrica/src/components/HURUmap/SubcategoryHeader/index.js @@ -1,4 +1,4 @@ -import { RichTypography } from "@commons-ui/core"; +import { RichTypography } from "@commons-ui/legacy"; import { Typography } from "@mui/material"; import makeStyles from "@mui/styles/makeStyles"; import PropTypes from "prop-types"; diff --git a/apps/climatemappedafrica/src/components/HURUmap/TreeView/TreeView.snap.js b/apps/climatemappedafrica/src/components/HURUmap/TreeView/TreeView.snap.js index dee356bbe..952ff48de 100644 --- a/apps/climatemappedafrica/src/components/HURUmap/TreeView/TreeView.snap.js +++ b/apps/climatemappedafrica/src/components/HURUmap/TreeView/TreeView.snap.js @@ -8,14 +8,15 @@ exports[` renders unchanged 1`] = `