From e888bbb17245edeb362b909571ad547cd90c8ca0 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Wed, 26 Jun 2024 15:51:09 +0300
Subject: [PATCH 01/25] Add About page
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/pages/about.tsx | 57 +++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 apps/roboshield/src/pages/about.tsx
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
new file mode 100644
index 000000000..3906f8a99
--- /dev/null
+++ b/apps/roboshield/src/pages/about.tsx
@@ -0,0 +1,57 @@
+import { getPageServerSideProps } from "@/roboshield/lib/data";
+
+export default function About() {
+ return (
+ <>
+
About Page
+ >
+ );
+}
+
+export async function getServerSideProps(context: any) {
+ const { props } = await getPageServerSideProps(context);
+ return {
+ props: {
+ ...props,
+ footer: {
+ logo: props?.footer?.logo,
+ newsletter: props?.footer?.newsletter,
+ description: `This site is an open source code built by Code for Africa, the continent's largest network of civic technology and data journalism labs. All content is released under a Creative Commons 4 Attribution License. Reuse it to help empower your own community.`,
+ connect: props?.footer?.connect,
+ partners: [
+ {
+ name: "DW Africa",
+ url: "https://www.dw.com/africa",
+ logo: {
+ alt: "DW Africa",
+ prefix: "media",
+ filename: "dw-africa.png",
+ sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
+ url: "/images/DW.png",
+ src: "/images/DW.png",
+ },
+ },
+ {
+ name: "Civic Signal",
+ url: "https://civicsignal.africa/",
+ logo: {
+ alt: "Civic Signal",
+ prefix: "media",
+ filename: "civic-signal.png",
+ sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
+ url: "/images/civic-signal.png",
+ src: "/images/civic-signal.png",
+ },
+ },
+ ],
+ project: `This project was inspired by a
+ survey conducted
+ by the Reutures Instititue in the Minority World. The Audit data used
+ in this project was based on
+ CivicSignal
+ MediaData database.
+ `,
+ },
+ },
+ };
+}
From a0fd623d876b66984300a12555e4f33208f619da Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Thu, 27 Jun 2024 14:23:19 +0300
Subject: [PATCH 02/25] Render About Page
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/pages/about.tsx | 173 +++++++++++++++++++++-------
1 file changed, 132 insertions(+), 41 deletions(-)
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index 3906f8a99..d1adf5e5a 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -1,10 +1,48 @@
import { getPageServerSideProps } from "@/roboshield/lib/data";
+import RichText from "@/roboshield/components/RichText";
+import { Section } from "@commons-ui/core";
+import { RichTypography } from "@commons-ui/next";
-export default function About() {
+interface ContentType {
+ title: string;
+ content: Array<{
+ type: string;
+ children: Array<{
+ text: string;
+ }>;
+ }>;
+}
+
+export default function About({ title, content }: ContentType) {
return (
- <>
- About Page
- >
+
+
+ {title}
+
+ ({
+ mb: "30px",
+ "& h2": {
+ typography: { xs: "h4", md: "h2" },
+ },
+ "& p,& a, & li": {
+ typography: { xs: "body1", md: "subheading" },
+ mb: 2,
+ },
+ "& a": {
+ textDecorationColor: theme.palette.primary.main,
+ },
+ })}
+ />
+
);
}
@@ -13,45 +51,98 @@ export async function getServerSideProps(context: any) {
return {
props: {
...props,
- footer: {
- logo: props?.footer?.logo,
- newsletter: props?.footer?.newsletter,
- description: `This site is an open source code built by Code for Africa, the continent's largest network of civic technology and data journalism labs. All content is released under a Creative Commons 4 Attribution License. Reuse it to help empower your own community.`,
- connect: props?.footer?.connect,
- partners: [
- {
- name: "DW Africa",
- url: "https://www.dw.com/africa",
- logo: {
- alt: "DW Africa",
- prefix: "media",
- filename: "dw-africa.png",
- sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
- url: "/images/DW.png",
- src: "/images/DW.png",
+ title: "About Page",
+ content: [
+ {
+ type: "h2",
+ children: [
+ {
+ text: "Overview",
},
- },
- {
- name: "Civic Signal",
- url: "https://civicsignal.africa/",
- logo: {
- alt: "Civic Signal",
- prefix: "media",
- filename: "civic-signal.png",
- sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
- url: "/images/civic-signal.png",
- src: "/images/civic-signal.png",
+ ],
+ },
+ {
+ children: [
+ {
+ text: "As AI bots become more prevalent, it is crucial for websites to protect their data from unauthorised scraping and crawling by AI bots, which use the scraped data to train their models.",
},
- },
- ],
- project: `This project was inspired by a
- survey conducted
- by the Reutures Instititue in the Minority World. The Audit data used
- in this project was based on
- CivicSignal
- MediaData database.
- `,
- },
+ ],
+ },
+ {
+ children: [
+ {
+ text: "We recently analysed a broad range of popular websites across Africa to assess their measures against AI bot activities. The results were alarming, highlighting a significant gap in the security practices of these websites.",
+ },
+ ],
+ },
+ {
+ type: "h3",
+ children: [
+ {
+ text: "Robots.txt File",
+ },
+ ],
+ },
+ {
+ children: [
+ {
+ text: "The robots.txt file is a critical component in guiding search engine bots on which pages to index and which to ignore. Surprisingly, only 45.5% of the websites had implemented a robots.txt file. This leaves more than half of the websites without a fundamental line of defence against unwanted bot activities.",
+ },
+ ],
+ },
+ {
+ type: "h3",
+ children: [
+ {
+ text: "Blocking AI Bots",
+ },
+ ],
+ },
+ {
+ children: [
+ {
+ text: "Only 4.3% of the websites were blocking AI bots. This means 95.7% of websites are potentially vulnerable to unauthorised scraping and crawling by AI bots.",
+ },
+ ],
+ },
+ {
+ type: "h3",
+ children: [
+ {
+ text: "Aim of Study",
+ },
+ ],
+ },
+ {
+ children: [
+ {
+ text: "The principal aim of this study was to determine how frequently African media houses and other top websites were implementing policies to block artificial intelligence (AI) crawlers. Large language models (LLMs) rely on vast amounts of data for training and improvement, often gathered through methodical trawling of web content using crawlers. However, some websites aim to limit how their content is used to train LLMs by blocking these web crawlers.",
+ },
+ ],
+ },
+ {
+ type: "h3",
+ children: [
+ {
+ text: "Technique Used",
+ },
+ ],
+ },
+ {
+ children: [
+ {
+ text: "We examined the robots.txt files of the websites to determine if they were blocking AI bots. The robots.txt file specifies which pages search engine bots can crawl and which they cannot. We checked these files for common AI bot user agents to see if they were being ",
+ },
+ ],
+ },
+ {
+ children: [
+ {
+ text: "\n\n",
+ },
+ ],
+ },
+ ],
},
};
}
From 1ddb1073b7edb518aca74e77ebc846c98676cc1c Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Thu, 27 Jun 2024 15:05:33 +0300
Subject: [PATCH 03/25] Render statistics
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../Type=layout, Size=32, Color=1020E1.svg | 5 +
.../components/Statistics/StatisticCard.tsx | 85 +++++++++++
.../src/components/Statistics/Statistics.tsx | 55 +++++++
.../src/components/Statistics/index.ts | 3 +
apps/roboshield/src/pages/about.tsx | 140 ++++++++++++++----
5 files changed, 259 insertions(+), 29 deletions(-)
create mode 100644 apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg
create mode 100644 apps/roboshield/src/components/Statistics/StatisticCard.tsx
create mode 100644 apps/roboshield/src/components/Statistics/Statistics.tsx
create mode 100644 apps/roboshield/src/components/Statistics/index.ts
diff --git a/apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg b/apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg
new file mode 100644
index 000000000..b36cc2427
--- /dev/null
+++ b/apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg
@@ -0,0 +1,5 @@
+
diff --git a/apps/roboshield/src/components/Statistics/StatisticCard.tsx b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
new file mode 100644
index 000000000..5beb12285
--- /dev/null
+++ b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
@@ -0,0 +1,85 @@
+import { Figure, RichTypography } from "@commons-ui/next";
+import { Card, CardContent, Box } from "@mui/material";
+import { styled } from "@mui/material/styles";
+import React from "react";
+
+import RichText from "@/roboshield/components/RichText";
+
+const StatisticCardRoot = styled(Card, {
+ slot: "Root",
+})(({ theme: { breakpoints } }) => ({
+ backgroundColor: "inherit",
+ boxShadow: "none",
+ width: "100%",
+ [breakpoints.up("md")]: {
+ width: "326px",
+ },
+ [breakpoints.up("lg")]: {
+ width: "332px",
+ },
+}));
+export default function StatisticCard(props: any) {
+ const { icon, label, value, description } = props;
+
+ const imageSrc = icon?.src || icon?.url || icon;
+ const imageAlt = icon?.alt || label;
+ return (
+
+
+
+
+
+ {label}
+
+
+
+
+ {value}
+
+
+
+
+ );
+}
diff --git a/apps/roboshield/src/components/Statistics/Statistics.tsx b/apps/roboshield/src/components/Statistics/Statistics.tsx
new file mode 100644
index 000000000..31615abe3
--- /dev/null
+++ b/apps/roboshield/src/components/Statistics/Statistics.tsx
@@ -0,0 +1,55 @@
+import { Box, Grid } from "@mui/material";
+import { Section } from "@commons-ui/core";
+import { RichTypography } from "@commons-ui/next";
+import StatisticCard from "./StatisticCard";
+
+export interface StatiscticsProps {
+ title: string;
+ statistics: Array<{
+ name: string;
+ value: string;
+ label: string;
+ icon: string;
+ description: Array<{
+ type: string;
+ children: Array<{
+ text: string;
+ }>;
+ }>;
+ }>;
+}
+
+export default function Statistics({ title, statistics }: StatiscticsProps) {
+ return (
+
+
+ {title && (
+
+ {title}
+
+ )}
+
+ {statistics.map((statistic) => (
+
+
+
+ ))}
+
+
+
+ );
+}
diff --git a/apps/roboshield/src/components/Statistics/index.ts b/apps/roboshield/src/components/Statistics/index.ts
new file mode 100644
index 000000000..c8bd68afc
--- /dev/null
+++ b/apps/roboshield/src/components/Statistics/index.ts
@@ -0,0 +1,3 @@
+import Statistics from "./Statistics";
+
+export default Statistics;
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index d1adf5e5a..5bf033fe7 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -2,6 +2,7 @@ import { getPageServerSideProps } from "@/roboshield/lib/data";
import RichText from "@/roboshield/components/RichText";
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
+import Statistics from "@/roboshield/components/Statistics";
interface ContentType {
title: string;
@@ -11,38 +12,53 @@ interface ContentType {
text: string;
}>;
}>;
+ statistics: Array<{
+ name: string;
+ value: string;
+ label: string;
+ icon: string;
+ description: Array<{
+ type: string;
+ children: Array<{
+ text: string;
+ }>;
+ }>;
+ }>;
}
-export default function About({ title, content }: ContentType) {
+export default function About({ title, content, statistics }: ContentType) {
return (
-
-
- {title}
-
- ({
- mb: "30px",
- "& h2": {
- typography: { xs: "h4", md: "h2" },
- },
- "& p,& a, & li": {
- typography: { xs: "body1", md: "subheading" },
- mb: 2,
- },
- "& a": {
- textDecorationColor: theme.palette.primary.main,
- },
- })}
- />
-
+ <>
+
+
+ {title}
+
+ ({
+ mb: "30px",
+ "& h2": {
+ typography: { xs: "h4", md: "h2" },
+ },
+ "& p,& a, & li": {
+ typography: { xs: "body1", md: "subheading" },
+ mb: 2,
+ },
+ "& a": {
+ textDecorationColor: theme.palette.primary.main,
+ },
+ })}
+ />
+
+
+ >
);
}
@@ -143,6 +159,72 @@ export async function getServerSideProps(context: any) {
],
},
],
+ statistics: [
+ {
+ name: "botsTracked",
+ value: "30+",
+ label: "Bots Tracked",
+ icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ description: [
+ {
+ type: "p",
+ children: [
+ {
+ text: "We tracked more than 40 unique AI bots across all websites scanned.",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "websitesScanned",
+ value: "4000+",
+ label: "Websites Scanned",
+ icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ description: [
+ {
+ type: "p",
+ children: [
+ {
+ text: "We scanned 4626 websites across Africa.",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "websitesBlocking",
+ value: "203",
+ label: "Websites Blocking AI Bots",
+ icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ description: [
+ {
+ type: "p",
+ children: [
+ {
+ text: "Only 203 websites were blocking AI bots.",
+ },
+ ],
+ },
+ ],
+ },
+ {
+ name: "websitesWithRobots",
+ value: "2106",
+ label: "Websites With Robots.txt File",
+ icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ description: [
+ {
+ type: "p",
+ children: [
+ {
+ text: "Only 2106 websites had a robots.txt file.",
+ },
+ ],
+ },
+ ],
+ },
+ ],
},
};
}
From 7c40e0c6b155eede6596bfb835caae4a2f621bc5 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Thu, 27 Jun 2024 16:00:23 +0300
Subject: [PATCH 04/25] FIx richtect types
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../components/Statistics/StatisticCard.tsx | 8 +++----
.../src/components/Statistics/Statistics.tsx | 21 ++++++++-----------
apps/roboshield/src/pages/about.tsx | 8 ++-----
3 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/apps/roboshield/src/components/Statistics/StatisticCard.tsx b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
index 5beb12285..f809e8b3e 100644
--- a/apps/roboshield/src/components/Statistics/StatisticCard.tsx
+++ b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
@@ -2,8 +2,10 @@ import { Figure, RichTypography } from "@commons-ui/next";
import { Card, CardContent, Box } from "@mui/material";
import { styled } from "@mui/material/styles";
import React from "react";
+import type { Children } from "@/roboshield/components/RichText";
import RichText from "@/roboshield/components/RichText";
+import { Statistics } from "./Statistics";
const StatisticCardRoot = styled(Card, {
slot: "Root",
@@ -18,11 +20,9 @@ const StatisticCardRoot = styled(Card, {
width: "332px",
},
}));
-export default function StatisticCard(props: any) {
+export default function StatisticCard(props: Statistics) {
const { icon, label, value, description } = props;
- const imageSrc = icon?.src || icon?.url || icon;
- const imageAlt = icon?.alt || label;
return (
;
- }>;
- }>;
+ statistics: Statistics[];
}
export default function Statistics({ title, statistics }: StatiscticsProps) {
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index 5bf033fe7..b01018fc6 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -3,6 +3,7 @@ import RichText from "@/roboshield/components/RichText";
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
import Statistics from "@/roboshield/components/Statistics";
+import type { Children } from "@/roboshield/components/RichText";
interface ContentType {
title: string;
@@ -17,12 +18,7 @@ interface ContentType {
value: string;
label: string;
icon: string;
- description: Array<{
- type: string;
- children: Array<{
- text: string;
- }>;
- }>;
+ description: Children;
}>;
}
From 73cef82ce4e82b09a06d64dbf9f896c283a3321f Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Thu, 27 Jun 2024 16:35:34 +0300
Subject: [PATCH 05/25] Add content Block
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/payload/blocks/Content.ts | 33 +++++++++++++++++++
.../src/payload/collections/Pages.ts | 3 +-
2 files changed, 35 insertions(+), 1 deletion(-)
create mode 100644 apps/roboshield/src/payload/blocks/Content.ts
diff --git a/apps/roboshield/src/payload/blocks/Content.ts b/apps/roboshield/src/payload/blocks/Content.ts
new file mode 100644
index 000000000..900b73e74
--- /dev/null
+++ b/apps/roboshield/src/payload/blocks/Content.ts
@@ -0,0 +1,33 @@
+import { Block } from "payload/types";
+import { slateEditor } from "@payloadcms/richtext-slate";
+
+export const Content: Block = {
+ slug: "content",
+ labels: {
+ singular: "Content",
+ plural: "Content",
+ },
+ fields: [
+ {
+ name: "content",
+ type: "richText",
+ label: "Content",
+ editor: slateEditor({
+ admin: {
+ elements: [
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "link",
+ "ol",
+ "ul",
+ "indent",
+ ],
+ },
+ }),
+ },
+ ],
+};
diff --git a/apps/roboshield/src/payload/collections/Pages.ts b/apps/roboshield/src/payload/collections/Pages.ts
index e9c31e747..e97b25aca 100644
--- a/apps/roboshield/src/payload/collections/Pages.ts
+++ b/apps/roboshield/src/payload/collections/Pages.ts
@@ -1,6 +1,7 @@
import { CollectionConfig } from "payload/types";
import fullTitle from "../fields/fullTitle";
import slug from "../fields/slug";
+import { Content } from "../blocks/Content";
const Pages: CollectionConfig = {
slug: "pages",
@@ -25,7 +26,7 @@ const Pages: CollectionConfig = {
{
name: "blocks",
type: "blocks",
- blocks: [],
+ blocks: [Content],
localized: true,
admin: {
initCollapsed: true,
From e38b98df13afe1e13f8fb143cbe1a1cf03e48e62 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 11:34:54 +0300
Subject: [PATCH 06/25] Fetch Blocks
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../roboshield/src/lib/data/blockify/index.ts | 37 +++++++++++++++++++
apps/roboshield/src/lib/data/common/index.ts | 22 +++++++++--
apps/roboshield/src/lib/data/local/index.ts | 6 ++-
apps/roboshield/src/lib/data/payload.types.ts | 4 +-
apps/roboshield/src/lib/payload/index.ts | 1 -
5 files changed, 63 insertions(+), 7 deletions(-)
create mode 100644 apps/roboshield/src/lib/data/blockify/index.ts
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
new file mode 100644
index 000000000..4da2bf80e
--- /dev/null
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -0,0 +1,37 @@
+import { Api } from "../payload.types";
+
+type PropsifyBlockFunction = (block: any, api: Api) => Promise;
+
+interface PropsifyBlockBySlug {
+ [key: string]: PropsifyBlockFunction;
+}
+
+const content: PropsifyBlockFunction = async (block: any) => {
+ return {
+ ...block,
+ slug: "content",
+ };
+};
+
+const propsifyBlockBySlug: PropsifyBlockBySlug = {
+ content: content,
+};
+export const blockify = async (blocks: any[], api: Api) => {
+ const promises = blocks?.map(async (block) => {
+ const slug = block.blockType;
+ const propsifyBlock = propsifyBlockBySlug[slug];
+
+ if (propsifyBlock) {
+ return propsifyBlock(block, api);
+ }
+ return {
+ ...block,
+ slug,
+ };
+ });
+
+ if (promises) {
+ return Promise.all(promises);
+ }
+ return blocks ?? null;
+};
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index daa5d7c41..da9326ae9 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -1,5 +1,6 @@
+import { blockify } from "../blockify";
import { Api, MediaData, Settings } from "../payload.types";
-import { AppContext } from "next/app";
+import { GetServerSidePropsContext } from "next";
export function imageFromMedia({ alt = null, url = null }: Partial) {
return { alt, src: url };
@@ -40,7 +41,22 @@ function getFooter(settings: Settings) {
};
}
-export async function getPageProps(api: Api, context: AppContext) {
+export async function getPageProps(
+ api: Api,
+ context: GetServerSidePropsContext,
+) {
+ const { resolvedUrl } = context;
+ const path = resolvedUrl.replace(/^\//, "");
+ const {
+ docs: [page],
+ } = await api.findPage(path);
+
+ if (!page) {
+ return null;
+ }
+
+ const blocks = await blockify(page.blocks, api);
+
const siteSettings: Settings = (await api.findGlobal(
"settings-site",
)) as Settings;
@@ -48,7 +64,7 @@ export async function getPageProps(api: Api, context: AppContext) {
const footer = getFooter(siteSettings);
return {
- blocks: [],
+ blocks,
footer,
navbar,
};
diff --git a/apps/roboshield/src/lib/data/local/index.ts b/apps/roboshield/src/lib/data/local/index.ts
index 9b39e0778..05a2557b8 100644
--- a/apps/roboshield/src/lib/data/local/index.ts
+++ b/apps/roboshield/src/lib/data/local/index.ts
@@ -1,8 +1,10 @@
import { getPageProps } from "@/roboshield/lib/data/common";
import api from "@/roboshield/lib/payload";
-import { AppContext } from "next/app";
+import { GetServerSidePropsContext } from "next";
-export async function getPageServerSideProps(context: AppContext) {
+export async function getPageServerSideProps(
+ context: GetServerSidePropsContext,
+) {
const props = await getPageProps(api, context);
if (!props) {
return { notFound: true };
diff --git a/apps/roboshield/src/lib/data/payload.types.ts b/apps/roboshield/src/lib/data/payload.types.ts
index f6ec878aa..5b93ba462 100644
--- a/apps/roboshield/src/lib/data/payload.types.ts
+++ b/apps/roboshield/src/lib/data/payload.types.ts
@@ -1,3 +1,5 @@
+import { PaginatedDocs } from "payload/database";
+
interface TextNode {
children: TextNode | null;
text?: string;
@@ -105,7 +107,7 @@ export interface Api {
createCollection: (...args: any) => Promise;
deleteCollection: (...args: any) => Promise;
findGlobal: (...args: any) => Promise;
- findPage: (...args: any) => Promise;
+ findPage: (...args: any) => Promise;
getCollection: (...args: any) => Promise;
updateCollection: (...args: any) => Promise;
}
diff --git a/apps/roboshield/src/lib/payload/index.ts b/apps/roboshield/src/lib/payload/index.ts
index d37400192..5f652c91f 100644
--- a/apps/roboshield/src/lib/payload/index.ts
+++ b/apps/roboshield/src/lib/payload/index.ts
@@ -1,5 +1,4 @@
import payload from "payload";
-import { CollectionQuery } from "../data/payload.types";
import { ByIDOptions } from "payload/dist/collections/operations/local/update";
async function findPage(slug: string, options: ByIDOptions) {
From 56cfead43d8f791ae486ba75478fce4f6eca0501 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 12:01:28 +0300
Subject: [PATCH 07/25] Render By Block
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../BlockRenderer/BlockRenderer.tsx | 32 ++
.../src/components/BlockRenderer/index.ts | 3 +
.../src/components/Content/Content.tsx | 36 ++
.../src/components/Content/index.ts | 3 +
apps/roboshield/src/pages/about.tsx | 352 ++++++++----------
5 files changed, 239 insertions(+), 187 deletions(-)
create mode 100644 apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
create mode 100644 apps/roboshield/src/components/BlockRenderer/index.ts
create mode 100644 apps/roboshield/src/components/Content/Content.tsx
create mode 100644 apps/roboshield/src/components/Content/index.ts
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
new file mode 100644
index 000000000..951992075
--- /dev/null
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -0,0 +1,32 @@
+import Content from "../Content";
+
+interface BlockRendererProps {
+ blocks: any[];
+}
+
+interface ComponentMap {
+ content: React.ComponentType;
+}
+interface Block {
+ slug: keyof ComponentMap;
+}
+
+export default function BlockRenderer({ blocks }: BlockRendererProps) {
+ const components: ComponentMap = {
+ content: Content,
+ };
+
+ return (
+ <>
+ {blocks?.map((block, index) => {
+ const Component = components[block.slug];
+
+ if (Component) {
+ return ;
+ }
+
+ return null;
+ })}
+ >
+ );
+}
diff --git a/apps/roboshield/src/components/BlockRenderer/index.ts b/apps/roboshield/src/components/BlockRenderer/index.ts
new file mode 100644
index 000000000..73892c08f
--- /dev/null
+++ b/apps/roboshield/src/components/BlockRenderer/index.ts
@@ -0,0 +1,3 @@
+import BlockRenderer from "./BlockRenderer";
+
+export default BlockRenderer;
diff --git a/apps/roboshield/src/components/Content/Content.tsx b/apps/roboshield/src/components/Content/Content.tsx
new file mode 100644
index 000000000..3286657b5
--- /dev/null
+++ b/apps/roboshield/src/components/Content/Content.tsx
@@ -0,0 +1,36 @@
+import { Section } from "@commons-ui/core";
+import RichText, { Children } from "@/roboshield/components/RichText";
+
+interface ContentProps {
+ content: Children;
+}
+
+export default function Content({ content }: ContentProps) {
+ return (
+
+ ({
+ mb: "30px",
+ "& h2": {
+ typography: { xs: "h4", md: "h2" },
+ },
+ "& p,& a, & li": {
+ typography: { xs: "body1", md: "subheading" },
+ mb: 2,
+ },
+ "& a": {
+ textDecorationColor: theme.palette.primary.main,
+ },
+ })}
+ />
+
+ );
+}
diff --git a/apps/roboshield/src/components/Content/index.ts b/apps/roboshield/src/components/Content/index.ts
new file mode 100644
index 000000000..7238170d4
--- /dev/null
+++ b/apps/roboshield/src/components/Content/index.ts
@@ -0,0 +1,3 @@
+import Content from "./Content";
+
+export default Content;
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index b01018fc6..58da9f882 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -3,6 +3,7 @@ import RichText from "@/roboshield/components/RichText";
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
import Statistics from "@/roboshield/components/Statistics";
+import BlockRenderer from "@/roboshield/components/BlockRenderer";
import type { Children } from "@/roboshield/components/RichText";
interface ContentType {
@@ -22,38 +23,15 @@ interface ContentType {
}>;
}
-export default function About({ title, content, statistics }: ContentType) {
+interface PageProps {
+ title: string;
+ blocks: any[];
+}
+
+export default function About({ title, blocks }: PageProps) {
return (
<>
-
-
- {title}
-
- ({
- mb: "30px",
- "& h2": {
- typography: { xs: "h4", md: "h2" },
- },
- "& p,& a, & li": {
- typography: { xs: "body1", md: "subheading" },
- mb: 2,
- },
- "& a": {
- textDecorationColor: theme.palette.primary.main,
- },
- })}
- />
-
-
+
>
);
}
@@ -64,163 +42,163 @@ export async function getServerSideProps(context: any) {
props: {
...props,
title: "About Page",
- content: [
- {
- type: "h2",
- children: [
- {
- text: "Overview",
- },
- ],
- },
- {
- children: [
- {
- text: "As AI bots become more prevalent, it is crucial for websites to protect their data from unauthorised scraping and crawling by AI bots, which use the scraped data to train their models.",
- },
- ],
- },
- {
- children: [
- {
- text: "We recently analysed a broad range of popular websites across Africa to assess their measures against AI bot activities. The results were alarming, highlighting a significant gap in the security practices of these websites.",
- },
- ],
- },
- {
- type: "h3",
- children: [
- {
- text: "Robots.txt File",
- },
- ],
- },
- {
- children: [
- {
- text: "The robots.txt file is a critical component in guiding search engine bots on which pages to index and which to ignore. Surprisingly, only 45.5% of the websites had implemented a robots.txt file. This leaves more than half of the websites without a fundamental line of defence against unwanted bot activities.",
- },
- ],
- },
- {
- type: "h3",
- children: [
- {
- text: "Blocking AI Bots",
- },
- ],
- },
- {
- children: [
- {
- text: "Only 4.3% of the websites were blocking AI bots. This means 95.7% of websites are potentially vulnerable to unauthorised scraping and crawling by AI bots.",
- },
- ],
- },
- {
- type: "h3",
- children: [
- {
- text: "Aim of Study",
- },
- ],
- },
- {
- children: [
- {
- text: "The principal aim of this study was to determine how frequently African media houses and other top websites were implementing policies to block artificial intelligence (AI) crawlers. Large language models (LLMs) rely on vast amounts of data for training and improvement, often gathered through methodical trawling of web content using crawlers. However, some websites aim to limit how their content is used to train LLMs by blocking these web crawlers.",
- },
- ],
- },
- {
- type: "h3",
- children: [
- {
- text: "Technique Used",
- },
- ],
- },
- {
- children: [
- {
- text: "We examined the robots.txt files of the websites to determine if they were blocking AI bots. The robots.txt file specifies which pages search engine bots can crawl and which they cannot. We checked these files for common AI bot user agents to see if they were being ",
- },
- ],
- },
- {
- children: [
- {
- text: "\n\n",
- },
- ],
- },
- ],
- statistics: [
- {
- name: "botsTracked",
- value: "30+",
- label: "Bots Tracked",
- icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- description: [
- {
- type: "p",
- children: [
- {
- text: "We tracked more than 40 unique AI bots across all websites scanned.",
- },
- ],
- },
- ],
- },
- {
- name: "websitesScanned",
- value: "4000+",
- label: "Websites Scanned",
- icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- description: [
- {
- type: "p",
- children: [
- {
- text: "We scanned 4626 websites across Africa.",
- },
- ],
- },
- ],
- },
- {
- name: "websitesBlocking",
- value: "203",
- label: "Websites Blocking AI Bots",
- icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- description: [
- {
- type: "p",
- children: [
- {
- text: "Only 203 websites were blocking AI bots.",
- },
- ],
- },
- ],
- },
- {
- name: "websitesWithRobots",
- value: "2106",
- label: "Websites With Robots.txt File",
- icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- description: [
- {
- type: "p",
- children: [
- {
- text: "Only 2106 websites had a robots.txt file.",
- },
- ],
- },
- ],
- },
- ],
+ // content: [
+ // {
+ // type: "h2",
+ // children: [
+ // {
+ // text: "Overview",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "As AI bots become more prevalent, it is crucial for websites to protect their data from unauthorised scraping and crawling by AI bots, which use the scraped data to train their models.",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "We recently analysed a broad range of popular websites across Africa to assess their measures against AI bot activities. The results were alarming, highlighting a significant gap in the security practices of these websites.",
+ // },
+ // ],
+ // },
+ // {
+ // type: "h3",
+ // children: [
+ // {
+ // text: "Robots.txt File",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "The robots.txt file is a critical component in guiding search engine bots on which pages to index and which to ignore. Surprisingly, only 45.5% of the websites had implemented a robots.txt file. This leaves more than half of the websites without a fundamental line of defence against unwanted bot activities.",
+ // },
+ // ],
+ // },
+ // {
+ // type: "h3",
+ // children: [
+ // {
+ // text: "Blocking AI Bots",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "Only 4.3% of the websites were blocking AI bots. This means 95.7% of websites are potentially vulnerable to unauthorised scraping and crawling by AI bots.",
+ // },
+ // ],
+ // },
+ // {
+ // type: "h3",
+ // children: [
+ // {
+ // text: "Aim of Study",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "The principal aim of this study was to determine how frequently African media houses and other top websites were implementing policies to block artificial intelligence (AI) crawlers. Large language models (LLMs) rely on vast amounts of data for training and improvement, often gathered through methodical trawling of web content using crawlers. However, some websites aim to limit how their content is used to train LLMs by blocking these web crawlers.",
+ // },
+ // ],
+ // },
+ // {
+ // type: "h3",
+ // children: [
+ // {
+ // text: "Technique Used",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "We examined the robots.txt files of the websites to determine if they were blocking AI bots. The robots.txt file specifies which pages search engine bots can crawl and which they cannot. We checked these files for common AI bot user agents to see if they were being ",
+ // },
+ // ],
+ // },
+ // {
+ // children: [
+ // {
+ // text: "\n\n",
+ // },
+ // ],
+ // },
+ // ],
+ // statistics: [
+ // {
+ // name: "botsTracked",
+ // value: "30+",
+ // label: "Bots Tracked",
+ // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ // description: [
+ // {
+ // type: "p",
+ // children: [
+ // {
+ // text: "We tracked more than 40 unique AI bots across all websites scanned.",
+ // },
+ // ],
+ // },
+ // ],
+ // },
+ // {
+ // name: "websitesScanned",
+ // value: "4000+",
+ // label: "Websites Scanned",
+ // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ // description: [
+ // {
+ // type: "p",
+ // children: [
+ // {
+ // text: "We scanned 4626 websites across Africa.",
+ // },
+ // ],
+ // },
+ // ],
+ // },
+ // {
+ // name: "websitesBlocking",
+ // value: "203",
+ // label: "Websites Blocking AI Bots",
+ // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ // description: [
+ // {
+ // type: "p",
+ // children: [
+ // {
+ // text: "Only 203 websites were blocking AI bots.",
+ // },
+ // ],
+ // },
+ // ],
+ // },
+ // {
+ // name: "websitesWithRobots",
+ // value: "2106",
+ // label: "Websites With Robots.txt File",
+ // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
+ // description: [
+ // {
+ // type: "p",
+ // children: [
+ // {
+ // text: "Only 2106 websites had a robots.txt file.",
+ // },
+ // ],
+ // },
+ // ],
+ // },
+ // ],
},
};
}
From cbcfd6e30c2a69d4012713e969774b56f4f92ad6 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 12:03:10 +0300
Subject: [PATCH 08/25] Remove unused imports
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/pages/about.tsx | 189 +---------------------------
1 file changed, 2 insertions(+), 187 deletions(-)
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index 58da9f882..53ee2d81b 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -1,39 +1,12 @@
import { getPageServerSideProps } from "@/roboshield/lib/data";
-import RichText from "@/roboshield/components/RichText";
-import { Section } from "@commons-ui/core";
-import { RichTypography } from "@commons-ui/next";
-import Statistics from "@/roboshield/components/Statistics";
import BlockRenderer from "@/roboshield/components/BlockRenderer";
-import type { Children } from "@/roboshield/components/RichText";
-
-interface ContentType {
- title: string;
- content: Array<{
- type: string;
- children: Array<{
- text: string;
- }>;
- }>;
- statistics: Array<{
- name: string;
- value: string;
- label: string;
- icon: string;
- description: Children;
- }>;
-}
interface PageProps {
- title: string;
blocks: any[];
}
-export default function About({ title, blocks }: PageProps) {
- return (
- <>
-
- >
- );
+export default function About({ blocks }: PageProps) {
+ return ;
}
export async function getServerSideProps(context: any) {
@@ -41,164 +14,6 @@ export async function getServerSideProps(context: any) {
return {
props: {
...props,
- title: "About Page",
- // content: [
- // {
- // type: "h2",
- // children: [
- // {
- // text: "Overview",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "As AI bots become more prevalent, it is crucial for websites to protect their data from unauthorised scraping and crawling by AI bots, which use the scraped data to train their models.",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "We recently analysed a broad range of popular websites across Africa to assess their measures against AI bot activities. The results were alarming, highlighting a significant gap in the security practices of these websites.",
- // },
- // ],
- // },
- // {
- // type: "h3",
- // children: [
- // {
- // text: "Robots.txt File",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "The robots.txt file is a critical component in guiding search engine bots on which pages to index and which to ignore. Surprisingly, only 45.5% of the websites had implemented a robots.txt file. This leaves more than half of the websites without a fundamental line of defence against unwanted bot activities.",
- // },
- // ],
- // },
- // {
- // type: "h3",
- // children: [
- // {
- // text: "Blocking AI Bots",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "Only 4.3% of the websites were blocking AI bots. This means 95.7% of websites are potentially vulnerable to unauthorised scraping and crawling by AI bots.",
- // },
- // ],
- // },
- // {
- // type: "h3",
- // children: [
- // {
- // text: "Aim of Study",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "The principal aim of this study was to determine how frequently African media houses and other top websites were implementing policies to block artificial intelligence (AI) crawlers. Large language models (LLMs) rely on vast amounts of data for training and improvement, often gathered through methodical trawling of web content using crawlers. However, some websites aim to limit how their content is used to train LLMs by blocking these web crawlers.",
- // },
- // ],
- // },
- // {
- // type: "h3",
- // children: [
- // {
- // text: "Technique Used",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "We examined the robots.txt files of the websites to determine if they were blocking AI bots. The robots.txt file specifies which pages search engine bots can crawl and which they cannot. We checked these files for common AI bot user agents to see if they were being ",
- // },
- // ],
- // },
- // {
- // children: [
- // {
- // text: "\n\n",
- // },
- // ],
- // },
- // ],
- // statistics: [
- // {
- // name: "botsTracked",
- // value: "30+",
- // label: "Bots Tracked",
- // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- // description: [
- // {
- // type: "p",
- // children: [
- // {
- // text: "We tracked more than 40 unique AI bots across all websites scanned.",
- // },
- // ],
- // },
- // ],
- // },
- // {
- // name: "websitesScanned",
- // value: "4000+",
- // label: "Websites Scanned",
- // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- // description: [
- // {
- // type: "p",
- // children: [
- // {
- // text: "We scanned 4626 websites across Africa.",
- // },
- // ],
- // },
- // ],
- // },
- // {
- // name: "websitesBlocking",
- // value: "203",
- // label: "Websites Blocking AI Bots",
- // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- // description: [
- // {
- // type: "p",
- // children: [
- // {
- // text: "Only 203 websites were blocking AI bots.",
- // },
- // ],
- // },
- // ],
- // },
- // {
- // name: "websitesWithRobots",
- // value: "2106",
- // label: "Websites With Robots.txt File",
- // icon: "/images/Type=layout,%20Size=32,%20Color=1020E1.svg",
- // description: [
- // {
- // type: "p",
- // children: [
- // {
- // text: "Only 2106 websites had a robots.txt file.",
- // },
- // ],
- // },
- // ],
- // },
- // ],
},
};
}
From bfc530bf582d57dc9f3dcd6f96832792873d7a0d Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 13:29:48 +0300
Subject: [PATCH 09/25] Use generated types
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/package.json | 3 +-
apps/roboshield/payload-types.ts | 220 ++++++++++++++++++
.../src/components/Footer/Footer.tsx | 4 +-
.../roboshield/src/lib/data/blockify/index.ts | 6 +-
apps/roboshield/src/lib/data/common/index.ts | 29 +--
apps/roboshield/src/lib/data/payload.types.ts | 113 ---------
apps/roboshield/src/lib/payload/index.ts | 42 ++--
7 files changed, 270 insertions(+), 147 deletions(-)
create mode 100644 apps/roboshield/payload-types.ts
delete mode 100644 apps/roboshield/src/lib/data/payload.types.ts
diff --git a/apps/roboshield/package.json b/apps/roboshield/package.json
index 80f220bec..74486c8f6 100644
--- a/apps/roboshield/package.json
+++ b/apps/roboshield/package.json
@@ -11,7 +11,8 @@
"clean": "rm -rf .next .turbo node_modules",
"jest": "jest --passWithNoTests",
"lint-check": "TIMING=1 next lint './'",
- "lint": "TIMING=1 next lint --fix './'"
+ "lint": "TIMING=1 next lint --fix './'",
+ "generate:types": "PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH:-dist/payload.config.js} payload generate:types"
},
"dependencies": {
"@commons-ui/core": "workspace:*",
diff --git a/apps/roboshield/payload-types.ts b/apps/roboshield/payload-types.ts
new file mode 100644
index 000000000..86ef36042
--- /dev/null
+++ b/apps/roboshield/payload-types.ts
@@ -0,0 +1,220 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * This file was automatically generated by Payload.
+ * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
+ * and re-run `payload generate:types` to regenerate this file.
+ */
+
+export interface Config {
+ collections: {
+ media: Media;
+ pages: Page;
+ users: User;
+ 'payload-preferences': PayloadPreference;
+ 'payload-migrations': PayloadMigration;
+ };
+ globals: {
+ 'settings-site': SettingsSite;
+ };
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "media".
+ */
+export interface Media {
+ id: string;
+ alt: string;
+ prefix?: string | null;
+ updatedAt: string;
+ createdAt: string;
+ url?: string | null;
+ filename?: string | null;
+ mimeType?: string | null;
+ filesize?: number | null;
+ width?: number | null;
+ height?: number | null;
+ focalX?: number | null;
+ focalY?: number | null;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "pages".
+ */
+export interface Page {
+ id: string;
+ title: string;
+ fullTitle?: string | null;
+ slug?: string | null;
+ blocks?:
+ | {
+ content?:
+ | {
+ [k: string]: unknown;
+ }[]
+ | null;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: 'content';
+ }[]
+ | null;
+ meta?: {
+ title?: string | null;
+ description?: string | null;
+ image?: string | Media | null;
+ };
+ parent?: (string | null) | Page;
+ breadcrumbs?:
+ | {
+ doc?: (string | null) | Page;
+ url?: string | null;
+ label?: string | null;
+ id?: string | null;
+ }[]
+ | null;
+ updatedAt: string;
+ createdAt: string;
+ _status?: ('draft' | 'published') | null;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "users".
+ */
+export interface User {
+ id: string;
+ firstName: string;
+ lastName: string;
+ roles: ('admin' | 'editor')[];
+ updatedAt: string;
+ createdAt: string;
+ email: string;
+ resetPasswordToken?: string | null;
+ resetPasswordExpiration?: string | null;
+ salt?: string | null;
+ hash?: string | null;
+ _verified?: boolean | null;
+ _verificationToken?: string | null;
+ loginAttempts?: number | null;
+ lockUntil?: string | null;
+ password: string | null;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "payload-preferences".
+ */
+export interface PayloadPreference {
+ id: string;
+ user: {
+ relationTo: 'users';
+ value: string | User;
+ };
+ key?: string | null;
+ value?:
+ | {
+ [k: string]: unknown;
+ }
+ | unknown[]
+ | string
+ | number
+ | boolean
+ | null;
+ updatedAt: string;
+ createdAt: string;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "payload-migrations".
+ */
+export interface PayloadMigration {
+ id: string;
+ name?: string | null;
+ batch?: number | null;
+ updatedAt: string;
+ createdAt: string;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "settings-site".
+ */
+export interface SettingsSite {
+ id: string;
+ title: string;
+ description: {
+ [k: string]: unknown;
+ }[];
+ primaryLogo: string | Media;
+ secondaryLogo?: string | Media | null;
+ primaryNavigation?: {
+ menus?:
+ | {
+ label: string;
+ linkType?: ('custom' | 'internal') | null;
+ doc?: {
+ relationTo: 'pages';
+ value: string | Page;
+ } | null;
+ url?: string | null;
+ href: string;
+ id?: string | null;
+ }[]
+ | null;
+ connect?: ('Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack') | null;
+ };
+ secondaryNavigation?: {
+ menus?:
+ | {
+ label: string;
+ linkType?: ('custom' | 'internal') | null;
+ doc?: {
+ relationTo: 'pages';
+ value: string | Page;
+ } | null;
+ url?: string | null;
+ href: string;
+ id?: string | null;
+ }[]
+ | null;
+ };
+ connect: {
+ title: string;
+ links?:
+ | {
+ platform: 'Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack';
+ url: string;
+ id?: string | null;
+ }[]
+ | null;
+ };
+ newsletter: {
+ title: string;
+ embedCode: string;
+ };
+ initiative: {
+ title: string;
+ description: {
+ [k: string]: unknown;
+ }[];
+ partners?:
+ | {
+ name: string;
+ logo: string | Media;
+ label: string;
+ linkType?: ('custom' | 'internal') | null;
+ doc?: {
+ relationTo: 'pages';
+ value: string | Page;
+ } | null;
+ url?: string | null;
+ href: string;
+ id?: string | null;
+ }[]
+ | null;
+ };
+ updatedAt?: string | null;
+ createdAt?: string | null;
+}
+
+
+declare module 'payload' {
+ export interface GeneratedTypes extends Config {}
+}
\ No newline at end of file
diff --git a/apps/roboshield/src/components/Footer/Footer.tsx b/apps/roboshield/src/components/Footer/Footer.tsx
index b5ee76b4f..d2a6f04be 100644
--- a/apps/roboshield/src/components/Footer/Footer.tsx
+++ b/apps/roboshield/src/components/Footer/Footer.tsx
@@ -8,7 +8,9 @@ import StayInTouch from "@/roboshield/components/StayInTouch";
import RichText from "@/roboshield/components/RichText";
import type { Children } from "@/roboshield/components/RichText";
import FooterDescription from "./FooterDescription";
-import { Partner } from "@/roboshield/lib/data/payload.types";
+import { SettingsSite } from "../../../payload-types";
+
+type Partner = SettingsSite["initiative"]["partners"];
export interface FooterProps {
connect: {
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
index 4da2bf80e..9e01783f4 100644
--- a/apps/roboshield/src/lib/data/blockify/index.ts
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -1,4 +1,4 @@
-import { Api } from "../payload.types";
+import { Api } from "../../payload";
type PropsifyBlockFunction = (block: any, api: Api) => Promise;
@@ -16,8 +16,8 @@ const content: PropsifyBlockFunction = async (block: any) => {
const propsifyBlockBySlug: PropsifyBlockBySlug = {
content: content,
};
-export const blockify = async (blocks: any[], api: Api) => {
- const promises = blocks?.map(async (block) => {
+export const blockify = async (blocks: any, api: Api) => {
+ const promises = blocks?.map(async (block: any) => {
const slug = block.blockType;
const propsifyBlock = propsifyBlockBySlug[slug];
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index da9326ae9..231bb784b 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -1,28 +1,32 @@
import { blockify } from "../blockify";
-import { Api, MediaData, Settings } from "../payload.types";
import { GetServerSidePropsContext } from "next";
+import { SettingsSite } from "../../../../payload-types";
+import { Api } from "../../payload";
-export function imageFromMedia({ alt = null, url = null }: Partial) {
+export function imageFromMedia(alt: string, url: string) {
return { alt, src: url };
}
-function getNavBar(settings: Settings) {
+function getNavBar(settings: SettingsSite) {
const {
connect: { links = [] },
- primaryLogo: media,
- primaryNavigation: { menus = null, connect },
+ primaryLogo,
+ primaryNavigation,
title,
} = settings;
- const socialLinks = links.filter((link) => link.platform === connect);
-
+ const menus = primaryNavigation?.menus;
+ const connect = primaryNavigation?.connect;
+ const socialLinks = links?.filter((link) => link.platform === connect);
+ const primaryLogoUrl =
+ typeof primaryLogo === "string" ? null : primaryLogo.url;
return {
- logo: imageFromMedia({ alt: title, ...media }),
+ logo: imageFromMedia(title, primaryLogoUrl || ""),
menus,
socialLinks,
};
}
-function getFooter(settings: Settings) {
+function getFooter(settings: SettingsSite) {
const {
primaryLogo,
primaryNavigation,
@@ -32,10 +36,11 @@ function getFooter(settings: Settings) {
...footer
} = settings;
const media = secondaryLogo || primaryLogo;
+ const footerLogoUrl = typeof media === "string" ? null : media.url;
return {
...footer,
- logo: imageFromMedia({ alt: title, ...media }),
+ logo: imageFromMedia(title, footerLogoUrl || ""),
primaryMenus: primaryNavigation?.menus || null,
secondaryMenus: secondaryNavigation?.menus || null,
};
@@ -57,9 +62,7 @@ export async function getPageProps(
const blocks = await blockify(page.blocks, api);
- const siteSettings: Settings = (await api.findGlobal(
- "settings-site",
- )) as Settings;
+ const siteSettings = await api.findGlobal("settings-site");
const navbar = getNavBar(siteSettings);
const footer = getFooter(siteSettings);
diff --git a/apps/roboshield/src/lib/data/payload.types.ts b/apps/roboshield/src/lib/data/payload.types.ts
deleted file mode 100644
index 5b93ba462..000000000
--- a/apps/roboshield/src/lib/data/payload.types.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import { PaginatedDocs } from "payload/database";
-
-interface TextNode {
- children: TextNode | null;
- text?: string;
-}
-
-interface BreadCrumbs {
- doc: string;
- url: string;
- label: string;
- id: string;
-}
-
-interface Document {
- id: string;
- title: string;
- fullTitle: string;
- slug: string;
- blocks: any[];
- meta: any;
- breadcrumbs: BreadCrumbs[];
- createdAt: string;
- updatedAt: string;
-}
-
-interface Link {
- label: string;
- linkType: string;
- doc: {
- value: Document;
- };
- relationTo: string;
-}
-
-interface SocialMediaLink {
- platform: string;
- url: string;
- id: string;
-}
-
-interface StayInTouchData {
- title: string;
- links: SocialMediaLink[];
-}
-
-export interface MediaData {
- id: string;
- alt?: string | null;
- prefix: string;
- filename: string;
- mimeType: string;
- filesize: number;
- width: number;
- height: number;
- createdAt: string;
- updatedAt: string;
- url: string | null;
- src: string | null;
-}
-
-export interface Partner {
- logo: MediaData;
- name: string;
- url: string;
-}
-export interface Settings {
- title: string;
- description: TextNode;
- connect: StayInTouchData;
- primaryLogo: MediaData;
- secondaryLogo: MediaData;
- primaryNavigation: {
- menus: Link[];
- connect: string;
- };
- secondaryNavigation: {
- menus: Link[];
- };
- newsletter: {
- title: string;
- embedCode: string;
- };
- initiative: {
- partners: Partner[];
- title: string;
- description: TextNode;
- };
-}
-
-export interface CollectionQuery {
- collection: string;
- depth: number;
- page: number;
- limit: number;
- pagination: boolean;
- where: Record;
- sort: string;
- locale: string;
- fallbackLocale: boolean | string;
- user: string;
- overrideAccess: boolean;
- showHiddenFields: boolean;
-}
-
-export interface Api {
- createCollection: (...args: any) => Promise;
- deleteCollection: (...args: any) => Promise;
- findGlobal: (...args: any) => Promise;
- findPage: (...args: any) => Promise;
- getCollection: (...args: any) => Promise;
- updateCollection: (...args: any) => Promise;
-}
diff --git a/apps/roboshield/src/lib/payload/index.ts b/apps/roboshield/src/lib/payload/index.ts
index 5f652c91f..f13ec4032 100644
--- a/apps/roboshield/src/lib/payload/index.ts
+++ b/apps/roboshield/src/lib/payload/index.ts
@@ -1,12 +1,17 @@
import payload from "payload";
import { ByIDOptions } from "payload/dist/collections/operations/local/update";
+import { Options } from "payload/dist/globals/operations/local/findOne";
+import { SettingsSite, Page, Config } from "../../../payload-types";
+import { PaginatedDocs } from "payload/database";
-async function findPage(slug: string, options: ByIDOptions) {
+export type CollectionConfig = keyof Config["collections"];
+export type CollectionItemTypes = Config["collections"][CollectionConfig];
+export type GlobalConfig = keyof Config["globals"];
+
+async function findPage(slug: string): Promise> {
return payload.find({
- ...options,
collection: "pages",
where: {
- ...(options?.where || {}),
slug: {
equals: slug,
},
@@ -15,9 +20,9 @@ async function findPage(slug: string, options: ByIDOptions) {
}
async function getCollection(
- collection: string,
- options: Partial>,
-) {
+ collection: CollectionConfig,
+ options?: Partial>,
+): Promise> {
return payload.find({
limit: 0,
...options,
@@ -25,7 +30,10 @@ async function getCollection(
});
}
-async function findGlobal(slug: string, options: ByIDOptions) {
+async function findGlobal(
+ slug: GlobalConfig,
+ options?: Partial>,
+): Promise {
return payload.findGlobal({
...options,
slug,
@@ -33,10 +41,10 @@ async function findGlobal(slug: string, options: ByIDOptions) {
}
async function createCollection(
- collection: string,
+ collection: CollectionConfig,
data: any,
- options: Partial>,
-) {
+ options?: Partial>,
+): Promise {
return payload.create({
collection,
data,
@@ -45,9 +53,9 @@ async function createCollection(
}
async function deleteCollection(
- collection: string,
- options: ByIDOptions,
-) {
+ collection: CollectionConfig,
+ options: ByIDOptions,
+): Promise {
return payload.delete({
...options,
collection,
@@ -55,11 +63,11 @@ async function deleteCollection(
}
async function updateCollection(
- collection: string,
+ collection: CollectionConfig,
id: string,
data: any,
- options: ByIDOptions,
-) {
+ options: ByIDOptions,
+): Promise {
const args = {
...options,
collection,
@@ -77,4 +85,6 @@ const api = {
updateCollection,
};
+export type Api = typeof api;
+
export default api;
From f2024123511f73beede4d287181faf9391ed6b02 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 13:44:08 +0300
Subject: [PATCH 10/25] Fix generated types file location
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/package.json | 2 +-
apps/roboshield/payload.config.ts | 21 +++++++++++++------
.../src/components/Footer/Footer.tsx | 2 +-
apps/roboshield/src/lib/data/common/index.ts | 2 +-
.../lib/data/generated-payload-types.ts} | 0
apps/roboshield/src/lib/payload/index.ts | 2 +-
6 files changed, 19 insertions(+), 10 deletions(-)
rename apps/roboshield/{payload-types.ts => src/lib/data/generated-payload-types.ts} (100%)
diff --git a/apps/roboshield/package.json b/apps/roboshield/package.json
index 74486c8f6..7a9dd1f1f 100644
--- a/apps/roboshield/package.json
+++ b/apps/roboshield/package.json
@@ -12,7 +12,7 @@
"jest": "jest --passWithNoTests",
"lint-check": "TIMING=1 next lint './'",
"lint": "TIMING=1 next lint --fix './'",
- "generate:types": "PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH:-dist/payload.config.js} payload generate:types"
+ "generate:types": "payload generate:types"
},
"dependencies": {
"@commons-ui/core": "workspace:*",
diff --git a/apps/roboshield/payload.config.ts b/apps/roboshield/payload.config.ts
index 7bc788338..3704e17da 100644
--- a/apps/roboshield/payload.config.ts
+++ b/apps/roboshield/payload.config.ts
@@ -53,12 +53,12 @@ export default buildConfig({
globals: [Site] as GlobalConfig[],
...(locales?.length
? {
- localization: {
- locales,
- defaultLocale,
- fallback: true,
- },
- }
+ localization: {
+ locales,
+ defaultLocale,
+ fallback: true,
+ },
+ }
: undefined),
admin: {
user: Users.slug,
@@ -114,4 +114,13 @@ export default buildConfig({
}),
] as any[],
telemetry: process?.env?.NODE_ENV !== "production",
+ typescript: {
+ outputFile: path.resolve(
+ __dirname,
+ "src",
+ "lib",
+ "data",
+ "generated-payload-types.ts",
+ ),
+ },
});
diff --git a/apps/roboshield/src/components/Footer/Footer.tsx b/apps/roboshield/src/components/Footer/Footer.tsx
index d2a6f04be..827077859 100644
--- a/apps/roboshield/src/components/Footer/Footer.tsx
+++ b/apps/roboshield/src/components/Footer/Footer.tsx
@@ -8,7 +8,7 @@ import StayInTouch from "@/roboshield/components/StayInTouch";
import RichText from "@/roboshield/components/RichText";
import type { Children } from "@/roboshield/components/RichText";
import FooterDescription from "./FooterDescription";
-import { SettingsSite } from "../../../payload-types";
+import { SettingsSite } from "@/roboshield/lib/data/generated-payload-types";
type Partner = SettingsSite["initiative"]["partners"];
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index 231bb784b..4fa21c524 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -1,7 +1,7 @@
import { blockify } from "../blockify";
import { GetServerSidePropsContext } from "next";
-import { SettingsSite } from "../../../../payload-types";
import { Api } from "../../payload";
+import { SettingsSite } from "../generated-payload-types";
export function imageFromMedia(alt: string, url: string) {
return { alt, src: url };
diff --git a/apps/roboshield/payload-types.ts b/apps/roboshield/src/lib/data/generated-payload-types.ts
similarity index 100%
rename from apps/roboshield/payload-types.ts
rename to apps/roboshield/src/lib/data/generated-payload-types.ts
diff --git a/apps/roboshield/src/lib/payload/index.ts b/apps/roboshield/src/lib/payload/index.ts
index f13ec4032..2ae388832 100644
--- a/apps/roboshield/src/lib/payload/index.ts
+++ b/apps/roboshield/src/lib/payload/index.ts
@@ -1,8 +1,8 @@
import payload from "payload";
import { ByIDOptions } from "payload/dist/collections/operations/local/update";
import { Options } from "payload/dist/globals/operations/local/findOne";
-import { SettingsSite, Page, Config } from "../../../payload-types";
import { PaginatedDocs } from "payload/database";
+import { Config, Page, SettingsSite } from "../data/generated-payload-types";
export type CollectionConfig = keyof Config["collections"];
export type CollectionItemTypes = Config["collections"][CollectionConfig];
From e857803cc3ce742e0d5fe2225c0a2bd972c65fca Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 15:09:39 +0300
Subject: [PATCH 11/25] Add statisctics card
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/payload.config.ts | 12 +--
.../BlockRenderer/BlockRenderer.tsx | 25 +++---
.../components/Statistics/StatisticCard.tsx | 5 +-
.../src/components/Statistics/Statistics.tsx | 1 -
.../roboshield/src/lib/data/blockify/index.ts | 5 +-
.../src/lib/data/generated-payload-types.ts | 80 ++++++++++++-------
.../src/payload/blocks/Statistics.ts | 58 ++++++++++++++
.../src/payload/collections/Pages.ts | 3 +-
8 files changed, 136 insertions(+), 53 deletions(-)
create mode 100644 apps/roboshield/src/payload/blocks/Statistics.ts
diff --git a/apps/roboshield/payload.config.ts b/apps/roboshield/payload.config.ts
index 3704e17da..91514209d 100644
--- a/apps/roboshield/payload.config.ts
+++ b/apps/roboshield/payload.config.ts
@@ -53,12 +53,12 @@ export default buildConfig({
globals: [Site] as GlobalConfig[],
...(locales?.length
? {
- localization: {
- locales,
- defaultLocale,
- fallback: true,
- },
- }
+ localization: {
+ locales,
+ defaultLocale,
+ fallback: true,
+ },
+ }
: undefined),
admin: {
user: Users.slug,
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
index 951992075..d8d6c230f 100644
--- a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -1,25 +1,24 @@
-import Content from "../Content";
+import Content from "@/roboshield/components/Content";
+import Statistics from "@/roboshield/components/Statistics";
+import { Page } from "@/roboshield/lib/data/generated-payload-types";
+type BlockType = Page["blocks"];
interface BlockRendererProps {
- blocks: any[];
+ blocks: BlockType;
}
-interface ComponentMap {
- content: React.ComponentType;
-}
-interface Block {
- slug: keyof ComponentMap;
-}
+const components = {
+ content: Content,
+ statistics: Statistics,
+};
-export default function BlockRenderer({ blocks }: BlockRendererProps) {
- const components: ComponentMap = {
- content: Content,
- };
+type BlockSlug = keyof typeof components;
+export default function BlockRenderer({ blocks }: BlockRendererProps) {
return (
<>
{blocks?.map((block, index) => {
- const Component = components[block.slug];
+ const Component = components[block.blockType as BlockSlug];
if (Component) {
return ;
diff --git a/apps/roboshield/src/components/Statistics/StatisticCard.tsx b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
index f809e8b3e..7e1374b8b 100644
--- a/apps/roboshield/src/components/Statistics/StatisticCard.tsx
+++ b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
@@ -2,7 +2,6 @@ import { Figure, RichTypography } from "@commons-ui/next";
import { Card, CardContent, Box } from "@mui/material";
import { styled } from "@mui/material/styles";
import React from "react";
-import type { Children } from "@/roboshield/components/RichText";
import RichText from "@/roboshield/components/RichText";
import { Statistics } from "./Statistics";
@@ -21,7 +20,7 @@ const StatisticCardRoot = styled(Card, {
},
}));
export default function StatisticCard(props: Statistics) {
- const { icon, label, value, description } = props;
+ const { icon, name, value, description } = props;
return (
@@ -53,7 +52,7 @@ export default function StatisticCard(props: Statistics) {
ml: "0.93rem",
}}
>
- {label}
+ {name}
diff --git a/apps/roboshield/src/components/Statistics/Statistics.tsx b/apps/roboshield/src/components/Statistics/Statistics.tsx
index 7a7b1c8af..bd7790a46 100644
--- a/apps/roboshield/src/components/Statistics/Statistics.tsx
+++ b/apps/roboshield/src/components/Statistics/Statistics.tsx
@@ -7,7 +7,6 @@ import type { Children } from "@/roboshield/components/RichText";
export type Statistics = {
name: string;
value: string;
- label: string;
icon: string;
description: Children;
};
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
index 9e01783f4..0f16f1740 100644
--- a/apps/roboshield/src/lib/data/blockify/index.ts
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -1,4 +1,5 @@
import { Api } from "../../payload";
+import { Page } from "../generated-payload-types";
type PropsifyBlockFunction = (block: any, api: Api) => Promise;
@@ -16,8 +17,8 @@ const content: PropsifyBlockFunction = async (block: any) => {
const propsifyBlockBySlug: PropsifyBlockBySlug = {
content: content,
};
-export const blockify = async (blocks: any, api: Api) => {
- const promises = blocks?.map(async (block: any) => {
+export const blockify = async (blocks: Page["blocks"], api: Api) => {
+ const promises = blocks?.map(async (block) => {
const slug = block.blockType;
const propsifyBlock = propsifyBlockBySlug[slug];
diff --git a/apps/roboshield/src/lib/data/generated-payload-types.ts b/apps/roboshield/src/lib/data/generated-payload-types.ts
index 86ef36042..b861a4cd6 100644
--- a/apps/roboshield/src/lib/data/generated-payload-types.ts
+++ b/apps/roboshield/src/lib/data/generated-payload-types.ts
@@ -11,11 +11,11 @@ export interface Config {
media: Media;
pages: Page;
users: User;
- 'payload-preferences': PayloadPreference;
- 'payload-migrations': PayloadMigration;
+ "payload-preferences": PayloadPreference;
+ "payload-migrations": PayloadMigration;
};
globals: {
- 'settings-site': SettingsSite;
+ "settings-site": SettingsSite;
};
}
/**
@@ -47,16 +47,35 @@ export interface Page {
fullTitle?: string | null;
slug?: string | null;
blocks?:
- | {
- content?:
- | {
- [k: string]: unknown;
- }[]
- | null;
- id?: string | null;
- blockName?: string | null;
- blockType: 'content';
- }[]
+ | (
+ | {
+ content?:
+ | {
+ [k: string]: unknown;
+ }[]
+ | null;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: "content";
+ }
+ | {
+ title: string;
+ statistics?:
+ | {
+ name: string;
+ value: number;
+ description: {
+ [k: string]: unknown;
+ }[];
+ icon?: string | Media | null;
+ id?: string | null;
+ }[]
+ | null;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: "statistics";
+ }
+ )[]
| null;
meta?: {
title?: string | null;
@@ -74,7 +93,7 @@ export interface Page {
| null;
updatedAt: string;
createdAt: string;
- _status?: ('draft' | 'published') | null;
+ _status?: ("draft" | "published") | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@@ -84,7 +103,7 @@ export interface User {
id: string;
firstName: string;
lastName: string;
- roles: ('admin' | 'editor')[];
+ roles: ("admin" | "editor")[];
updatedAt: string;
createdAt: string;
email: string;
@@ -105,7 +124,7 @@ export interface User {
export interface PayloadPreference {
id: string;
user: {
- relationTo: 'users';
+ relationTo: "users";
value: string | User;
};
key?: string | null;
@@ -148,9 +167,9 @@ export interface SettingsSite {
menus?:
| {
label: string;
- linkType?: ('custom' | 'internal') | null;
+ linkType?: ("custom" | "internal") | null;
doc?: {
- relationTo: 'pages';
+ relationTo: "pages";
value: string | Page;
} | null;
url?: string | null;
@@ -158,15 +177,17 @@ export interface SettingsSite {
id?: string | null;
}[]
| null;
- connect?: ('Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack') | null;
+ connect?:
+ | ("Facebook" | "Twitter" | "Instagram" | "Linkedin" | "Github" | "Slack")
+ | null;
};
secondaryNavigation?: {
menus?:
| {
label: string;
- linkType?: ('custom' | 'internal') | null;
+ linkType?: ("custom" | "internal") | null;
doc?: {
- relationTo: 'pages';
+ relationTo: "pages";
value: string | Page;
} | null;
url?: string | null;
@@ -179,7 +200,13 @@ export interface SettingsSite {
title: string;
links?:
| {
- platform: 'Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack';
+ platform:
+ | "Facebook"
+ | "Twitter"
+ | "Instagram"
+ | "Linkedin"
+ | "Github"
+ | "Slack";
url: string;
id?: string | null;
}[]
@@ -199,9 +226,9 @@ export interface SettingsSite {
name: string;
logo: string | Media;
label: string;
- linkType?: ('custom' | 'internal') | null;
+ linkType?: ("custom" | "internal") | null;
doc?: {
- relationTo: 'pages';
+ relationTo: "pages";
value: string | Page;
} | null;
url?: string | null;
@@ -214,7 +241,6 @@ export interface SettingsSite {
createdAt?: string | null;
}
-
-declare module 'payload' {
+declare module "payload" {
export interface GeneratedTypes extends Config {}
-}
\ No newline at end of file
+}
diff --git a/apps/roboshield/src/payload/blocks/Statistics.ts b/apps/roboshield/src/payload/blocks/Statistics.ts
new file mode 100644
index 000000000..70f0fa37c
--- /dev/null
+++ b/apps/roboshield/src/payload/blocks/Statistics.ts
@@ -0,0 +1,58 @@
+import { Block } from "payload/types";
+import image from "../fields/image";
+
+export const Statistics: Block = {
+ slug: "statistics",
+ labels: {
+ singular: "Statistics",
+ plural: "Statistics",
+ },
+ fields: [
+ {
+ name: "title",
+ type: "text",
+ label: "Title",
+ required: true,
+ defaultValue: "Statistics",
+ },
+ {
+ name: "statistics",
+ type: "array",
+ label: "Statistics",
+ labels: {
+ singular: "Statistic",
+ plural: "Statistics",
+ },
+ fields: [
+ {
+ name: "name",
+ type: "text",
+ label: "Name",
+ required: true,
+ },
+ {
+ name: "value",
+ type: "number",
+ label: "Number",
+ required: true,
+ },
+ {
+ name: "description",
+ type: "richText",
+ label: "Description",
+ required: true,
+ },
+ image({
+ overrides: {
+ name: "icon",
+ localized: true,
+ admin: {
+ description:
+ "An icon to represent this statistic. SVG format is recommended.",
+ },
+ },
+ }),
+ ],
+ },
+ ],
+};
diff --git a/apps/roboshield/src/payload/collections/Pages.ts b/apps/roboshield/src/payload/collections/Pages.ts
index e97b25aca..d8ce079e1 100644
--- a/apps/roboshield/src/payload/collections/Pages.ts
+++ b/apps/roboshield/src/payload/collections/Pages.ts
@@ -2,6 +2,7 @@ import { CollectionConfig } from "payload/types";
import fullTitle from "../fields/fullTitle";
import slug from "../fields/slug";
import { Content } from "../blocks/Content";
+import { Statistics } from "../blocks/Statistics";
const Pages: CollectionConfig = {
slug: "pages",
@@ -26,7 +27,7 @@ const Pages: CollectionConfig = {
{
name: "blocks",
type: "blocks",
- blocks: [Content],
+ blocks: [Content, Statistics],
localized: true,
admin: {
initCollapsed: true,
From a66da0469f85cabc2b0a88cfc9eefe1178b644e0 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 16:01:02 +0300
Subject: [PATCH 12/25] Add Page HEader
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../src/assets/images/1920x668px bg - 2 2.png | Bin 0 -> 15008 bytes
.../BlockRenderer/BlockRenderer.tsx | 2 +
.../src/components/PageHeader/PageHeader.tsx | 40 +++++++++++++
.../src/components/PageHeader/index.ts | 0
.../TwoToneBackground/TwoToneBackground.tsx | 55 ++++++++++++++++++
.../src/components/TwoToneBackground/index.ts | 3 +
.../src/lib/data/generated-payload-types.ts | 52 ++++++++---------
apps/roboshield/src/pages/about.tsx | 6 +-
.../src/payload/blocks/PageHeader.ts | 24 ++++++++
.../src/payload/blocks/Statistics.ts | 5 ++
.../src/payload/collections/Pages.ts | 3 +-
11 files changed, 162 insertions(+), 28 deletions(-)
create mode 100644 apps/roboshield/src/assets/images/1920x668px bg - 2 2.png
create mode 100644 apps/roboshield/src/components/PageHeader/PageHeader.tsx
create mode 100644 apps/roboshield/src/components/PageHeader/index.ts
create mode 100644 apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx
create mode 100644 apps/roboshield/src/components/TwoToneBackground/index.ts
create mode 100644 apps/roboshield/src/payload/blocks/PageHeader.ts
diff --git a/apps/roboshield/src/assets/images/1920x668px bg - 2 2.png b/apps/roboshield/src/assets/images/1920x668px bg - 2 2.png
new file mode 100644
index 0000000000000000000000000000000000000000..39c60da93f54a4afae25df35ad88a7b17f539551
GIT binary patch
literal 15008
zcmeHO3s93+7LL|dE$cE}+lul?cRP#Iu9~JTq`Z<^Si
zVg3N&+;a_Iv0UhS-R#q`zvc{6`wi2oY)n6
z8iDXw@AzDSC@%G~zqsP`zKHh_RUJNK_J>tT+xKioAZq9y=7eVvh~R+T;oCpTT%nYp
zzb-rCojYi_Rr=zkcID0PHD`MwO5fhk`66ab{zt0+oP4(anWBp!w|xuZK6oK6@8aO9
zlf#fM|J~P{?xF_&RCOhrd7oSdB^6*MA4rgG45hyMAZ_<_fN2xCkiQduiQOe0J+|0m
zN~5RUI?#`croqoe7+jcXvIO09erT*nBB=us+
z=o%?w*Ah&AbfETL2-IxH&(}VfX_ilFFI_>UdbY_KqvM&TlpyABU;XJR7xmaRYHOhm
zA@v#(YOd!|gA)&kE2yG_^yN1_@kZE|qE6(te00;PP+#FEOLp?;vD!Y8-ZZ6ZQMIk+
zY1zV6P`br5ZoHou`Ol|Di0j~q=g5$_h?m}&rI}K3(M@=sR5T=S`MV(gX+h?Ci=B9m
z4hzR?^M5CoY8ZmrPMwL_CR!COlCedxL13$XX1*(y^wjtLm7y_?JTtgpbRPIXAmj8}avaNQF=mHD
zHMpxhsDco51b#Xw#&5otOGuXdCe?YG%9(;OG5NNBlY$(x&Io2NGm=xYPji^?q__
ze7rf(zy5%@WCKcl+5FuTGA)m
z%q`O84eXamGIu0-b`WKC?+E<5rdnBTUJwzNUCYP#12j7v9UrX-w$L|sT4TUkj)B#S
zXOv(4?&M{rPm~}O%f$Mww@fw-m9YHC#&*E8t7m`7Lt_QVAs)JGrXI3V;;6nrg)$rY
ztHv$<;?4bWzEP~LqV9xnN0Y`v#*t4tS`?6;!s)dS6{cymNc`#@x+Os>#rbl^7H#3@
z1+oO5>E0jHDw>__0ZYB%BU}Ykp-B4VKDI&}E!uz~l#@^ycx+!8HNgM&(mQHS58rZS
zkS$dWX{PRT(OuH|friX1j67=D>-z$i8c7fPNgQ9Wg_|!w6?t*#b$0l;zO2x8bml?l
zkpc@B8FoPCy}m5$9RYddzBwBt2x3ckpq5PS#u6$X+
z+Bx)r1l?hoRVUAplBt3!0d1{HXf#s_)PT)2oNQ73$N5N$7Ih~%`nA6;iTgT%Q_Pi;
z02>2EYoB-G_tPXraLy)ZQPhJQBzT3YxVanT&mT;KyH
z;CCw(?dOU}g2J`dI}=zx6zZ~B_cg%XRT@?-01%8vGY=`lU+8Z>736;-*h&clxe9Hq
zsYB=;eC7lN>S&qKeRUzqdQjL$g}OMpMl?tiR2m9n#beaaEWPMW5Ch=x*<6h7L8eKr
z(M*pqM)N)WWajD7W+GtPwG)H8g_;?Qm#pw?hgfPbC`<~VLJ3nq8K0F*vhC4pHjj><
zbNUXTr*L|$k;xacSF>!=eMNP5u*LE%|duWq=djrSULe7WoU0#x1<@SH${
zG?pWEc1;OL0w8kKDdvc_&D3oKrNA;OF%2;0#1w!aus4>rGgC_Xk;p(rw$*dlEB&_=
z<2_A#6dh|$jGT0#4@81^8Pc;+BMKE{=k)23E+GZz%y87N+^t#jkX9ee#2&EsYhM8n
z;D!kY1)mUEt5qr%P136ylcB{Rq9@Emx6z@pYV+F?BCCC(^3neQK+9HrStGx}1+*p?
z_<%c;)Hq^%Lj!a?a#EaX&}3$zy-m2eg8**wWAijWC=o`MY>1-%@v%>x~n-x;P&J2eZq_oaMT33%|T4L|lb^?s3hL0N@6db3|Pbb;ZZq-&r
z*=Tis%WwLv6Lz78g**6LLY`yF(F&51Yt%}ed=6+X@Bw!wBt^FNzFbNq8CTK6%n(E@s-*PrBKho6Wh|oSV%(
zDOVs6ZZ_wTP26nG&F0)}?#Wrg^&K~xdvq0UHs{h(+-z=XGtpvrvXz_7&1N5)YEd?~
zXrtRuX;+-T?C>j<@lT(mgq6$BIvwh}YZJpD&?~*TRmmPVC;9q42|r~%clWv0Z-SrSyF>na#>%nRUwW&l
zAotcQJJ!6FyOGhc@{2=jb{&$gNnmYYzWCZp`=*ew6-It??|T4-UcF{CQiWG6n_84z@7?BQg`Z>LwArFgaiQ0^!AaaRa3@KwD-G)
zjq;eA8BBbcn#dOBJ@v42tB+S}h>+?OrZbw$R$IM1j7glC!wuNj2W&3Lo4_g-3&49%
zU@^D89jCtBU6ZS|ur>f)h2Qt;qd6BZMTo@6G9P@wQPY(A(}D>D3&+Cwd4OO+(D8
z-GuLC+5!sy3NR~;Jp*g&F+aN&XV#}tjmcX^E23EOmZ=9EwQwcK-Crj{88^I#N+2}F
z%OjYH!3}h3)r1uwaRe*(R_`Byn#JALYVWRg$u&sVI>Qz7#?rQcNbfszzJ;CvcBuK;
zeKrfd%S-D|9We|ObI7AksM*b(9!|Ma_$=C|=6vA9w(=uz3vD|B@_#oRK&J;ZVYVQ>>p9SCP8MVsaN5
zFwEtQhpT`2N=Lq&2ejbqv>Z!UtEL5Hx#Fs$UWVC@ZSpuUo^3?|tg^tngKsIO>9HPE
z6c$R|a!+EN?C-V=Ua5HnXL-Xs9L-}BD0n2?c=Sw)B8WiWX
zM7G0Qw`Z)Ax@$NkNR=A?2BHbi+@VdR4&24l{?)FPmoUz~u>6VccaHe7=Lv5QhCW{!
z!vF}h0KIP`FBB_j$h;Or33|D@Y$SRF>IZchguK4*r|Um%E#B+^!R|lr4X=9dP~Lw5
D2T+A<
literal 0
HcmV?d00001
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
index d8d6c230f..40d36d839 100644
--- a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -1,6 +1,7 @@
import Content from "@/roboshield/components/Content";
import Statistics from "@/roboshield/components/Statistics";
import { Page } from "@/roboshield/lib/data/generated-payload-types";
+import PageHeader from "@/roboshield/components/PageHeader/PageHeader";
type BlockType = Page["blocks"];
interface BlockRendererProps {
@@ -10,6 +11,7 @@ interface BlockRendererProps {
const components = {
content: Content,
statistics: Statistics,
+ "page-header": PageHeader,
};
type BlockSlug = keyof typeof components;
diff --git a/apps/roboshield/src/components/PageHeader/PageHeader.tsx b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
new file mode 100644
index 000000000..488b35ea9
--- /dev/null
+++ b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
@@ -0,0 +1,40 @@
+import { Section } from "@commons-ui/core";
+import { RichTypography } from "@commons-ui/next";
+import TwoToneBackground from "@/roboshield/components/TwoToneBackground";
+
+interface Props {
+ title: string;
+ subtitle: string;
+}
+
+export default function PageHeader({ title, subtitle }: Props) {
+ return (
+ <>
+
+
+
+ {title}
+
+
+ {subtitle}
+
+
+
+ >
+ );
+}
diff --git a/apps/roboshield/src/components/PageHeader/index.ts b/apps/roboshield/src/components/PageHeader/index.ts
new file mode 100644
index 000000000..e69de29bb
diff --git a/apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx b/apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx
new file mode 100644
index 000000000..c28dc3a0c
--- /dev/null
+++ b/apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx
@@ -0,0 +1,55 @@
+import { Box } from "@mui/material";
+import { alpha, styled } from "@mui/material/styles";
+import React from "react";
+
+import bg from "@/roboshield/assets/images/1920x668px bg - 2 2.png";
+
+const TwoToneBackgroundRoot = styled(Box)(({ theme }) => ({
+ display: "flex",
+ justifyContent: "center",
+ width: "100%",
+ position: "relative",
+ backgroundColor: theme.palette.background.main,
+ backgroundImage: `url('${bg.src}')`,
+ backgroundPosition: "top left",
+ "&:before": {
+ content: '""',
+ top: 0,
+ left: 0,
+ position: "absolute",
+ height: "100%",
+ width: "100%",
+ background: `linear-gradient(to right, ${theme.palette.background.main}, transparent 30%)`,
+ [theme.breakpoints.up("sm")]: {
+ background: `linear-gradient(to right, ${theme.palette.background.main} 20%, transparent 30%)`,
+ },
+ [theme.breakpoints.up("md")]: {
+ background: `linear-gradient(to right, ${
+ theme.palette.background.main
+ } 30%, transparent 40%, transparent 95%, ${alpha(
+ theme.palette.background.main,
+ 0.7,
+ )} 98%)`,
+ },
+ [theme.breakpoints.up("lg")]: {
+ background: `linear-gradient(to right, ${theme.palette.background.main} 30%, transparent 40%, transparent 95%, ${theme.palette.background.main} 99%)`,
+ },
+ [theme.breakpoints.up("xl")]: {
+ background: `linear-gradient(to right, ${theme.palette.background.main} 35%, transparent 45%, transparent 80%, ${theme.palette.background.main} 90%)`,
+ },
+ },
+}));
+
+interface Props {
+ children: React.ReactNode;
+ sx: any;
+}
+
+const TwoToneBackground = React.forwardRef(function TwoToneBackground({
+ children,
+ ...props
+}: Props) {
+ return {children};
+});
+
+export default TwoToneBackground;
diff --git a/apps/roboshield/src/components/TwoToneBackground/index.ts b/apps/roboshield/src/components/TwoToneBackground/index.ts
new file mode 100644
index 000000000..6ff8a0d75
--- /dev/null
+++ b/apps/roboshield/src/components/TwoToneBackground/index.ts
@@ -0,0 +1,3 @@
+import TwoToneBackground from "./TwoToneBackground";
+
+export default TwoToneBackground;
diff --git a/apps/roboshield/src/lib/data/generated-payload-types.ts b/apps/roboshield/src/lib/data/generated-payload-types.ts
index b861a4cd6..faddf7462 100644
--- a/apps/roboshield/src/lib/data/generated-payload-types.ts
+++ b/apps/roboshield/src/lib/data/generated-payload-types.ts
@@ -11,11 +11,11 @@ export interface Config {
media: Media;
pages: Page;
users: User;
- "payload-preferences": PayloadPreference;
- "payload-migrations": PayloadMigration;
+ 'payload-preferences': PayloadPreference;
+ 'payload-migrations': PayloadMigration;
};
globals: {
- "settings-site": SettingsSite;
+ 'settings-site': SettingsSite;
};
}
/**
@@ -56,7 +56,7 @@ export interface Page {
| null;
id?: string | null;
blockName?: string | null;
- blockType: "content";
+ blockType: 'content';
}
| {
title: string;
@@ -73,7 +73,14 @@ export interface Page {
| null;
id?: string | null;
blockName?: string | null;
- blockType: "statistics";
+ blockType: 'statistics';
+ }
+ | {
+ title: string;
+ subtitle: string;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: 'page-header';
}
)[]
| null;
@@ -93,7 +100,7 @@ export interface Page {
| null;
updatedAt: string;
createdAt: string;
- _status?: ("draft" | "published") | null;
+ _status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@@ -103,7 +110,7 @@ export interface User {
id: string;
firstName: string;
lastName: string;
- roles: ("admin" | "editor")[];
+ roles: ('admin' | 'editor')[];
updatedAt: string;
createdAt: string;
email: string;
@@ -124,7 +131,7 @@ export interface User {
export interface PayloadPreference {
id: string;
user: {
- relationTo: "users";
+ relationTo: 'users';
value: string | User;
};
key?: string | null;
@@ -167,9 +174,9 @@ export interface SettingsSite {
menus?:
| {
label: string;
- linkType?: ("custom" | "internal") | null;
+ linkType?: ('custom' | 'internal') | null;
doc?: {
- relationTo: "pages";
+ relationTo: 'pages';
value: string | Page;
} | null;
url?: string | null;
@@ -177,17 +184,15 @@ export interface SettingsSite {
id?: string | null;
}[]
| null;
- connect?:
- | ("Facebook" | "Twitter" | "Instagram" | "Linkedin" | "Github" | "Slack")
- | null;
+ connect?: ('Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack') | null;
};
secondaryNavigation?: {
menus?:
| {
label: string;
- linkType?: ("custom" | "internal") | null;
+ linkType?: ('custom' | 'internal') | null;
doc?: {
- relationTo: "pages";
+ relationTo: 'pages';
value: string | Page;
} | null;
url?: string | null;
@@ -200,13 +205,7 @@ export interface SettingsSite {
title: string;
links?:
| {
- platform:
- | "Facebook"
- | "Twitter"
- | "Instagram"
- | "Linkedin"
- | "Github"
- | "Slack";
+ platform: 'Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack';
url: string;
id?: string | null;
}[]
@@ -226,9 +225,9 @@ export interface SettingsSite {
name: string;
logo: string | Media;
label: string;
- linkType?: ("custom" | "internal") | null;
+ linkType?: ('custom' | 'internal') | null;
doc?: {
- relationTo: "pages";
+ relationTo: 'pages';
value: string | Page;
} | null;
url?: string | null;
@@ -241,6 +240,7 @@ export interface SettingsSite {
createdAt?: string | null;
}
-declare module "payload" {
+
+declare module 'payload' {
export interface GeneratedTypes extends Config {}
-}
+}
\ No newline at end of file
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index 53ee2d81b..a2f74e577 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -6,7 +6,11 @@ interface PageProps {
}
export default function About({ blocks }: PageProps) {
- return ;
+ return (
+ <>
+
+ >
+ );
}
export async function getServerSideProps(context: any) {
diff --git a/apps/roboshield/src/payload/blocks/PageHeader.ts b/apps/roboshield/src/payload/blocks/PageHeader.ts
new file mode 100644
index 000000000..b7bd5f1bb
--- /dev/null
+++ b/apps/roboshield/src/payload/blocks/PageHeader.ts
@@ -0,0 +1,24 @@
+import { Block } from "payload/types";
+import { slateEditor } from "@payloadcms/richtext-slate";
+
+export const PageHeader: Block = {
+ slug: "page-header",
+ labels: {
+ singular: "Page Header",
+ plural: "Page Header",
+ },
+ fields: [
+ {
+ name: "title",
+ type: "text",
+ label: "Title",
+ required: true,
+ },
+ {
+ name: "subtitle",
+ type: "text",
+ label: "Subtitle",
+ required: true,
+ },
+ ],
+};
diff --git a/apps/roboshield/src/payload/blocks/Statistics.ts b/apps/roboshield/src/payload/blocks/Statistics.ts
index 70f0fa37c..45e7db7ca 100644
--- a/apps/roboshield/src/payload/blocks/Statistics.ts
+++ b/apps/roboshield/src/payload/blocks/Statistics.ts
@@ -23,6 +23,11 @@ export const Statistics: Block = {
singular: "Statistic",
plural: "Statistics",
},
+ admin: {
+ components: {
+ RowLabel: ({ data }: any) => data.name,
+ },
+ },
fields: [
{
name: "name",
diff --git a/apps/roboshield/src/payload/collections/Pages.ts b/apps/roboshield/src/payload/collections/Pages.ts
index d8ce079e1..610edc0ff 100644
--- a/apps/roboshield/src/payload/collections/Pages.ts
+++ b/apps/roboshield/src/payload/collections/Pages.ts
@@ -3,6 +3,7 @@ import fullTitle from "../fields/fullTitle";
import slug from "../fields/slug";
import { Content } from "../blocks/Content";
import { Statistics } from "../blocks/Statistics";
+import { PageHeader } from "../blocks/PageHeader";
const Pages: CollectionConfig = {
slug: "pages",
@@ -27,7 +28,7 @@ const Pages: CollectionConfig = {
{
name: "blocks",
type: "blocks",
- blocks: [Content, Statistics],
+ blocks: [Content, Statistics, PageHeader],
localized: true,
admin: {
initCollapsed: true,
From f1ab54ae2061aa348687be96b2b7b9c3abb04b8e Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 16:01:02 +0300
Subject: [PATCH 13/25] Add Page HEader
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../src/assets/images/1920x668px bg - 2 2.png | Bin 0 -> 15008 bytes
.../BlockRenderer/BlockRenderer.tsx | 33 +++
.../src/components/PageHeader/PageHeader.tsx | 40 +++
.../src/components/PageHeader/index.ts | 0
.../TwoToneBackground/TwoToneBackground.tsx | 55 ++++
.../src/components/TwoToneBackground/index.ts | 3 +
.../src/lib/data/generated-payload-types.ts | 246 ++++++++++++++++++
apps/roboshield/src/pages/about.tsx | 23 ++
.../src/payload/blocks/PageHeader.ts | 24 ++
.../src/payload/collections/Pages.ts | 2 +-
10 files changed, 425 insertions(+), 1 deletion(-)
create mode 100644 apps/roboshield/src/assets/images/1920x668px bg - 2 2.png
create mode 100644 apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
create mode 100644 apps/roboshield/src/components/PageHeader/PageHeader.tsx
create mode 100644 apps/roboshield/src/components/PageHeader/index.ts
create mode 100644 apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx
create mode 100644 apps/roboshield/src/components/TwoToneBackground/index.ts
create mode 100644 apps/roboshield/src/lib/data/generated-payload-types.ts
create mode 100644 apps/roboshield/src/pages/about.tsx
create mode 100644 apps/roboshield/src/payload/blocks/PageHeader.ts
diff --git a/apps/roboshield/src/assets/images/1920x668px bg - 2 2.png b/apps/roboshield/src/assets/images/1920x668px bg - 2 2.png
new file mode 100644
index 0000000000000000000000000000000000000000..39c60da93f54a4afae25df35ad88a7b17f539551
GIT binary patch
literal 15008
zcmeHO3s93+7LL|dE$cE}+lul?cRP#Iu9~JTq`Z<^Si
zVg3N&+;a_Iv0UhS-R#q`zvc{6`wi2oY)n6
z8iDXw@AzDSC@%G~zqsP`zKHh_RUJNK_J>tT+xKioAZq9y=7eVvh~R+T;oCpTT%nYp
zzb-rCojYi_Rr=zkcID0PHD`MwO5fhk`66ab{zt0+oP4(anWBp!w|xuZK6oK6@8aO9
zlf#fM|J~P{?xF_&RCOhrd7oSdB^6*MA4rgG45hyMAZ_<_fN2xCkiQduiQOe0J+|0m
zN~5RUI?#`croqoe7+jcXvIO09erT*nBB=us+
z=o%?w*Ah&AbfETL2-IxH&(}VfX_ilFFI_>UdbY_KqvM&TlpyABU;XJR7xmaRYHOhm
zA@v#(YOd!|gA)&kE2yG_^yN1_@kZE|qE6(te00;PP+#FEOLp?;vD!Y8-ZZ6ZQMIk+
zY1zV6P`br5ZoHou`Ol|Di0j~q=g5$_h?m}&rI}K3(M@=sR5T=S`MV(gX+h?Ci=B9m
z4hzR?^M5CoY8ZmrPMwL_CR!COlCedxL13$XX1*(y^wjtLm7y_?JTtgpbRPIXAmj8}avaNQF=mHD
zHMpxhsDco51b#Xw#&5otOGuXdCe?YG%9(;OG5NNBlY$(x&Io2NGm=xYPji^?q__
ze7rf(zy5%@WCKcl+5FuTGA)m
z%q`O84eXamGIu0-b`WKC?+E<5rdnBTUJwzNUCYP#12j7v9UrX-w$L|sT4TUkj)B#S
zXOv(4?&M{rPm~}O%f$Mww@fw-m9YHC#&*E8t7m`7Lt_QVAs)JGrXI3V;;6nrg)$rY
ztHv$<;?4bWzEP~LqV9xnN0Y`v#*t4tS`?6;!s)dS6{cymNc`#@x+Os>#rbl^7H#3@
z1+oO5>E0jHDw>__0ZYB%BU}Ykp-B4VKDI&}E!uz~l#@^ycx+!8HNgM&(mQHS58rZS
zkS$dWX{PRT(OuH|friX1j67=D>-z$i8c7fPNgQ9Wg_|!w6?t*#b$0l;zO2x8bml?l
zkpc@B8FoPCy}m5$9RYddzBwBt2x3ckpq5PS#u6$X+
z+Bx)r1l?hoRVUAplBt3!0d1{HXf#s_)PT)2oNQ73$N5N$7Ih~%`nA6;iTgT%Q_Pi;
z02>2EYoB-G_tPXraLy)ZQPhJQBzT3YxVanT&mT;KyH
z;CCw(?dOU}g2J`dI}=zx6zZ~B_cg%XRT@?-01%8vGY=`lU+8Z>736;-*h&clxe9Hq
zsYB=;eC7lN>S&qKeRUzqdQjL$g}OMpMl?tiR2m9n#beaaEWPMW5Ch=x*<6h7L8eKr
z(M*pqM)N)WWajD7W+GtPwG)H8g_;?Qm#pw?hgfPbC`<~VLJ3nq8K0F*vhC4pHjj><
zbNUXTr*L|$k;xacSF>!=eMNP5u*LE%|duWq=djrSULe7WoU0#x1<@SH${
zG?pWEc1;OL0w8kKDdvc_&D3oKrNA;OF%2;0#1w!aus4>rGgC_Xk;p(rw$*dlEB&_=
z<2_A#6dh|$jGT0#4@81^8Pc;+BMKE{=k)23E+GZz%y87N+^t#jkX9ee#2&EsYhM8n
z;D!kY1)mUEt5qr%P136ylcB{Rq9@Emx6z@pYV+F?BCCC(^3neQK+9HrStGx}1+*p?
z_<%c;)Hq^%Lj!a?a#EaX&}3$zy-m2eg8**wWAijWC=o`MY>1-%@v%>x~n-x;P&J2eZq_oaMT33%|T4L|lb^?s3hL0N@6db3|Pbb;ZZq-&r
z*=Tis%WwLv6Lz78g**6LLY`yF(F&51Yt%}ed=6+X@Bw!wBt^FNzFbNq8CTK6%n(E@s-*PrBKho6Wh|oSV%(
zDOVs6ZZ_wTP26nG&F0)}?#Wrg^&K~xdvq0UHs{h(+-z=XGtpvrvXz_7&1N5)YEd?~
zXrtRuX;+-T?C>j<@lT(mgq6$BIvwh}YZJpD&?~*TRmmPVC;9q42|r~%clWv0Z-SrSyF>na#>%nRUwW&l
zAotcQJJ!6FyOGhc@{2=jb{&$gNnmYYzWCZp`=*ew6-It??|T4-UcF{CQiWG6n_84z@7?BQg`Z>LwArFgaiQ0^!AaaRa3@KwD-G)
zjq;eA8BBbcn#dOBJ@v42tB+S}h>+?OrZbw$R$IM1j7glC!wuNj2W&3Lo4_g-3&49%
zU@^D89jCtBU6ZS|ur>f)h2Qt;qd6BZMTo@6G9P@wQPY(A(}D>D3&+Cwd4OO+(D8
z-GuLC+5!sy3NR~;Jp*g&F+aN&XV#}tjmcX^E23EOmZ=9EwQwcK-Crj{88^I#N+2}F
z%OjYH!3}h3)r1uwaRe*(R_`Byn#JALYVWRg$u&sVI>Qz7#?rQcNbfszzJ;CvcBuK;
zeKrfd%S-D|9We|ObI7AksM*b(9!|Ma_$=C|=6vA9w(=uz3vD|B@_#oRK&J;ZVYVQ>>p9SCP8MVsaN5
zFwEtQhpT`2N=Lq&2ejbqv>Z!UtEL5Hx#Fs$UWVC@ZSpuUo^3?|tg^tngKsIO>9HPE
z6c$R|a!+EN?C-V=Ua5HnXL-Xs9L-}BD0n2?c=Sw)B8WiWX
zM7G0Qw`Z)Ax@$NkNR=A?2BHbi+@VdR4&24l{?)FPmoUz~u>6VccaHe7=Lv5QhCW{!
z!vF}h0KIP`FBB_j$h;Or33|D@Y$SRF>IZchguK4*r|Um%E#B+^!R|lr4X=9dP~Lw5
D2T+A<
literal 0
HcmV?d00001
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
new file mode 100644
index 000000000..40d36d839
--- /dev/null
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -0,0 +1,33 @@
+import Content from "@/roboshield/components/Content";
+import Statistics from "@/roboshield/components/Statistics";
+import { Page } from "@/roboshield/lib/data/generated-payload-types";
+import PageHeader from "@/roboshield/components/PageHeader/PageHeader";
+
+type BlockType = Page["blocks"];
+interface BlockRendererProps {
+ blocks: BlockType;
+}
+
+const components = {
+ content: Content,
+ statistics: Statistics,
+ "page-header": PageHeader,
+};
+
+type BlockSlug = keyof typeof components;
+
+export default function BlockRenderer({ blocks }: BlockRendererProps) {
+ return (
+ <>
+ {blocks?.map((block, index) => {
+ const Component = components[block.blockType as BlockSlug];
+
+ if (Component) {
+ return ;
+ }
+
+ return null;
+ })}
+ >
+ );
+}
diff --git a/apps/roboshield/src/components/PageHeader/PageHeader.tsx b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
new file mode 100644
index 000000000..488b35ea9
--- /dev/null
+++ b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
@@ -0,0 +1,40 @@
+import { Section } from "@commons-ui/core";
+import { RichTypography } from "@commons-ui/next";
+import TwoToneBackground from "@/roboshield/components/TwoToneBackground";
+
+interface Props {
+ title: string;
+ subtitle: string;
+}
+
+export default function PageHeader({ title, subtitle }: Props) {
+ return (
+ <>
+
+
+
+ {title}
+
+
+ {subtitle}
+
+
+
+ >
+ );
+}
diff --git a/apps/roboshield/src/components/PageHeader/index.ts b/apps/roboshield/src/components/PageHeader/index.ts
new file mode 100644
index 000000000..e69de29bb
diff --git a/apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx b/apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx
new file mode 100644
index 000000000..c28dc3a0c
--- /dev/null
+++ b/apps/roboshield/src/components/TwoToneBackground/TwoToneBackground.tsx
@@ -0,0 +1,55 @@
+import { Box } from "@mui/material";
+import { alpha, styled } from "@mui/material/styles";
+import React from "react";
+
+import bg from "@/roboshield/assets/images/1920x668px bg - 2 2.png";
+
+const TwoToneBackgroundRoot = styled(Box)(({ theme }) => ({
+ display: "flex",
+ justifyContent: "center",
+ width: "100%",
+ position: "relative",
+ backgroundColor: theme.palette.background.main,
+ backgroundImage: `url('${bg.src}')`,
+ backgroundPosition: "top left",
+ "&:before": {
+ content: '""',
+ top: 0,
+ left: 0,
+ position: "absolute",
+ height: "100%",
+ width: "100%",
+ background: `linear-gradient(to right, ${theme.palette.background.main}, transparent 30%)`,
+ [theme.breakpoints.up("sm")]: {
+ background: `linear-gradient(to right, ${theme.palette.background.main} 20%, transparent 30%)`,
+ },
+ [theme.breakpoints.up("md")]: {
+ background: `linear-gradient(to right, ${
+ theme.palette.background.main
+ } 30%, transparent 40%, transparent 95%, ${alpha(
+ theme.palette.background.main,
+ 0.7,
+ )} 98%)`,
+ },
+ [theme.breakpoints.up("lg")]: {
+ background: `linear-gradient(to right, ${theme.palette.background.main} 30%, transparent 40%, transparent 95%, ${theme.palette.background.main} 99%)`,
+ },
+ [theme.breakpoints.up("xl")]: {
+ background: `linear-gradient(to right, ${theme.palette.background.main} 35%, transparent 45%, transparent 80%, ${theme.palette.background.main} 90%)`,
+ },
+ },
+}));
+
+interface Props {
+ children: React.ReactNode;
+ sx: any;
+}
+
+const TwoToneBackground = React.forwardRef(function TwoToneBackground({
+ children,
+ ...props
+}: Props) {
+ return {children};
+});
+
+export default TwoToneBackground;
diff --git a/apps/roboshield/src/components/TwoToneBackground/index.ts b/apps/roboshield/src/components/TwoToneBackground/index.ts
new file mode 100644
index 000000000..6ff8a0d75
--- /dev/null
+++ b/apps/roboshield/src/components/TwoToneBackground/index.ts
@@ -0,0 +1,3 @@
+import TwoToneBackground from "./TwoToneBackground";
+
+export default TwoToneBackground;
diff --git a/apps/roboshield/src/lib/data/generated-payload-types.ts b/apps/roboshield/src/lib/data/generated-payload-types.ts
new file mode 100644
index 000000000..faddf7462
--- /dev/null
+++ b/apps/roboshield/src/lib/data/generated-payload-types.ts
@@ -0,0 +1,246 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * This file was automatically generated by Payload.
+ * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
+ * and re-run `payload generate:types` to regenerate this file.
+ */
+
+export interface Config {
+ collections: {
+ media: Media;
+ pages: Page;
+ users: User;
+ 'payload-preferences': PayloadPreference;
+ 'payload-migrations': PayloadMigration;
+ };
+ globals: {
+ 'settings-site': SettingsSite;
+ };
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "media".
+ */
+export interface Media {
+ id: string;
+ alt: string;
+ prefix?: string | null;
+ updatedAt: string;
+ createdAt: string;
+ url?: string | null;
+ filename?: string | null;
+ mimeType?: string | null;
+ filesize?: number | null;
+ width?: number | null;
+ height?: number | null;
+ focalX?: number | null;
+ focalY?: number | null;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "pages".
+ */
+export interface Page {
+ id: string;
+ title: string;
+ fullTitle?: string | null;
+ slug?: string | null;
+ blocks?:
+ | (
+ | {
+ content?:
+ | {
+ [k: string]: unknown;
+ }[]
+ | null;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: 'content';
+ }
+ | {
+ title: string;
+ statistics?:
+ | {
+ name: string;
+ value: number;
+ description: {
+ [k: string]: unknown;
+ }[];
+ icon?: string | Media | null;
+ id?: string | null;
+ }[]
+ | null;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: 'statistics';
+ }
+ | {
+ title: string;
+ subtitle: string;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: 'page-header';
+ }
+ )[]
+ | null;
+ meta?: {
+ title?: string | null;
+ description?: string | null;
+ image?: string | Media | null;
+ };
+ parent?: (string | null) | Page;
+ breadcrumbs?:
+ | {
+ doc?: (string | null) | Page;
+ url?: string | null;
+ label?: string | null;
+ id?: string | null;
+ }[]
+ | null;
+ updatedAt: string;
+ createdAt: string;
+ _status?: ('draft' | 'published') | null;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "users".
+ */
+export interface User {
+ id: string;
+ firstName: string;
+ lastName: string;
+ roles: ('admin' | 'editor')[];
+ updatedAt: string;
+ createdAt: string;
+ email: string;
+ resetPasswordToken?: string | null;
+ resetPasswordExpiration?: string | null;
+ salt?: string | null;
+ hash?: string | null;
+ _verified?: boolean | null;
+ _verificationToken?: string | null;
+ loginAttempts?: number | null;
+ lockUntil?: string | null;
+ password: string | null;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "payload-preferences".
+ */
+export interface PayloadPreference {
+ id: string;
+ user: {
+ relationTo: 'users';
+ value: string | User;
+ };
+ key?: string | null;
+ value?:
+ | {
+ [k: string]: unknown;
+ }
+ | unknown[]
+ | string
+ | number
+ | boolean
+ | null;
+ updatedAt: string;
+ createdAt: string;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "payload-migrations".
+ */
+export interface PayloadMigration {
+ id: string;
+ name?: string | null;
+ batch?: number | null;
+ updatedAt: string;
+ createdAt: string;
+}
+/**
+ * This interface was referenced by `Config`'s JSON-Schema
+ * via the `definition` "settings-site".
+ */
+export interface SettingsSite {
+ id: string;
+ title: string;
+ description: {
+ [k: string]: unknown;
+ }[];
+ primaryLogo: string | Media;
+ secondaryLogo?: string | Media | null;
+ primaryNavigation?: {
+ menus?:
+ | {
+ label: string;
+ linkType?: ('custom' | 'internal') | null;
+ doc?: {
+ relationTo: 'pages';
+ value: string | Page;
+ } | null;
+ url?: string | null;
+ href: string;
+ id?: string | null;
+ }[]
+ | null;
+ connect?: ('Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack') | null;
+ };
+ secondaryNavigation?: {
+ menus?:
+ | {
+ label: string;
+ linkType?: ('custom' | 'internal') | null;
+ doc?: {
+ relationTo: 'pages';
+ value: string | Page;
+ } | null;
+ url?: string | null;
+ href: string;
+ id?: string | null;
+ }[]
+ | null;
+ };
+ connect: {
+ title: string;
+ links?:
+ | {
+ platform: 'Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack';
+ url: string;
+ id?: string | null;
+ }[]
+ | null;
+ };
+ newsletter: {
+ title: string;
+ embedCode: string;
+ };
+ initiative: {
+ title: string;
+ description: {
+ [k: string]: unknown;
+ }[];
+ partners?:
+ | {
+ name: string;
+ logo: string | Media;
+ label: string;
+ linkType?: ('custom' | 'internal') | null;
+ doc?: {
+ relationTo: 'pages';
+ value: string | Page;
+ } | null;
+ url?: string | null;
+ href: string;
+ id?: string | null;
+ }[]
+ | null;
+ };
+ updatedAt?: string | null;
+ createdAt?: string | null;
+}
+
+
+declare module 'payload' {
+ export interface GeneratedTypes extends Config {}
+}
\ No newline at end of file
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
new file mode 100644
index 000000000..a2f74e577
--- /dev/null
+++ b/apps/roboshield/src/pages/about.tsx
@@ -0,0 +1,23 @@
+import { getPageServerSideProps } from "@/roboshield/lib/data";
+import BlockRenderer from "@/roboshield/components/BlockRenderer";
+
+interface PageProps {
+ blocks: any[];
+}
+
+export default function About({ blocks }: PageProps) {
+ return (
+ <>
+
+ >
+ );
+}
+
+export async function getServerSideProps(context: any) {
+ const { props } = await getPageServerSideProps(context);
+ return {
+ props: {
+ ...props,
+ },
+ };
+}
diff --git a/apps/roboshield/src/payload/blocks/PageHeader.ts b/apps/roboshield/src/payload/blocks/PageHeader.ts
new file mode 100644
index 000000000..b7bd5f1bb
--- /dev/null
+++ b/apps/roboshield/src/payload/blocks/PageHeader.ts
@@ -0,0 +1,24 @@
+import { Block } from "payload/types";
+import { slateEditor } from "@payloadcms/richtext-slate";
+
+export const PageHeader: Block = {
+ slug: "page-header",
+ labels: {
+ singular: "Page Header",
+ plural: "Page Header",
+ },
+ fields: [
+ {
+ name: "title",
+ type: "text",
+ label: "Title",
+ required: true,
+ },
+ {
+ name: "subtitle",
+ type: "text",
+ label: "Subtitle",
+ required: true,
+ },
+ ],
+};
diff --git a/apps/roboshield/src/payload/collections/Pages.ts b/apps/roboshield/src/payload/collections/Pages.ts
index e9c31e747..64092c309 100644
--- a/apps/roboshield/src/payload/collections/Pages.ts
+++ b/apps/roboshield/src/payload/collections/Pages.ts
@@ -25,7 +25,7 @@ const Pages: CollectionConfig = {
{
name: "blocks",
type: "blocks",
- blocks: [],
+ blocks: [, PageHeader],
localized: true,
admin: {
initCollapsed: true,
From 775585884b55458456871ba50450665bef2cc7e8 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 16:30:46 +0300
Subject: [PATCH 14/25] Remove unnecessary files
---
...ated-payload-types.ts => payload-types.ts} | 43 ++--------
apps/roboshield/payload.config.ts | 12 +--
.../BlockRenderer/BlockRenderer.tsx | 6 +-
.../src/components/Content/Content.tsx | 36 --------
.../src/components/Content/index.ts | 3 -
.../src/components/Footer/Footer.tsx | 2 +-
.../components/Statistics/StatisticCard.tsx | 84 -------------------
.../src/components/Statistics/Statistics.tsx | 51 -----------
.../src/components/Statistics/index.ts | 3 -
apps/roboshield/src/payload/blocks/Content.ts | 33 --------
.../src/payload/blocks/Statistics.ts | 63 --------------
.../src/payload/collections/Pages.ts | 4 +-
12 files changed, 16 insertions(+), 324 deletions(-)
rename apps/roboshield/{src/lib/data/generated-payload-types.ts => payload-types.ts} (83%)
delete mode 100644 apps/roboshield/src/components/Content/Content.tsx
delete mode 100644 apps/roboshield/src/components/Content/index.ts
delete mode 100644 apps/roboshield/src/components/Statistics/StatisticCard.tsx
delete mode 100644 apps/roboshield/src/components/Statistics/Statistics.tsx
delete mode 100644 apps/roboshield/src/components/Statistics/index.ts
delete mode 100644 apps/roboshield/src/payload/blocks/Content.ts
delete mode 100644 apps/roboshield/src/payload/blocks/Statistics.ts
diff --git a/apps/roboshield/src/lib/data/generated-payload-types.ts b/apps/roboshield/payload-types.ts
similarity index 83%
rename from apps/roboshield/src/lib/data/generated-payload-types.ts
rename to apps/roboshield/payload-types.ts
index faddf7462..139a74857 100644
--- a/apps/roboshield/src/lib/data/generated-payload-types.ts
+++ b/apps/roboshield/payload-types.ts
@@ -47,42 +47,13 @@ export interface Page {
fullTitle?: string | null;
slug?: string | null;
blocks?:
- | (
- | {
- content?:
- | {
- [k: string]: unknown;
- }[]
- | null;
- id?: string | null;
- blockName?: string | null;
- blockType: 'content';
- }
- | {
- title: string;
- statistics?:
- | {
- name: string;
- value: number;
- description: {
- [k: string]: unknown;
- }[];
- icon?: string | Media | null;
- id?: string | null;
- }[]
- | null;
- id?: string | null;
- blockName?: string | null;
- blockType: 'statistics';
- }
- | {
- title: string;
- subtitle: string;
- id?: string | null;
- blockName?: string | null;
- blockType: 'page-header';
- }
- )[]
+ | {
+ title: string;
+ subtitle: string;
+ id?: string | null;
+ blockName?: string | null;
+ blockType: 'page-header';
+ }[]
| null;
meta?: {
title?: string | null;
diff --git a/apps/roboshield/payload.config.ts b/apps/roboshield/payload.config.ts
index 7bc788338..bbad36fd9 100644
--- a/apps/roboshield/payload.config.ts
+++ b/apps/roboshield/payload.config.ts
@@ -53,12 +53,12 @@ export default buildConfig({
globals: [Site] as GlobalConfig[],
...(locales?.length
? {
- localization: {
- locales,
- defaultLocale,
- fallback: true,
- },
- }
+ localization: {
+ locales,
+ defaultLocale,
+ fallback: true,
+ },
+ }
: undefined),
admin: {
user: Users.slug,
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
index 40d36d839..14c10f3a5 100644
--- a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -1,7 +1,5 @@
-import Content from "@/roboshield/components/Content";
-import Statistics from "@/roboshield/components/Statistics";
-import { Page } from "@/roboshield/lib/data/generated-payload-types";
import PageHeader from "@/roboshield/components/PageHeader/PageHeader";
+import { Page } from "../../../payload-types";
type BlockType = Page["blocks"];
interface BlockRendererProps {
@@ -9,8 +7,6 @@ interface BlockRendererProps {
}
const components = {
- content: Content,
- statistics: Statistics,
"page-header": PageHeader,
};
diff --git a/apps/roboshield/src/components/Content/Content.tsx b/apps/roboshield/src/components/Content/Content.tsx
deleted file mode 100644
index 3286657b5..000000000
--- a/apps/roboshield/src/components/Content/Content.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Section } from "@commons-ui/core";
-import RichText, { Children } from "@/roboshield/components/RichText";
-
-interface ContentProps {
- content: Children;
-}
-
-export default function Content({ content }: ContentProps) {
- return (
-
- ({
- mb: "30px",
- "& h2": {
- typography: { xs: "h4", md: "h2" },
- },
- "& p,& a, & li": {
- typography: { xs: "body1", md: "subheading" },
- mb: 2,
- },
- "& a": {
- textDecorationColor: theme.palette.primary.main,
- },
- })}
- />
-
- );
-}
diff --git a/apps/roboshield/src/components/Content/index.ts b/apps/roboshield/src/components/Content/index.ts
deleted file mode 100644
index 7238170d4..000000000
--- a/apps/roboshield/src/components/Content/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Content from "./Content";
-
-export default Content;
diff --git a/apps/roboshield/src/components/Footer/Footer.tsx b/apps/roboshield/src/components/Footer/Footer.tsx
index 827077859..d2a6f04be 100644
--- a/apps/roboshield/src/components/Footer/Footer.tsx
+++ b/apps/roboshield/src/components/Footer/Footer.tsx
@@ -8,7 +8,7 @@ import StayInTouch from "@/roboshield/components/StayInTouch";
import RichText from "@/roboshield/components/RichText";
import type { Children } from "@/roboshield/components/RichText";
import FooterDescription from "./FooterDescription";
-import { SettingsSite } from "@/roboshield/lib/data/generated-payload-types";
+import { SettingsSite } from "../../../payload-types";
type Partner = SettingsSite["initiative"]["partners"];
diff --git a/apps/roboshield/src/components/Statistics/StatisticCard.tsx b/apps/roboshield/src/components/Statistics/StatisticCard.tsx
deleted file mode 100644
index 7e1374b8b..000000000
--- a/apps/roboshield/src/components/Statistics/StatisticCard.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-import { Figure, RichTypography } from "@commons-ui/next";
-import { Card, CardContent, Box } from "@mui/material";
-import { styled } from "@mui/material/styles";
-import React from "react";
-
-import RichText from "@/roboshield/components/RichText";
-import { Statistics } from "./Statistics";
-
-const StatisticCardRoot = styled(Card, {
- slot: "Root",
-})(({ theme: { breakpoints } }) => ({
- backgroundColor: "inherit",
- boxShadow: "none",
- width: "100%",
- [breakpoints.up("md")]: {
- width: "326px",
- },
- [breakpoints.up("lg")]: {
- width: "332px",
- },
-}));
-export default function StatisticCard(props: Statistics) {
- const { icon, name, value, description } = props;
-
- return (
-
-
-
-
-
- {name}
-
-
-
-
- {value}
-
-
-
-
- );
-}
diff --git a/apps/roboshield/src/components/Statistics/Statistics.tsx b/apps/roboshield/src/components/Statistics/Statistics.tsx
deleted file mode 100644
index bd7790a46..000000000
--- a/apps/roboshield/src/components/Statistics/Statistics.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import { Box, Grid } from "@mui/material";
-import { Section } from "@commons-ui/core";
-import { RichTypography } from "@commons-ui/next";
-import StatisticCard from "./StatisticCard";
-import type { Children } from "@/roboshield/components/RichText";
-
-export type Statistics = {
- name: string;
- value: string;
- icon: string;
- description: Children;
-};
-export interface StatiscticsProps {
- title: string;
- statistics: Statistics[];
-}
-
-export default function Statistics({ title, statistics }: StatiscticsProps) {
- return (
-
-
- {title && (
-
- {title}
-
- )}
-
- {statistics.map((statistic) => (
-
-
-
- ))}
-
-
-
- );
-}
diff --git a/apps/roboshield/src/components/Statistics/index.ts b/apps/roboshield/src/components/Statistics/index.ts
deleted file mode 100644
index c8bd68afc..000000000
--- a/apps/roboshield/src/components/Statistics/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Statistics from "./Statistics";
-
-export default Statistics;
diff --git a/apps/roboshield/src/payload/blocks/Content.ts b/apps/roboshield/src/payload/blocks/Content.ts
deleted file mode 100644
index 900b73e74..000000000
--- a/apps/roboshield/src/payload/blocks/Content.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { Block } from "payload/types";
-import { slateEditor } from "@payloadcms/richtext-slate";
-
-export const Content: Block = {
- slug: "content",
- labels: {
- singular: "Content",
- plural: "Content",
- },
- fields: [
- {
- name: "content",
- type: "richText",
- label: "Content",
- editor: slateEditor({
- admin: {
- elements: [
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6",
- "link",
- "ol",
- "ul",
- "indent",
- ],
- },
- }),
- },
- ],
-};
diff --git a/apps/roboshield/src/payload/blocks/Statistics.ts b/apps/roboshield/src/payload/blocks/Statistics.ts
deleted file mode 100644
index 45e7db7ca..000000000
--- a/apps/roboshield/src/payload/blocks/Statistics.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { Block } from "payload/types";
-import image from "../fields/image";
-
-export const Statistics: Block = {
- slug: "statistics",
- labels: {
- singular: "Statistics",
- plural: "Statistics",
- },
- fields: [
- {
- name: "title",
- type: "text",
- label: "Title",
- required: true,
- defaultValue: "Statistics",
- },
- {
- name: "statistics",
- type: "array",
- label: "Statistics",
- labels: {
- singular: "Statistic",
- plural: "Statistics",
- },
- admin: {
- components: {
- RowLabel: ({ data }: any) => data.name,
- },
- },
- fields: [
- {
- name: "name",
- type: "text",
- label: "Name",
- required: true,
- },
- {
- name: "value",
- type: "number",
- label: "Number",
- required: true,
- },
- {
- name: "description",
- type: "richText",
- label: "Description",
- required: true,
- },
- image({
- overrides: {
- name: "icon",
- localized: true,
- admin: {
- description:
- "An icon to represent this statistic. SVG format is recommended.",
- },
- },
- }),
- ],
- },
- ],
-};
diff --git a/apps/roboshield/src/payload/collections/Pages.ts b/apps/roboshield/src/payload/collections/Pages.ts
index 68a53d1c9..50c6029dd 100644
--- a/apps/roboshield/src/payload/collections/Pages.ts
+++ b/apps/roboshield/src/payload/collections/Pages.ts
@@ -1,8 +1,6 @@
import { CollectionConfig } from "payload/types";
import fullTitle from "../fields/fullTitle";
import slug from "../fields/slug";
-import { Content } from "../blocks/Content";
-import { Statistics } from "../blocks/Statistics";
import { PageHeader } from "../blocks/PageHeader";
const Pages: CollectionConfig = {
@@ -28,7 +26,7 @@ const Pages: CollectionConfig = {
{
name: "blocks",
type: "blocks",
- blocks: [Content, Statistics, PageHeader, PageHeader],
+ blocks: [PageHeader],
localized: true,
admin: {
initCollapsed: true,
From c91ec0f221e1d51f8ce8fcc02722233957058f91 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 16:40:19 +0300
Subject: [PATCH 15/25] Import correctly
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/lib/data/blockify/index.ts | 2 +-
apps/roboshield/src/lib/data/common/index.ts | 2 +-
apps/roboshield/src/lib/payload/index.ts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
index 0f16f1740..284ec58d0 100644
--- a/apps/roboshield/src/lib/data/blockify/index.ts
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -1,5 +1,5 @@
+import { Page } from "../../../../payload-types";
import { Api } from "../../payload";
-import { Page } from "../generated-payload-types";
type PropsifyBlockFunction = (block: any, api: Api) => Promise;
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index 4fa21c524..844b47f99 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -1,7 +1,7 @@
import { blockify } from "../blockify";
import { GetServerSidePropsContext } from "next";
import { Api } from "../../payload";
-import { SettingsSite } from "../generated-payload-types";
+import { SettingsSite } from "../../../../payload-types";
export function imageFromMedia(alt: string, url: string) {
return { alt, src: url };
diff --git a/apps/roboshield/src/lib/payload/index.ts b/apps/roboshield/src/lib/payload/index.ts
index 2ae388832..242ce15cc 100644
--- a/apps/roboshield/src/lib/payload/index.ts
+++ b/apps/roboshield/src/lib/payload/index.ts
@@ -2,7 +2,7 @@ import payload from "payload";
import { ByIDOptions } from "payload/dist/collections/operations/local/update";
import { Options } from "payload/dist/globals/operations/local/findOne";
import { PaginatedDocs } from "payload/database";
-import { Config, Page, SettingsSite } from "../data/generated-payload-types";
+import { Config, Page, SettingsSite } from "../../../payload-types";
export type CollectionConfig = keyof Config["collections"];
export type CollectionItemTypes = Config["collections"][CollectionConfig];
From 5c1d8db2a535d57939943a7b28b2a36ce7002ed3 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 17:43:48 +0300
Subject: [PATCH 16/25] Strongly typed blocks
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../src/components/PageHeader/PageHeader.tsx | 9 +++++-
.../roboshield/src/lib/data/blockify/index.ts | 30 ++++++++++++++-----
apps/roboshield/src/lib/payload/index.ts | 2 +-
apps/roboshield/src/utils/blocks.ts | 1 +
4 files changed, 32 insertions(+), 10 deletions(-)
create mode 100644 apps/roboshield/src/utils/blocks.ts
diff --git a/apps/roboshield/src/components/PageHeader/PageHeader.tsx b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
index 488b35ea9..4fe744d55 100644
--- a/apps/roboshield/src/components/PageHeader/PageHeader.tsx
+++ b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
@@ -1,13 +1,20 @@
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
import TwoToneBackground from "@/roboshield/components/TwoToneBackground";
+import { Page } from "../../../payload-types";
+import { ExtractBlockType } from "@/roboshield/utils/blocks";
interface Props {
title: string;
subtitle: string;
}
-export default function PageHeader({ title, subtitle }: Props) {
+type PageHeaderProps = ExtractBlockType<
+ NonNullable[number],
+ "page-header"
+>;
+
+export default function PageHeader({ title, subtitle }: PageHeaderProps) {
return (
<>
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
index 284ec58d0..a87344514 100644
--- a/apps/roboshield/src/lib/data/blockify/index.ts
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -1,25 +1,39 @@
import { Page } from "../../../../payload-types";
+import { ExtractBlockType } from "@/roboshield/utils/blocks";
import { Api } from "../../payload";
-type PropsifyBlockFunction = (block: any, api: Api) => Promise;
+type PropsifyBlockFunction = (
+ block: T,
+ api: Api,
+) => Promise;
-interface PropsifyBlockBySlug {
- [key: string]: PropsifyBlockFunction;
-}
+type PropsifyBlockBySlug = {
+ [K in NonNullable<
+ Page["blocks"]
+ >[number]["blockType"]]?: PropsifyBlockFunction<
+ ExtractBlockType[number], K>
+ >;
+};
-const content: PropsifyBlockFunction = async (block: any) => {
+const pageHeader: PropsifyBlockFunction<
+ ExtractBlockType[number], "page-header">
+> = async (block, api) => {
+ // some block specific computation, i.e using api
return {
...block,
- slug: "content",
+ slug: "page-header",
};
};
const propsifyBlockBySlug: PropsifyBlockBySlug = {
- content: content,
+ "page-header": pageHeader,
};
+
export const blockify = async (blocks: Page["blocks"], api: Api) => {
const promises = blocks?.map(async (block) => {
- const slug = block.blockType;
+ const slug = block.blockType as NonNullable<
+ Page["blocks"]
+ >[number]["blockType"];
const propsifyBlock = propsifyBlockBySlug[slug];
if (propsifyBlock) {
diff --git a/apps/roboshield/src/lib/payload/index.ts b/apps/roboshield/src/lib/payload/index.ts
index 242ce15cc..a564f1bfc 100644
--- a/apps/roboshield/src/lib/payload/index.ts
+++ b/apps/roboshield/src/lib/payload/index.ts
@@ -66,7 +66,7 @@ async function updateCollection(
collection: CollectionConfig,
id: string,
data: any,
- options: ByIDOptions,
+ options?: ByIDOptions,
): Promise {
const args = {
...options,
diff --git a/apps/roboshield/src/utils/blocks.ts b/apps/roboshield/src/utils/blocks.ts
new file mode 100644
index 000000000..e2863cd6d
--- /dev/null
+++ b/apps/roboshield/src/utils/blocks.ts
@@ -0,0 +1 @@
+export type ExtractBlockType = T extends { blockType: U } ? T : never;
From 70bf62a9a3b53426998b89681db58d902149790c Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 17:53:25 +0300
Subject: [PATCH 17/25] cleanup
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../public/images/Type=layout, Size=32, Color=1020E1.svg | 5 -----
.../src/components/BlockRenderer/BlockRenderer.tsx | 2 +-
apps/roboshield/src/components/Footer/Footer.tsx | 2 +-
apps/roboshield/src/components/PageHeader/PageHeader.tsx | 7 +------
apps/roboshield/src/components/PageHeader/index.ts | 3 +++
apps/roboshield/src/lib/data/blockify/index.ts | 2 +-
apps/roboshield/src/lib/data/common/index.ts | 2 +-
apps/roboshield/src/lib/payload/index.ts | 2 +-
apps/roboshield/src/payload/blocks/PageHeader.ts | 1 -
apps/roboshield/tsconfig.json | 3 ++-
10 files changed, 11 insertions(+), 18 deletions(-)
delete mode 100644 apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg
diff --git a/apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg b/apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg
deleted file mode 100644
index b36cc2427..000000000
--- a/apps/roboshield/public/images/Type=layout, Size=32, Color=1020E1.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
index 14c10f3a5..b18531da2 100644
--- a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -1,5 +1,5 @@
import PageHeader from "@/roboshield/components/PageHeader/PageHeader";
-import { Page } from "../../../payload-types";
+import { Page } from "@/root/payload-types";
type BlockType = Page["blocks"];
interface BlockRendererProps {
diff --git a/apps/roboshield/src/components/Footer/Footer.tsx b/apps/roboshield/src/components/Footer/Footer.tsx
index d2a6f04be..c3f5d6848 100644
--- a/apps/roboshield/src/components/Footer/Footer.tsx
+++ b/apps/roboshield/src/components/Footer/Footer.tsx
@@ -8,7 +8,7 @@ import StayInTouch from "@/roboshield/components/StayInTouch";
import RichText from "@/roboshield/components/RichText";
import type { Children } from "@/roboshield/components/RichText";
import FooterDescription from "./FooterDescription";
-import { SettingsSite } from "../../../payload-types";
+import { SettingsSite } from "@/root/payload-types";
type Partner = SettingsSite["initiative"]["partners"];
diff --git a/apps/roboshield/src/components/PageHeader/PageHeader.tsx b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
index 4fe744d55..6b36716fa 100644
--- a/apps/roboshield/src/components/PageHeader/PageHeader.tsx
+++ b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
@@ -1,14 +1,9 @@
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
import TwoToneBackground from "@/roboshield/components/TwoToneBackground";
-import { Page } from "../../../payload-types";
+import { Page } from "@/root/payload-types";
import { ExtractBlockType } from "@/roboshield/utils/blocks";
-interface Props {
- title: string;
- subtitle: string;
-}
-
type PageHeaderProps = ExtractBlockType<
NonNullable[number],
"page-header"
diff --git a/apps/roboshield/src/components/PageHeader/index.ts b/apps/roboshield/src/components/PageHeader/index.ts
index e69de29bb..b294687a4 100644
--- a/apps/roboshield/src/components/PageHeader/index.ts
+++ b/apps/roboshield/src/components/PageHeader/index.ts
@@ -0,0 +1,3 @@
+import PageHeader from "./PageHeader";
+
+export default PageHeader;
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
index a87344514..ba3b8a529 100644
--- a/apps/roboshield/src/lib/data/blockify/index.ts
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -1,4 +1,4 @@
-import { Page } from "../../../../payload-types";
+import { Page } from "@/root/payload-types";
import { ExtractBlockType } from "@/roboshield/utils/blocks";
import { Api } from "../../payload";
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index 844b47f99..67d23cef2 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -1,7 +1,7 @@
import { blockify } from "../blockify";
import { GetServerSidePropsContext } from "next";
import { Api } from "../../payload";
-import { SettingsSite } from "../../../../payload-types";
+import { SettingsSite } from "@/root/payload-types";
export function imageFromMedia(alt: string, url: string) {
return { alt, src: url };
diff --git a/apps/roboshield/src/lib/payload/index.ts b/apps/roboshield/src/lib/payload/index.ts
index a564f1bfc..30216832d 100644
--- a/apps/roboshield/src/lib/payload/index.ts
+++ b/apps/roboshield/src/lib/payload/index.ts
@@ -2,7 +2,7 @@ import payload from "payload";
import { ByIDOptions } from "payload/dist/collections/operations/local/update";
import { Options } from "payload/dist/globals/operations/local/findOne";
import { PaginatedDocs } from "payload/database";
-import { Config, Page, SettingsSite } from "../../../payload-types";
+import { Config, Page, SettingsSite } from "@/root/payload-types";
export type CollectionConfig = keyof Config["collections"];
export type CollectionItemTypes = Config["collections"][CollectionConfig];
diff --git a/apps/roboshield/src/payload/blocks/PageHeader.ts b/apps/roboshield/src/payload/blocks/PageHeader.ts
index b7bd5f1bb..b8a6a688f 100644
--- a/apps/roboshield/src/payload/blocks/PageHeader.ts
+++ b/apps/roboshield/src/payload/blocks/PageHeader.ts
@@ -1,5 +1,4 @@
import { Block } from "payload/types";
-import { slateEditor } from "@payloadcms/richtext-slate";
export const PageHeader: Block = {
slug: "page-header",
diff --git a/apps/roboshield/tsconfig.json b/apps/roboshield/tsconfig.json
index f90fae451..eb2f2f483 100644
--- a/apps/roboshield/tsconfig.json
+++ b/apps/roboshield/tsconfig.json
@@ -20,7 +20,8 @@
"paths": {
"@/roboshield/*": ["./src/*"],
"@/commons-ui/core/*": ["../../packages/commons-ui-core/src/*"],
- "@/commons-ui/next/*": ["../../packages/commons-ui-next/src/*"]
+ "@/commons-ui/next/*": ["../../packages/commons-ui-next/src/*"],
+ "@/root/*": ["./*"]
}
},
"include": [
From 6331c760a19e91a02ce46662fb931a94683b13d5 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 17:56:35 +0300
Subject: [PATCH 18/25] FixFormarting
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/payload-types.ts | 43 +++++++++++++++++------------
apps/roboshield/payload.config.ts | 12 ++++----
apps/roboshield/src/pages/about.tsx | 5 +++-
3 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/apps/roboshield/payload-types.ts b/apps/roboshield/payload-types.ts
index 139a74857..0251bfb07 100644
--- a/apps/roboshield/payload-types.ts
+++ b/apps/roboshield/payload-types.ts
@@ -11,11 +11,11 @@ export interface Config {
media: Media;
pages: Page;
users: User;
- 'payload-preferences': PayloadPreference;
- 'payload-migrations': PayloadMigration;
+ "payload-preferences": PayloadPreference;
+ "payload-migrations": PayloadMigration;
};
globals: {
- 'settings-site': SettingsSite;
+ "settings-site": SettingsSite;
};
}
/**
@@ -52,7 +52,7 @@ export interface Page {
subtitle: string;
id?: string | null;
blockName?: string | null;
- blockType: 'page-header';
+ blockType: "page-header";
}[]
| null;
meta?: {
@@ -71,7 +71,7 @@ export interface Page {
| null;
updatedAt: string;
createdAt: string;
- _status?: ('draft' | 'published') | null;
+ _status?: ("draft" | "published") | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@@ -81,7 +81,7 @@ export interface User {
id: string;
firstName: string;
lastName: string;
- roles: ('admin' | 'editor')[];
+ roles: ("admin" | "editor")[];
updatedAt: string;
createdAt: string;
email: string;
@@ -102,7 +102,7 @@ export interface User {
export interface PayloadPreference {
id: string;
user: {
- relationTo: 'users';
+ relationTo: "users";
value: string | User;
};
key?: string | null;
@@ -145,9 +145,9 @@ export interface SettingsSite {
menus?:
| {
label: string;
- linkType?: ('custom' | 'internal') | null;
+ linkType?: ("custom" | "internal") | null;
doc?: {
- relationTo: 'pages';
+ relationTo: "pages";
value: string | Page;
} | null;
url?: string | null;
@@ -155,15 +155,17 @@ export interface SettingsSite {
id?: string | null;
}[]
| null;
- connect?: ('Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack') | null;
+ connect?:
+ | ("Facebook" | "Twitter" | "Instagram" | "Linkedin" | "Github" | "Slack")
+ | null;
};
secondaryNavigation?: {
menus?:
| {
label: string;
- linkType?: ('custom' | 'internal') | null;
+ linkType?: ("custom" | "internal") | null;
doc?: {
- relationTo: 'pages';
+ relationTo: "pages";
value: string | Page;
} | null;
url?: string | null;
@@ -176,7 +178,13 @@ export interface SettingsSite {
title: string;
links?:
| {
- platform: 'Facebook' | 'Twitter' | 'Instagram' | 'Linkedin' | 'Github' | 'Slack';
+ platform:
+ | "Facebook"
+ | "Twitter"
+ | "Instagram"
+ | "Linkedin"
+ | "Github"
+ | "Slack";
url: string;
id?: string | null;
}[]
@@ -196,9 +204,9 @@ export interface SettingsSite {
name: string;
logo: string | Media;
label: string;
- linkType?: ('custom' | 'internal') | null;
+ linkType?: ("custom" | "internal") | null;
doc?: {
- relationTo: 'pages';
+ relationTo: "pages";
value: string | Page;
} | null;
url?: string | null;
@@ -211,7 +219,6 @@ export interface SettingsSite {
createdAt?: string | null;
}
-
-declare module 'payload' {
+declare module "payload" {
export interface GeneratedTypes extends Config {}
-}
\ No newline at end of file
+}
diff --git a/apps/roboshield/payload.config.ts b/apps/roboshield/payload.config.ts
index bbad36fd9..7bc788338 100644
--- a/apps/roboshield/payload.config.ts
+++ b/apps/roboshield/payload.config.ts
@@ -53,12 +53,12 @@ export default buildConfig({
globals: [Site] as GlobalConfig[],
...(locales?.length
? {
- localization: {
- locales,
- defaultLocale,
- fallback: true,
- },
- }
+ localization: {
+ locales,
+ defaultLocale,
+ fallback: true,
+ },
+ }
: undefined),
admin: {
user: Users.slug,
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index a2f74e577..e1c2ec1e7 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -1,8 +1,11 @@
import { getPageServerSideProps } from "@/roboshield/lib/data";
import BlockRenderer from "@/roboshield/components/BlockRenderer";
+import { Page } from "@/root/payload-types";
+
+type BlockType = Page["blocks"];
interface PageProps {
- blocks: any[];
+ blocks: BlockType;
}
export default function About({ blocks }: PageProps) {
From 19178f9756ab8992c78042b0e04526b716cfca36 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 18:17:10 +0300
Subject: [PATCH 19/25] Misc fixes
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/lib/data/blockify/index.ts | 2 +-
apps/roboshield/src/lib/data/common/index.ts | 2 +-
apps/roboshield/src/utils/blocks.ts | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/apps/roboshield/src/lib/data/blockify/index.ts b/apps/roboshield/src/lib/data/blockify/index.ts
index ba3b8a529..6b18ff40c 100644
--- a/apps/roboshield/src/lib/data/blockify/index.ts
+++ b/apps/roboshield/src/lib/data/blockify/index.ts
@@ -1,6 +1,6 @@
import { Page } from "@/root/payload-types";
import { ExtractBlockType } from "@/roboshield/utils/blocks";
-import { Api } from "../../payload";
+import { Api } from "@/roboshield/lib/payload";
type PropsifyBlockFunction = (
block: T,
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index 67d23cef2..350d3a8b0 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -1,6 +1,6 @@
import { blockify } from "../blockify";
import { GetServerSidePropsContext } from "next";
-import { Api } from "../../payload";
+import { Api } from "@/roboshield/lib/payload";
import { SettingsSite } from "@/root/payload-types";
export function imageFromMedia(alt: string, url: string) {
diff --git a/apps/roboshield/src/utils/blocks.ts b/apps/roboshield/src/utils/blocks.ts
index e2863cd6d..2c114c59a 100644
--- a/apps/roboshield/src/utils/blocks.ts
+++ b/apps/roboshield/src/utils/blocks.ts
@@ -1 +1,2 @@
+// Utility type to extract block type
export type ExtractBlockType = T extends { blockType: U } ? T : never;
From dc40e7b559d6e41b34ce91a85ec9ac57f8645b40 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 18:24:04 +0300
Subject: [PATCH 20/25] Resolve homepage not loading
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/lib/data/common/index.ts | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/apps/roboshield/src/lib/data/common/index.ts b/apps/roboshield/src/lib/data/common/index.ts
index 350d3a8b0..d5e19abc9 100644
--- a/apps/roboshield/src/lib/data/common/index.ts
+++ b/apps/roboshield/src/lib/data/common/index.ts
@@ -51,7 +51,12 @@ export async function getPageProps(
context: GetServerSidePropsContext,
) {
const { resolvedUrl } = context;
- const path = resolvedUrl.replace(/^\//, "");
+ let path;
+ if (resolvedUrl === "/" || resolvedUrl === "") {
+ path = "index";
+ } else {
+ path = resolvedUrl.replace(/^\//, "");
+ }
const {
docs: [page],
} = await api.findPage(path);
From b749786c5f57ee9af8e8a42504a741214d3ff0ee Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 19:32:32 +0300
Subject: [PATCH 21/25] Fix failing builds
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/codeforafrica/payload.config.ts | 3 +
apps/roboshield/package.json | 2 +-
.../src/components/PageHeader/PageHeader.tsx | 2 +-
.../TwoToneBackground/TwoToneBackground.tsx | 16 +-
apps/roboshield/src/theme/index.ts | 10 +-
pnpm-lock.yaml | 391 ++++++++++++++----
6 files changed, 325 insertions(+), 99 deletions(-)
diff --git a/apps/codeforafrica/payload.config.ts b/apps/codeforafrica/payload.config.ts
index bae5c65c6..2b6ca15b2 100644
--- a/apps/codeforafrica/payload.config.ts
+++ b/apps/codeforafrica/payload.config.ts
@@ -147,4 +147,7 @@ export default buildConfig({
}),
] as any[],
telemetry: process?.env?.NODE_ENV !== "production",
+ typescript: {
+ declare: false,
+ },
});
diff --git a/apps/roboshield/package.json b/apps/roboshield/package.json
index 7a9dd1f1f..4990b18a1 100644
--- a/apps/roboshield/package.json
+++ b/apps/roboshield/package.json
@@ -71,6 +71,6 @@
"jest-config-commons-ui": "workspace:*",
"prettier": "3.1.1",
"ts-node": "^10.9.2",
- "typescript": "^5.5.2"
+ "typescript": "5.4.5"
}
}
diff --git a/apps/roboshield/src/components/PageHeader/PageHeader.tsx b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
index 6b36716fa..c856793b0 100644
--- a/apps/roboshield/src/components/PageHeader/PageHeader.tsx
+++ b/apps/roboshield/src/components/PageHeader/PageHeader.tsx
@@ -12,7 +12,7 @@ type PageHeaderProps = ExtractBlockType<
export default function PageHeader({ title, subtitle }: PageHeaderProps) {
return (
<>
-
+
({
justifyContent: "center",
width: "100%",
position: "relative",
- backgroundColor: theme.palette.background.main,
+ backgroundColor: theme.palette.background.default,
backgroundImage: `url('${bg.src}')`,
backgroundPosition: "top left",
"&:before": {
@@ -19,23 +19,23 @@ const TwoToneBackgroundRoot = styled(Box)(({ theme }) => ({
position: "absolute",
height: "100%",
width: "100%",
- background: `linear-gradient(to right, ${theme.palette.background.main}, transparent 30%)`,
+ background: `linear-gradient(to right, ${theme.palette.background.default}, transparent 30%)`,
[theme.breakpoints.up("sm")]: {
- background: `linear-gradient(to right, ${theme.palette.background.main} 20%, transparent 30%)`,
+ background: `linear-gradient(to right, ${theme.palette.background.default} 20%, transparent 30%)`,
},
[theme.breakpoints.up("md")]: {
background: `linear-gradient(to right, ${
- theme.palette.background.main
+ theme.palette.background.default
} 30%, transparent 40%, transparent 95%, ${alpha(
- theme.palette.background.main,
+ theme.palette.background.default,
0.7,
)} 98%)`,
},
[theme.breakpoints.up("lg")]: {
- background: `linear-gradient(to right, ${theme.palette.background.main} 30%, transparent 40%, transparent 95%, ${theme.palette.background.main} 99%)`,
+ background: `linear-gradient(to right, ${theme.palette.background.default} 30%, transparent 40%, transparent 95%, ${theme.palette.background.default} 99%)`,
},
[theme.breakpoints.up("xl")]: {
- background: `linear-gradient(to right, ${theme.palette.background.main} 35%, transparent 45%, transparent 80%, ${theme.palette.background.main} 90%)`,
+ background: `linear-gradient(to right, ${theme.palette.background.default} 35%, transparent 45%, transparent 80%, ${theme.palette.background.default} 90%)`,
},
},
}));
diff --git a/apps/roboshield/src/theme/index.ts b/apps/roboshield/src/theme/index.ts
index 3e8d87c22..af44098ea 100644
--- a/apps/roboshield/src/theme/index.ts
+++ b/apps/roboshield/src/theme/index.ts
@@ -22,7 +22,7 @@ const palette = {
grey: { main: "#B4ABAB", light: "#E3DFDF" },
text: { primary: "#000000", secondary: "#FFFFFF" },
divider: "#DAD5D5",
- background: { main: "#F6F5F5" },
+ background: { default: "#F6F5F5" },
action: { hoverOpacity: 0, focusOpacity: 0 },
highlight: { main: "#ED1C24" },
};
@@ -212,7 +212,7 @@ const theme = createTheme({
padding: 0,
"&.MuiChip-clickable": {
"&:hover": {
- backgroundColor: palette.background.main,
+ backgroundColor: palette.background.default,
...(ownerState.variant === "filled" &&
ownerState.color === "primary" && {
backgroundColor: "#E0E2FC",
@@ -221,8 +221,8 @@ const theme = createTheme({
},
}),
filled: ({ ownerState }: any) => ({
- border: `1px solid ${palette.background.main}`,
- backgroundColor: palette.background.main,
+ border: `1px solid ${palette.background.default}`,
+ backgroundColor: palette.background.default,
color: palette.secondary.light,
...(ownerState.color === "primary" && {
border: `1px solid ${palette.primary.main}`,
@@ -471,7 +471,7 @@ deepmerge(
MuiCssBaseline: {
styleOverrides: `
blockquote {
- background-color: ${palette.background.main};
+ background-color: ${palette.background.default};
font-size: ${pxToRem(16)};
line-height: ${26 / 16};
margin: 20px 0;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e6d590e74..434f42664 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -785,7 +785,7 @@ importers:
version: 3.0.0
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-config-commons-ui:
specifier: workspace:*
version: link:../../packages/jest-config-commons-ui
@@ -866,7 +866,7 @@ importers:
version: 5.0.0-alpha.0(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(formik@2.4.6(react@18.3.1))(react@18.3.1)(tiny-warning@1.0.3)
formik-mui-lab:
specifier: ^1.0.0
- version: 1.0.0(au23chaimxrf4qlnsjncm6hkeu)
+ version: 1.0.0(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/lab@5.0.0-alpha.155(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/material@5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(formik@2.4.6(react@18.3.1))(react@18.3.1)(tiny-warning@1.0.3)
jwt-decode:
specifier: ^4.0.0
version: 4.0.0
@@ -957,7 +957,7 @@ importers:
version: 3.0.0
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-config-commons-ui:
specifier: workspace:*
version: link:../../packages/jest-config-commons-ui
@@ -1014,25 +1014,25 @@ importers:
version: 14.2.4
'@payloadcms/bundler-webpack':
specifier: ^1.0.7
- version: 1.0.7(@swc/core@1.6.1(@swc/helpers@0.5.5))(ajv@8.16.0)(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(sass@1.69.4)
+ version: 1.0.7(@swc/core@1.6.1(@swc/helpers@0.5.5))(ajv@8.16.0)(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(sass@1.69.4)
'@payloadcms/db-mongodb':
specifier: ^1.5.2
- version: 1.5.2(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))
+ version: 1.5.2(@aws-sdk/client-sso-oidc@3.600.0)(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))
'@payloadcms/plugin-cloud-storage':
specifier: ^1.1.3
- version: 1.1.3(@aws-sdk/client-s3@3.600.0)(@aws-sdk/lib-storage@3.600.0(@aws-sdk/client-s3@3.600.0))(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))
+ version: 1.1.3(@aws-sdk/client-s3@3.600.0)(@aws-sdk/lib-storage@3.600.0(@aws-sdk/client-s3@3.600.0))(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))
'@payloadcms/plugin-nested-docs':
specifier: ^1.0.12
- version: 1.0.12(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))
+ version: 1.0.12(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))
'@payloadcms/plugin-sentry':
specifier: ^0.0.6
- version: 0.0.6(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)
+ version: 0.0.6(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)
'@payloadcms/plugin-seo':
specifier: ^2.3.2
- version: 2.3.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)
+ version: 2.3.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)
'@payloadcms/richtext-slate':
specifier: ^1.5.2
- version: 1.5.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ version: 1.5.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@sentry/nextjs':
specifier: ^8.12.0
version: 8.12.0(@opentelemetry/api@1.9.0)(@opentelemetry/core@1.25.1(@opentelemetry/api@1.9.0))(@opentelemetry/instrumentation@0.52.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@1.25.1(@opentelemetry/api@1.9.0))(@opentelemetry/semantic-conventions@1.25.1)(encoding@0.1.13)(next@14.2.4(@babel/core@7.24.7)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4))(react@18.3.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
@@ -1059,7 +1059,7 @@ importers:
version: 1.0.3
payload:
specifier: 2.22.0
- version: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ version: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
react:
specifier: ^18.3.1
version: 18.3.1
@@ -1096,7 +1096,7 @@ importers:
version: link:../../packages/commons-ui-testing-library
'@svgr/webpack':
specifier: ^8.1.0
- version: 8.1.0(typescript@5.5.2)
+ version: 8.1.0(typescript@5.4.5)
'@types/express':
specifier: ^4.17.21
version: 4.17.21
@@ -1120,7 +1120,7 @@ importers:
version: 8.57.0
eslint-config-next:
specifier: ^14.2.4
- version: 14.2.4(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)(typescript@5.5.2)
+ version: 14.2.4(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)(typescript@5.4.5)
eslint-config-prettier:
specifier: ^9.1.0
version: 9.1.0(eslint@8.57.0)
@@ -1132,7 +1132,7 @@ importers:
version: 2.29.1(eslint-import-resolver-webpack@0.13.8)(eslint@8.57.0)
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-config-commons-ui:
specifier: workspace:*
version: link:../../packages/jest-config-commons-ui
@@ -1141,10 +1141,10 @@ importers:
version: 3.1.1
ts-node:
specifier: ^10.9.2
- version: 10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2)
+ version: 10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5)
typescript:
- specifier: ^5.5.2
- version: 5.5.2
+ specifier: 5.4.5
+ version: 5.4.5
apps/vpnmanager:
dependencies:
@@ -1198,7 +1198,7 @@ importers:
version: 133.0.0(encoding@0.1.13)
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
next:
specifier: ^14.2.4
version: 14.2.4(@babel/core@7.24.7)(@opentelemetry/api@1.9.0)(@playwright/test@1.45.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.69.4)
@@ -1284,7 +1284,7 @@ importers:
version: 3.0.0
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-config-commons-ui:
specifier: workspace:*
version: link:../jest-config-commons-ui
@@ -1342,7 +1342,7 @@ importers:
version: link:../eslint-config-commons-ui
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-config-commons-ui:
specifier: workspace:*
version: link:../jest-config-commons-ui
@@ -1412,7 +1412,7 @@ importers:
version: 3.0.0
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-config-commons-ui:
specifier: workspace:*
version: link:../jest-config-commons-ui
@@ -1460,7 +1460,7 @@ importers:
version: 1.1.0
eslint-plugin-import:
specifier: ^2.29.1
- version: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ version: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
eslint-plugin-jest:
specifier: ^27.9.0
version: 27.9.0(eslint@8.57.0)(jest@29.7.0)(typescript@5.5.2)
@@ -1534,7 +1534,7 @@ importers:
version: 3.0.0
jest:
specifier: ^29.7.0
- version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ version: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
prettier:
specifier: ^3.3.2
version: 3.3.2
@@ -12120,6 +12120,11 @@ packages:
resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==}
engines: {node: '>= 0.4'}
+ typescript@5.4.5:
+ resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
+ engines: {node: '>=14.17'}
+ hasBin: true
+
typescript@5.5.2:
resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==}
engines: {node: '>=14.17'}
@@ -13066,7 +13071,7 @@ snapshots:
'@aws-sdk/client-sso-oidc': 3.600.0(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/client-sts': 3.600.0
'@aws-sdk/core': 3.598.0
- '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/middleware-host-header': 3.598.0
'@aws-sdk/middleware-logger': 3.598.0
'@aws-sdk/middleware-recursion-detection': 3.598.0
@@ -13114,7 +13119,7 @@ snapshots:
'@aws-sdk/client-sso-oidc': 3.600.0(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/client-sts': 3.600.0
'@aws-sdk/core': 3.598.0
- '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/middleware-bucket-endpoint': 3.598.0
'@aws-sdk/middleware-expect-continue': 3.598.0
'@aws-sdk/middleware-flexible-checksums': 3.598.0
@@ -13175,7 +13180,7 @@ snapshots:
'@aws-crypto/sha256-js': 5.2.0
'@aws-sdk/client-sts': 3.600.0
'@aws-sdk/core': 3.598.0
- '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/middleware-host-header': 3.598.0
'@aws-sdk/middleware-logger': 3.598.0
'@aws-sdk/middleware-recursion-detection': 3.598.0
@@ -13264,7 +13269,7 @@ snapshots:
'@aws-crypto/sha256-js': 5.2.0
'@aws-sdk/client-sso-oidc': 3.600.0(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/core': 3.598.0
- '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
'@aws-sdk/middleware-host-header': 3.598.0
'@aws-sdk/middleware-logger': 3.598.0
'@aws-sdk/middleware-recursion-detection': 3.598.0
@@ -13343,6 +13348,24 @@ snapshots:
'@smithy/util-stream': 3.0.4
tslib: 2.6.3
+ '@aws-sdk/credential-provider-ini@3.598.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)':
+ dependencies:
+ '@aws-sdk/client-sts': 3.600.0
+ '@aws-sdk/credential-provider-env': 3.598.0
+ '@aws-sdk/credential-provider-http': 3.598.0
+ '@aws-sdk/credential-provider-process': 3.598.0
+ '@aws-sdk/credential-provider-sso': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0)
+ '@aws-sdk/credential-provider-web-identity': 3.598.0(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/types': 3.598.0
+ '@smithy/credential-provider-imds': 3.1.2
+ '@smithy/property-provider': 3.1.2
+ '@smithy/shared-ini-file-loader': 3.1.2
+ '@smithy/types': 3.2.0
+ tslib: 2.6.3
+ transitivePeerDependencies:
+ - '@aws-sdk/client-sso-oidc'
+ - aws-crt
+
'@aws-sdk/credential-provider-ini@3.598.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0)':
dependencies:
'@aws-sdk/client-sts': 3.600.0
@@ -13360,6 +13383,26 @@ snapshots:
transitivePeerDependencies:
- '@aws-sdk/client-sso-oidc'
- aws-crt
+ optional: true
+
+ '@aws-sdk/credential-provider-node@3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)':
+ dependencies:
+ '@aws-sdk/credential-provider-env': 3.598.0
+ '@aws-sdk/credential-provider-http': 3.598.0
+ '@aws-sdk/credential-provider-ini': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-process': 3.598.0
+ '@aws-sdk/credential-provider-sso': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0)
+ '@aws-sdk/credential-provider-web-identity': 3.598.0(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/types': 3.598.0
+ '@smithy/credential-provider-imds': 3.1.2
+ '@smithy/property-provider': 3.1.2
+ '@smithy/shared-ini-file-loader': 3.1.2
+ '@smithy/types': 3.2.0
+ tslib: 2.6.3
+ transitivePeerDependencies:
+ - '@aws-sdk/client-sso-oidc'
+ - '@aws-sdk/client-sts'
+ - aws-crt
'@aws-sdk/credential-provider-node@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)(@aws-sdk/client-sts@3.600.0)':
dependencies:
@@ -13379,6 +13422,7 @@ snapshots:
- '@aws-sdk/client-sso-oidc'
- '@aws-sdk/client-sts'
- aws-crt
+ optional: true
'@aws-sdk/credential-provider-process@3.598.0':
dependencies:
@@ -13410,6 +13454,29 @@ snapshots:
tslib: 2.6.3
'@aws-sdk/credential-providers@3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))':
+ dependencies:
+ '@aws-sdk/client-cognito-identity': 3.600.0
+ '@aws-sdk/client-sso': 3.598.0
+ '@aws-sdk/client-sts': 3.600.0
+ '@aws-sdk/credential-provider-cognito-identity': 3.600.0
+ '@aws-sdk/credential-provider-env': 3.598.0
+ '@aws-sdk/credential-provider-http': 3.598.0
+ '@aws-sdk/credential-provider-ini': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-node': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/credential-provider-process': 3.598.0
+ '@aws-sdk/credential-provider-sso': 3.598.0(@aws-sdk/client-sso-oidc@3.600.0)
+ '@aws-sdk/credential-provider-web-identity': 3.598.0(@aws-sdk/client-sts@3.600.0)
+ '@aws-sdk/types': 3.598.0
+ '@smithy/credential-provider-imds': 3.1.2
+ '@smithy/property-provider': 3.1.2
+ '@smithy/types': 3.2.0
+ tslib: 2.6.3
+ transitivePeerDependencies:
+ - '@aws-sdk/client-sso-oidc'
+ - aws-crt
+ optional: true
+
+ '@aws-sdk/credential-providers@3.600.0(@aws-sdk/client-sso-oidc@3.600.0)':
dependencies:
'@aws-sdk/client-cognito-identity': 3.600.0
'@aws-sdk/client-sso': 3.598.0
@@ -15352,7 +15419,7 @@ snapshots:
- ts-node
optional: true
- '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))':
+ '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))':
dependencies:
'@jest/console': 29.7.0
'@jest/reporters': 29.7.0
@@ -15366,7 +15433,7 @@ snapshots:
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
- jest-config: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ jest-config: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@@ -16212,7 +16279,7 @@ snapshots:
'@panva/hkdf@1.2.0': {}
- '@payloadcms/bundler-webpack@1.0.7(@swc/core@1.6.1(@swc/helpers@0.5.5))(ajv@8.16.0)(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(sass@1.69.4)':
+ '@payloadcms/bundler-webpack@1.0.7(@swc/core@1.6.1(@swc/helpers@0.5.5))(ajv@8.16.0)(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(sass@1.69.4)':
dependencies:
ajv: 8.16.0
compression: 1.7.4
@@ -16224,7 +16291,7 @@ snapshots:
md5: 2.3.0
mini-css-extract-plugin: 1.6.2(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))(webpack-cli@4.10.0))
path-browserify: 1.0.1
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
postcss: 8.4.31
postcss-loader: 6.2.1(postcss@8.4.31)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))(webpack-cli@4.10.0))
postcss-preset-env: 9.0.0(postcss@8.4.31)
@@ -16344,7 +16411,7 @@ snapshots:
- utf-8-validate
- webpack-dev-server
- '@payloadcms/db-mongodb@1.5.2(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))':
+ '@payloadcms/db-mongodb@1.5.2(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(payload@2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(webpack-cli@4.10.0)))':
dependencies:
bson-objectid: 2.0.4
deepmerge: 4.3.1
@@ -16353,7 +16420,7 @@ snapshots:
mongoose: 6.12.3(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))
mongoose-aggregate-paginate-v2: 1.0.6
mongoose-paginate-v2: 1.7.22
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(webpack-cli@4.10.0))
prompts: 2.4.2
uuid: 9.0.0
transitivePeerDependencies:
@@ -16361,7 +16428,7 @@ snapshots:
- aws-crt
- supports-color
- '@payloadcms/db-mongodb@1.5.2(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(payload@2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(webpack-cli@4.10.0)))':
+ '@payloadcms/db-mongodb@1.5.2(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(payload@2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))))':
dependencies:
bson-objectid: 2.0.4
deepmerge: 4.3.1
@@ -16370,7 +16437,7 @@ snapshots:
mongoose: 6.12.3(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))
mongoose-aggregate-paginate-v2: 1.0.6
mongoose-paginate-v2: 1.7.22
- payload: 2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(webpack-cli@4.10.0))
+ payload: 2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5)))
prompts: 2.4.2
uuid: 9.0.0
transitivePeerDependencies:
@@ -16378,16 +16445,16 @@ snapshots:
- aws-crt
- supports-color
- '@payloadcms/db-mongodb@1.5.2(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))(payload@2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))))':
+ '@payloadcms/db-mongodb@1.5.2(@aws-sdk/client-sso-oidc@3.600.0)(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))':
dependencies:
bson-objectid: 2.0.4
deepmerge: 4.3.1
get-port: 5.1.1
http-status: 1.6.2
- mongoose: 6.12.3(@aws-sdk/client-sso-oidc@3.600.0(@aws-sdk/client-sts@3.600.0))
+ mongoose: 6.12.3(@aws-sdk/client-sso-oidc@3.600.0)
mongoose-aggregate-paginate-v2: 1.0.6
mongoose-paginate-v2: 1.7.22
- payload: 2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
prompts: 2.4.2
uuid: 9.0.0
transitivePeerDependencies:
@@ -16395,10 +16462,10 @@ snapshots:
- aws-crt
- supports-color
- '@payloadcms/plugin-cloud-storage@1.1.3(@aws-sdk/client-s3@3.600.0)(@aws-sdk/lib-storage@3.600.0(@aws-sdk/client-s3@3.600.0))(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))':
+ '@payloadcms/plugin-cloud-storage@1.1.3(@aws-sdk/client-s3@3.600.0)(@aws-sdk/lib-storage@3.600.0(@aws-sdk/client-s3@3.600.0))(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))':
dependencies:
find-node-modules: 2.1.3
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
range-parser: 1.2.1
optionalDependencies:
'@aws-sdk/client-s3': 3.600.0
@@ -16422,9 +16489,9 @@ snapshots:
'@aws-sdk/client-s3': 3.600.0
'@aws-sdk/lib-storage': 3.600.0(@aws-sdk/client-s3@3.600.0)
- '@payloadcms/plugin-nested-docs@1.0.12(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))':
+ '@payloadcms/plugin-nested-docs@1.0.12(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))':
dependencies:
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
'@payloadcms/plugin-nested-docs@1.0.12(payload@2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(webpack-cli@4.10.0)))':
dependencies:
@@ -16434,12 +16501,12 @@ snapshots:
dependencies:
payload: 2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5)))
- '@payloadcms/plugin-sentry@0.0.6(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)':
+ '@payloadcms/plugin-sentry@0.0.6(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)':
dependencies:
'@sentry/node': 7.118.0
'@sentry/types': 7.118.0
express: 4.19.2
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
react: 18.3.1
transitivePeerDependencies:
- supports-color
@@ -16464,9 +16531,9 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@payloadcms/plugin-seo@2.3.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)':
+ '@payloadcms/plugin-seo@2.3.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react@18.3.1)':
dependencies:
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
react: 18.3.1
'@payloadcms/plugin-seo@2.3.2(payload@2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5))(webpack-cli@4.10.0)))(react@18.3.1)':
@@ -16479,12 +16546,12 @@ snapshots:
payload: 2.22.2(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.5(@swc/helpers@0.5.5)))
react: 18.3.1
- '@payloadcms/richtext-slate@1.5.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
+ '@payloadcms/richtext-slate@1.5.2(payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@faceless-ui/modal': 2.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
i18next: 22.5.1
is-hotkey: 0.2.0
- payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
+ payload: 2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
react: 18.3.1
react-i18next: 11.18.6(i18next@22.5.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
slate: 0.91.4
@@ -18535,6 +18602,17 @@ snapshots:
'@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.24.7)
'@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.24.7)
+ '@svgr/core@8.1.0(typescript@5.4.5)':
+ dependencies:
+ '@babel/core': 7.24.7
+ '@svgr/babel-preset': 8.1.0(@babel/core@7.24.7)
+ camelcase: 6.3.0
+ cosmiconfig: 8.3.6(typescript@5.4.5)
+ snake-case: 3.0.4
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+
'@svgr/core@8.1.0(typescript@5.5.2)':
dependencies:
'@babel/core': 7.24.7
@@ -18551,6 +18629,16 @@ snapshots:
'@babel/types': 7.24.7
entities: 4.5.0
+ '@svgr/plugin-jsx@8.1.0(@svgr/core@8.1.0(typescript@5.4.5))':
+ dependencies:
+ '@babel/core': 7.24.7
+ '@svgr/babel-preset': 8.1.0(@babel/core@7.24.7)
+ '@svgr/core': 8.1.0(typescript@5.4.5)
+ '@svgr/hast-util-to-babel-ast': 8.0.0
+ svg-parser: 2.0.4
+ transitivePeerDependencies:
+ - supports-color
+
'@svgr/plugin-jsx@8.1.0(@svgr/core@8.1.0(typescript@5.5.2))':
dependencies:
'@babel/core': 7.24.7
@@ -18561,6 +18649,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@svgr/plugin-svgo@8.1.0(@svgr/core@8.1.0(typescript@5.4.5))(typescript@5.4.5)':
+ dependencies:
+ '@svgr/core': 8.1.0(typescript@5.4.5)
+ cosmiconfig: 8.3.6(typescript@5.4.5)
+ deepmerge: 4.3.1
+ svgo: 3.3.2
+ transitivePeerDependencies:
+ - typescript
+
'@svgr/plugin-svgo@8.1.0(@svgr/core@8.1.0(typescript@5.5.2))(typescript@5.5.2)':
dependencies:
'@svgr/core': 8.1.0(typescript@5.5.2)
@@ -18570,6 +18667,20 @@ snapshots:
transitivePeerDependencies:
- typescript
+ '@svgr/webpack@8.1.0(typescript@5.4.5)':
+ dependencies:
+ '@babel/core': 7.24.7
+ '@babel/plugin-transform-react-constant-elements': 7.24.7(@babel/core@7.24.7)
+ '@babel/preset-env': 7.24.7(@babel/core@7.24.7)
+ '@babel/preset-react': 7.24.7(@babel/core@7.24.7)
+ '@babel/preset-typescript': 7.24.7(@babel/core@7.24.7)
+ '@svgr/core': 8.1.0(typescript@5.4.5)
+ '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.4.5))
+ '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0(typescript@5.4.5))(typescript@5.4.5)
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+
'@svgr/webpack@8.1.0(typescript@5.5.2)':
dependencies:
'@babel/core': 7.24.7
@@ -18731,7 +18842,7 @@ snapshots:
optionalDependencies:
'@jest/globals': 29.7.0
'@types/jest': 29.5.12
- jest: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ jest: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)
'@testing-library/jest-dom@6.4.5(@jest/globals@29.7.0)(@types/jest@29.5.12)(jest@29.7.0(@types/node@20.14.9))':
dependencies:
@@ -18761,7 +18872,7 @@ snapshots:
optionalDependencies:
'@jest/globals': 29.7.0
'@types/jest': 29.5.12
- jest: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ jest: 29.7.0(babel-plugin-macros@3.1.0)
'@testing-library/react@14.3.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
@@ -19131,6 +19242,19 @@ snapshots:
dependencies:
'@types/yargs-parser': 21.0.3
+ '@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5)':
+ dependencies:
+ '@typescript-eslint/scope-manager': 7.2.0
+ '@typescript-eslint/types': 7.2.0
+ '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.4.5)
+ '@typescript-eslint/visitor-keys': 7.2.0
+ debug: 4.3.5
+ eslint: 8.57.0
+ optionalDependencies:
+ typescript: 5.4.5
+ transitivePeerDependencies:
+ - supports-color
+
'@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2)':
dependencies:
'@typescript-eslint/scope-manager': 7.2.0
@@ -19172,6 +19296,21 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@typescript-eslint/typescript-estree@7.2.0(typescript@5.4.5)':
+ dependencies:
+ '@typescript-eslint/types': 7.2.0
+ '@typescript-eslint/visitor-keys': 7.2.0
+ debug: 4.3.5
+ globby: 11.1.0
+ is-glob: 4.0.3
+ minimatch: 9.0.3
+ semver: 7.6.2
+ ts-api-utils: 1.3.0(typescript@5.4.5)
+ optionalDependencies:
+ typescript: 5.4.5
+ transitivePeerDependencies:
+ - supports-color
+
'@typescript-eslint/typescript-estree@7.2.0(typescript@5.5.2)':
dependencies:
'@typescript-eslint/types': 7.2.0
@@ -20431,6 +20570,15 @@ snapshots:
path-type: 4.0.0
yaml: 1.10.2
+ cosmiconfig@8.3.6(typescript@5.4.5):
+ dependencies:
+ import-fresh: 3.3.0
+ js-yaml: 4.1.0
+ parse-json: 5.2.0
+ path-type: 4.0.0
+ optionalDependencies:
+ typescript: 5.4.5
+
cosmiconfig@8.3.6(typescript@5.5.2):
dependencies:
import-fresh: 3.3.0
@@ -20491,13 +20639,13 @@ snapshots:
- ts-node
optional: true
- create-jest@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2)):
+ create-jest@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5)):
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
- jest-config: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ jest-config: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@@ -21416,7 +21564,7 @@ snapshots:
dependencies:
confusing-browser-globals: 1.0.11
eslint: 8.57.0
- eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
object.assign: 4.1.5
object.entries: 1.1.8
semver: 6.3.1
@@ -21425,27 +21573,27 @@ snapshots:
dependencies:
eslint: 8.57.0
eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0)
- eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0)
eslint-plugin-react: 7.34.3(eslint@8.57.0)
eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0)
object.assign: 4.1.5
object.entries: 1.1.8
- eslint-config-next@14.2.4(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)(typescript@5.5.2):
+ eslint-config-next@14.2.4(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)(typescript@5.4.5):
dependencies:
'@next/eslint-plugin-next': 14.2.4
'@rushstack/eslint-patch': 1.10.3
- '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2)
+ '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.5)
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0)
- eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0)
+ eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0)
eslint-plugin-react: 7.34.3(eslint@8.57.0)
eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0)
optionalDependencies:
- typescript: 5.5.2
+ typescript: 5.4.5
transitivePeerDependencies:
- eslint-import-resolver-webpack
- supports-color
@@ -21498,13 +21646,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
- eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0):
+ eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0):
dependencies:
debug: 4.3.5
enhanced-resolve: 5.17.0
eslint: 8.57.0
- eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
- eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
fast-glob: 3.3.2
get-tsconfig: 4.7.5
is-core-module: 2.14.0
@@ -21622,14 +21770,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
- eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0):
+ eslint-module-utils@2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0):
dependencies:
debug: 3.2.7
optionalDependencies:
- '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2)
+ '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.5)
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0)
+ eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0)
eslint-import-resolver-webpack: 0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
transitivePeerDependencies:
- supports-color
@@ -21655,7 +21803,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0):
+ eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0):
dependencies:
array-includes: 3.1.8
array.prototype.findlastindex: 1.2.5
@@ -21665,7 +21813,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
- eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
+ eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint-import-resolver-webpack@0.13.8(eslint-plugin-import@2.29.1)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))))(eslint@8.57.0)
hasown: 2.0.2
is-core-module: 2.14.0
is-glob: 4.0.3
@@ -21676,7 +21824,7 @@ snapshots:
semver: 6.3.1
tsconfig-paths: 3.15.0
optionalDependencies:
- '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.2)
+ '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.4.5)
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
@@ -21747,7 +21895,7 @@ snapshots:
'@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.5.2)
eslint: 8.57.0
optionalDependencies:
- jest: 29.7.0(@types/node@20.14.9)
+ jest: 29.7.0
transitivePeerDependencies:
- supports-color
- typescript
@@ -22336,8 +22484,8 @@ snapshots:
combined-stream: 1.0.8
mime-types: 2.1.35
- formik-mui-lab@1.0.0(au23chaimxrf4qlnsjncm6hkeu):
- dependencies:
+ ? formik-mui-lab@1.0.0(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/lab@5.0.0-alpha.155(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/material@5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(formik@2.4.6(react@18.3.1))(react@18.3.1)(tiny-warning@1.0.3)
+ : dependencies:
'@emotion/react': 11.11.4(@types/react@18.3.3)(react@18.3.1)
'@emotion/styled': 11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
'@mui/lab': 5.0.0-alpha.155(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.15.20(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -23507,16 +23655,16 @@ snapshots:
- ts-node
optional: true
- jest-cli@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2)):
+ jest-cli@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5)):
dependencies:
- '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
- create-jest: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ create-jest: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
exit: 0.1.2
import-local: 3.1.0
- jest-config: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ jest-config: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@@ -23576,7 +23724,7 @@ snapshots:
- supports-color
optional: true
- jest-config@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2)):
+ jest-config@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5)):
dependencies:
'@babel/core': 7.24.7
'@jest/test-sequencer': 29.7.0
@@ -23602,7 +23750,7 @@ snapshots:
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 20.14.9
- ts-node: 10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2)
+ ts-node: 10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
@@ -23874,6 +24022,19 @@ snapshots:
merge-stream: 2.0.0
supports-color: 8.1.1
+ jest@29.7.0:
+ dependencies:
+ '@jest/core': 29.7.0
+ '@jest/types': 29.6.3
+ import-local: 3.1.0
+ jest-cli: 29.7.0(@types/node@20.14.9)
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ optional: true
+
jest@29.7.0(@types/node@20.14.9):
dependencies:
'@jest/core': 29.7.0
@@ -23887,12 +24048,25 @@ snapshots:
- ts-node
optional: true
- jest@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2)):
+ jest@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0):
dependencies:
- '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
'@jest/types': 29.6.3
import-local: 3.1.0
- jest-cli: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2))
+ jest-cli: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ optional: true
+
+ jest@29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5)):
+ dependencies:
+ '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
+ '@jest/types': 29.6.3
+ import-local: 3.1.0
+ jest-cli: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@@ -23911,6 +24085,19 @@ snapshots:
- supports-color
- ts-node
+ jest@29.7.0(babel-plugin-macros@3.1.0):
+ dependencies:
+ '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
+ '@jest/types': 29.6.3
+ import-local: 3.1.0
+ jest-cli: 29.7.0(@types/node@20.14.9)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5))
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ optional: true
+
jiti@1.21.6: {}
jmespath@0.16.0: {}
@@ -24673,6 +24860,18 @@ snapshots:
- '@aws-sdk/client-sso-oidc'
- aws-crt
+ mongodb@4.17.1(@aws-sdk/client-sso-oidc@3.600.0):
+ dependencies:
+ bson: 4.7.2
+ mongodb-connection-string-url: 2.6.0
+ socks: 2.8.3
+ optionalDependencies:
+ '@aws-sdk/credential-providers': 3.600.0(@aws-sdk/client-sso-oidc@3.600.0)
+ '@mongodb-js/saslprep': 1.1.7
+ transitivePeerDependencies:
+ - '@aws-sdk/client-sso-oidc'
+ - aws-crt
+
mongoose-aggregate-paginate-v2@1.0.6: {}
mongoose-paginate-v2@1.7.22: {}
@@ -24691,6 +24890,20 @@ snapshots:
- aws-crt
- supports-color
+ mongoose@6.12.3(@aws-sdk/client-sso-oidc@3.600.0):
+ dependencies:
+ bson: 4.7.2
+ kareem: 2.5.1
+ mongodb: 4.17.1(@aws-sdk/client-sso-oidc@3.600.0)
+ mpath: 0.9.0
+ mquery: 4.0.3
+ ms: 2.1.3
+ sift: 16.0.1
+ transitivePeerDependencies:
+ - '@aws-sdk/client-sso-oidc'
+ - aws-crt
+ - supports-color
+
mpath@0.9.0: {}
mpd-parser@1.3.0:
@@ -25287,7 +25500,7 @@ snapshots:
pause@0.0.1: {}
- payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.5.2)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))):
+ payload@2.22.0(@swc/helpers@0.5.5)(@types/react@18.3.3)(encoding@0.1.13)(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5))):
dependencies:
'@date-io/date-fns': 2.16.0(date-fns@2.30.0)
'@dnd-kit/core': 6.0.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -25374,7 +25587,7 @@ snapshots:
sharp: 0.33.4
swc-loader: 0.2.3(@swc/core@1.6.1(@swc/helpers@0.5.5))(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
terser-webpack-plugin: 5.3.9(@swc/core@1.6.1(@swc/helpers@0.5.5))(webpack@5.92.1(@swc/core@1.6.1(@swc/helpers@0.5.5)))
- ts-essentials: 7.0.3(typescript@5.5.2)
+ ts-essentials: 7.0.3(typescript@5.4.5)
use-context-selector: 1.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.23.0)
uuid: 9.0.1
transitivePeerDependencies:
@@ -27837,12 +28050,20 @@ snapshots:
dependencies:
utf8-byte-length: 1.0.5
+ ts-api-utils@1.3.0(typescript@5.4.5):
+ dependencies:
+ typescript: 5.4.5
+
ts-api-utils@1.3.0(typescript@5.5.2):
dependencies:
typescript: 5.5.2
ts-dedent@2.2.0: {}
+ ts-essentials@7.0.3(typescript@5.4.5):
+ dependencies:
+ typescript: 5.4.5
+
ts-essentials@7.0.3(typescript@5.5.2):
dependencies:
typescript: 5.5.2
@@ -27859,7 +28080,7 @@ snapshots:
dependencies:
tslib: 1.14.1
- ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.5.2):
+ ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.9)(typescript@5.4.5):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.11
@@ -27873,7 +28094,7 @@ snapshots:
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
- typescript: 5.5.2
+ typescript: 5.4.5
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
optionalDependencies:
@@ -28036,6 +28257,8 @@ snapshots:
is-typed-array: 1.1.13
possible-typed-array-names: 1.0.0
+ typescript@5.4.5: {}
+
typescript@5.5.2: {}
ufo@1.5.3: {}
From 2259ffe39d2920b6518f36a68d3aed6b220c67d4 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 19:40:02 +0300
Subject: [PATCH 22/25] Remove wrongly comitted file
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/codeforafrica/payload.config.ts | 3 ---
1 file changed, 3 deletions(-)
diff --git a/apps/codeforafrica/payload.config.ts b/apps/codeforafrica/payload.config.ts
index 2b6ca15b2..bae5c65c6 100644
--- a/apps/codeforafrica/payload.config.ts
+++ b/apps/codeforafrica/payload.config.ts
@@ -147,7 +147,4 @@ export default buildConfig({
}),
] as any[],
telemetry: process?.env?.NODE_ENV !== "production",
- typescript: {
- declare: false,
- },
});
From fca465723dfe661ae12c63bd4e9bf1d33c533b61 Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Fri, 28 Jun 2024 20:25:37 +0300
Subject: [PATCH 23/25] Partial type fixes
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../src/components/BlockRenderer/BlockRenderer.tsx | 9 ++-------
apps/roboshield/src/payload/fields/richText.ts | 12 +++++++-----
.../src/payload/globals/Site/EngagementTab.ts | 3 ++-
.../src/payload/globals/Site/GeneralTab.ts | 3 ++-
.../src/payload/globals/Site/InitiativeTab.ts | 3 ++-
.../src/payload/globals/Site/NavigationTab.ts | 3 ++-
apps/roboshield/src/payload/globals/Site/index.ts | 3 ++-
7 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
index b18531da2..759cf72b4 100644
--- a/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
+++ b/apps/roboshield/src/components/BlockRenderer/BlockRenderer.tsx
@@ -1,22 +1,17 @@
import PageHeader from "@/roboshield/components/PageHeader/PageHeader";
import { Page } from "@/root/payload-types";
-type BlockType = Page["blocks"];
-interface BlockRendererProps {
- blocks: BlockType;
-}
+interface BlockRendererProps extends Pick {}
const components = {
"page-header": PageHeader,
};
-type BlockSlug = keyof typeof components;
-
export default function BlockRenderer({ blocks }: BlockRendererProps) {
return (
<>
{blocks?.map((block, index) => {
- const Component = components[block.blockType as BlockSlug];
+ const Component = components[block.blockType];
if (Component) {
return ;
diff --git a/apps/roboshield/src/payload/fields/richText.ts b/apps/roboshield/src/payload/fields/richText.ts
index a5c67f60a..0aa6f0e0d 100644
--- a/apps/roboshield/src/payload/fields/richText.ts
+++ b/apps/roboshield/src/payload/fields/richText.ts
@@ -1,7 +1,7 @@
import { deepmerge } from "@mui/utils";
import mapLinkTypeToHref, { NodeType } from "../utils/mapLinkTypeToHref";
-import { Field, PayloadRequest } from "payload/types";
+import { Field, FieldHook, PayloadRequest } from "payload/types";
async function insertHref(nodes: NodeType[] | null, payload: PayloadRequest) {
if (!nodes?.length) {
@@ -53,15 +53,17 @@ async function mapLinkToHrefAfterRead({
return insertHref(value, payload);
}
-function richText(overrides: Partial) {
- const richTextResult = {
+function richText(overrides: Partial): Field {
+ const richTextResult: Partial = {
type: "richText",
hooks: {
- afterRead: [mapLinkToHrefAfterRead],
+ afterRead: [
+ mapLinkToHrefAfterRead as unknown as FieldHook,
+ ],
},
};
- return deepmerge(richTextResult, overrides);
+ return deepmerge(richTextResult, overrides) as Field;
}
export default richText;
diff --git a/apps/roboshield/src/payload/globals/Site/EngagementTab.ts b/apps/roboshield/src/payload/globals/Site/EngagementTab.ts
index d7dc53f33..d61390ad6 100644
--- a/apps/roboshield/src/payload/globals/Site/EngagementTab.ts
+++ b/apps/roboshield/src/payload/globals/Site/EngagementTab.ts
@@ -1,6 +1,7 @@
+import { Tab } from "payload/types";
import socialLinks from "../../fields/socialLinks";
-const EngagementTab = {
+const EngagementTab: Tab = {
label: "Engagement",
fields: [
{
diff --git a/apps/roboshield/src/payload/globals/Site/GeneralTab.ts b/apps/roboshield/src/payload/globals/Site/GeneralTab.ts
index a1fa6fb64..5ea5155de 100644
--- a/apps/roboshield/src/payload/globals/Site/GeneralTab.ts
+++ b/apps/roboshield/src/payload/globals/Site/GeneralTab.ts
@@ -1,7 +1,8 @@
+import { Tab } from "payload/types";
import image from "../../fields/image";
import richText from "../../fields/richText";
-const GeneralTab = {
+const GeneralTab: Tab = {
label: "General",
fields: [
{
diff --git a/apps/roboshield/src/payload/globals/Site/InitiativeTab.ts b/apps/roboshield/src/payload/globals/Site/InitiativeTab.ts
index cf1d069da..cff569bf2 100644
--- a/apps/roboshield/src/payload/globals/Site/InitiativeTab.ts
+++ b/apps/roboshield/src/payload/globals/Site/InitiativeTab.ts
@@ -1,8 +1,9 @@
+import { Tab } from "payload/types";
import image from "../../fields/image";
import link from "../../fields/links/link";
import richText from "../../fields/richText";
-const PartnersTab = {
+const PartnersTab: Tab = {
label: "Initiative",
fields: [
{
diff --git a/apps/roboshield/src/payload/globals/Site/NavigationTab.ts b/apps/roboshield/src/payload/globals/Site/NavigationTab.ts
index 6c2a3cf8b..769e0c006 100644
--- a/apps/roboshield/src/payload/globals/Site/NavigationTab.ts
+++ b/apps/roboshield/src/payload/globals/Site/NavigationTab.ts
@@ -1,3 +1,4 @@
+import { Tab } from "payload/types";
import link from "../../fields/links/link";
import linkArray from "../../fields/links/linkArray";
import { socialMediaOptions } from "../../fields/socialLinks";
@@ -6,7 +7,7 @@ const linkField = link({
disableOpenInNewTab: true,
});
-const NavigationTab = {
+const NavigationTab: Tab = {
label: "Navigation",
fields: [
{
diff --git a/apps/roboshield/src/payload/globals/Site/index.ts b/apps/roboshield/src/payload/globals/Site/index.ts
index f439b60f0..be6070119 100644
--- a/apps/roboshield/src/payload/globals/Site/index.ts
+++ b/apps/roboshield/src/payload/globals/Site/index.ts
@@ -2,8 +2,9 @@ import EngagementTab from "./EngagementTab";
import GeneralTab from "./GeneralTab";
import NavigationTab from "./NavigationTab";
import InitiativeTab from "./InitiativeTab";
+import { GlobalConfig } from "payload/types";
-const Site = {
+const Site: GlobalConfig = {
slug: "settings-site",
label: "Site",
access: {
From c74093c6e9be8022407193d351a3edcd045e55bb Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Mon, 1 Jul 2024 14:00:06 +0300
Subject: [PATCH 24/25] Fix types
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
apps/roboshield/src/lib/data/index.ts | 6 ++++++
apps/roboshield/src/pages/about.tsx | 11 +++--------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/apps/roboshield/src/lib/data/index.ts b/apps/roboshield/src/lib/data/index.ts
index d299fa14b..6c0d33040 100644
--- a/apps/roboshield/src/lib/data/index.ts
+++ b/apps/roboshield/src/lib/data/index.ts
@@ -1 +1,7 @@
+import { Page } from "@/root/payload-types";
+
export { getPageServerSideProps } from "./local";
+
+export interface PageProps {
+ blocks: Page["blocks"];
+}
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/about.tsx
index e1c2ec1e7..7f2f62036 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/about.tsx
@@ -1,12 +1,7 @@
import { getPageServerSideProps } from "@/roboshield/lib/data";
import BlockRenderer from "@/roboshield/components/BlockRenderer";
-import { Page } from "@/root/payload-types";
-
-type BlockType = Page["blocks"];
-
-interface PageProps {
- blocks: BlockType;
-}
+import { PageProps } from "@/roboshield/lib/data";
+import { GetServerSidePropsContext } from "next";
export default function About({ blocks }: PageProps) {
return (
@@ -16,7 +11,7 @@ export default function About({ blocks }: PageProps) {
);
}
-export async function getServerSideProps(context: any) {
+export async function getServerSideProps(context: GetServerSidePropsContext) {
const { props } = await getPageServerSideProps(context);
return {
props: {
From a21fc5c5a0a3161c0139e27774560776ea0c784a Mon Sep 17 00:00:00 2001
From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
Date: Mon, 1 Jul 2024 15:09:11 +0300
Subject: [PATCH 25/25] Use catch all page
Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com>
---
.../src/pages/{about.tsx => [[...slug]].tsx} | 2 +-
apps/roboshield/src/pages/index.tsx | 227 ------------------
2 files changed, 1 insertion(+), 228 deletions(-)
rename apps/roboshield/src/pages/{about.tsx => [[...slug]].tsx} (90%)
delete mode 100644 apps/roboshield/src/pages/index.tsx
diff --git a/apps/roboshield/src/pages/about.tsx b/apps/roboshield/src/pages/[[...slug]].tsx
similarity index 90%
rename from apps/roboshield/src/pages/about.tsx
rename to apps/roboshield/src/pages/[[...slug]].tsx
index 7f2f62036..0e3b365ed 100644
--- a/apps/roboshield/src/pages/about.tsx
+++ b/apps/roboshield/src/pages/[[...slug]].tsx
@@ -3,7 +3,7 @@ import BlockRenderer from "@/roboshield/components/BlockRenderer";
import { PageProps } from "@/roboshield/lib/data";
import { GetServerSidePropsContext } from "next";
-export default function About({ blocks }: PageProps) {
+export default function Page({ blocks }: PageProps) {
return (
<>
diff --git a/apps/roboshield/src/pages/index.tsx b/apps/roboshield/src/pages/index.tsx
deleted file mode 100644
index 362f300ca..000000000
--- a/apps/roboshield/src/pages/index.tsx
+++ /dev/null
@@ -1,227 +0,0 @@
-import { Section } from "@commons-ui/core";
-import {
- IconButton,
- Alert,
- Box,
- Paper,
- Stack,
- Step,
- StepButton,
- Stepper,
- Tooltip,
-} from "@mui/material";
-import { useEffect } from "react";
-import React from "react";
-import { useRef, useState } from "react";
-
-import Delays from "@/roboshield/components/Delays";
-import Hero from "@/roboshield/components/Hero";
-import Sitemaps from "@/roboshield/components/Sitemaps";
-
-import CommonBots from "@/roboshield/components/CommonBots";
-import CommonSettings from "@/roboshield/components/CommonSettings";
-import ExistingRobots from "@/roboshield/components/ExistingRobots";
-import Finish from "@/roboshield/components/Finish";
-import {
- useGlobalState,
- defaultState,
-} from "@/roboshield/context/GlobalContext";
-import { generateRobots } from "@/roboshield/lib/robots";
-import { getPageServerSideProps } from "@/roboshield/lib/data";
-
-interface Step {
- label: string;
- description: string;
- component: React.FC;
-}
-
-export default function Home() {
- const [activeStep, setActiveStep] = useState(0);
- const { state, setState } = useGlobalState();
- const [code, setCode] = useState(state.robots || "");
- const scrolRef = useRef(null);
-
- const steps: Step[] = [
- {
- label: "Existing robots",
- description: `Start by fetching the robots.txt file of the website you want to generate robots for.`,
- component: ExistingRobots,
- },
- {
- label: "Delays",
- description: `You can set bot delays for the robots you want to generate.`,
- component: Delays,
- },
- {
- label: "Paths",
- description:
- "You can set disallowed and allowed paths for the robots you want to generate. All paths should be relative to the root of your site and end with a /",
- component: CommonSettings,
- },
- {
- label: "Block Bots",
- description: `Select bots you want to block from crawling your website.`,
- component: CommonBots,
- },
- {
- label: "Site Maps",
- description: `You can add sitemap URLs to your robots.txt file.`,
- component: Sitemaps,
- },
- {
- label: "Finish",
- description: `Your robots.txt file has been generated successfully. You can now copy the code or download the file.`,
- component: Finish,
- },
- ];
-
- const handleNext = () => {
- setActiveStep((prevActiveStep) => prevActiveStep + 1);
- };
-
- const handleBack = () => {
- setActiveStep((prevActiveStep) => prevActiveStep - 1);
- };
-
- const handleReset = () => {
- setState(defaultState);
- setActiveStep(0);
- };
-
- const handleNextStep = (data: any) => {
- const newState = { ...state, ...data };
- setState(newState);
- handleNext();
- };
-
- const handleSkipToLast = (data: any) => {
- const newState = { ...state, ...data };
- setState(newState);
- setActiveStep(steps.length - 1);
- };
-
- const handleStep = (step: number) => () => {
- setActiveStep(step);
- };
-
- useEffect(() => {
- const generateRobotsFile = async () => {
- const robots = await generateRobots(state);
- setCode(robots);
- };
-
- generateRobotsFile();
- }, [state]);
-
- const ActiveComponent = steps[activeStep]?.component ?? null;
-
- return (
- <>
-
-
-
-
-
-
-
-
-
- {steps.map((step, index) => (
-
-
- {step.label}
-
-
- ))}
-
- {ActiveComponent && (
-
-
-
- )}
-
-
-
-
-
- >
- );
-}
-
-export async function getServerSideProps(context: any) {
- return getPageServerSideProps(context);
-}