From d3ed0919c7e8309cfcf0b832978eacef43496a47 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Thu, 4 Jul 2024 16:48:51 +0300 Subject: [PATCH 1/4] Fix Charteafrica build --- .github/workflows/charterafrica-deploy-dev.yml | 2 +- apps/charterafrica/src/pages/_app.page.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/charterafrica-deploy-dev.yml b/.github/workflows/charterafrica-deploy-dev.yml index 2fd34029b..f3945e787 100644 --- a/.github/workflows/charterafrica-deploy-dev.yml +++ b/.github/workflows/charterafrica-deploy-dev.yml @@ -2,7 +2,7 @@ name: charterAFRICA | Deploy | DEV on: push: - branches: [main] + branches: [bugfix/charterafrica-build] paths: - "apps/charterafrica/**" - "Dockerfile" diff --git a/apps/charterafrica/src/pages/_app.page.js b/apps/charterafrica/src/pages/_app.page.js index aa9ef5852..a72e64886 100644 --- a/apps/charterafrica/src/pages/_app.page.js +++ b/apps/charterafrica/src/pages/_app.page.js @@ -75,7 +75,7 @@ MyApp.getInitialProps = async (appContext) => { const appProps = await App.getInitialProps(appContext); const { Component, - router: { defaultLocale, locale, locales }, + router: { defaultLocale, locale = "en", locales }, ctx: appCtx, } = appContext; let pageProps = {}; From a9f67f28497e0a4277d051b6d7fbd0377cc6975a Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Thu, 4 Jul 2024 17:02:36 +0300 Subject: [PATCH 2/4] Build test --- apps/charterafrica/src/lib/data/local/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/charterafrica/src/lib/data/local/index.js b/apps/charterafrica/src/lib/data/local/index.js index 6ca719ebe..4299136d3 100644 --- a/apps/charterafrica/src/lib/data/local/index.js +++ b/apps/charterafrica/src/lib/data/local/index.js @@ -25,7 +25,11 @@ export async function getServerSideTags(collection, context) { return getTags(collection, api, context); } -export async function getPageServerSideProps(context) { +export async function getPageServerSideProps({ + locale = "en", + ...contextWithoutLocale +}) { + const context = { ...contextWithoutLocale, locale }; const props = await getPageProps(api, context); if (!props) { From b77d9622406a99b5d81617062b8dada3b3f94042 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Thu, 4 Jul 2024 17:13:26 +0300 Subject: [PATCH 3/4] Fix Charter Africa tools --- .github/workflows/charterafrica-deploy-dev.yml | 2 +- apps/charterafrica/contrib/dokku/Dockerfile | 2 +- apps/charterafrica/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/charterafrica-deploy-dev.yml b/.github/workflows/charterafrica-deploy-dev.yml index f3945e787..2fd34029b 100644 --- a/.github/workflows/charterafrica-deploy-dev.yml +++ b/.github/workflows/charterafrica-deploy-dev.yml @@ -2,7 +2,7 @@ name: charterAFRICA | Deploy | DEV on: push: - branches: [bugfix/charterafrica-build] + branches: [main] paths: - "apps/charterafrica/**" - "Dockerfile" diff --git a/apps/charterafrica/contrib/dokku/Dockerfile b/apps/charterafrica/contrib/dokku/Dockerfile index f6d008d59..352275f24 100644 --- a/apps/charterafrica/contrib/dokku/Dockerfile +++ b/apps/charterafrica/contrib/dokku/Dockerfile @@ -1 +1 @@ -FROM codeforafrica/charterafrica-ui:0.1.27 +FROM codeforafrica/charterafrica-ui:0.1.28 diff --git a/apps/charterafrica/package.json b/apps/charterafrica/package.json index 994c51c31..c10a368cf 100644 --- a/apps/charterafrica/package.json +++ b/apps/charterafrica/package.json @@ -1,6 +1,6 @@ { "name": "charterafrica", - "version": "0.1.27", + "version": "0.1.28", "private": true, "author": "Code for Africa ", "description": "This is the official code for https://charter.africa site", From 45e70e64b1a25033f6dd58c2052396ebf9474774 Mon Sep 17 00:00:00 2001 From: Kevin Koech Date: Thu, 4 Jul 2024 17:18:31 +0300 Subject: [PATCH 4/4] Remove unneeded change --- apps/charterafrica/src/pages/_app.page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/charterafrica/src/pages/_app.page.js b/apps/charterafrica/src/pages/_app.page.js index a72e64886..aa9ef5852 100644 --- a/apps/charterafrica/src/pages/_app.page.js +++ b/apps/charterafrica/src/pages/_app.page.js @@ -75,7 +75,7 @@ MyApp.getInitialProps = async (appContext) => { const appProps = await App.getInitialProps(appContext); const { Component, - router: { defaultLocale, locale = "en", locales }, + router: { defaultLocale, locale, locales }, ctx: appCtx, } = appContext; let pageProps = {};