-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/civicsignal_live_previews' of github.com:CodeForAfr…
…ica/ui into fix/civicsignal_live_previews
- Loading branch information
Showing
71 changed files
with
5,962 additions
and
5,455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ README.md | |
**/.turbo | ||
**/.vscode | ||
**/build | ||
**/media |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SENTRY_ENVIRONMENT=local | ||
SENTRY_ORG=code-for-africa | ||
SENTRY_PROJECT=hurumapclimate | ||
SENTRY_PROJECT=climatemapafrica |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# dependencies | ||
node_modules | ||
.pnp | ||
.pnp.js | ||
.pnpm-debug.log | ||
|
||
# typescript | ||
dist/ | ||
|
||
# testing | ||
coverage | ||
|
||
# next.js | ||
.next/ | ||
out/ | ||
|
||
# payload | ||
build/ | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Vercel | ||
.vercel | ||
.now | ||
|
||
# turbo | ||
.turbo | ||
test-results/ | ||
playwright-report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"version": "0.0.3", | ||
"private": true, | ||
"author": "Code for Africa <[email protected]>", | ||
"description": "Climate Mapped Africa ", | ||
"description": "ClimateMapped Africa", | ||
"keywords": [ | ||
"climatemappedafrica", | ||
"next", | ||
|
@@ -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:", | ||
|
@@ -64,7 +65,6 @@ | |
"next": "catalog:", | ||
"next-images": "catalog:", | ||
"next-seo": "catalog:", | ||
"nodemailer-sendgrid": "catalog:", | ||
"papaparse": "catalog:", | ||
"payload": "catalog:", | ||
"plaiceholder": "catalog:", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"use client"; | ||
|
||
import site from "@/climatemappedafrica/utils/site"; | ||
|
||
export default function payloadImageLoader({ src }) { | ||
// Handle relative paths (i.e. `/media`) only | ||
if (src?.startsWith("/media")) { | ||
// site.url has a trailing `/` | ||
return `${site.url}${src.substring(1)}`; | ||
} | ||
return src; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,29 @@ import path from "path"; | |
import { spawn } from "child_process"; | ||
import express from "express"; | ||
import next from "next"; | ||
import nodemailerSendgrid from "nodemailer-sendgrid"; | ||
import payload from "payload"; | ||
import { Payload } from "payload/dist/payload"; | ||
import { loadEnvConfig } from "@next/env"; | ||
import type { Payload } from "payload/dist/payload"; | ||
|
||
// TODO(kilemensi): Figure out why alias "@/climatemappedafrica" doesn't work here | ||
import { getClient } from "./src/lib/payload/payload-client"; | ||
|
||
const projectDir = process.cwd(); | ||
loadEnvConfig(projectDir); | ||
|
||
const dev = process.env.NODE_ENV !== "production"; | ||
const hostname = process.env.NEXT_HOSTNAME || "localhost"; | ||
const port = parseInt(process.env.PORT || "3000", 10); | ||
const sendGridAPIKey = process.env.SENDGRID_API_KEY; | ||
// TODO(kilemensi): Migrate to SMTP email setup instead of SendGrid specific | ||
const smtpAuthPass = process.env.SMTP_PASS || process.env.SENDGRID_API_KEY; | ||
const smtpFromName = | ||
process.env.SMTP_FROM_NAME || | ||
process.env.SENDGRID_FROM_NAME || | ||
"ClimateMapped Africa CMS"; | ||
const smtpFromAddress = | ||
process.env.SMTP_FROM_ADDRESS || | ||
process.env.SENDGRID_FROM_EMAIL || | ||
"[email protected]"; | ||
const smtpPort = Number(process.env.SMTP_PORT || 587); | ||
|
||
if (!process.env.NEXT_MANUAL_SIG_HANDLE) { | ||
process.on("SIGTERM", () => process.exit(0)); | ||
|
@@ -25,24 +36,30 @@ const app = express(); | |
const start = async (): Promise<void> => { | ||
let localPayload: Payload; | ||
try { | ||
localPayload = await payload.init({ | ||
...(sendGridAPIKey | ||
localPayload = await getClient({ | ||
...(smtpAuthPass | ||
? { | ||
email: { | ||
transportOptions: nodemailerSendgrid({ | ||
apiKey: sendGridAPIKey, | ||
}), | ||
fromName: | ||
process.env.SENDGRID_FROM_NAME || "ClimateMapped Africa CMS", | ||
fromAddress: | ||
process.env.SENDGRID_FROM_EMAIL || "[email protected]", | ||
transportOptions: { | ||
auth: { | ||
user: process.env.SMTP_USER || "apikey", | ||
apiKey: smtpAuthPass, | ||
}, | ||
host: process.env.SMTP_HOST || "smtp.sendgrid.net", | ||
port: smtpPort, | ||
secure: smtpPort === 465, // true for port 465, false (the default) for 587 and others | ||
}, | ||
fromName: smtpFromName, | ||
fromAddress: smtpFromAddress, | ||
}, | ||
} | ||
: undefined), | ||
secret: process.env.PAYLOAD_SECRET, | ||
express: app, | ||
local: false, | ||
onInit: (initPayload) => { | ||
initPayload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`); | ||
initPayload.logger.info( | ||
`Payload Admin URL: ${initPayload.getAdminURL()}`, | ||
); | ||
}, | ||
}); | ||
} catch (e: any) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/climatemappedafrica/src/components/DataIndicators/IndicatorPanel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.