From 8928dd8eafef68f6cae7e6a2ca2a1a68b90f61dc Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Tue, 22 Jun 2021 14:20:22 +0200 Subject: [PATCH 01/15] Fixed update queries. Ready to merge :) --- backend/components/blocks/card.json | 4 +- backend/components/blocks/single-feature.json | 4 +- frontend/features/plugins/usePagePlugin.ts | 2 - frontend/graphql.schema.json | 42 ++++------- frontend/graphql/GetPageData.graphql | 13 +--- frontend/graphql/GetPages.graphql | 12 +--- frontend/graphql/generated.ts | 72 +++++-------------- frontend/pages/[...slug].tsx | 2 +- 8 files changed, 39 insertions(+), 112 deletions(-) diff --git a/backend/components/blocks/card.json b/backend/components/blocks/card.json index 9d34e461..4e24f04e 100644 --- a/backend/components/blocks/card.json +++ b/backend/components/blocks/card.json @@ -26,9 +26,7 @@ "pluginOptions": {} }, "projectLink": { - "type": "component", - "repeatable": false, - "component": "menu.page-link" + "type": "string" } } } diff --git a/backend/components/blocks/single-feature.json b/backend/components/blocks/single-feature.json index c536df3b..533eb425 100644 --- a/backend/components/blocks/single-feature.json +++ b/backend/components/blocks/single-feature.json @@ -26,9 +26,7 @@ "pluginOptions": {} }, "serviceLink": { - "type": "component", - "repeatable": true, - "component": "menu.page-link" + "type": "string" } } } diff --git a/frontend/features/plugins/usePagePlugin.ts b/frontend/features/plugins/usePagePlugin.ts index 6e28af02..e8adc283 100644 --- a/frontend/features/plugins/usePagePlugin.ts +++ b/frontend/features/plugins/usePagePlugin.ts @@ -37,8 +37,6 @@ export function usePagePlugin(pageData: PageData): [PageData, Form] { initialValues: pageData, onSubmit: async (values) => { const input = getPageInput(values); - console.log("Input", getPageInput(values)); - try { const response = await cms.api.strapi.fetchGraphql(UpdatePage, { input, diff --git a/frontend/graphql.schema.json b/frontend/graphql.schema.json index 85fba56a..2a089f8c 100644 --- a/frontend/graphql.schema.json +++ b/frontend/graphql.schema.json @@ -169,8 +169,8 @@ "description": null, "args": [], "type": { - "kind": "OBJECT", - "name": "ComponentMenuPageLink", + "kind": "SCALAR", + "name": "String", "ofType": null }, "isDeprecated": false, @@ -236,8 +236,8 @@ "name": "projectLink", "description": null, "type": { - "kind": "INPUT_OBJECT", - "name": "ComponentMenuPageLinkInput", + "kind": "SCALAR", + "name": "String", "ofType": null }, "defaultValue": null, @@ -539,13 +539,9 @@ "description": null, "args": [], "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ComponentMenuPageLink", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "isDeprecated": false, "deprecationReason": null @@ -610,13 +606,9 @@ "name": "serviceLink", "description": null, "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ComponentMenuPageLinkInput", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -10194,8 +10186,8 @@ "name": "projectLink", "description": null, "type": { - "kind": "INPUT_OBJECT", - "name": "editComponentMenuPageLinkInput", + "kind": "SCALAR", + "name": "String", "ofType": null }, "defaultValue": null, @@ -10375,13 +10367,9 @@ "name": "serviceLink", "description": null, "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "editComponentMenuPageLinkInput", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null, "isDeprecated": false, diff --git a/frontend/graphql/GetPageData.graphql b/frontend/graphql/GetPageData.graphql index 74bbf493..dc518b56 100644 --- a/frontend/graphql/GetPageData.graphql +++ b/frontend/graphql/GetPageData.graphql @@ -13,12 +13,9 @@ query GetPageData($locale: String) { image { url } - projectLink { - path { - path - } - } + projectLink } + ... on ComponentBlocksSingleFeature { id title @@ -26,11 +23,7 @@ query GetPageData($locale: String) { image { url } - serviceLink { - path { - path - } - } + serviceLink } ... on ComponentBlocksHero { id diff --git a/frontend/graphql/GetPages.graphql b/frontend/graphql/GetPages.graphql index 46fab280..7d6499e9 100644 --- a/frontend/graphql/GetPages.graphql +++ b/frontend/graphql/GetPages.graphql @@ -15,11 +15,7 @@ query GetPages($where: JSON, $locale: String) { image { url } - projectLink { - path { - path - } - } + projectLink } ... on ComponentBlocksSingleFeature { id @@ -28,11 +24,7 @@ query GetPages($where: JSON, $locale: String) { image { url } - serviceLink { - path { - path - } - } + serviceLink } ... on ComponentBlocksHero { id diff --git a/frontend/graphql/generated.ts b/frontend/graphql/generated.ts index 4a02c5af..700585bb 100644 --- a/frontend/graphql/generated.ts +++ b/frontend/graphql/generated.ts @@ -43,14 +43,14 @@ export type ComponentBlocksCard = { title: Scalars['String']; description: Scalars['String']; image?: Maybe; - projectLink?: Maybe; + projectLink?: Maybe; }; export type ComponentBlocksCardInput = { title: Scalars['String']; description: Scalars['String']; image?: Maybe; - projectLink?: Maybe; + projectLink?: Maybe; }; export type ComponentBlocksFeature = { @@ -85,14 +85,14 @@ export type ComponentBlocksSingleFeature = { description: Scalars['String']; title: Scalars['String']; image?: Maybe; - serviceLink?: Maybe>>; + serviceLink?: Maybe; }; export type ComponentBlocksSingleFeatureInput = { description: Scalars['String']; title: Scalars['String']; image?: Maybe; - serviceLink?: Maybe>>; + serviceLink?: Maybe; }; export type ComponentFeatFeat = { @@ -1352,7 +1352,7 @@ export type EditComponentBlocksCardInput = { title?: Maybe; description?: Maybe; image?: Maybe; - projectLink?: Maybe; + projectLink?: Maybe; }; export type EditComponentBlocksFeatureInput = { @@ -1373,7 +1373,7 @@ export type EditComponentBlocksSingleFeatureInput = { description?: Maybe; title?: Maybe; image?: Maybe; - serviceLink?: Maybe>>; + serviceLink?: Maybe; }; export type EditComponentFeatFeatInput = { @@ -1561,33 +1561,21 @@ export type GetPageDataQuery = ( & Pick & { blocks?: Maybe + & Pick & { image?: Maybe<( { __typename?: 'UploadFile' } & Pick - )>, projectLink?: Maybe<( - { __typename?: 'ComponentMenuPageLink' } - & { path?: Maybe<( - { __typename?: 'Pages' } - & Pick - )> } )> } ) | ( { __typename: 'ComponentBlocksHero' } & Pick ) | ( { __typename: 'ComponentBlocksSingleFeature' } - & Pick + & Pick & { image?: Maybe<( { __typename?: 'UploadFile' } & Pick - )>, serviceLink?: Maybe - )> } - )>>> } + )> } )>>> } )>>> } ); @@ -1623,33 +1611,21 @@ export type GetPagesQuery = ( & Pick & { blocks?: Maybe + & Pick & { image?: Maybe<( { __typename?: 'UploadFile' } & Pick - )>, projectLink?: Maybe<( - { __typename?: 'ComponentMenuPageLink' } - & { path?: Maybe<( - { __typename?: 'Pages' } - & Pick - )> } )> } ) | ( { __typename: 'ComponentBlocksHero' } & Pick ) | ( { __typename: 'ComponentBlocksSingleFeature' } - & Pick + & Pick & { image?: Maybe<( { __typename?: 'UploadFile' } & Pick - )>, serviceLink?: Maybe - )> } - )>>> } + )> } )>>> } )>>> } ); @@ -1725,11 +1701,7 @@ export const GetPageData = ` image { url } - projectLink { - path { - path - } - } + projectLink } ... on ComponentBlocksSingleFeature { id @@ -1738,11 +1710,7 @@ export const GetPageData = ` image { url } - serviceLink { - path { - path - } - } + serviceLink } ... on ComponentBlocksHero { id @@ -1788,11 +1756,7 @@ export const GetPages = ` image { url } - projectLink { - path { - path - } - } + projectLink } ... on ComponentBlocksSingleFeature { id @@ -1801,11 +1765,7 @@ export const GetPages = ` image { url } - serviceLink { - path { - path - } - } + serviceLink } ... on ComponentBlocksHero { id diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index 46c3ea6b..dd1983c4 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -188,7 +188,7 @@ function getPageData( title: section.title, description: section.description, imageUrl: STRAPI_URL + section.image?.url, - projectLink: section.projectLink?.path?.path, + projectLink: section.projectLink, }; } case "ComponentBlocksSingleFeature": { From 99ff8487f26ed2f145c0e6ae7384289e5685a896 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Tue, 22 Jun 2021 16:09:31 +0200 Subject: [PATCH 02/15] Basic styling to hero block --- backend/components/blocks/card.json | 2 +- backend/components/blocks/hero.json | 2 +- frontend/features/pageBlocks/HeroBlock.tsx | 41 ++++++++++++++++++---- frontend/layouts/defaultLayout/index.tsx | 4 +-- frontend/pages/[...slug].tsx | 2 +- frontend/theme/index.ts | 12 +++++-- 6 files changed, 49 insertions(+), 14 deletions(-) diff --git a/backend/components/blocks/card.json b/backend/components/blocks/card.json index 4e24f04e..b250c464 100644 --- a/backend/components/blocks/card.json +++ b/backend/components/blocks/card.json @@ -8,7 +8,7 @@ "options": {}, "attributes": { "title": { - "type": "string", + "type": "text", "required": true }, "description": { diff --git a/backend/components/blocks/hero.json b/backend/components/blocks/hero.json index 8e11ba3c..ea719015 100644 --- a/backend/components/blocks/hero.json +++ b/backend/components/blocks/hero.json @@ -8,7 +8,7 @@ "options": {}, "attributes": { "title": { - "type": "string", + "type": "text", "required": true }, "subtitle": { diff --git a/frontend/features/pageBlocks/HeroBlock.tsx b/frontend/features/pageBlocks/HeroBlock.tsx index 843dec34..c2c41e2b 100644 --- a/frontend/features/pageBlocks/HeroBlock.tsx +++ b/frontend/features/pageBlocks/HeroBlock.tsx @@ -1,4 +1,5 @@ -import { Box, Flex } from "@chakra-ui/react"; +import { Flex, Box, chakra, useMediaQuery } from "@chakra-ui/react"; + import React from "react"; import { Block, BlocksControls, InlineText } from "react-tinacms-inline"; import { BlockTemplateData } from "./types"; @@ -20,20 +21,46 @@ interface HeroBlockProps { } export function HeroBlock({}: HeroBlockProps) { + /*const [isSmallerThan900] = useMediaQuery( + "(max-width: 900px){ font-size:4xl }" + );*/ return ( - - - - + + + +

+ +

- +
-
+ ); } +const HeroBox = chakra(Box); +//const H2 = chakra(InlineText); + export const heroBlock: Block = { Component: ({ index, data, name, ...other }) => { return ( diff --git a/frontend/layouts/defaultLayout/index.tsx b/frontend/layouts/defaultLayout/index.tsx index d5059208..5df37b64 100644 --- a/frontend/layouts/defaultLayout/index.tsx +++ b/frontend/layouts/defaultLayout/index.tsx @@ -1,7 +1,7 @@ import { Box, Flex, useColorMode } from "@chakra-ui/react"; import Head from "next/head"; import React from "react"; -import DarkModeSwitch from "@components/DarkModeSwitch"; +// import DarkModeSwitch from "@components/DarkModeSwitch"; export function DefaultLayout({ children, title }: any) { const { colorMode } = useColorMode(); @@ -17,7 +17,7 @@ export function DefaultLayout({ children, title }: any) { width="100%" justifyContent="flex-end" > - + {/* */}
{children}
diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index dd1983c4..948bb56c 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -41,7 +41,7 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { Date: Tue, 22 Jun 2021 16:51:54 +0200 Subject: [PATCH 03/15] Added some media queries to Hero block. TODO: figure out a way to wrap hero title. --- frontend/features/pageBlocks/HeroBlock.tsx | 20 ++++++++++++-------- frontend/theme/index.ts | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/features/pageBlocks/HeroBlock.tsx b/frontend/features/pageBlocks/HeroBlock.tsx index c2c41e2b..8f9c27b1 100644 --- a/frontend/features/pageBlocks/HeroBlock.tsx +++ b/frontend/features/pageBlocks/HeroBlock.tsx @@ -21,14 +21,20 @@ interface HeroBlockProps { } export function HeroBlock({}: HeroBlockProps) { - /*const [isSmallerThan900] = useMediaQuery( - "(max-width: 900px){ font-size:4xl }" - );*/ + const [isSmallerThan900] = useMediaQuery("(max-width: 900px)"); + const [isSmallerThan600] = useMediaQuery("(max-width: 600px)"); + const [isSmallerThan1260] = useMediaQuery("(max-width: 1260px)"); + const [isSmallerThan700] = useMediaQuery("(max-width: 700)"); + const [isSmallerThan1020] = useMediaQuery("(max-width: 1020)"); return ( - + -

- -

+
Date: Wed, 23 Jun 2021 10:35:51 +0200 Subject: [PATCH 04/15] Added style to basic hero and feature block --- backend/api/pages/models/pages.settings.json | 20 +-- backend/components/blocks/hero.json | 3 +- frontend/features/pageBlocks/FeatureBlock.tsx | 30 ++++- frontend/features/pageBlocks/HeroBlock.tsx | 9 +- frontend/features/pageBlocks/index.ts | 12 +- frontend/graphql.schema.json | 82 ++++++------ frontend/graphql/generated.ts | 8 +- frontend/layouts/defaultLayout/index.tsx | 5 +- frontend/pages/[...slug].tsx | 120 +++++++++++++++++- 9 files changed, 214 insertions(+), 75 deletions(-) diff --git a/backend/api/pages/models/pages.settings.json b/backend/api/pages/models/pages.settings.json index c9e62c1e..196c4d86 100644 --- a/backend/api/pages/models/pages.settings.json +++ b/backend/api/pages/models/pages.settings.json @@ -26,26 +26,26 @@ } } }, - "blocks": { - "type": "dynamiczone", - "components": [ - "blocks.card", - "blocks.hero", - "blocks.single-feature" - ], + "path": { + "type": "string", "pluginOptions": { "i18n": { "localized": true } } }, - "path": { - "type": "string", + "blocks": { "pluginOptions": { "i18n": { "localized": true } - } + }, + "type": "dynamiczone", + "components": [ + "blocks.card", + "blocks.hero", + "blocks.single-feature" + ] } } } diff --git a/backend/components/blocks/hero.json b/backend/components/blocks/hero.json index ea719015..c5527546 100644 --- a/backend/components/blocks/hero.json +++ b/backend/components/blocks/hero.json @@ -9,7 +9,8 @@ "attributes": { "title": { "type": "text", - "required": true + "required": true, + "default": "sd" }, "subtitle": { "type": "text" diff --git a/frontend/features/pageBlocks/FeatureBlock.tsx b/frontend/features/pageBlocks/FeatureBlock.tsx index 4bd5d7df..b88685d9 100644 --- a/frontend/features/pageBlocks/FeatureBlock.tsx +++ b/frontend/features/pageBlocks/FeatureBlock.tsx @@ -1,4 +1,4 @@ -import { Box, Flex, Link } from "@chakra-ui/react"; +import { Box, chakra, Flex, Link } from "@chakra-ui/react"; import React from "react"; import { Block, @@ -27,13 +27,31 @@ interface FeatureBlockProps { } export function FeatureBlock({}: FeatureBlockProps) { + const StyledInlineText = chakra(InlineText); return ( - - + + media.id} /> - - - + + + + + + + diff --git a/frontend/features/pageBlocks/HeroBlock.tsx b/frontend/features/pageBlocks/HeroBlock.tsx index 8f9c27b1..ab5a2771 100644 --- a/frontend/features/pageBlocks/HeroBlock.tsx +++ b/frontend/features/pageBlocks/HeroBlock.tsx @@ -30,12 +30,16 @@ export function HeroBlock({}: HeroBlockProps) { diff --git a/frontend/features/pageBlocks/index.ts b/frontend/features/pageBlocks/index.ts index f1e93b0d..323a7ddd 100644 --- a/frontend/features/pageBlocks/index.ts +++ b/frontend/features/pageBlocks/index.ts @@ -3,11 +3,19 @@ import { cardBlock, CardBlockData } from "./CardBlock"; import { featureBlock, FeatureBlockData } from "./FeatureBlock"; import { heroBlock, HeroBlockData } from "./HeroBlock"; -export const PAGE_BLOCKS = { +export const HERO_BLOCK = { /** We will define blocks here later */ hero: heroBlock, - card: cardBlock, +}; + +export const FEAT_BLOCK = { + /** We will define blocks here later */ feat: featureBlock, }; +export const CARD_BLOCK = { + /** We will define blocks here later */ + card: cardBlock, +}; + export type BlockData = HeroBlockData | CardBlockData | FeatureBlockData; diff --git a/frontend/graphql.schema.json b/frontend/graphql.schema.json index 2a089f8c..5478561b 100644 --- a/frontend/graphql.schema.json +++ b/frontend/graphql.schema.json @@ -440,13 +440,9 @@ "name": "title", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -4234,6 +4230,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "path", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "blocks", "description": null, @@ -4254,18 +4262,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "path", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "localizations", "description": null, @@ -4405,29 +4401,29 @@ "deprecationReason": null }, { - "name": "blocks", + "name": "path", "description": null, "args": [], "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "UNION", - "name": "PagesBlocksDynamicZone", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "path", + "name": "blocks", "description": null, "args": [], "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PagesBlocksDynamicZone", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null @@ -11007,6 +11003,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "path", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "blocks", "description": null, @@ -11027,18 +11035,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "path", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "localizations", "description": null, diff --git a/frontend/graphql/generated.ts b/frontend/graphql/generated.ts index 700585bb..7aaca0a6 100644 --- a/frontend/graphql/generated.ts +++ b/frontend/graphql/generated.ts @@ -75,7 +75,7 @@ export type ComponentBlocksHero = { }; export type ComponentBlocksHeroInput = { - title: Scalars['String']; + title?: Maybe; subtitle?: Maybe; }; @@ -543,8 +543,8 @@ export type NavigationItemsDynamicZone = ComponentMenuLink | ComponentMenuPageLi export type PageInput = { pageName: Scalars['String']; - blocks?: Maybe>; path?: Maybe; + blocks?: Maybe>; localizations?: Maybe>>; locale?: Maybe; published_at?: Maybe; @@ -558,8 +558,8 @@ export type Pages = { created_at: Scalars['DateTime']; updated_at: Scalars['DateTime']; pageName: Scalars['String']; - blocks?: Maybe>>; path?: Maybe; + blocks?: Maybe>>; locale?: Maybe; published_at?: Maybe; localizations?: Maybe>>; @@ -1441,8 +1441,8 @@ export type EditNavigationInput = { export type EditPageInput = { pageName?: Maybe; - blocks?: Maybe>; path?: Maybe; + blocks?: Maybe>; localizations?: Maybe>>; locale?: Maybe; published_at?: Maybe; diff --git a/frontend/layouts/defaultLayout/index.tsx b/frontend/layouts/defaultLayout/index.tsx index 5df37b64..87e07093 100644 --- a/frontend/layouts/defaultLayout/index.tsx +++ b/frontend/layouts/defaultLayout/index.tsx @@ -11,14 +11,15 @@ export function DefaultLayout({ children, title }: any) { {title} + {/* - {/* */} - + + */} {children} diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index 948bb56c..8c85a032 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -7,10 +7,22 @@ import { GetPagesQuery, GetPagesQueryVariables, } from "@graphql/generated"; -import { BlockData, BlockItemProps, PAGE_BLOCKS } from "@features/pageBlocks"; +import { + BlockData, + BlockItemProps, + CARD_BLOCK, + FEAT_BLOCK, + HERO_BLOCK, +} from "@features/pageBlocks"; import { PageData, usePagePlugin } from "@features/plugins/usePagePlugin"; import { DefaultLayout } from "@layouts/defaultLayout"; -import { chakra, useColorMode } from "@chakra-ui/react"; +import { + Box, + chakra, + Flex, + useColorMode, + useMediaQuery, +} from "@chakra-ui/react"; import { STRAPI_URL } from "@config/env"; interface DynamicPageProps { @@ -36,6 +48,13 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { }; }, [preview]); + const [isSmallerThan900] = useMediaQuery("(max-width: 900px)"); + const [isSmallerThan600] = useMediaQuery("(max-width: 600px)"); + const [isSmallerThan1260] = useMediaQuery("(max-width: 1260px)"); + const [isSmallerThan700] = useMediaQuery("(max-width: 700px)"); + const [isSmallerThan1020] = useMediaQuery("(max-width: 1020px)"); + const [isSmallerThan750] = useMediaQuery("(max-width: 750px)"); + return (
@@ -43,13 +62,104 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { + + + SERVICES + + + + +

New e-commerces, replatforming, consulting

+
+ +

+ We are Shopify partners that help ambitious entrepreneurs + selling more using Shopify. We can help you create a brand + new site, boost your e-commerce performances and user + experience, develop custom integrations with your supply + chain and improve your workflow. +

+
+
+
+ + + +
+
+ + {/* */} - -

SLUG

); From 1c139cbf0d01853798d3b8f65656b0310814449f Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Wed, 23 Jun 2021 16:52:39 +0200 Subject: [PATCH 05/15] Add sections. Can't retrieve data from Strapi. TODO: Fix this problem --- backend/api/pages/models/pages.settings.json | 14 +- frontend/features/pageBlocks/HeroBlock.tsx | 2 - frontend/features/pageBlocks/index.ts | 3 - frontend/features/plugins/usePagePlugin.ts | 120 +- frontend/graphql.schema.json | 2000 ++++++++++++++++-- frontend/graphql/GetPageData.graphql | 56 +- frontend/graphql/GetPages.graphql | 51 +- frontend/graphql/generated.ts | 456 +++- frontend/pages/[...slug].tsx | 246 +-- 9 files changed, 2406 insertions(+), 542 deletions(-) diff --git a/backend/api/pages/models/pages.settings.json b/backend/api/pages/models/pages.settings.json index 196c4d86..fa612fe6 100644 --- a/backend/api/pages/models/pages.settings.json +++ b/backend/api/pages/models/pages.settings.json @@ -34,18 +34,8 @@ } } }, - "blocks": { - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "type": "dynamiczone", - "components": [ - "blocks.card", - "blocks.hero", - "blocks.single-feature" - ] + "sections": { + "collection": "section" } } } diff --git a/frontend/features/pageBlocks/HeroBlock.tsx b/frontend/features/pageBlocks/HeroBlock.tsx index ab5a2771..0fe66003 100644 --- a/frontend/features/pageBlocks/HeroBlock.tsx +++ b/frontend/features/pageBlocks/HeroBlock.tsx @@ -68,8 +68,6 @@ export function HeroBlock({}: HeroBlockProps) { } const HeroBox = chakra(Box); -//const H2 = chakra(InlineText); - export const heroBlock: Block = { Component: ({ index, data, name, ...other }) => { return ( diff --git a/frontend/features/pageBlocks/index.ts b/frontend/features/pageBlocks/index.ts index 323a7ddd..af9bcc20 100644 --- a/frontend/features/pageBlocks/index.ts +++ b/frontend/features/pageBlocks/index.ts @@ -4,17 +4,14 @@ import { featureBlock, FeatureBlockData } from "./FeatureBlock"; import { heroBlock, HeroBlockData } from "./HeroBlock"; export const HERO_BLOCK = { - /** We will define blocks here later */ hero: heroBlock, }; export const FEAT_BLOCK = { - /** We will define blocks here later */ feat: featureBlock, }; export const CARD_BLOCK = { - /** We will define blocks here later */ card: cardBlock, }; diff --git a/frontend/features/plugins/usePagePlugin.ts b/frontend/features/plugins/usePagePlugin.ts index e8adc283..114a4708 100644 --- a/frontend/features/plugins/usePagePlugin.ts +++ b/frontend/features/plugins/usePagePlugin.ts @@ -1,11 +1,12 @@ import { BlockData } from "@features/pageBlocks"; +import { SectionBlockData } from "@features/sectionBlocks"; import { CreatePage, CreatePageInput, UpdatePage, - UpdatePageInput, + UpdateSection, + UpdateSectionInput, } from "@graphql/generated"; -import { useRouter } from "next/router"; import { ContentCreatorPlugin, Form, @@ -14,12 +15,20 @@ import { useForm, usePlugin, } from "tinacms"; +import { assertNever } from "utils"; export interface PageData { id: string; title?: string; path?: string; - blocks: BlockData[]; + sections: SectionBlockData[]; +} + +export interface SectionData { + id: string; + title?: string; + subtitle?: string; + blocks?: BlockData[]; } export interface PageDataCreateInput { @@ -28,6 +37,81 @@ export interface PageDataCreateInput { locale: string; } +export function useSectionPlugin( + sectionData: SectionData +): [SectionData, Form] { + const cms = useCMS(); + const formConfig: FormOptions = { + id: sectionData, + label: "aa", + initialValues: sectionData, + onSubmit: async (values) => { + const input = getSectionInput(values); + try { + const response = await cms.api.strapi.fetchGraphql(UpdateSection, { + input, + }); + if (response.data) { + cms.alerts.success("Changes saved!"); + } else { + cms.alerts.error("Error while saving changes"); + } + } catch (error) { + console.log(error); + cms.alerts.error("Error while saving changes"); + } + }, + fields: [], + }; + const [section, form] = useForm(formConfig); + usePlugin(form); + + return [section, form]; +} + +function getSectionInput(data: SectionData): UpdateSectionInput { + return { + where: { id: data.id }, + data: { + title: data.title, + subtitle: data.subtitle, + blocks: data.blocks?.map((section) => { + switch (section._template) { + case "hero": { + return { + id: section.id, + title: section.title, + subtitle: section.subtitle, + }; + } + case "feat": { + return { + id: section.id, + title: section.title, + subtitle: section.description, + serviceLink: section.serviceLink, + imageUrl: section.imageUrl, + }; + } + case "card": { + return { + id: section.id, + title: section.title, + subtitle: section.description, + projectLink: section.projectLink, + imageUrl: section.imageUrl, + }; + } + + default: + return assertNever(section); + } + }), + }, + }; +} + +/* export function usePagePlugin(pageData: PageData): [PageData, Form] { const cms = useCMS(); const router = useRouter(); @@ -63,43 +147,42 @@ export function usePagePlugin(pageData: PageData): [PageData, Form] { return [page, form]; } +*/ +/* function getPageInput(data: PageData): UpdatePageInput { return { where: { id: data.id }, data: { pageName: data.title, path: data.path, - blocks: data.blocks.map((block) => { - console.log("Blocks", data.blocks); - + sections: data.sections.map((block) => { switch (block._template) { - case "hero": { + case "heroSection": { return { - __typename: "ComponentBlocksHero", + __typename: "", id: block.id, title: block.title, subtitle: block.subtitle, + blocks: block.blocks, }; } - case "card": { + case "cardSection": { return { __typename: "ComponentBlocksCard", id: block.id, title: block.title, - description: block.description, - projectLink: block.projectLink, - imageUrl: block.imageUrl ? block.imageUrl : "undefined", + subtitle: block.subtitle, + blocks: block.blocks, }; } - case "feat": { + case "featureSection": { return { __typename: "ComponentBlocksSingleFeature", id: block.id, title: block.title, - description: block.description, - serviceLink: block.serviceLink, - imageUrl: block.imageUrl ? block.imageUrl : "undefined", + subtitle: block.subtitle, + blocks: block.blocks, }; } default: @@ -109,10 +192,7 @@ function getPageInput(data: PageData): UpdatePageInput { }, }; } - -function assertNever(x: never): never { - throw new Error("Unexpected object: " + x); -} +*/ interface PageCreatorPluginOptions { locales: string[]; diff --git a/frontend/graphql.schema.json b/frontend/graphql.schema.json index 5478561b..459f127a 100644 --- a/frontend/graphql.schema.json +++ b/frontend/graphql.schema.json @@ -2245,6 +2245,81 @@ "name": "deletePagePayload", "ofType": null }, + { + "kind": "OBJECT", + "name": "Section", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionAggregator", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionGroupBy", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionId", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionCreated_at", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionUpdated_at", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionTitle", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionSubtitle", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionPath", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionLocale", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionPublished_at", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "createSectionPayload", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "updateSectionPayload", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "deleteSectionPayload", + "ofType": null + }, { "kind": "OBJECT", "name": "I18NLocale", @@ -2787,6 +2862,81 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "createSection", + "description": null, + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "createSectionInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "createSectionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateSection", + "description": null, + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "updateSectionInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "updateSectionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deleteSection", + "description": null, + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "deleteSectionInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "deleteSectionPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "deleteFile", "description": "Delete one file", @@ -3061,6 +3211,39 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "createSectionLocalization", + "description": null, + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "updateSectionInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "upload", "description": null, @@ -4243,19 +4426,15 @@ "deprecationReason": null }, { - "name": "blocks", + "name": "sections", "description": null, "type": { "kind": "LIST", "name": null, "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "PagesBlocksDynamicZoneInput", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null } }, "defaultValue": null, @@ -4413,41 +4592,90 @@ "deprecationReason": null }, { - "name": "blocks", + "name": "locale", "description": null, "args": [], "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "UNION", - "name": "PagesBlocksDynamicZone", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "locale", + "name": "published_at", "description": null, "args": [], "type": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "published_at", + "name": "sections", "description": null, - "args": [], + "args": [ + { + "name": "sort", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null @@ -4559,46 +4787,10 @@ "possibleTypes": null }, { - "kind": "UNION", - "name": "PagesBlocksDynamicZone", + "kind": "OBJECT", + "name": "PagesConnection", "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "ComponentBlocksCard", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ComponentBlocksHero", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ComponentBlocksSingleFeature", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "PagesBlocksDynamicZoneInput", - "description": "Input type for dynamic zone blocks of Pages", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PagesConnection", - "description": null, - "fields": [ + "fields": [ { "name": "values", "description": null, @@ -5650,6 +5842,209 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "section", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publicationState", + "description": null, + "type": { + "kind": "ENUM", + "name": "PublicationState", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sections", + "description": null, + "args": [ + { + "name": "sort", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publicationState", + "description": null, + "type": { + "kind": "ENUM", + "name": "PublicationState", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locale", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sectionsConnection", + "description": null, + "args": [ + { + "name": "sort", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locale", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "files", "description": null, @@ -6001,84 +6396,973 @@ } ], "type": { - "kind": "OBJECT", - "name": "UsersPermissionsUser", - "ofType": null + "kind": "OBJECT", + "name": "UsersPermissionsUser", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "users", + "description": null, + "args": [ + { + "name": "sort", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publicationState", + "description": null, + "type": { + "kind": "ENUM", + "name": "PublicationState", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UsersPermissionsUser", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "usersConnection", + "description": null, + "args": [ + { + "name": "sort", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "OBJECT", + "name": "UsersPermissionsUserConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "me", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "UsersPermissionsMe", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RoleInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "permissions", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "users", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "created_by", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updated_by", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Section", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "created_at", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updated_at", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtitle", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "blocks", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "SectionBlocksDynamicZone", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locale", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "published_at", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "localizations", + "description": null, + "args": [ + { + "name": "sort", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionAggregator", + "description": null, + "fields": [ + { + "name": "count", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "SectionBlocksDynamicZone", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "ComponentBlocksCard", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ComponentBlocksHero", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ComponentBlocksSingleFeature", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "SectionBlocksDynamicZoneInput", + "description": "Input type for dynamic zone blocks of Section", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnection", + "description": null, + "fields": [ + { + "name": "values", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "groupBy", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionGroupBy", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aggregate", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionAggregator", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionCreated_at", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionId", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionLocale", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionPath", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionPublished_at", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionSubtitle", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionTitle", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionConnectionUpdated_at", + "description": null, + "fields": [ + { + "name": "key", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "connection", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "SectionConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SectionGroupBy", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionId", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "created_at", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionCreated_at", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updated_at", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionUpdated_at", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionTitle", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtitle", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionSubtitle", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null }, { - "name": "users", + "name": "path", "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "publicationState", - "description": null, - "type": { - "kind": "ENUM", - "name": "PublicationState", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], + "args": [], "type": { "kind": "LIST", "name": null, "ofType": { "kind": "OBJECT", - "name": "UsersPermissionsUser", + "name": "SectionConnectionPath", "ofType": null } }, @@ -6086,74 +7370,33 @@ "deprecationReason": null }, { - "name": "usersConnection", + "name": "locale", "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], + "args": [], "type": { - "kind": "OBJECT", - "name": "UsersPermissionsUserConnection", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionLocale", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null }, { - "name": "me", + "name": "published_at", "description": null, "args": [], "type": { - "kind": "OBJECT", - "name": "UsersPermissionsMe", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SectionConnectionPublished_at", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null @@ -6166,28 +7409,24 @@ }, { "kind": "INPUT_OBJECT", - "name": "RoleInput", + "name": "SectionInput", "description": null, "fields": null, "inputFields": [ { - "name": "name", + "name": "title", "description": null, "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "description", + "name": "subtitle", "description": null, "type": { "kind": "SCALAR", @@ -6199,7 +7438,27 @@ "deprecationReason": null }, { - "name": "type", + "name": "blocks", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "SectionBlocksDynamicZoneInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", "description": null, "type": { "kind": "SCALAR", @@ -6211,7 +7470,7 @@ "deprecationReason": null }, { - "name": "permissions", + "name": "localizations", "description": null, "type": { "kind": "LIST", @@ -6227,16 +7486,24 @@ "deprecationReason": null }, { - "name": "users", + "name": "locale", "description": null, "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "published_at", + "description": null, + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, "defaultValue": null, "isDeprecated": false, @@ -9689,16 +10956,62 @@ }, { "kind": "OBJECT", - "name": "createNavigationPayload", + "name": "createNavigationPayload", + "description": null, + "fields": [ + { + "name": "navigation", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Navigation", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "createPageInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "data", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "PageInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "createPagePayload", "description": null, "fields": [ { - "name": "navigation", + "name": "page", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "Navigation", + "name": "Pages", "ofType": null }, "isDeprecated": false, @@ -9712,7 +11025,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "createPageInput", + "name": "createRoleInput", "description": null, "fields": null, "inputFields": [ @@ -9721,7 +11034,7 @@ "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "PageInput", + "name": "RoleInput", "ofType": null }, "defaultValue": null, @@ -9735,16 +11048,16 @@ }, { "kind": "OBJECT", - "name": "createPagePayload", + "name": "createRolePayload", "description": null, "fields": [ { - "name": "page", + "name": "role", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "Pages", + "name": "UsersPermissionsRole", "ofType": null }, "isDeprecated": false, @@ -9758,7 +11071,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "createRoleInput", + "name": "createSectionInput", "description": null, "fields": null, "inputFields": [ @@ -9767,7 +11080,7 @@ "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "RoleInput", + "name": "SectionInput", "ofType": null }, "defaultValue": null, @@ -9781,16 +11094,16 @@ }, { "kind": "OBJECT", - "name": "createRolePayload", + "name": "createSectionPayload", "description": null, "fields": [ { - "name": "role", + "name": "section", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "UsersPermissionsRole", + "name": "Section", "ofType": null }, "isDeprecated": false, @@ -10078,6 +11391,52 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "deleteSectionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "where", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "InputID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "deleteSectionPayload", + "description": null, + "fields": [ + { + "name": "section", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "deleteUserInput", @@ -11016,19 +12375,15 @@ "deprecationReason": null }, { - "name": "blocks", + "name": "sections", "description": null, "type": { "kind": "LIST", "name": null, "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "PagesBlocksDynamicZoneInput", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null } }, "defaultValue": null, @@ -11207,6 +12562,137 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "editSectionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "title", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtitle", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "blocks", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "SectionBlocksDynamicZoneInput", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "path", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "localizations", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locale", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "published_at", + "description": null, + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "created_by", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updated_by", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "editUserInput", @@ -11582,6 +13068,64 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "updateSectionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "where", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "InputID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "data", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "editSectionInput", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "updateSectionPayload", + "description": null, + "fields": [ + { + "name": "section", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Section", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "updateUserInput", diff --git a/frontend/graphql/GetPageData.graphql b/frontend/graphql/GetPageData.graphql index dc518b56..d2d05140 100644 --- a/frontend/graphql/GetPageData.graphql +++ b/frontend/graphql/GetPageData.graphql @@ -1,34 +1,38 @@ -query GetPageData($locale: String) { - pages(locale: $locale) { +query getPageData { + pages { id - locale pageName + created_at + updated_at path - blocks { - __typename - ... on ComponentBlocksCard { - id - title - description - image { - url + locale + sections { + title + subtitle + blocks { + ... on ComponentBlocksHero { + id + title + subtitle } - projectLink - } - - ... on ComponentBlocksSingleFeature { - id - title - description - image { - url + ... on ComponentBlocksSingleFeature { + id + description + title + serviceLink + image { + url + } + } + ... on ComponentBlocksCard { + id + title + description + projectLink + image { + url + } } - serviceLink - } - ... on ComponentBlocksHero { - id - title - subtitle } } } diff --git a/frontend/graphql/GetPages.graphql b/frontend/graphql/GetPages.graphql index 7d6499e9..205f3b97 100644 --- a/frontend/graphql/GetPages.graphql +++ b/frontend/graphql/GetPages.graphql @@ -1,35 +1,36 @@ -query GetPages($where: JSON, $locale: String) { +query getPages($where: JSON, $locale: String) { pages(where: $where, locale: $locale) { id locale - created_at - updated_at pageName path - blocks { - __typename - ... on ComponentBlocksCard { - id - title - description - image { - url + sections { + title + subtitle + blocks { + ... on ComponentBlocksHero { + id + title + subtitle } - projectLink - } - ... on ComponentBlocksSingleFeature { - id - title - description - image { - url + ... on ComponentBlocksSingleFeature { + id + description + title + serviceLink + image { + url + } + } + ... on ComponentBlocksCard { + id + title + description + projectLink + image { + url + } } - serviceLink - } - ... on ComponentBlocksHero { - id - title - subtitle } } } diff --git a/frontend/graphql/generated.ts b/frontend/graphql/generated.ts index 7aaca0a6..79abb1ca 100644 --- a/frontend/graphql/generated.ts +++ b/frontend/graphql/generated.ts @@ -21,8 +21,8 @@ export type Scalars = { Long: any; /** Input type for dynamic zone items of Navigation */ NavigationItemsDynamicZoneInput: any; - /** Input type for dynamic zone blocks of Pages */ - PagesBlocksDynamicZoneInput: any; + /** Input type for dynamic zone blocks of Section */ + SectionBlocksDynamicZoneInput: any; /** A time string with format: HH:mm:ss.SSS */ Time: any; /** The `Upload` scalar type represents a file upload. */ @@ -262,7 +262,7 @@ export type LocaleInput = { }; -export type Morph = UsersPermissionsMe | UsersPermissionsMeRole | UsersPermissionsLoginPayload | UserPermissionsPasswordPayload | FeaturesSections | FeaturesSectionsConnection | FeaturesSectionsAggregator | FeaturesSectionsGroupBy | FeaturesSectionsConnectionId | FeaturesSectionsConnectionCreated_At | FeaturesSectionsConnectionUpdated_At | FeaturesSectionsConnectionLocale | FeaturesSectionsConnectionPublished_At | CreateFeaturesSectionPayload | UpdateFeaturesSectionPayload | DeleteFeaturesSectionPayload | Navigation | NavigationConnection | NavigationAggregator | NavigationGroupBy | NavigationConnectionId | NavigationConnectionCreated_At | NavigationConnectionUpdated_At | NavigationConnectionNavigationName | NavigationConnectionLocale | NavigationConnectionPublished_At | CreateNavigationPayload | UpdateNavigationPayload | DeleteNavigationPayload | Pages | PagesConnection | PagesAggregator | PagesGroupBy | PagesConnectionId | PagesConnectionCreated_At | PagesConnectionUpdated_At | PagesConnectionPageName | PagesConnectionPath | PagesConnectionLocale | PagesConnectionPublished_At | CreatePagePayload | UpdatePagePayload | DeletePagePayload | I18NLocale | UploadFile | UploadFileConnection | UploadFileAggregator | UploadFileAggregatorSum | UploadFileAggregatorAvg | UploadFileAggregatorMin | UploadFileAggregatorMax | UploadFileGroupBy | UploadFileConnectionId | UploadFileConnectionCreated_At | UploadFileConnectionUpdated_At | UploadFileConnectionName | UploadFileConnectionAlternativeText | UploadFileConnectionCaption | UploadFileConnectionWidth | UploadFileConnectionHeight | UploadFileConnectionFormats | UploadFileConnectionHash | UploadFileConnectionExt | UploadFileConnectionMime | UploadFileConnectionSize | UploadFileConnectionUrl | UploadFileConnectionPreviewUrl | UploadFileConnectionProvider | UploadFileConnectionProvider_Metadata | DeleteFilePayload | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsRoleConnection | UsersPermissionsRoleAggregator | UsersPermissionsRoleGroupBy | UsersPermissionsRoleConnectionId | UsersPermissionsRoleConnectionName | UsersPermissionsRoleConnectionDescription | UsersPermissionsRoleConnectionType | CreateRolePayload | UpdateRolePayload | DeleteRolePayload | UsersPermissionsUser | UsersPermissionsUserConnection | UsersPermissionsUserAggregator | UsersPermissionsUserGroupBy | UsersPermissionsUserConnectionId | UsersPermissionsUserConnectionCreated_At | UsersPermissionsUserConnectionUpdated_At | UsersPermissionsUserConnectionUsername | UsersPermissionsUserConnectionEmail | UsersPermissionsUserConnectionProvider | UsersPermissionsUserConnectionConfirmed | UsersPermissionsUserConnectionBlocked | UsersPermissionsUserConnectionRole | CreateUserPayload | UpdateUserPayload | DeleteUserPayload | ComponentBlocksCard | ComponentBlocksFeature | ComponentBlocksHero | ComponentBlocksSingleFeature | ComponentFeatFeat | ComponentMenuLink | ComponentMenuPageLink; +export type Morph = UsersPermissionsMe | UsersPermissionsMeRole | UsersPermissionsLoginPayload | UserPermissionsPasswordPayload | FeaturesSections | FeaturesSectionsConnection | FeaturesSectionsAggregator | FeaturesSectionsGroupBy | FeaturesSectionsConnectionId | FeaturesSectionsConnectionCreated_At | FeaturesSectionsConnectionUpdated_At | FeaturesSectionsConnectionLocale | FeaturesSectionsConnectionPublished_At | CreateFeaturesSectionPayload | UpdateFeaturesSectionPayload | DeleteFeaturesSectionPayload | Navigation | NavigationConnection | NavigationAggregator | NavigationGroupBy | NavigationConnectionId | NavigationConnectionCreated_At | NavigationConnectionUpdated_At | NavigationConnectionNavigationName | NavigationConnectionLocale | NavigationConnectionPublished_At | CreateNavigationPayload | UpdateNavigationPayload | DeleteNavigationPayload | Pages | PagesConnection | PagesAggregator | PagesGroupBy | PagesConnectionId | PagesConnectionCreated_At | PagesConnectionUpdated_At | PagesConnectionPageName | PagesConnectionPath | PagesConnectionLocale | PagesConnectionPublished_At | CreatePagePayload | UpdatePagePayload | DeletePagePayload | Section | SectionConnection | SectionAggregator | SectionGroupBy | SectionConnectionId | SectionConnectionCreated_At | SectionConnectionUpdated_At | SectionConnectionTitle | SectionConnectionSubtitle | SectionConnectionPath | SectionConnectionLocale | SectionConnectionPublished_At | CreateSectionPayload | UpdateSectionPayload | DeleteSectionPayload | I18NLocale | UploadFile | UploadFileConnection | UploadFileAggregator | UploadFileAggregatorSum | UploadFileAggregatorAvg | UploadFileAggregatorMin | UploadFileAggregatorMax | UploadFileGroupBy | UploadFileConnectionId | UploadFileConnectionCreated_At | UploadFileConnectionUpdated_At | UploadFileConnectionName | UploadFileConnectionAlternativeText | UploadFileConnectionCaption | UploadFileConnectionWidth | UploadFileConnectionHeight | UploadFileConnectionFormats | UploadFileConnectionHash | UploadFileConnectionExt | UploadFileConnectionMime | UploadFileConnectionSize | UploadFileConnectionUrl | UploadFileConnectionPreviewUrl | UploadFileConnectionProvider | UploadFileConnectionProvider_Metadata | DeleteFilePayload | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsRoleConnection | UsersPermissionsRoleAggregator | UsersPermissionsRoleGroupBy | UsersPermissionsRoleConnectionId | UsersPermissionsRoleConnectionName | UsersPermissionsRoleConnectionDescription | UsersPermissionsRoleConnectionType | CreateRolePayload | UpdateRolePayload | DeleteRolePayload | UsersPermissionsUser | UsersPermissionsUserConnection | UsersPermissionsUserAggregator | UsersPermissionsUserGroupBy | UsersPermissionsUserConnectionId | UsersPermissionsUserConnectionCreated_At | UsersPermissionsUserConnectionUpdated_At | UsersPermissionsUserConnectionUsername | UsersPermissionsUserConnectionEmail | UsersPermissionsUserConnectionProvider | UsersPermissionsUserConnectionConfirmed | UsersPermissionsUserConnectionBlocked | UsersPermissionsUserConnectionRole | CreateUserPayload | UpdateUserPayload | DeleteUserPayload | ComponentBlocksCard | ComponentBlocksFeature | ComponentBlocksHero | ComponentBlocksSingleFeature | ComponentFeatFeat | ComponentMenuLink | ComponentMenuPageLink; export type Mutation = { __typename?: 'Mutation'; @@ -275,6 +275,9 @@ export type Mutation = { createPage?: Maybe; updatePage?: Maybe; deletePage?: Maybe; + createSection?: Maybe; + updateSection?: Maybe; + deleteSection?: Maybe; /** Delete one file */ deleteFile?: Maybe; /** Create a new role */ @@ -292,6 +295,7 @@ export type Mutation = { createFeaturesSectionLocalization: FeaturesSections; createNavigationLocalization: Navigation; createPageLocalization: Pages; + createSectionLocalization: Section; upload: UploadFile; multipleUpload: Array>; updateFileInfo: UploadFile; @@ -348,6 +352,21 @@ export type MutationDeletePageArgs = { }; +export type MutationCreateSectionArgs = { + input?: Maybe; +}; + + +export type MutationUpdateSectionArgs = { + input?: Maybe; +}; + + +export type MutationDeleteSectionArgs = { + input?: Maybe; +}; + + export type MutationDeleteFileArgs = { input?: Maybe; }; @@ -398,6 +417,11 @@ export type MutationCreatePageLocalizationArgs = { }; +export type MutationCreateSectionLocalizationArgs = { + input: UpdateSectionInput; +}; + + export type MutationUploadArgs = { refId?: Maybe; ref?: Maybe; @@ -544,7 +568,7 @@ export type NavigationItemsDynamicZone = ComponentMenuLink | ComponentMenuPageLi export type PageInput = { pageName: Scalars['String']; path?: Maybe; - blocks?: Maybe>; + sections?: Maybe>>; localizations?: Maybe>>; locale?: Maybe; published_at?: Maybe; @@ -559,13 +583,21 @@ export type Pages = { updated_at: Scalars['DateTime']; pageName: Scalars['String']; path?: Maybe; - blocks?: Maybe>>; locale?: Maybe; published_at?: Maybe; + sections?: Maybe>>; localizations?: Maybe>>; }; +export type PagesSectionsArgs = { + sort?: Maybe; + limit?: Maybe; + start?: Maybe; + where?: Maybe; +}; + + export type PagesLocalizationsArgs = { sort?: Maybe; limit?: Maybe; @@ -579,9 +611,6 @@ export type PagesAggregator = { totalCount?: Maybe; }; -export type PagesBlocksDynamicZone = ComponentBlocksCard | ComponentBlocksHero | ComponentBlocksSingleFeature; - - export type PagesConnection = { __typename?: 'PagesConnection'; values?: Maybe>>; @@ -658,6 +687,9 @@ export type Query = { page?: Maybe; pages?: Maybe>>; pagesConnection?: Maybe; + section?: Maybe
; + sections?: Maybe>>; + sectionsConnection?: Maybe; files?: Maybe>>; filesConnection?: Maybe; role?: Maybe; @@ -746,6 +778,31 @@ export type QueryPagesConnectionArgs = { }; +export type QuerySectionArgs = { + id: Scalars['ID']; + publicationState?: Maybe; +}; + + +export type QuerySectionsArgs = { + sort?: Maybe; + limit?: Maybe; + start?: Maybe; + where?: Maybe; + publicationState?: Maybe; + locale?: Maybe; +}; + + +export type QuerySectionsConnectionArgs = { + sort?: Maybe; + limit?: Maybe; + start?: Maybe; + where?: Maybe; + locale?: Maybe; +}; + + export type QueryFilesArgs = { sort?: Maybe; limit?: Maybe; @@ -818,6 +875,116 @@ export type RoleInput = { updated_by?: Maybe; }; +export type Section = { + __typename?: 'Section'; + id: Scalars['ID']; + created_at: Scalars['DateTime']; + updated_at: Scalars['DateTime']; + title?: Maybe; + subtitle?: Maybe; + blocks?: Maybe>>; + path?: Maybe; + locale?: Maybe; + published_at?: Maybe; + localizations?: Maybe>>; +}; + + +export type SectionLocalizationsArgs = { + sort?: Maybe; + limit?: Maybe; + start?: Maybe; + where?: Maybe; +}; + +export type SectionAggregator = { + __typename?: 'SectionAggregator'; + count?: Maybe; + totalCount?: Maybe; +}; + +export type SectionBlocksDynamicZone = ComponentBlocksCard | ComponentBlocksHero | ComponentBlocksSingleFeature; + + +export type SectionConnection = { + __typename?: 'SectionConnection'; + values?: Maybe>>; + groupBy?: Maybe; + aggregate?: Maybe; +}; + +export type SectionConnectionCreated_At = { + __typename?: 'SectionConnectionCreated_at'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionId = { + __typename?: 'SectionConnectionId'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionLocale = { + __typename?: 'SectionConnectionLocale'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionPath = { + __typename?: 'SectionConnectionPath'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionPublished_At = { + __typename?: 'SectionConnectionPublished_at'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionSubtitle = { + __typename?: 'SectionConnectionSubtitle'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionTitle = { + __typename?: 'SectionConnectionTitle'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionConnectionUpdated_At = { + __typename?: 'SectionConnectionUpdated_at'; + key?: Maybe; + connection?: Maybe; +}; + +export type SectionGroupBy = { + __typename?: 'SectionGroupBy'; + id?: Maybe>>; + created_at?: Maybe>>; + updated_at?: Maybe>>; + title?: Maybe>>; + subtitle?: Maybe>>; + path?: Maybe>>; + locale?: Maybe>>; + published_at?: Maybe>>; +}; + +export type SectionInput = { + title?: Maybe; + subtitle?: Maybe; + blocks?: Maybe>; + path?: Maybe; + localizations?: Maybe>>; + locale?: Maybe; + published_at?: Maybe; + created_by?: Maybe; + updated_by?: Maybe; +}; + export type UploadFile = { @@ -1284,6 +1451,15 @@ export type CreateRolePayload = { role?: Maybe; }; +export type CreateSectionInput = { + data?: Maybe; +}; + +export type CreateSectionPayload = { + __typename?: 'createSectionPayload'; + section?: Maybe
; +}; + export type CreateUserInput = { data?: Maybe; }; @@ -1338,6 +1514,15 @@ export type DeleteRolePayload = { role?: Maybe; }; +export type DeleteSectionInput = { + where?: Maybe; +}; + +export type DeleteSectionPayload = { + __typename?: 'deleteSectionPayload'; + section?: Maybe
; +}; + export type DeleteUserInput = { where?: Maybe; }; @@ -1442,7 +1627,7 @@ export type EditNavigationInput = { export type EditPageInput = { pageName?: Maybe; path?: Maybe; - blocks?: Maybe>; + sections?: Maybe>>; localizations?: Maybe>>; locale?: Maybe; published_at?: Maybe; @@ -1460,6 +1645,18 @@ export type EditRoleInput = { updated_by?: Maybe; }; +export type EditSectionInput = { + title?: Maybe; + subtitle?: Maybe; + blocks?: Maybe>; + path?: Maybe; + localizations?: Maybe>>; + locale?: Maybe; + published_at?: Maybe; + created_by?: Maybe; + updated_by?: Maybe; +}; + export type EditUserInput = { username?: Maybe; email?: Maybe; @@ -1514,6 +1711,16 @@ export type UpdateRolePayload = { role?: Maybe; }; +export type UpdateSectionInput = { + where?: Maybe; + data?: Maybe; +}; + +export type UpdateSectionPayload = { + __typename?: 'updateSectionPayload'; + section?: Maybe
; +}; + export type UpdateUserInput = { where?: Maybe; data?: Maybe; @@ -1549,33 +1756,35 @@ export type GetNavItemsQuery = ( )>>> } ); -export type GetPageDataQueryVariables = Exact<{ - locale?: Maybe; -}>; +export type GetPageDataQueryVariables = Exact<{ [key: string]: never; }>; export type GetPageDataQuery = ( { __typename?: 'Query' } & { pages?: Maybe - & { blocks?: Maybe - & { image?: Maybe<( - { __typename?: 'UploadFile' } - & Pick - )> } - ) | ( - { __typename: 'ComponentBlocksHero' } - & Pick - ) | ( - { __typename: 'ComponentBlocksSingleFeature' } - & Pick - & { image?: Maybe<( - { __typename?: 'UploadFile' } - & Pick - )> } + & Pick + & { sections?: Maybe + & { blocks?: Maybe + & { image?: Maybe<( + { __typename?: 'UploadFile' } + & Pick + )> } + ) | ( + { __typename?: 'ComponentBlocksHero' } + & Pick + ) | ( + { __typename?: 'ComponentBlocksSingleFeature' } + & Pick + & { image?: Maybe<( + { __typename?: 'UploadFile' } + & Pick + )> } + )>>> } )>>> } )>>> } ); @@ -1608,19 +1817,55 @@ export type GetPagesQuery = ( { __typename?: 'Query' } & { pages?: Maybe + & Pick + & { sections?: Maybe + & { blocks?: Maybe + & { image?: Maybe<( + { __typename?: 'UploadFile' } + & Pick + )> } + ) | ( + { __typename?: 'ComponentBlocksHero' } + & Pick + ) | ( + { __typename?: 'ComponentBlocksSingleFeature' } + & Pick + & { image?: Maybe<( + { __typename?: 'UploadFile' } + & Pick + )> } + )>>> } + )>>> } + )>>> } +); + +export type GetSectionsQueryVariables = Exact<{ + where?: Maybe; + locale?: Maybe; +}>; + + +export type GetSectionsQuery = ( + { __typename?: 'Query' } + & { sections?: Maybe & { blocks?: Maybe & { image?: Maybe<( { __typename?: 'UploadFile' } & Pick )> } ) | ( - { __typename: 'ComponentBlocksHero' } + { __typename?: 'ComponentBlocksHero' } & Pick ) | ( - { __typename: 'ComponentBlocksSingleFeature' } + { __typename?: 'ComponentBlocksSingleFeature' } & Pick & { image?: Maybe<( { __typename?: 'UploadFile' } @@ -1630,6 +1875,22 @@ export type GetPagesQuery = ( )>>> } ); +export type UpdateSectionMutationVariables = Exact<{ + input?: Maybe; +}>; + + +export type UpdateSectionMutation = ( + { __typename?: 'Mutation' } + & { updateSection?: Maybe<( + { __typename?: 'updateSectionPayload' } + & { section?: Maybe<( + { __typename?: 'Section' } + & Pick + )> } + )> } +); + export type CreatePageMutationVariables = Exact<{ input?: Maybe; }>; @@ -1686,36 +1947,41 @@ export const GetNavItems = ` } `; export const GetPageData = ` - query GetPageData($locale: String) { - pages(locale: $locale) { + query getPageData { + pages { id - locale pageName + created_at + updated_at path - blocks { - __typename - ... on ComponentBlocksCard { - id - title - description - image { - url + locale + sections { + title + subtitle + blocks { + ... on ComponentBlocksHero { + id + title + subtitle } - projectLink - } - ... on ComponentBlocksSingleFeature { - id - title - description - image { - url + ... on ComponentBlocksSingleFeature { + id + description + title + serviceLink + image { + url + } + } + ... on ComponentBlocksCard { + id + title + description + projectLink + image { + url + } } - serviceLink - } - ... on ComponentBlocksHero { - id - title - subtitle } } } @@ -1739,43 +2005,89 @@ export const GetFeatures = ` } `; export const GetPages = ` - query GetPages($where: JSON, $locale: String) { + query getPages($where: JSON, $locale: String) { pages(where: $where, locale: $locale) { id locale - created_at - updated_at pageName path + sections { + title + subtitle + blocks { + ... on ComponentBlocksHero { + id + title + subtitle + } + ... on ComponentBlocksSingleFeature { + id + description + title + serviceLink + image { + url + } + } + ... on ComponentBlocksCard { + id + title + description + projectLink + image { + url + } + } + } + } + } +} + `; +export const GetSections = ` + query GetSections($where: JSON, $locale: String) { + sections(where: $where, locale: $locale) { + id + title + subtitle + locale + path blocks { - __typename - ... on ComponentBlocksCard { + ... on ComponentBlocksHero { id title - description - image { - url - } - projectLink + subtitle } ... on ComponentBlocksSingleFeature { id title description + serviceLink image { url } - serviceLink } - ... on ComponentBlocksHero { + ... on ComponentBlocksCard { id title - subtitle + description + projectLink + image { + url + } } } } } `; +export const UpdateSection = ` + mutation UpdateSection($input: updateSectionInput) { + updateSection(input: $input) { + section { + id + } + } +} + `; export const CreatePage = ` mutation CreatePage($input: createPageInput) { createPage(input: $input) { diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index 8c85a032..5c4b462f 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -6,41 +6,36 @@ import { GetPages, GetPagesQuery, GetPagesQueryVariables, + GetSections, + GetSectionsQuery, + GetSectionsQueryVariables, } from "@graphql/generated"; -import { - BlockData, - BlockItemProps, - CARD_BLOCK, - FEAT_BLOCK, - HERO_BLOCK, -} from "@features/pageBlocks"; -import { PageData, usePagePlugin } from "@features/plugins/usePagePlugin"; +import { BlockItemProps } from "@features/pageBlocks"; +import { SectionData, useSectionPlugin } from "@features/plugins/usePagePlugin"; import { DefaultLayout } from "@layouts/defaultLayout"; -import { - Box, - chakra, - Flex, - useColorMode, - useMediaQuery, -} from "@chakra-ui/react"; -import { STRAPI_URL } from "@config/env"; +import { chakra, useColorMode } from "@chakra-ui/react"; +import { SectionBlockData, SECTION_PAGE_BLOCKS } from "@features/sectionBlocks"; +import { assertNever } from "utils"; interface DynamicPageProps { path: string[]; locale: string; preview: boolean; previewData?: PreviewData; - pageData: PageData; + sectionData: SectionData; } -export default function DynamicPage({ pageData, preview }: DynamicPageProps) { - if (pageData == null) { +export default function DynamicPage({ + sectionData, + preview, +}: DynamicPageProps) { + if (sectionData == null) { return null; } const { colorMode } = useColorMode(); - const [_, form] = usePagePlugin(pageData); + const [_, form] = useSectionPlugin(sectionData); const itemProps = React.useMemo(() => { return { @@ -48,13 +43,6 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { }; }, [preview]); - const [isSmallerThan900] = useMediaQuery("(max-width: 900px)"); - const [isSmallerThan600] = useMediaQuery("(max-width: 600px)"); - const [isSmallerThan1260] = useMediaQuery("(max-width: 1260px)"); - const [isSmallerThan700] = useMediaQuery("(max-width: 700px)"); - const [isSmallerThan1020] = useMediaQuery("(max-width: 1020px)"); - const [isSmallerThan750] = useMediaQuery("(max-width: 750px)"); - return (
@@ -62,101 +50,9 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { - - - SERVICES - - - - -

New e-commerces, replatforming, consulting

-
- -

- We are Shopify partners that help ambitious entrepreneurs - selling more using Shopify. We can help you create a brand - new site, boost your e-commerce performances and user - experience, develop custom integrations with your supply - chain and improve your workflow. -

-
-
-
- - - -
-
- - {/* */} @@ -193,14 +89,11 @@ export const getStaticPaths: GetStaticPaths = async (context) => { // Decompose the slug that was saved in Strapi const pagePath = page.path?.replace(/^\/+/, "") || ""; const slugArray: any = pagePath.length > 0 ? pagePath.split("/") : false; - console.log("Slug array", slugArray); - return { params: { slug: slugArray }, locale: page.locale!, }; }); - console.log("Paths", paths); return { paths, fallback: true }; }; @@ -222,6 +115,15 @@ export const getStaticProps: GetStaticProps< throw new Error(`Path "${pathParts.join("/")}" has no locale!`); } const preview = context.preview === true; + const localeSection = await fetchGraphQL< + GetSectionsQuery, + GetSectionsQueryVariables + >(GetSections, { + locale, + where: { + path, + }, + }); const localePages = await fetchGraphQL( GetPages, @@ -239,20 +141,29 @@ export const getStaticProps: GetStaticProps< }; } - const pageData = getPageData(localePages.pages, locale); - - if (pageData == null) { + if (localeSection.sections == null) { return { notFound: true, }; } - console.log("Page data", pageData); + const sectionData = getSectionData(localeSection.sections, locale); + console.log( + "localeSection.section", + JSON.stringify(localeSection.sections, null, " ") + ); + console.log("Section data", JSON.stringify(sectionData?.blocks, null, " ")); + + if (sectionData == null) { + return { + notFound: true, + }; + } if (preview) { return { props: { - pageData, + sectionData, path: pathParts, locale, preview, @@ -263,62 +174,89 @@ export const getStaticProps: GetStaticProps< return { props: { - pageData, + sectionData, path: pathParts, locale, preview, }, }; }; - +/* function getPageData( pages: GetPagesQuery["pages"], locale: string ): PageData | undefined { const page = pages?.find((page) => page?.locale === locale); + console.log("Page", page); + if (page) { - const blocks = - page.blocks?.map((section) => { + const sections = + page.sections?.map((section) => { if (section == null) { return null; } - switch (section.__typename) { + return { + title: section.title, + subtitle: section.subtitle, + blocks: section.blocks, + }; + }) || []; + + return { + id: page.id, + sections: filterListNullableItems(sections), + path: page.path ? page.path : undefined, + }; + } +} +*/ + +function getSectionData( + sections: GetSectionsQuery["sections"], + locale: string +): SectionData | undefined { + const section = sections?.find((section) => section?.locale === locale); + if (section) { + const sections = + section.blocks?.map((block) => { + if (block == null) return null; + switch (block.__typename) { case "ComponentBlocksHero": { return { - _template: "hero", - id: section.id, - title: section.title, - subtitle: section.subtitle, + id: block.id, + title: block.title, + subtitle: block.subtitle, }; } case "ComponentBlocksCard": { return { - _template: "card", - id: section.id, - title: section.title, - description: section.description, - imageUrl: STRAPI_URL + section.image?.url, - projectLink: section.projectLink, + id: block.id, + title: block.id, + subtitle: block.id, + projectLink: block.projectLink, + imageUrl: block.image?.url, }; } case "ComponentBlocksSingleFeature": { return { - _template: "feat", - id: section.id, - title: section.title, - description: section.description, - imageUrl: STRAPI_URL + section.image?.url, - serviceLink: section.serviceLink, + id: block.id, + title: block.id, + subtitle: block.id, + serviceLink: block.serviceLink, + imageUrl: block.image?.url, }; } + default: - return null; + return assertNever(block); } }) || []; return { - id: page.id, - blocks: filterListNullableItems(blocks), - path: page.path ? page.path : undefined, + id: section.id, + title: section.title ? section.title : undefined, + subtitle: section.subtitle ? section.subtitle : undefined, + blocks: filterListNullableItems(sections), }; } + return undefined; } From e2418d1585643a9d8af1224ff2a0253252ae069e Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Thu, 24 Jun 2021 16:55:59 +0200 Subject: [PATCH 06/15] Almost fixed sections --- .../api/features-sections/config/routes.json | 52 - .../controllers/features-sections.js | 8 - .../models/features-sections.js | 8 - .../models/features-sections.settings.json | 31 - .../services/features-sections.js | 8 - backend/api/pages/models/pages.settings.json | 12 +- backend/components/blocks/feature.json | 22 - backend/components/blocks/hero.json | 5 +- backend/components/feat/feat.json | 13 - frontend/features/pageBlocks/CardBlock.tsx | 4 +- frontend/features/pageBlocks/FeatureBlock.tsx | 2 +- frontend/features/pageBlocks/HeroBlock.tsx | 6 +- frontend/features/plugins/usePagePlugin.ts | 150 +- frontend/graphql.schema.json | 3453 +++-------------- frontend/graphql/GetPageData.graphql | 39 - frontend/graphql/GetPageSections.graphql | 15 - frontend/graphql/GetPages.graphql | 44 +- frontend/graphql/generated.ts | 732 +--- frontend/pages/[...slug].tsx | 255 +- 19 files changed, 814 insertions(+), 4045 deletions(-) delete mode 100644 backend/api/features-sections/config/routes.json delete mode 100644 backend/api/features-sections/controllers/features-sections.js delete mode 100644 backend/api/features-sections/models/features-sections.js delete mode 100644 backend/api/features-sections/models/features-sections.settings.json delete mode 100644 backend/api/features-sections/services/features-sections.js delete mode 100644 backend/components/blocks/feature.json delete mode 100644 backend/components/feat/feat.json delete mode 100644 frontend/graphql/GetPageData.graphql delete mode 100644 frontend/graphql/GetPageSections.graphql diff --git a/backend/api/features-sections/config/routes.json b/backend/api/features-sections/config/routes.json deleted file mode 100644 index 637da113..00000000 --- a/backend/api/features-sections/config/routes.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "routes": [ - { - "method": "GET", - "path": "/features-sections", - "handler": "features-sections.find", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/features-sections/count", - "handler": "features-sections.count", - "config": { - "policies": [] - } - }, - { - "method": "GET", - "path": "/features-sections/:id", - "handler": "features-sections.findOne", - "config": { - "policies": [] - } - }, - { - "method": "POST", - "path": "/features-sections", - "handler": "features-sections.create", - "config": { - "policies": [] - } - }, - { - "method": "PUT", - "path": "/features-sections/:id", - "handler": "features-sections.update", - "config": { - "policies": [] - } - }, - { - "method": "DELETE", - "path": "/features-sections/:id", - "handler": "features-sections.delete", - "config": { - "policies": [] - } - } - ] -} diff --git a/backend/api/features-sections/controllers/features-sections.js b/backend/api/features-sections/controllers/features-sections.js deleted file mode 100644 index e8608953..00000000 --- a/backend/api/features-sections/controllers/features-sections.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-controllers) - * to customize this controller - */ - -module.exports = {}; diff --git a/backend/api/features-sections/models/features-sections.js b/backend/api/features-sections/models/features-sections.js deleted file mode 100644 index 0054d33c..00000000 --- a/backend/api/features-sections/models/features-sections.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#lifecycle-hooks) - * to customize this model - */ - -module.exports = {}; diff --git a/backend/api/features-sections/models/features-sections.settings.json b/backend/api/features-sections/models/features-sections.settings.json deleted file mode 100644 index 9a247eed..00000000 --- a/backend/api/features-sections/models/features-sections.settings.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "kind": "collectionType", - "collectionName": "features_sections", - "info": { - "name": "pageFeaturesSection", - "description": "" - }, - "options": { - "increments": true, - "timestamps": true, - "draftAndPublish": true - }, - "pluginOptions": { - "i18n": { - "localized": true - } - }, - "attributes": { - "blocks": { - "type": "dynamiczone", - "components": [ - "blocks.feature" - ], - "pluginOptions": { - "i18n": { - "localized": true - } - } - } - } -} diff --git a/backend/api/features-sections/services/features-sections.js b/backend/api/features-sections/services/features-sections.js deleted file mode 100644 index 6538a8c8..00000000 --- a/backend/api/features-sections/services/features-sections.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-services) - * to customize this service - */ - -module.exports = {}; diff --git a/backend/api/pages/models/pages.settings.json b/backend/api/pages/models/pages.settings.json index fa612fe6..37233a06 100644 --- a/backend/api/pages/models/pages.settings.json +++ b/backend/api/pages/models/pages.settings.json @@ -35,7 +35,17 @@ } }, "sections": { - "collection": "section" + "pluginOptions": { + "i18n": { + "localized": true + } + }, + "type": "dynamiczone", + "components": [ + "section.card-section", + "section.hero-section", + "section.single-feature-section" + ] } } } diff --git a/backend/components/blocks/feature.json b/backend/components/blocks/feature.json deleted file mode 100644 index 9849b136..00000000 --- a/backend/components/blocks/feature.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "collectionName": "components_blocks_features", - "info": { - "name": "feature", - "icon": "ad" - }, - "options": {}, - "attributes": { - "featureTitle": { - "type": "string", - "required": true - }, - "featureDescription": { - "type": "text" - }, - "feat": { - "type": "component", - "repeatable": true, - "component": "feat.feat" - } - } -} diff --git a/backend/components/blocks/hero.json b/backend/components/blocks/hero.json index c5527546..5fa9d44b 100644 --- a/backend/components/blocks/hero.json +++ b/backend/components/blocks/hero.json @@ -8,9 +8,8 @@ "options": {}, "attributes": { "title": { - "type": "text", - "required": true, - "default": "sd" + "type": "string", + "required": false }, "subtitle": { "type": "text" diff --git a/backend/components/feat/feat.json b/backend/components/feat/feat.json deleted file mode 100644 index b7f573b9..00000000 --- a/backend/components/feat/feat.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "collectionName": "components_feat_feats", - "info": { - "name": "feat", - "icon": "angle-up" - }, - "options": {}, - "attributes": { - "featDescription": { - "type": "text" - } - } -} diff --git a/frontend/features/pageBlocks/CardBlock.tsx b/frontend/features/pageBlocks/CardBlock.tsx index cfea2d2c..7a80b9ba 100644 --- a/frontend/features/pageBlocks/CardBlock.tsx +++ b/frontend/features/pageBlocks/CardBlock.tsx @@ -9,7 +9,7 @@ import { import { BlockTemplateData } from "./types"; export type CardBlockData = BlockTemplateData< - "card", + "ComponentBlocksCard", { id: string; imageUrl?: string; @@ -26,7 +26,7 @@ interface CardBlockProps { projectLink?: string; } -export function CardBlock({ imageUrl, projectLink }: CardBlockProps) { +export function CardBlock({ projectLink }: CardBlockProps) { return ( ; diff --git a/frontend/features/plugins/usePagePlugin.ts b/frontend/features/plugins/usePagePlugin.ts index 114a4708..525c9b26 100644 --- a/frontend/features/plugins/usePagePlugin.ts +++ b/frontend/features/plugins/usePagePlugin.ts @@ -1,12 +1,11 @@ -import { BlockData } from "@features/pageBlocks"; import { SectionBlockData } from "@features/sectionBlocks"; import { CreatePage, CreatePageInput, UpdatePage, - UpdateSection, - UpdateSectionInput, + UpdatePageInput, } from "@graphql/generated"; +import { useRouter } from "next/router"; import { ContentCreatorPlugin, Form, @@ -24,94 +23,12 @@ export interface PageData { sections: SectionBlockData[]; } -export interface SectionData { - id: string; - title?: string; - subtitle?: string; - blocks?: BlockData[]; -} - export interface PageDataCreateInput { title: string; path: string; locale: string; } -export function useSectionPlugin( - sectionData: SectionData -): [SectionData, Form] { - const cms = useCMS(); - const formConfig: FormOptions = { - id: sectionData, - label: "aa", - initialValues: sectionData, - onSubmit: async (values) => { - const input = getSectionInput(values); - try { - const response = await cms.api.strapi.fetchGraphql(UpdateSection, { - input, - }); - if (response.data) { - cms.alerts.success("Changes saved!"); - } else { - cms.alerts.error("Error while saving changes"); - } - } catch (error) { - console.log(error); - cms.alerts.error("Error while saving changes"); - } - }, - fields: [], - }; - const [section, form] = useForm(formConfig); - usePlugin(form); - - return [section, form]; -} - -function getSectionInput(data: SectionData): UpdateSectionInput { - return { - where: { id: data.id }, - data: { - title: data.title, - subtitle: data.subtitle, - blocks: data.blocks?.map((section) => { - switch (section._template) { - case "hero": { - return { - id: section.id, - title: section.title, - subtitle: section.subtitle, - }; - } - case "feat": { - return { - id: section.id, - title: section.title, - subtitle: section.description, - serviceLink: section.serviceLink, - imageUrl: section.imageUrl, - }; - } - case "card": { - return { - id: section.id, - title: section.title, - subtitle: section.description, - projectLink: section.projectLink, - imageUrl: section.imageUrl, - }; - } - - default: - return assertNever(section); - } - }), - }, - }; -} - -/* export function usePagePlugin(pageData: PageData): [PageData, Form] { const cms = useCMS(); const router = useRouter(); @@ -147,52 +64,77 @@ export function usePagePlugin(pageData: PageData): [PageData, Form] { return [page, form]; } -*/ -/* function getPageInput(data: PageData): UpdatePageInput { return { where: { id: data.id }, data: { pageName: data.title, path: data.path, - sections: data.sections.map((block) => { - switch (block._template) { + sections: data.sections.map((section) => { + switch (section._template) { case "heroSection": { return { - __typename: "", - id: block.id, - title: block.title, - subtitle: block.subtitle, - blocks: block.blocks, + __typename: "ComponentBlocksHero", + id: section.id, + title: section.title, + subtitle: section.subtitle, + sections: section.blocks?.map((hero) => { + if (hero != null) { + return { + id: hero.id, + title: hero.title, + subtitle: hero.subtitle, + }; + } + }), }; } case "cardSection": { return { __typename: "ComponentBlocksCard", - id: block.id, - title: block.title, - subtitle: block.subtitle, - blocks: block.blocks, + id: section.id, + title: section.title, + subtitle: section.subtitle, + sections: section.blocks?.map((card) => { + if (card != null) { + return { + id: card.id, + title: card.title, + description: card.description, + imageUrl: card.imageUrl, + projectLink: card.projectLink, + }; + } + }), }; } case "featureSection": { return { __typename: "ComponentBlocksSingleFeature", - id: block.id, - title: block.title, - subtitle: block.subtitle, - blocks: block.blocks, + id: section.id, + title: section.title, + subtitle: section.subtitle, + sections: section.blocks?.map((feature) => { + if (feature != null) { + return { + id: feature.id, + title: feature.title, + description: feature.description, + imageUrl: feature.imageUrl, + serviceLink: feature.serviceLink, + }; + } + }), }; } default: - return assertNever(block); + return assertNever(section); } }), }, }; } -*/ interface PageCreatorPluginOptions { locales: string[]; diff --git a/frontend/graphql.schema.json b/frontend/graphql.schema.json index 459f127a..b239cac9 100644 --- a/frontend/graphql.schema.json +++ b/frontend/graphql.schema.json @@ -251,7 +251,7 @@ }, { "kind": "OBJECT", - "name": "ComponentBlocksFeature", + "name": "ComponentBlocksHero", "description": null, "fields": [ { @@ -271,144 +271,14 @@ "deprecationReason": null }, { - "name": "featureTitle", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "featureDescription", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "feat", + "name": "title", "description": null, "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ComponentFeatFeat", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ComponentBlocksFeatureInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "featureTitle", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "featureDescription", - "description": null, "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "feat", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ComponentFeatFeatInput", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ComponentBlocksHero", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, "isDeprecated": false, "deprecationReason": null }, @@ -615,68 +485,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "OBJECT", - "name": "ComponentFeatFeat", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "featDescription", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ComponentFeatFeatInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "featDescription", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, { "kind": "OBJECT", "name": "ComponentMenuLink", @@ -866,56 +674,16 @@ "possibleTypes": null }, { - "kind": "SCALAR", - "name": "Date", - "description": "A date string, such as 2007-12-03, compliant with the `full-date` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "DateTime", - "description": "A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "FeaturesSectionInput", + "kind": "OBJECT", + "name": "ComponentSectionCardSection", "description": null, - "fields": null, - "inputFields": [ - { - "name": "blocks", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "FeaturesSectionsBlocksDynamicZoneInput", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, + "fields": [ { - "name": "localizations", + "name": "id", "description": null, + "args": [], "type": { - "kind": "LIST", + "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", @@ -923,102 +691,113 @@ "ofType": null } }, - "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "locale", + "name": "title", "description": null, + "args": [], "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "published_at", + "name": "subtitle", "description": null, + "args": [], "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null }, - "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "created_by", + "name": "card", "description": null, + "args": [], "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ComponentBlocksCard", + "ofType": null + } }, - "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "updated_by", + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ComponentSectionCardSectionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "title", "description": null, "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null }, "defaultValue": null, "isDeprecated": false, "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSections", - "description": null, - "fields": [ + }, { - "name": "id", + "name": "subtitle", "description": null, - "args": [], "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "String", + "ofType": null }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "created_at", + "name": "card", "description": null, - "args": [], "type": { - "kind": "NON_NULL", + "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "DateTime", + "kind": "INPUT_OBJECT", + "name": "ComponentBlocksCardInput", "ofType": null } }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ComponentSectionHeroSection", + "description": null, + "fields": [ { - "name": "updated_at", + "name": "id", "description": null, "args": [], "type": { @@ -1026,7 +805,7 @@ "name": null, "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "ID", "ofType": null } }, @@ -1034,15 +813,15 @@ "deprecationReason": null }, { - "name": "blocks", + "name": "hero", "description": null, "args": [], "type": { "kind": "LIST", "name": null, "ofType": { - "kind": "UNION", - "name": "FeaturesSectionsBlocksDynamicZone", + "kind": "OBJECT", + "name": "ComponentBlocksHero", "ofType": null } }, @@ -1050,7 +829,7 @@ "deprecationReason": null }, { - "name": "locale", + "name": "title", "description": null, "args": [], "type": { @@ -1062,174 +841,89 @@ "deprecationReason": null }, { - "name": "published_at", + "name": "subtitle", "description": null, "args": [], "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null }, "isDeprecated": false, "deprecationReason": null - }, + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ComponentSectionHeroSectionInput", + "description": null, + "fields": null, + "inputFields": [ { - "name": "localizations", + "name": "hero", "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], "type": { "kind": "LIST", "name": null, "ofType": { - "kind": "OBJECT", - "name": "FeaturesSections", + "kind": "INPUT_OBJECT", + "name": "ComponentBlocksHeroInput", "ofType": null } }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsAggregator", - "description": null, - "fields": [ + }, { - "name": "count", + "name": "title", "description": null, - "args": [], "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "totalCount", + "name": "subtitle", "description": null, - "args": [], "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null } ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "UNION", - "name": "FeaturesSectionsBlocksDynamicZone", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "ComponentBlocksFeature", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "FeaturesSectionsBlocksDynamicZoneInput", - "description": "Input type for dynamic zone blocks of FeaturesSections", - "fields": null, - "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null }, { "kind": "OBJECT", - "name": "FeaturesSectionsConnection", + "name": "ComponentSectionSingleFeatureSection", "description": null, "fields": [ { - "name": "values", + "name": "id", "description": null, "args": [], "type": { - "kind": "LIST", + "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "FeaturesSections", + "kind": "SCALAR", + "name": "ID", "ofType": null } }, @@ -1237,60 +931,41 @@ "deprecationReason": null }, { - "name": "groupBy", + "name": "title", "description": null, "args": [], "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsGroupBy", + "kind": "SCALAR", + "name": "String", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "aggregate", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsAggregator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionCreated_at", - "description": null, - "fields": [ - { - "name": "key", + "name": "subtitle", "description": null, "args": [], "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "connection", + "name": "singleFeature", "description": null, "args": [], "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnection", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ComponentBlocksSingleFeature", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null @@ -1302,233 +977,73 @@ "possibleTypes": null }, { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionId", + "kind": "INPUT_OBJECT", + "name": "ComponentSectionSingleFeatureSectionInput", "description": null, - "fields": [ + "fields": null, + "inputFields": [ { - "name": "key", + "name": "title", "description": null, - "args": [], "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "connection", + "name": "subtitle", "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionLocale", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], "type": { "kind": "SCALAR", "name": "String", "ofType": null }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionPublished_at", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", + "name": "singleFeature", "description": null, - "args": [], "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnection", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ComponentBlocksSingleFeatureInput", + "ofType": null + } }, + "defaultValue": null, "isDeprecated": false, "deprecationReason": null } ], - "inputFields": null, - "interfaces": [], + "interfaces": null, "enumValues": null, "possibleTypes": null }, { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionUpdated_at", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], + "kind": "SCALAR", + "name": "Date", + "description": "A date string, such as 2007-12-03, compliant with the `full-date` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.", + "fields": null, "inputFields": null, - "interfaces": [], + "interfaces": null, "enumValues": null, "possibleTypes": null }, { - "kind": "OBJECT", - "name": "FeaturesSectionsGroupBy", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionId", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "created_at", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionCreated_at", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updated_at", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionUpdated_at", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionLocale", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "published_at", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionPublished_at", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], + "kind": "SCALAR", + "name": "DateTime", + "description": "A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.", + "fields": null, "inputFields": null, - "interfaces": [], + "interfaces": null, "enumValues": null, "possibleTypes": null }, @@ -1822,6 +1337,16 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "SCALAR", + "name": "Int", + "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "SCALAR", "name": "Float", @@ -2050,66 +1575,6 @@ "name": "UserPermissionsPasswordPayload", "ofType": null }, - { - "kind": "OBJECT", - "name": "FeaturesSections", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnection", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsAggregator", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsGroupBy", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionId", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionCreated_at", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionUpdated_at", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionLocale", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "FeaturesSectionsConnectionPublished_at", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "createFeaturesSectionPayload", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "updateFeaturesSectionPayload", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "deleteFeaturesSectionPayload", - "ofType": null - }, { "kind": "OBJECT", "name": "Navigation", @@ -2247,132 +1712,57 @@ }, { "kind": "OBJECT", - "name": "Section", + "name": "I18NLocale", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnection", + "name": "UploadFile", "ofType": null }, { "kind": "OBJECT", - "name": "SectionAggregator", + "name": "UploadFileConnection", "ofType": null }, { "kind": "OBJECT", - "name": "SectionGroupBy", + "name": "UploadFileAggregator", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionId", + "name": "UploadFileAggregatorSum", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionCreated_at", + "name": "UploadFileAggregatorAvg", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionUpdated_at", + "name": "UploadFileAggregatorMin", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionTitle", + "name": "UploadFileAggregatorMax", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionSubtitle", + "name": "UploadFileGroupBy", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionPath", + "name": "UploadFileConnectionId", "ofType": null }, { "kind": "OBJECT", - "name": "SectionConnectionLocale", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionPublished_at", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "createSectionPayload", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "updateSectionPayload", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "deleteSectionPayload", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "I18NLocale", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFile", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileConnection", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileAggregator", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileAggregatorSum", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileAggregatorAvg", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileAggregatorMin", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileAggregatorMax", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileGroupBy", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileConnectionId", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "UploadFileConnectionCreated_at", + "name": "UploadFileConnectionCreated_at", "ofType": null }, { @@ -2602,32 +1992,37 @@ }, { "kind": "OBJECT", - "name": "ComponentBlocksFeature", + "name": "ComponentBlocksHero", "ofType": null }, { "kind": "OBJECT", - "name": "ComponentBlocksHero", + "name": "ComponentBlocksSingleFeature", "ofType": null }, { "kind": "OBJECT", - "name": "ComponentBlocksSingleFeature", + "name": "ComponentMenuLink", "ofType": null }, { "kind": "OBJECT", - "name": "ComponentFeatFeat", + "name": "ComponentMenuPageLink", "ofType": null }, { "kind": "OBJECT", - "name": "ComponentMenuLink", + "name": "ComponentSectionCardSection", "ofType": null }, { "kind": "OBJECT", - "name": "ComponentMenuPageLink", + "name": "ComponentSectionHeroSection", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ComponentSectionSingleFeatureSection", "ofType": null } ] @@ -2637,81 +2032,6 @@ "name": "Mutation", "description": null, "fields": [ - { - "name": "createFeaturesSection", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "createFeaturesSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "createFeaturesSectionPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateFeaturesSection", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "updateFeaturesSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "updateFeaturesSectionPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deleteFeaturesSection", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "deleteFeaturesSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "deleteFeaturesSectionPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "createNavigation", "description": null, @@ -2862,81 +2182,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "createSection", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "createSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "createSectionPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateSection", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "updateSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "updateSectionPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deleteSection", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "deleteSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "deleteSectionPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "deleteFile", "description": "Delete one file", @@ -3112,39 +2357,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "createFeaturesSectionLocalization", - "description": null, - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "updateFeaturesSectionInput", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "FeaturesSections", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "createNavigationLocalization", "description": null, @@ -3212,44 +2424,11 @@ "deprecationReason": null }, { - "name": "createSectionLocalization", + "name": "upload", "description": null, "args": [ { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "updateSectionInput", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Section", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "upload", - "description": null, - "args": [ - { - "name": "refId", + "name": "refId", "description": null, "type": { "kind": "SCALAR", @@ -4432,9 +3611,13 @@ "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "PagesSectionsDynamicZoneInput", + "ofType": null + } } }, "defaultValue": null, @@ -4592,90 +3775,41 @@ "deprecationReason": null }, { - "name": "locale", + "name": "sections", "description": null, "args": [], "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "UNION", + "name": "PagesSectionsDynamicZone", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null }, { - "name": "published_at", + "name": "locale", "description": null, "args": [], "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "sections", + "name": "published_at", "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], + "args": [], "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Section", - "ofType": null - } + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, "isDeprecated": false, "deprecationReason": null @@ -5205,6 +4339,42 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "UNION", + "name": "PagesSectionsDynamicZone", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "ComponentSectionCardSection", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ComponentSectionHeroSection", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ComponentSectionSingleFeatureSection", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "PagesSectionsDynamicZoneInput", + "description": "Input type for dynamic zone sections of Pages", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "PublicationState", @@ -5234,7 +4404,7 @@ "description": null, "fields": [ { - "name": "featuresSection", + "name": "navigation", "description": null, "args": [ { @@ -5268,14 +4438,14 @@ ], "type": { "kind": "OBJECT", - "name": "FeaturesSections", + "name": "Navigation", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "featuresSections", + "name": "navigations", "description": null, "args": [ { @@ -5356,7 +4526,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "FeaturesSections", + "name": "Navigation", "ofType": null } }, @@ -5364,7 +4534,7 @@ "deprecationReason": null }, { - "name": "featuresSectionsConnection", + "name": "navigationsConnection", "description": null, "args": [ { @@ -5430,14 +4600,14 @@ ], "type": { "kind": "OBJECT", - "name": "FeaturesSectionsConnection", + "name": "NavigationConnection", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "navigation", + "name": "page", "description": null, "args": [ { @@ -5471,14 +4641,14 @@ ], "type": { "kind": "OBJECT", - "name": "Navigation", + "name": "Pages", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "navigations", + "name": "pages", "description": null, "args": [ { @@ -5559,7 +4729,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "Navigation", + "name": "Pages", "ofType": null } }, @@ -5567,7 +4737,7 @@ "deprecationReason": null }, { - "name": "navigationsConnection", + "name": "pagesConnection", "description": null, "args": [ { @@ -5633,55 +4803,14 @@ ], "type": { "kind": "OBJECT", - "name": "NavigationConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "page", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "publicationState", - "description": null, - "type": { - "kind": "ENUM", - "name": "PublicationState", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Pages", + "name": "PagesConnection", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "pages", + "name": "files", "description": null, "args": [ { @@ -5743,18 +4872,6 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null } ], "type": { @@ -5762,7 +4879,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "Pages", + "name": "UploadFile", "ofType": null } }, @@ -5770,7 +4887,7 @@ "deprecationReason": null }, { - "name": "pagesConnection", + "name": "filesConnection", "description": null, "args": [ { @@ -5820,30 +4937,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null } ], "type": { "kind": "OBJECT", - "name": "PagesConnection", + "name": "UploadFileConnection", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "section", + "name": "role", "description": null, "args": [ { @@ -5877,15 +4982,15 @@ ], "type": { "kind": "OBJECT", - "name": "Section", + "name": "UsersPermissionsRole", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "sections", - "description": null, + "name": "roles", + "description": "Retrieve all the existing roles. You can't apply filters on this query.", "args": [ { "name": "sort", @@ -5946,18 +5051,6 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null } ], "type": { @@ -5965,7 +5058,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "Section", + "name": "UsersPermissionsRole", "ofType": null } }, @@ -5973,157 +5066,7 @@ "deprecationReason": null }, { - "name": "sectionsConnection", - "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "files", - "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "publicationState", - "description": null, - "type": { - "kind": "ENUM", - "name": "PublicationState", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "UploadFile", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "filesConnection", + "name": "rolesConnection", "description": null, "args": [ { @@ -6177,14 +5120,14 @@ ], "type": { "kind": "OBJECT", - "name": "UploadFileConnection", + "name": "UsersPermissionsRoleConnection", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "role", + "name": "user", "description": null, "args": [ { @@ -6218,15 +5161,15 @@ ], "type": { "kind": "OBJECT", - "name": "UsersPermissionsRole", + "name": "UsersPermissionsUser", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "roles", - "description": "Retrieve all the existing roles. You can't apply filters on this query.", + "name": "users", + "description": null, "args": [ { "name": "sort", @@ -6294,7 +5237,7 @@ "name": null, "ofType": { "kind": "OBJECT", - "name": "UsersPermissionsRole", + "name": "UsersPermissionsUser", "ofType": null } }, @@ -6302,7 +5245,7 @@ "deprecationReason": null }, { - "name": "rolesConnection", + "name": "usersConnection", "description": null, "args": [ { @@ -6312,1091 +5255,64 @@ "kind": "SCALAR", "name": "String", "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UsersPermissionsRoleConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "user", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "publicationState", - "description": null, - "type": { - "kind": "ENUM", - "name": "PublicationState", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UsersPermissionsUser", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "users", - "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "publicationState", - "description": null, - "type": { - "kind": "ENUM", - "name": "PublicationState", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "UsersPermissionsUser", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "usersConnection", - "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UsersPermissionsUserConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "me", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "UsersPermissionsMe", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "RoleInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "permissions", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "users", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "created_by", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updated_by", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Section", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "created_at", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updated_at", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subtitle", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "blocks", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "UNION", - "name": "SectionBlocksDynamicZone", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "published_at", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "localizations", - "description": null, - "args": [ - { - "name": "sort", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "start", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "where", - "description": null, - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Section", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionAggregator", - "description": null, - "fields": [ - { - "name": "count", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "UNION", - "name": "SectionBlocksDynamicZone", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "ComponentBlocksCard", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ComponentBlocksHero", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ComponentBlocksSingleFeature", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "SectionBlocksDynamicZoneInput", - "description": "Input type for dynamic zone blocks of Section", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnection", - "description": null, - "fields": [ - { - "name": "values", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Section", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "groupBy", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionGroupBy", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "aggregate", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionAggregator", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionCreated_at", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionId", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionLocale", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionPath", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionPublished_at", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionSubtitle", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionTitle", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionConnectionUpdated_at", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "connection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "SectionConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SectionGroupBy", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionId", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "created_at", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionCreated_at", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updated_at", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionUpdated_at", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionTitle", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subtitle", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionSubtitle", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionPath", - "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "where", + "description": null, + "type": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "args": [], + ], "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionLocale", - "ofType": null - } + "kind": "OBJECT", + "name": "UsersPermissionsUserConnection", + "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { - "name": "published_at", + "name": "me", "description": null, "args": [], "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SectionConnectionPublished_at", - "ofType": null - } + "kind": "OBJECT", + "name": "UsersPermissionsMe", + "ofType": null }, "isDeprecated": false, "deprecationReason": null @@ -7409,24 +5325,28 @@ }, { "kind": "INPUT_OBJECT", - "name": "SectionInput", + "name": "RoleInput", "description": null, "fields": null, "inputFields": [ { - "name": "title", + "name": "name", "description": null, "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } }, "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "subtitle", + "name": "description", "description": null, "type": { "kind": "SCALAR", @@ -7438,27 +5358,7 @@ "deprecationReason": null }, { - "name": "blocks", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "SectionBlocksDynamicZoneInput", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", + "name": "type", "description": null, "type": { "kind": "SCALAR", @@ -7470,7 +5370,7 @@ "deprecationReason": null }, { - "name": "localizations", + "name": "permissions", "description": null, "type": { "kind": "LIST", @@ -7486,24 +5386,16 @@ "deprecationReason": null }, { - "name": "locale", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "published_at", + "name": "users", "description": null, "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } }, "defaultValue": null, "isDeprecated": false, @@ -10862,157 +8754,19 @@ }, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "role", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "UsersPermissionsUserConnectionRole", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "createFeaturesSectionInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "data", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "FeaturesSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "createFeaturesSectionPayload", - "description": null, - "fields": [ - { - "name": "featuresSection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "FeaturesSections", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "createNavigationInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "data", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "NavigationInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "createNavigationPayload", - "description": null, - "fields": [ - { - "name": "navigation", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Navigation", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "createPageInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "data", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "PageInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "createPagePayload", - "description": null, - "fields": [ + }, { - "name": "page", + "name": "role", "description": null, "args": [], "type": { - "kind": "OBJECT", - "name": "Pages", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "UsersPermissionsUserConnectionRole", + "ofType": null + } }, "isDeprecated": false, "deprecationReason": null @@ -11025,7 +8779,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "createRoleInput", + "name": "createNavigationInput", "description": null, "fields": null, "inputFields": [ @@ -11034,7 +8788,7 @@ "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "RoleInput", + "name": "NavigationInput", "ofType": null }, "defaultValue": null, @@ -11048,16 +8802,16 @@ }, { "kind": "OBJECT", - "name": "createRolePayload", + "name": "createNavigationPayload", "description": null, "fields": [ { - "name": "role", + "name": "navigation", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "UsersPermissionsRole", + "name": "Navigation", "ofType": null }, "isDeprecated": false, @@ -11071,7 +8825,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "createSectionInput", + "name": "createPageInput", "description": null, "fields": null, "inputFields": [ @@ -11080,7 +8834,7 @@ "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "SectionInput", + "name": "PageInput", "ofType": null }, "defaultValue": null, @@ -11094,16 +8848,16 @@ }, { "kind": "OBJECT", - "name": "createSectionPayload", + "name": "createPagePayload", "description": null, "fields": [ { - "name": "section", + "name": "page", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "Section", + "name": "Pages", "ofType": null }, "isDeprecated": false, @@ -11117,7 +8871,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "createUserInput", + "name": "createRoleInput", "description": null, "fields": null, "inputFields": [ @@ -11126,7 +8880,7 @@ "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "UserInput", + "name": "RoleInput", "ofType": null }, "defaultValue": null, @@ -11140,16 +8894,16 @@ }, { "kind": "OBJECT", - "name": "createUserPayload", + "name": "createRolePayload", "description": null, "fields": [ { - "name": "user", + "name": "role", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "UsersPermissionsUser", + "name": "UsersPermissionsRole", "ofType": null }, "isDeprecated": false, @@ -11163,16 +8917,16 @@ }, { "kind": "INPUT_OBJECT", - "name": "deleteFeaturesSectionInput", + "name": "createUserInput", "description": null, "fields": null, "inputFields": [ { - "name": "where", + "name": "data", "description": null, "type": { "kind": "INPUT_OBJECT", - "name": "InputID", + "name": "UserInput", "ofType": null }, "defaultValue": null, @@ -11186,16 +8940,16 @@ }, { "kind": "OBJECT", - "name": "deleteFeaturesSectionPayload", + "name": "createUserPayload", "description": null, "fields": [ { - "name": "featuresSection", + "name": "user", "description": null, "args": [], "type": { "kind": "OBJECT", - "name": "FeaturesSections", + "name": "UsersPermissionsUser", "ofType": null }, "isDeprecated": false, @@ -11391,52 +9145,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "INPUT_OBJECT", - "name": "deleteSectionInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "where", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "InputID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "deleteSectionPayload", - "description": null, - "fields": [ - { - "name": "section", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Section", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "deleteUserInput", @@ -11554,69 +9262,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "INPUT_OBJECT", - "name": "editComponentBlocksFeatureInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "id", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "featureTitle", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "featureDescription", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "feat", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "editComponentFeatFeatInput", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "editComponentBlocksHeroInput", @@ -11737,7 +9382,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "editComponentFeatFeatInput", + "name": "editComponentMenuLinkInput", "description": null, "fields": null, "inputFields": [ @@ -11754,7 +9399,7 @@ "deprecationReason": null }, { - "name": "featDescription", + "name": "linkName", "description": null, "type": { "kind": "SCALAR", @@ -11764,6 +9409,18 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "path", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -11772,7 +9429,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "editComponentMenuLinkInput", + "name": "editComponentMenuPageLinkInput", "description": null, "fields": null, "inputFields": [ @@ -11789,7 +9446,7 @@ "deprecationReason": null }, { - "name": "linkName", + "name": "pageLinkName", "description": null, "type": { "kind": "SCALAR", @@ -11819,7 +9476,7 @@ }, { "kind": "INPUT_OBJECT", - "name": "editComponentMenuPageLinkInput", + "name": "editComponentSectionCardSectionInput", "description": null, "fields": null, "inputFields": [ @@ -11836,7 +9493,7 @@ "deprecationReason": null }, { - "name": "pageLinkName", + "name": "title", "description": null, "type": { "kind": "SCALAR", @@ -11848,16 +9505,32 @@ "deprecationReason": null }, { - "name": "path", + "name": "subtitle", "description": null, "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null }, "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "card", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "editComponentBlocksCardInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -11866,39 +9539,31 @@ }, { "kind": "INPUT_OBJECT", - "name": "editFeaturesSectionInput", + "name": "editComponentSectionHeroSectionInput", "description": null, "fields": null, "inputFields": [ { - "name": "blocks", + "name": "id", "description": null, "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "FeaturesSectionsBlocksDynamicZoneInput", - "ofType": null - } - } + "kind": "SCALAR", + "name": "ID", + "ofType": null }, "defaultValue": null, "isDeprecated": false, "deprecationReason": null }, { - "name": "localizations", + "name": "hero", "description": null, "type": { "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "ID", + "kind": "INPUT_OBJECT", + "name": "editComponentBlocksHeroInput", "ofType": null } }, @@ -11907,7 +9572,7 @@ "deprecationReason": null }, { - "name": "locale", + "name": "title", "description": null, "type": { "kind": "SCALAR", @@ -11919,11 +9584,34 @@ "deprecationReason": null }, { - "name": "published_at", + "name": "subtitle", "description": null, "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "editComponentSectionSingleFeatureSectionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "id", + "description": null, + "type": { + "kind": "SCALAR", + "name": "ID", "ofType": null }, "defaultValue": null, @@ -11931,11 +9619,23 @@ "deprecationReason": null }, { - "name": "created_by", + "name": "title", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtitle", "description": null, "type": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null }, "defaultValue": null, @@ -11943,12 +9643,16 @@ "deprecationReason": null }, { - "name": "updated_by", + "name": "singleFeature", "description": null, "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "editComponentBlocksSingleFeatureInput", + "ofType": null + } }, "defaultValue": null, "isDeprecated": false, @@ -12381,9 +10085,13 @@ "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "PagesSectionsDynamicZoneInput", + "ofType": null + } } }, "defaultValue": null, @@ -12562,137 +10270,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "INPUT_OBJECT", - "name": "editSectionInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "title", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subtitle", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "blocks", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "SectionBlocksDynamicZoneInput", - "ofType": null - } - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "localizations", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locale", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "published_at", - "description": null, - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "created_by", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updated_by", - "description": null, - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "editUserInput", @@ -12836,64 +10413,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "INPUT_OBJECT", - "name": "updateFeaturesSectionInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "where", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "InputID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "editFeaturesSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "updateFeaturesSectionPayload", - "description": null, - "fields": [ - { - "name": "featuresSection", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "FeaturesSections", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "updateNavigationInput", @@ -13068,64 +10587,6 @@ "enumValues": null, "possibleTypes": null }, - { - "kind": "INPUT_OBJECT", - "name": "updateSectionInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "where", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "InputID", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "data", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "editSectionInput", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "updateSectionPayload", - "description": null, - "fields": [ - { - "name": "section", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Section", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, { "kind": "INPUT_OBJECT", "name": "updateUserInput", diff --git a/frontend/graphql/GetPageData.graphql b/frontend/graphql/GetPageData.graphql deleted file mode 100644 index d2d05140..00000000 --- a/frontend/graphql/GetPageData.graphql +++ /dev/null @@ -1,39 +0,0 @@ -query getPageData { - pages { - id - pageName - created_at - updated_at - path - locale - sections { - title - subtitle - blocks { - ... on ComponentBlocksHero { - id - title - subtitle - } - ... on ComponentBlocksSingleFeature { - id - description - title - serviceLink - image { - url - } - } - ... on ComponentBlocksCard { - id - title - description - projectLink - image { - url - } - } - } - } - } -} diff --git a/frontend/graphql/GetPageSections.graphql b/frontend/graphql/GetPageSections.graphql deleted file mode 100644 index cf0d347d..00000000 --- a/frontend/graphql/GetPageSections.graphql +++ /dev/null @@ -1,15 +0,0 @@ -query GetFeatures { - featuresSections { - blocks { - ... on ComponentBlocksFeature { - featureTitle - featureDescription - feat { - ... on ComponentFeatFeat { - featDescription - } - } - } - } - } -} diff --git a/frontend/graphql/GetPages.graphql b/frontend/graphql/GetPages.graphql index 205f3b97..391e17b2 100644 --- a/frontend/graphql/GetPages.graphql +++ b/frontend/graphql/GetPages.graphql @@ -1,19 +1,18 @@ -query getPages($where: JSON, $locale: String) { +query GetPages($where: JSON, $locale: String) { pages(where: $where, locale: $locale) { id - locale - pageName path + pageName + locale + __typename sections { - title - subtitle - blocks { - ... on ComponentBlocksHero { - id - title - subtitle - } - ... on ComponentBlocksSingleFeature { + ... on ComponentSectionSingleFeatureSection { + __typename + id + title + subtitle + singleFeature { + __typename id description title @@ -22,14 +21,31 @@ query getPages($where: JSON, $locale: String) { url } } - ... on ComponentBlocksCard { + } + ... on ComponentSectionHeroSection { + __typename + id + title + subtitle + hero { + id + title + subtitle + } + } + ... on ComponentSectionCardSection { + __typename + id + title + subtitle + card { id title description - projectLink image { url } + projectLink } } } diff --git a/frontend/graphql/generated.ts b/frontend/graphql/generated.ts index 79abb1ca..3546d458 100644 --- a/frontend/graphql/generated.ts +++ b/frontend/graphql/generated.ts @@ -13,16 +13,14 @@ export type Scalars = { Date: any; /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ DateTime: any; - /** Input type for dynamic zone blocks of FeaturesSections */ - FeaturesSectionsBlocksDynamicZoneInput: any; /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ JSON: any; /** The `Long` scalar type represents 52-bit integers */ Long: any; /** Input type for dynamic zone items of Navigation */ NavigationItemsDynamicZoneInput: any; - /** Input type for dynamic zone blocks of Section */ - SectionBlocksDynamicZoneInput: any; + /** Input type for dynamic zone sections of Pages */ + PagesSectionsDynamicZoneInput: any; /** A time string with format: HH:mm:ss.SSS */ Time: any; /** The `Upload` scalar type represents a file upload. */ @@ -53,24 +51,10 @@ export type ComponentBlocksCardInput = { projectLink?: Maybe; }; -export type ComponentBlocksFeature = { - __typename?: 'ComponentBlocksFeature'; - id: Scalars['ID']; - featureTitle: Scalars['String']; - featureDescription?: Maybe; - feat?: Maybe>>; -}; - -export type ComponentBlocksFeatureInput = { - featureTitle: Scalars['String']; - featureDescription?: Maybe; - feat?: Maybe>>; -}; - export type ComponentBlocksHero = { __typename?: 'ComponentBlocksHero'; id: Scalars['ID']; - title: Scalars['String']; + title?: Maybe; subtitle?: Maybe; }; @@ -95,16 +79,6 @@ export type ComponentBlocksSingleFeatureInput = { serviceLink?: Maybe; }; -export type ComponentFeatFeat = { - __typename?: 'ComponentFeatFeat'; - id: Scalars['ID']; - featDescription?: Maybe; -}; - -export type ComponentFeatFeatInput = { - featDescription?: Maybe; -}; - export type ComponentMenuLink = { __typename?: 'ComponentMenuLink'; id: Scalars['ID']; @@ -129,90 +103,49 @@ export type ComponentMenuPageLinkInput = { path?: Maybe; }; - - -export type FeaturesSectionInput = { - blocks?: Maybe>; - localizations?: Maybe>>; - locale?: Maybe; - published_at?: Maybe; - created_by?: Maybe; - updated_by?: Maybe; -}; - -export type FeaturesSections = { - __typename?: 'FeaturesSections'; +export type ComponentSectionCardSection = { + __typename?: 'ComponentSectionCardSection'; id: Scalars['ID']; - created_at: Scalars['DateTime']; - updated_at: Scalars['DateTime']; - blocks?: Maybe>>; - locale?: Maybe; - published_at?: Maybe; - localizations?: Maybe>>; -}; - - -export type FeaturesSectionsLocalizationsArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; -}; - -export type FeaturesSectionsAggregator = { - __typename?: 'FeaturesSectionsAggregator'; - count?: Maybe; - totalCount?: Maybe; + title?: Maybe; + subtitle?: Maybe; + card?: Maybe>>; }; -export type FeaturesSectionsBlocksDynamicZone = ComponentBlocksFeature; - - -export type FeaturesSectionsConnection = { - __typename?: 'FeaturesSectionsConnection'; - values?: Maybe>>; - groupBy?: Maybe; - aggregate?: Maybe; +export type ComponentSectionCardSectionInput = { + title?: Maybe; + subtitle?: Maybe; + card?: Maybe>>; }; -export type FeaturesSectionsConnectionCreated_At = { - __typename?: 'FeaturesSectionsConnectionCreated_at'; - key?: Maybe; - connection?: Maybe; +export type ComponentSectionHeroSection = { + __typename?: 'ComponentSectionHeroSection'; + id: Scalars['ID']; + hero?: Maybe>>; + title?: Maybe; + subtitle?: Maybe; }; -export type FeaturesSectionsConnectionId = { - __typename?: 'FeaturesSectionsConnectionId'; - key?: Maybe; - connection?: Maybe; +export type ComponentSectionHeroSectionInput = { + hero?: Maybe>>; + title?: Maybe; + subtitle?: Maybe; }; -export type FeaturesSectionsConnectionLocale = { - __typename?: 'FeaturesSectionsConnectionLocale'; - key?: Maybe; - connection?: Maybe; +export type ComponentSectionSingleFeatureSection = { + __typename?: 'ComponentSectionSingleFeatureSection'; + id: Scalars['ID']; + title?: Maybe; + subtitle?: Maybe; + singleFeature?: Maybe>>; }; -export type FeaturesSectionsConnectionPublished_At = { - __typename?: 'FeaturesSectionsConnectionPublished_at'; - key?: Maybe; - connection?: Maybe; +export type ComponentSectionSingleFeatureSectionInput = { + title?: Maybe; + subtitle?: Maybe; + singleFeature?: Maybe>>; }; -export type FeaturesSectionsConnectionUpdated_At = { - __typename?: 'FeaturesSectionsConnectionUpdated_at'; - key?: Maybe; - connection?: Maybe; -}; -export type FeaturesSectionsGroupBy = { - __typename?: 'FeaturesSectionsGroupBy'; - id?: Maybe>>; - created_at?: Maybe>>; - updated_at?: Maybe>>; - locale?: Maybe>>; - published_at?: Maybe>>; -}; export type FileInfoInput = { name?: Maybe; @@ -262,22 +195,16 @@ export type LocaleInput = { }; -export type Morph = UsersPermissionsMe | UsersPermissionsMeRole | UsersPermissionsLoginPayload | UserPermissionsPasswordPayload | FeaturesSections | FeaturesSectionsConnection | FeaturesSectionsAggregator | FeaturesSectionsGroupBy | FeaturesSectionsConnectionId | FeaturesSectionsConnectionCreated_At | FeaturesSectionsConnectionUpdated_At | FeaturesSectionsConnectionLocale | FeaturesSectionsConnectionPublished_At | CreateFeaturesSectionPayload | UpdateFeaturesSectionPayload | DeleteFeaturesSectionPayload | Navigation | NavigationConnection | NavigationAggregator | NavigationGroupBy | NavigationConnectionId | NavigationConnectionCreated_At | NavigationConnectionUpdated_At | NavigationConnectionNavigationName | NavigationConnectionLocale | NavigationConnectionPublished_At | CreateNavigationPayload | UpdateNavigationPayload | DeleteNavigationPayload | Pages | PagesConnection | PagesAggregator | PagesGroupBy | PagesConnectionId | PagesConnectionCreated_At | PagesConnectionUpdated_At | PagesConnectionPageName | PagesConnectionPath | PagesConnectionLocale | PagesConnectionPublished_At | CreatePagePayload | UpdatePagePayload | DeletePagePayload | Section | SectionConnection | SectionAggregator | SectionGroupBy | SectionConnectionId | SectionConnectionCreated_At | SectionConnectionUpdated_At | SectionConnectionTitle | SectionConnectionSubtitle | SectionConnectionPath | SectionConnectionLocale | SectionConnectionPublished_At | CreateSectionPayload | UpdateSectionPayload | DeleteSectionPayload | I18NLocale | UploadFile | UploadFileConnection | UploadFileAggregator | UploadFileAggregatorSum | UploadFileAggregatorAvg | UploadFileAggregatorMin | UploadFileAggregatorMax | UploadFileGroupBy | UploadFileConnectionId | UploadFileConnectionCreated_At | UploadFileConnectionUpdated_At | UploadFileConnectionName | UploadFileConnectionAlternativeText | UploadFileConnectionCaption | UploadFileConnectionWidth | UploadFileConnectionHeight | UploadFileConnectionFormats | UploadFileConnectionHash | UploadFileConnectionExt | UploadFileConnectionMime | UploadFileConnectionSize | UploadFileConnectionUrl | UploadFileConnectionPreviewUrl | UploadFileConnectionProvider | UploadFileConnectionProvider_Metadata | DeleteFilePayload | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsRoleConnection | UsersPermissionsRoleAggregator | UsersPermissionsRoleGroupBy | UsersPermissionsRoleConnectionId | UsersPermissionsRoleConnectionName | UsersPermissionsRoleConnectionDescription | UsersPermissionsRoleConnectionType | CreateRolePayload | UpdateRolePayload | DeleteRolePayload | UsersPermissionsUser | UsersPermissionsUserConnection | UsersPermissionsUserAggregator | UsersPermissionsUserGroupBy | UsersPermissionsUserConnectionId | UsersPermissionsUserConnectionCreated_At | UsersPermissionsUserConnectionUpdated_At | UsersPermissionsUserConnectionUsername | UsersPermissionsUserConnectionEmail | UsersPermissionsUserConnectionProvider | UsersPermissionsUserConnectionConfirmed | UsersPermissionsUserConnectionBlocked | UsersPermissionsUserConnectionRole | CreateUserPayload | UpdateUserPayload | DeleteUserPayload | ComponentBlocksCard | ComponentBlocksFeature | ComponentBlocksHero | ComponentBlocksSingleFeature | ComponentFeatFeat | ComponentMenuLink | ComponentMenuPageLink; +export type Morph = UsersPermissionsMe | UsersPermissionsMeRole | UsersPermissionsLoginPayload | UserPermissionsPasswordPayload | Navigation | NavigationConnection | NavigationAggregator | NavigationGroupBy | NavigationConnectionId | NavigationConnectionCreated_At | NavigationConnectionUpdated_At | NavigationConnectionNavigationName | NavigationConnectionLocale | NavigationConnectionPublished_At | CreateNavigationPayload | UpdateNavigationPayload | DeleteNavigationPayload | Pages | PagesConnection | PagesAggregator | PagesGroupBy | PagesConnectionId | PagesConnectionCreated_At | PagesConnectionUpdated_At | PagesConnectionPageName | PagesConnectionPath | PagesConnectionLocale | PagesConnectionPublished_At | CreatePagePayload | UpdatePagePayload | DeletePagePayload | I18NLocale | UploadFile | UploadFileConnection | UploadFileAggregator | UploadFileAggregatorSum | UploadFileAggregatorAvg | UploadFileAggregatorMin | UploadFileAggregatorMax | UploadFileGroupBy | UploadFileConnectionId | UploadFileConnectionCreated_At | UploadFileConnectionUpdated_At | UploadFileConnectionName | UploadFileConnectionAlternativeText | UploadFileConnectionCaption | UploadFileConnectionWidth | UploadFileConnectionHeight | UploadFileConnectionFormats | UploadFileConnectionHash | UploadFileConnectionExt | UploadFileConnectionMime | UploadFileConnectionSize | UploadFileConnectionUrl | UploadFileConnectionPreviewUrl | UploadFileConnectionProvider | UploadFileConnectionProvider_Metadata | DeleteFilePayload | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsRoleConnection | UsersPermissionsRoleAggregator | UsersPermissionsRoleGroupBy | UsersPermissionsRoleConnectionId | UsersPermissionsRoleConnectionName | UsersPermissionsRoleConnectionDescription | UsersPermissionsRoleConnectionType | CreateRolePayload | UpdateRolePayload | DeleteRolePayload | UsersPermissionsUser | UsersPermissionsUserConnection | UsersPermissionsUserAggregator | UsersPermissionsUserGroupBy | UsersPermissionsUserConnectionId | UsersPermissionsUserConnectionCreated_At | UsersPermissionsUserConnectionUpdated_At | UsersPermissionsUserConnectionUsername | UsersPermissionsUserConnectionEmail | UsersPermissionsUserConnectionProvider | UsersPermissionsUserConnectionConfirmed | UsersPermissionsUserConnectionBlocked | UsersPermissionsUserConnectionRole | CreateUserPayload | UpdateUserPayload | DeleteUserPayload | ComponentBlocksCard | ComponentBlocksHero | ComponentBlocksSingleFeature | ComponentMenuLink | ComponentMenuPageLink | ComponentSectionCardSection | ComponentSectionHeroSection | ComponentSectionSingleFeatureSection; export type Mutation = { __typename?: 'Mutation'; - createFeaturesSection?: Maybe; - updateFeaturesSection?: Maybe; - deleteFeaturesSection?: Maybe; createNavigation?: Maybe; updateNavigation?: Maybe; deleteNavigation?: Maybe; createPage?: Maybe; updatePage?: Maybe; deletePage?: Maybe; - createSection?: Maybe; - updateSection?: Maybe; - deleteSection?: Maybe; /** Delete one file */ deleteFile?: Maybe; /** Create a new role */ @@ -292,10 +219,8 @@ export type Mutation = { updateUser?: Maybe; /** Delete an existing user */ deleteUser?: Maybe; - createFeaturesSectionLocalization: FeaturesSections; createNavigationLocalization: Navigation; createPageLocalization: Pages; - createSectionLocalization: Section; upload: UploadFile; multipleUpload: Array>; updateFileInfo: UploadFile; @@ -307,21 +232,6 @@ export type Mutation = { }; -export type MutationCreateFeaturesSectionArgs = { - input?: Maybe; -}; - - -export type MutationUpdateFeaturesSectionArgs = { - input?: Maybe; -}; - - -export type MutationDeleteFeaturesSectionArgs = { - input?: Maybe; -}; - - export type MutationCreateNavigationArgs = { input?: Maybe; }; @@ -352,21 +262,6 @@ export type MutationDeletePageArgs = { }; -export type MutationCreateSectionArgs = { - input?: Maybe; -}; - - -export type MutationUpdateSectionArgs = { - input?: Maybe; -}; - - -export type MutationDeleteSectionArgs = { - input?: Maybe; -}; - - export type MutationDeleteFileArgs = { input?: Maybe; }; @@ -402,11 +297,6 @@ export type MutationDeleteUserArgs = { }; -export type MutationCreateFeaturesSectionLocalizationArgs = { - input: UpdateFeaturesSectionInput; -}; - - export type MutationCreateNavigationLocalizationArgs = { input: UpdateNavigationInput; }; @@ -417,11 +307,6 @@ export type MutationCreatePageLocalizationArgs = { }; -export type MutationCreateSectionLocalizationArgs = { - input: UpdateSectionInput; -}; - - export type MutationUploadArgs = { refId?: Maybe; ref?: Maybe; @@ -568,7 +453,7 @@ export type NavigationItemsDynamicZone = ComponentMenuLink | ComponentMenuPageLi export type PageInput = { pageName: Scalars['String']; path?: Maybe; - sections?: Maybe>>; + sections?: Maybe>; localizations?: Maybe>>; locale?: Maybe; published_at?: Maybe; @@ -583,21 +468,13 @@ export type Pages = { updated_at: Scalars['DateTime']; pageName: Scalars['String']; path?: Maybe; + sections?: Maybe>>; locale?: Maybe; published_at?: Maybe; - sections?: Maybe>>; localizations?: Maybe>>; }; -export type PagesSectionsArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; -}; - - export type PagesLocalizationsArgs = { sort?: Maybe; limit?: Maybe; @@ -671,6 +548,9 @@ export type PagesGroupBy = { published_at?: Maybe>>; }; +export type PagesSectionsDynamicZone = ComponentSectionCardSection | ComponentSectionHeroSection | ComponentSectionSingleFeatureSection; + + export enum PublicationState { Live = 'LIVE', Preview = 'PREVIEW' @@ -678,18 +558,12 @@ export enum PublicationState { export type Query = { __typename?: 'Query'; - featuresSection?: Maybe; - featuresSections?: Maybe>>; - featuresSectionsConnection?: Maybe; navigation?: Maybe; navigations?: Maybe>>; navigationsConnection?: Maybe; page?: Maybe; pages?: Maybe>>; pagesConnection?: Maybe; - section?: Maybe
; - sections?: Maybe>>; - sectionsConnection?: Maybe; files?: Maybe>>; filesConnection?: Maybe; role?: Maybe; @@ -703,31 +577,6 @@ export type Query = { }; -export type QueryFeaturesSectionArgs = { - id: Scalars['ID']; - publicationState?: Maybe; -}; - - -export type QueryFeaturesSectionsArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; - publicationState?: Maybe; - locale?: Maybe; -}; - - -export type QueryFeaturesSectionsConnectionArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; - locale?: Maybe; -}; - - export type QueryNavigationArgs = { id: Scalars['ID']; publicationState?: Maybe; @@ -778,31 +627,6 @@ export type QueryPagesConnectionArgs = { }; -export type QuerySectionArgs = { - id: Scalars['ID']; - publicationState?: Maybe; -}; - - -export type QuerySectionsArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; - publicationState?: Maybe; - locale?: Maybe; -}; - - -export type QuerySectionsConnectionArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; - locale?: Maybe; -}; - - export type QueryFilesArgs = { sort?: Maybe; limit?: Maybe; @@ -875,116 +699,6 @@ export type RoleInput = { updated_by?: Maybe; }; -export type Section = { - __typename?: 'Section'; - id: Scalars['ID']; - created_at: Scalars['DateTime']; - updated_at: Scalars['DateTime']; - title?: Maybe; - subtitle?: Maybe; - blocks?: Maybe>>; - path?: Maybe; - locale?: Maybe; - published_at?: Maybe; - localizations?: Maybe>>; -}; - - -export type SectionLocalizationsArgs = { - sort?: Maybe; - limit?: Maybe; - start?: Maybe; - where?: Maybe; -}; - -export type SectionAggregator = { - __typename?: 'SectionAggregator'; - count?: Maybe; - totalCount?: Maybe; -}; - -export type SectionBlocksDynamicZone = ComponentBlocksCard | ComponentBlocksHero | ComponentBlocksSingleFeature; - - -export type SectionConnection = { - __typename?: 'SectionConnection'; - values?: Maybe>>; - groupBy?: Maybe; - aggregate?: Maybe; -}; - -export type SectionConnectionCreated_At = { - __typename?: 'SectionConnectionCreated_at'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionId = { - __typename?: 'SectionConnectionId'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionLocale = { - __typename?: 'SectionConnectionLocale'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionPath = { - __typename?: 'SectionConnectionPath'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionPublished_At = { - __typename?: 'SectionConnectionPublished_at'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionSubtitle = { - __typename?: 'SectionConnectionSubtitle'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionTitle = { - __typename?: 'SectionConnectionTitle'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionConnectionUpdated_At = { - __typename?: 'SectionConnectionUpdated_at'; - key?: Maybe; - connection?: Maybe; -}; - -export type SectionGroupBy = { - __typename?: 'SectionGroupBy'; - id?: Maybe>>; - created_at?: Maybe>>; - updated_at?: Maybe>>; - title?: Maybe>>; - subtitle?: Maybe>>; - path?: Maybe>>; - locale?: Maybe>>; - published_at?: Maybe>>; -}; - -export type SectionInput = { - title?: Maybe; - subtitle?: Maybe; - blocks?: Maybe>; - path?: Maybe; - localizations?: Maybe>>; - locale?: Maybe; - published_at?: Maybe; - created_by?: Maybe; - updated_by?: Maybe; -}; - export type UploadFile = { @@ -1415,15 +1129,6 @@ export type UsersPermissionsUserGroupBy = { role?: Maybe>>; }; -export type CreateFeaturesSectionInput = { - data?: Maybe; -}; - -export type CreateFeaturesSectionPayload = { - __typename?: 'createFeaturesSectionPayload'; - featuresSection?: Maybe; -}; - export type CreateNavigationInput = { data?: Maybe; }; @@ -1451,15 +1156,6 @@ export type CreateRolePayload = { role?: Maybe; }; -export type CreateSectionInput = { - data?: Maybe; -}; - -export type CreateSectionPayload = { - __typename?: 'createSectionPayload'; - section?: Maybe
; -}; - export type CreateUserInput = { data?: Maybe; }; @@ -1469,15 +1165,6 @@ export type CreateUserPayload = { user?: Maybe; }; -export type DeleteFeaturesSectionInput = { - where?: Maybe; -}; - -export type DeleteFeaturesSectionPayload = { - __typename?: 'deleteFeaturesSectionPayload'; - featuresSection?: Maybe; -}; - export type DeleteFileInput = { where?: Maybe; }; @@ -1514,15 +1201,6 @@ export type DeleteRolePayload = { role?: Maybe; }; -export type DeleteSectionInput = { - where?: Maybe; -}; - -export type DeleteSectionPayload = { - __typename?: 'deleteSectionPayload'; - section?: Maybe
; -}; - export type DeleteUserInput = { where?: Maybe; }; @@ -1540,13 +1218,6 @@ export type EditComponentBlocksCardInput = { projectLink?: Maybe; }; -export type EditComponentBlocksFeatureInput = { - id?: Maybe; - featureTitle?: Maybe; - featureDescription?: Maybe; - feat?: Maybe>>; -}; - export type EditComponentBlocksHeroInput = { id?: Maybe; title?: Maybe; @@ -1561,11 +1232,6 @@ export type EditComponentBlocksSingleFeatureInput = { serviceLink?: Maybe; }; -export type EditComponentFeatFeatInput = { - id?: Maybe; - featDescription?: Maybe; -}; - export type EditComponentMenuLinkInput = { id?: Maybe; linkName?: Maybe; @@ -1578,13 +1244,25 @@ export type EditComponentMenuPageLinkInput = { path?: Maybe; }; -export type EditFeaturesSectionInput = { - blocks?: Maybe>; - localizations?: Maybe>>; - locale?: Maybe; - published_at?: Maybe; - created_by?: Maybe; - updated_by?: Maybe; +export type EditComponentSectionCardSectionInput = { + id?: Maybe; + title?: Maybe; + subtitle?: Maybe; + card?: Maybe>>; +}; + +export type EditComponentSectionHeroSectionInput = { + id?: Maybe; + hero?: Maybe>>; + title?: Maybe; + subtitle?: Maybe; +}; + +export type EditComponentSectionSingleFeatureSectionInput = { + id?: Maybe; + title?: Maybe; + subtitle?: Maybe; + singleFeature?: Maybe>>; }; export type EditFileInput = { @@ -1627,7 +1305,7 @@ export type EditNavigationInput = { export type EditPageInput = { pageName?: Maybe; path?: Maybe; - sections?: Maybe>>; + sections?: Maybe>; localizations?: Maybe>>; locale?: Maybe; published_at?: Maybe; @@ -1645,18 +1323,6 @@ export type EditRoleInput = { updated_by?: Maybe; }; -export type EditSectionInput = { - title?: Maybe; - subtitle?: Maybe; - blocks?: Maybe>; - path?: Maybe; - localizations?: Maybe>>; - locale?: Maybe; - published_at?: Maybe; - created_by?: Maybe; - updated_by?: Maybe; -}; - export type EditUserInput = { username?: Maybe; email?: Maybe; @@ -1671,16 +1337,6 @@ export type EditUserInput = { updated_by?: Maybe; }; -export type UpdateFeaturesSectionInput = { - where?: Maybe; - data?: Maybe; -}; - -export type UpdateFeaturesSectionPayload = { - __typename?: 'updateFeaturesSectionPayload'; - featuresSection?: Maybe; -}; - export type UpdateNavigationInput = { where?: Maybe; data?: Maybe; @@ -1711,16 +1367,6 @@ export type UpdateRolePayload = { role?: Maybe; }; -export type UpdateSectionInput = { - where?: Maybe; - data?: Maybe; -}; - -export type UpdateSectionPayload = { - __typename?: 'updateSectionPayload'; - section?: Maybe
; -}; - export type UpdateUserInput = { where?: Maybe; data?: Maybe; @@ -1756,57 +1402,6 @@ export type GetNavItemsQuery = ( )>>> } ); -export type GetPageDataQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetPageDataQuery = ( - { __typename?: 'Query' } - & { pages?: Maybe - & { sections?: Maybe - & { blocks?: Maybe - & { image?: Maybe<( - { __typename?: 'UploadFile' } - & Pick - )> } - ) | ( - { __typename?: 'ComponentBlocksHero' } - & Pick - ) | ( - { __typename?: 'ComponentBlocksSingleFeature' } - & Pick - & { image?: Maybe<( - { __typename?: 'UploadFile' } - & Pick - )> } - )>>> } - )>>> } - )>>> } -); - -export type GetFeaturesQueryVariables = Exact<{ [key: string]: never; }>; - - -export type GetFeaturesQuery = ( - { __typename?: 'Query' } - & { featuresSections?: Maybe - & { feat?: Maybe - )>>> } - )>>> } - )>>> } -); - export type GetPagesQueryVariables = Exact<{ where?: Maybe; locale?: Maybe; @@ -1816,23 +1411,31 @@ export type GetPagesQueryVariables = Exact<{ export type GetPagesQuery = ( { __typename?: 'Query' } & { pages?: Maybe + { __typename: 'Pages' } + & Pick & { sections?: Maybe - & { blocks?: Maybe + & { card?: Maybe & { image?: Maybe<( { __typename?: 'UploadFile' } & Pick )> } - ) | ( + )>>> } + ) | ( + { __typename: 'ComponentSectionHeroSection' } + & Pick + & { hero?: Maybe - ) | ( - { __typename?: 'ComponentBlocksSingleFeature' } + )>>> } + ) | ( + { __typename: 'ComponentSectionSingleFeatureSection' } + & Pick + & { singleFeature?: Maybe & { image?: Maybe<( { __typename?: 'UploadFile' } @@ -1843,54 +1446,6 @@ export type GetPagesQuery = ( )>>> } ); -export type GetSectionsQueryVariables = Exact<{ - where?: Maybe; - locale?: Maybe; -}>; - - -export type GetSectionsQuery = ( - { __typename?: 'Query' } - & { sections?: Maybe - & { blocks?: Maybe - & { image?: Maybe<( - { __typename?: 'UploadFile' } - & Pick - )> } - ) | ( - { __typename?: 'ComponentBlocksHero' } - & Pick - ) | ( - { __typename?: 'ComponentBlocksSingleFeature' } - & Pick - & { image?: Maybe<( - { __typename?: 'UploadFile' } - & Pick - )> } - )>>> } - )>>> } -); - -export type UpdateSectionMutationVariables = Exact<{ - input?: Maybe; -}>; - - -export type UpdateSectionMutation = ( - { __typename?: 'Mutation' } - & { updateSection?: Maybe<( - { __typename?: 'updateSectionPayload' } - & { section?: Maybe<( - { __typename?: 'Section' } - & Pick - )> } - )> } -); - export type CreatePageMutationVariables = Exact<{ input?: Maybe; }>; @@ -1946,25 +1501,22 @@ export const GetNavItems = ` } } `; -export const GetPageData = ` - query getPageData { - pages { +export const GetPages = ` + query GetPages($where: JSON, $locale: String) { + pages(where: $where, locale: $locale) { id - pageName - created_at - updated_at path + pageName locale + __typename sections { - title - subtitle - blocks { - ... on ComponentBlocksHero { - id - title - subtitle - } - ... on ComponentBlocksSingleFeature { + ... on ComponentSectionSingleFeatureSection { + __typename + id + title + subtitle + singleFeature { + __typename id description title @@ -1973,121 +1525,37 @@ export const GetPageData = ` url } } - ... on ComponentBlocksCard { - id - title - description - projectLink - image { - url - } - } } - } - } -} - `; -export const GetFeatures = ` - query GetFeatures { - featuresSections { - blocks { - ... on ComponentBlocksFeature { - featureTitle - featureDescription - feat { - ... on ComponentFeatFeat { - featDescription - } - } - } - } - } -} - `; -export const GetPages = ` - query getPages($where: JSON, $locale: String) { - pages(where: $where, locale: $locale) { - id - locale - pageName - path - sections { - title - subtitle - blocks { - ... on ComponentBlocksHero { + ... on ComponentSectionHeroSection { + __typename + id + title + subtitle + hero { id title subtitle } - ... on ComponentBlocksSingleFeature { - id - description - title - serviceLink - image { - url - } - } - ... on ComponentBlocksCard { + } + ... on ComponentSectionCardSection { + __typename + id + title + subtitle + card { id title description - projectLink image { url } + projectLink } } } } } `; -export const GetSections = ` - query GetSections($where: JSON, $locale: String) { - sections(where: $where, locale: $locale) { - id - title - subtitle - locale - path - blocks { - ... on ComponentBlocksHero { - id - title - subtitle - } - ... on ComponentBlocksSingleFeature { - id - title - description - serviceLink - image { - url - } - } - ... on ComponentBlocksCard { - id - title - description - projectLink - image { - url - } - } - } - } -} - `; -export const UpdateSection = ` - mutation UpdateSection($input: updateSectionInput) { - updateSection(input: $input) { - section { - id - } - } -} - `; export const CreatePage = ` mutation CreatePage($input: createPageInput) { createPage(input: $input) { diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index 5c4b462f..6889788c 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -6,12 +6,9 @@ import { GetPages, GetPagesQuery, GetPagesQueryVariables, - GetSections, - GetSectionsQuery, - GetSectionsQueryVariables, } from "@graphql/generated"; import { BlockItemProps } from "@features/pageBlocks"; -import { SectionData, useSectionPlugin } from "@features/plugins/usePagePlugin"; +import { PageData, usePagePlugin } from "@features/plugins/usePagePlugin"; import { DefaultLayout } from "@layouts/defaultLayout"; import { chakra, useColorMode } from "@chakra-ui/react"; import { SectionBlockData, SECTION_PAGE_BLOCKS } from "@features/sectionBlocks"; @@ -22,20 +19,19 @@ interface DynamicPageProps { locale: string; preview: boolean; previewData?: PreviewData; - sectionData: SectionData; + pageData: PageData; } -export default function DynamicPage({ - sectionData, - preview, -}: DynamicPageProps) { - if (sectionData == null) { +export default function DynamicPage({ pageData, preview }: DynamicPageProps) { + if (pageData == null) { return null; } const { colorMode } = useColorMode(); - const [_, form] = useSectionPlugin(sectionData); + const [_, form] = usePagePlugin(pageData); + + console.log("pageData", JSON.stringify(pageData, null, " ")); const itemProps = React.useMemo(() => { return { @@ -47,12 +43,11 @@ export default function DynamicPage({
- {/* */} @@ -61,7 +56,7 @@ export default function DynamicPage({ ); } -const StyledComponent = chakra(InlineBlocks); +const StyledInlineBlocks = chakra(InlineBlocks); export const getStaticPaths: GetStaticPaths = async (context) => { // Get all pages from Strapi @@ -115,23 +110,11 @@ export const getStaticProps: GetStaticProps< throw new Error(`Path "${pathParts.join("/")}" has no locale!`); } const preview = context.preview === true; - const localeSection = await fetchGraphQL< - GetSectionsQuery, - GetSectionsQueryVariables - >(GetSections, { - locale, - where: { - path, - }, - }); const localePages = await fetchGraphQL( GetPages, { locale, - where: { - path, - }, } ); @@ -141,20 +124,19 @@ export const getStaticProps: GetStaticProps< }; } - if (localeSection.sections == null) { - return { - notFound: true, - }; - } + const availablePages = await fetchGraphQL< + GetPagesQuery, + GetPagesQueryVariables + >(GetPages, { + locale, + where: { + path, + }, + }); - const sectionData = getSectionData(localeSection.sections, locale); - console.log( - "localeSection.section", - JSON.stringify(localeSection.sections, null, " ") - ); - console.log("Section data", JSON.stringify(sectionData?.blocks, null, " ")); + const pageData = getPageData(availablePages.pages, locale); - if (sectionData == null) { + if (pageData == null) { return { notFound: true, }; @@ -163,7 +145,7 @@ export const getStaticProps: GetStaticProps< if (preview) { return { props: { - sectionData, + pageData, path: pathParts, locale, preview, @@ -174,89 +156,176 @@ export const getStaticProps: GetStaticProps< return { props: { - sectionData, + pageData, path: pathParts, locale, preview, }, }; }; -/* + function getPageData( pages: GetPagesQuery["pages"], locale: string ): PageData | undefined { const page = pages?.find((page) => page?.locale === locale); - console.log("Page", page); if (page) { const sections = - page.sections?.map((section) => { + page.sections?.map((section) => { if (section == null) { return null; } - return { - title: section.title, - subtitle: section.subtitle, - blocks: section.blocks, - }; - }) || []; - - return { - id: page.id, - sections: filterListNullableItems(sections), - path: page.path ? page.path : undefined, - }; - } -} -*/ - -function getSectionData( - sections: GetSectionsQuery["sections"], - locale: string -): SectionData | undefined { - const section = sections?.find((section) => section?.locale === locale); - if (section) { - const sections = - section.blocks?.map((block) => { - if (block == null) return null; - switch (block.__typename) { - case "ComponentBlocksHero": { + switch (section.__typename) { + case "ComponentSectionHeroSection": { return { - id: block.id, - title: block.title, - subtitle: block.subtitle, + _template: "heroSection", + id: section.id, + title: section.title, + subtitle: section.subtitle, + blocks: section.hero?.map((hero) => { + if (hero != null) { + return { + id: hero.id, + title: hero.title, + subtitle: hero.subtitle, + }; + } + }), }; } - case "ComponentBlocksCard": { + case "ComponentSectionSingleFeatureSection": { + console.log( + "features", + JSON.stringify(section.singleFeature, null, " ") + ); return { - id: block.id, - title: block.id, - subtitle: block.id, - projectLink: block.projectLink, - imageUrl: block.image?.url, + _template: "featureSection", + id: section.id, + title: section.title, + subtitle: section.subtitle, + blocks: section.singleFeature?.map((feature) => { + if (feature != null) { + return { + id: feature.id, + title: feature.title, + description: feature.description, + imageUrl: feature.image?.url, + serviceLink: feature.serviceLink, + }; + } + }), }; } - case "ComponentBlocksSingleFeature": { + case "ComponentSectionCardSection": { return { - id: block.id, - title: block.id, - subtitle: block.id, - serviceLink: block.serviceLink, - imageUrl: block.image?.url, + _template: "cardSection", + id: section.id, + title: section.title, + subtitle: section.subtitle, + blocks: section.card?.map((card) => { + if (card != null) { + return { + id: card.id, + title: card.title, + description: card.description, + imageUrl: card.image?.url, + projectLink: card.projectLink, + }; + } + }), }; } - default: - return assertNever(block); + return assertNever(section); } }) || []; + return { - id: section.id, - title: section.title ? section.title : undefined, - subtitle: section.subtitle ? section.subtitle : undefined, - blocks: filterListNullableItems(sections), + id: page.id, + title: page.pageName, + sections: filterListNullableItems(sections), + path: page.path ? page.path : undefined, }; } - return undefined; } + +/* +function getPageData( + pages: GetPagesQuery["pages"], + locale: string +): PageData | undefined { + //const section = sections?.find((section) => section?.locale == locale); // == first section + //if (section) { + const aa: SectionBlockData = + pages?.map((page) => { + if (page == null) { + return null; + } + + let blocks = + section?.blocks?.map((block) => { + console.log("block", JSON.stringify(block, null, " ")); + if (block == null) { + return null; + } + switch (block?.__typename) { + case "ComponentBlocksHero": { + return { + _template: "ComponentBlocksHero", + id: block.id, + title: block.title, + subtitle: block.subtitle, + }; + } + case "ComponentBlocksCard": { + return { + _template: "ComponentBlocksCard", + id: block.id, + title: block.title, + subtitle: block.description, + projectLink: block.projectLink, + imageUrl: block.image?.url, + }; + } + case "ComponentBlocksSingleFeature": { + return { + _template: "ComponentBlocksSingleFeature", + id: block.id, + title: block.title, + subtitle: block.description, + serviceLink: block.serviceLink, + imageUrl: block.image?.url, + }; + } + + default: + return assertNever(block); + } + }) || []; + switch (sezioni._template) { + case "heroSection": { + return { + id: section.id, + title: section.title, + subtitle: section.subtitle, + blocks: filterListNullableItems(blocks), + }; + } + case "featureSection": { + return { + id: section.id, + title: section.title, + subtitle: section.subtitle, + blocks: filterListNullableItems(blocks), + }; + } + } + }) || []; + return { + id: sezioni.id, + title: sezioni.title, + sections: filterListNullableItems(sezioni), + }; +} +*/ From 167060a3305cb292411ddf1cd22b2b8ecdf01481 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Fri, 25 Jun 2021 11:22:10 +0200 Subject: [PATCH 07/15] Fixed sections and update queries --- frontend/features/pageBlocks/CardBlock.tsx | 2 +- frontend/features/pageBlocks/FeatureBlock.tsx | 12 +- frontend/features/pageBlocks/HeroBlock.tsx | 15 ++- frontend/features/pageBlocks/index.ts | 6 +- frontend/features/plugins/usePagePlugin.ts | 28 ++-- frontend/graphql.schema.json | 18 +-- frontend/graphql/GetPages.graphql | 6 +- frontend/graphql/generated.ts | 24 ++-- frontend/pages/[...slug].tsx | 124 +++--------------- 9 files changed, 83 insertions(+), 152 deletions(-) diff --git a/frontend/features/pageBlocks/CardBlock.tsx b/frontend/features/pageBlocks/CardBlock.tsx index 7a80b9ba..751b9e36 100644 --- a/frontend/features/pageBlocks/CardBlock.tsx +++ b/frontend/features/pageBlocks/CardBlock.tsx @@ -15,7 +15,7 @@ export type CardBlockData = BlockTemplateData< imageUrl?: string; title: string; description: string; - projectLink: string; + projectLink?: Nullable; } >; diff --git a/frontend/features/pageBlocks/FeatureBlock.tsx b/frontend/features/pageBlocks/FeatureBlock.tsx index 0059e944..5426bad1 100644 --- a/frontend/features/pageBlocks/FeatureBlock.tsx +++ b/frontend/features/pageBlocks/FeatureBlock.tsx @@ -12,10 +12,10 @@ export type FeatureBlockData = BlockTemplateData< "ComponentBlocksSingleFeature", { id: string; - imageUrl?: string; + imageUrl?: Nullable; title: string; description: string; - serviceLink: string; + serviceLink?: Nullable; } >; @@ -26,12 +26,16 @@ interface FeatureBlockProps { serviceLink?: string; } -export function FeatureBlock({}: FeatureBlockProps) { +export function FeatureBlock({ imageUrl }: FeatureBlockProps) { const StyledInlineText = chakra(InlineText); return ( - media.id} /> + "http://localhost:1337"} + name={"imageUrl"} + parse={(media) => media.filename} + /> ; + subtitle?: Nullable; } >; @@ -47,7 +52,7 @@ export function HeroBlock({}: HeroBlockProps) { fontFamily={"Monospace"} letterSpacing={"0.02em"} > - + - + diff --git a/frontend/features/pageBlocks/index.ts b/frontend/features/pageBlocks/index.ts index af9bcc20..da9a3f45 100644 --- a/frontend/features/pageBlocks/index.ts +++ b/frontend/features/pageBlocks/index.ts @@ -4,15 +4,15 @@ import { featureBlock, FeatureBlockData } from "./FeatureBlock"; import { heroBlock, HeroBlockData } from "./HeroBlock"; export const HERO_BLOCK = { - hero: heroBlock, + ComponentBlocksHero: heroBlock, }; export const FEAT_BLOCK = { - feat: featureBlock, + ComponentBlocksSingleFeature: featureBlock, }; export const CARD_BLOCK = { - card: cardBlock, + ComponentBlocksCard: cardBlock, }; export type BlockData = HeroBlockData | CardBlockData | FeatureBlockData; diff --git a/frontend/features/plugins/usePagePlugin.ts b/frontend/features/plugins/usePagePlugin.ts index 525c9b26..383c43a0 100644 --- a/frontend/features/plugins/usePagePlugin.ts +++ b/frontend/features/plugins/usePagePlugin.ts @@ -1,3 +1,5 @@ +import { BlockData } from "@features/pageBlocks"; +import { HeroBlockData } from "@features/pageBlocks/HeroBlock"; import { SectionBlockData } from "@features/sectionBlocks"; import { CreatePage, @@ -75,24 +77,27 @@ function getPageInput(data: PageData): UpdatePageInput { switch (section._template) { case "heroSection": { return { - __typename: "ComponentBlocksHero", + __typename: "ComponentSectionHeroSection", id: section.id, title: section.title, subtitle: section.subtitle, - sections: section.blocks?.map((hero) => { - if (hero != null) { - return { - id: hero.id, - title: hero.title, - subtitle: hero.subtitle, - }; + sections: section.blocks?.map( + (hero) => { + if (hero != null) { + return { + id: hero.id, + title: hero.title, + subtitle: hero.subtitle, + _template: "ComponentBlocksHero", + }; + } } - }), + ), }; } case "cardSection": { return { - __typename: "ComponentBlocksCard", + __typename: "ComponentSectionCardSection", id: section.id, title: section.title, subtitle: section.subtitle, @@ -111,7 +116,7 @@ function getPageInput(data: PageData): UpdatePageInput { } case "featureSection": { return { - __typename: "ComponentBlocksSingleFeature", + __typename: "ComponentSectionSingleFeatureSection", id: section.id, title: section.title, subtitle: section.subtitle, @@ -179,7 +184,6 @@ function getPageCreatorPlugin( }, ], onSubmit: async (values, cms) => { - console.log(values); const input = getPageCreateInput(values); try { const response = await cms.api.strapi.fetchGraphql(CreatePage, { diff --git a/frontend/graphql.schema.json b/frontend/graphql.schema.json index b239cac9..15987be7 100644 --- a/frontend/graphql.schema.json +++ b/frontend/graphql.schema.json @@ -719,7 +719,7 @@ "deprecationReason": null }, { - "name": "card", + "name": "sections", "description": null, "args": [], "type": { @@ -771,7 +771,7 @@ "deprecationReason": null }, { - "name": "card", + "name": "sections", "description": null, "type": { "kind": "LIST", @@ -813,7 +813,7 @@ "deprecationReason": null }, { - "name": "hero", + "name": "sections", "description": null, "args": [], "type": { @@ -865,7 +865,7 @@ "fields": null, "inputFields": [ { - "name": "hero", + "name": "sections", "description": null, "type": { "kind": "LIST", @@ -955,7 +955,7 @@ "deprecationReason": null }, { - "name": "singleFeature", + "name": "sections", "description": null, "args": [], "type": { @@ -1007,7 +1007,7 @@ "deprecationReason": null }, { - "name": "singleFeature", + "name": "sections", "description": null, "type": { "kind": "LIST", @@ -9517,7 +9517,7 @@ "deprecationReason": null }, { - "name": "card", + "name": "sections", "description": null, "type": { "kind": "LIST", @@ -9556,7 +9556,7 @@ "deprecationReason": null }, { - "name": "hero", + "name": "sections", "description": null, "type": { "kind": "LIST", @@ -9643,7 +9643,7 @@ "deprecationReason": null }, { - "name": "singleFeature", + "name": "sections", "description": null, "type": { "kind": "LIST", diff --git a/frontend/graphql/GetPages.graphql b/frontend/graphql/GetPages.graphql index 391e17b2..2fc9e9ab 100644 --- a/frontend/graphql/GetPages.graphql +++ b/frontend/graphql/GetPages.graphql @@ -11,7 +11,7 @@ query GetPages($where: JSON, $locale: String) { id title subtitle - singleFeature { + singleFeature: sections { __typename id description @@ -27,7 +27,7 @@ query GetPages($where: JSON, $locale: String) { id title subtitle - hero { + hero: sections { id title subtitle @@ -38,7 +38,7 @@ query GetPages($where: JSON, $locale: String) { id title subtitle - card { + card: sections { id title description diff --git a/frontend/graphql/generated.ts b/frontend/graphql/generated.ts index 3546d458..0ae14e42 100644 --- a/frontend/graphql/generated.ts +++ b/frontend/graphql/generated.ts @@ -108,25 +108,25 @@ export type ComponentSectionCardSection = { id: Scalars['ID']; title?: Maybe; subtitle?: Maybe; - card?: Maybe>>; + sections?: Maybe>>; }; export type ComponentSectionCardSectionInput = { title?: Maybe; subtitle?: Maybe; - card?: Maybe>>; + sections?: Maybe>>; }; export type ComponentSectionHeroSection = { __typename?: 'ComponentSectionHeroSection'; id: Scalars['ID']; - hero?: Maybe>>; + sections?: Maybe>>; title?: Maybe; subtitle?: Maybe; }; export type ComponentSectionHeroSectionInput = { - hero?: Maybe>>; + sections?: Maybe>>; title?: Maybe; subtitle?: Maybe; }; @@ -136,13 +136,13 @@ export type ComponentSectionSingleFeatureSection = { id: Scalars['ID']; title?: Maybe; subtitle?: Maybe; - singleFeature?: Maybe>>; + sections?: Maybe>>; }; export type ComponentSectionSingleFeatureSectionInput = { title?: Maybe; subtitle?: Maybe; - singleFeature?: Maybe>>; + sections?: Maybe>>; }; @@ -1248,12 +1248,12 @@ export type EditComponentSectionCardSectionInput = { id?: Maybe; title?: Maybe; subtitle?: Maybe; - card?: Maybe>>; + sections?: Maybe>>; }; export type EditComponentSectionHeroSectionInput = { id?: Maybe; - hero?: Maybe>>; + sections?: Maybe>>; title?: Maybe; subtitle?: Maybe; }; @@ -1262,7 +1262,7 @@ export type EditComponentSectionSingleFeatureSectionInput = { id?: Maybe; title?: Maybe; subtitle?: Maybe; - singleFeature?: Maybe>>; + sections?: Maybe>>; }; export type EditFileInput = { @@ -1515,7 +1515,7 @@ export const GetPages = ` id title subtitle - singleFeature { + singleFeature: sections { __typename id description @@ -1531,7 +1531,7 @@ export const GetPages = ` id title subtitle - hero { + hero: sections { id title subtitle @@ -1542,7 +1542,7 @@ export const GetPages = ` id title subtitle - card { + card: sections { id title description diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index 6889788c..722e45bf 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -7,7 +7,7 @@ import { GetPagesQuery, GetPagesQueryVariables, } from "@graphql/generated"; -import { BlockItemProps } from "@features/pageBlocks"; +import { BlockData } from "@features/pageBlocks"; import { PageData, usePagePlugin } from "@features/plugins/usePagePlugin"; import { DefaultLayout } from "@layouts/defaultLayout"; import { chakra, useColorMode } from "@chakra-ui/react"; @@ -22,7 +22,7 @@ interface DynamicPageProps { pageData: PageData; } -export default function DynamicPage({ pageData, preview }: DynamicPageProps) { +export default function DynamicPage({ pageData }: DynamicPageProps) { if (pageData == null) { return null; } @@ -31,13 +31,11 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { const [_, form] = usePagePlugin(pageData); - console.log("pageData", JSON.stringify(pageData, null, " ")); - - const itemProps = React.useMemo(() => { + /* const itemProps = React.useMemo(() => { return { isPreview: preview, }; - }, [preview]); + }, [preview]);*/ return (
@@ -47,7 +45,6 @@ export default function DynamicPage({ pageData, preview }: DynamicPageProps) { color={colorMode == "light" ? "dark" : "white"} name="sections" blocks={SECTION_PAGE_BLOCKS} - itemProps={itemProps} /> {/* */} @@ -183,38 +180,38 @@ function getPageData( id: section.id, title: section.title, subtitle: section.subtitle, - blocks: section.hero?.map((hero) => { + blocks: section.hero?.map((hero) => { if (hero != null) { return { id: hero.id, title: hero.title, subtitle: hero.subtitle, + _template: "ComponentBlocksHero", }; } }), }; } case "ComponentSectionSingleFeatureSection": { - console.log( - "features", - JSON.stringify(section.singleFeature, null, " ") - ); return { _template: "featureSection", id: section.id, title: section.title, subtitle: section.subtitle, - blocks: section.singleFeature?.map((feature) => { - if (feature != null) { - return { - id: feature.id, - title: feature.title, - description: feature.description, - imageUrl: feature.image?.url, - serviceLink: feature.serviceLink, - }; + blocks: section.singleFeature?.map( + (feature) => { + if (feature != null) { + return { + id: feature.id, + title: feature.title, + description: feature.description, + imageUrl: feature.image?.url ? feature.image.url : null, + serviceLink: feature.serviceLink, + _template: "ComponentBlocksSingleFeature", + }; + } } - }), + ), }; } case "ComponentSectionCardSection": { @@ -223,7 +220,7 @@ function getPageData( id: section.id, title: section.title, subtitle: section.subtitle, - blocks: section.card?.map((card) => { + blocks: section.card?.map((card) => { if (card != null) { return { id: card.id, @@ -231,6 +228,7 @@ function getPageData( description: card.description, imageUrl: card.image?.url, projectLink: card.projectLink, + _template: "ComponentBlocksCard", }; } }), @@ -249,83 +247,3 @@ function getPageData( }; } } - -/* -function getPageData( - pages: GetPagesQuery["pages"], - locale: string -): PageData | undefined { - //const section = sections?.find((section) => section?.locale == locale); // == first section - //if (section) { - const aa: SectionBlockData = - pages?.map((page) => { - if (page == null) { - return null; - } - - let blocks = - section?.blocks?.map((block) => { - console.log("block", JSON.stringify(block, null, " ")); - if (block == null) { - return null; - } - switch (block?.__typename) { - case "ComponentBlocksHero": { - return { - _template: "ComponentBlocksHero", - id: block.id, - title: block.title, - subtitle: block.subtitle, - }; - } - case "ComponentBlocksCard": { - return { - _template: "ComponentBlocksCard", - id: block.id, - title: block.title, - subtitle: block.description, - projectLink: block.projectLink, - imageUrl: block.image?.url, - }; - } - case "ComponentBlocksSingleFeature": { - return { - _template: "ComponentBlocksSingleFeature", - id: block.id, - title: block.title, - subtitle: block.description, - serviceLink: block.serviceLink, - imageUrl: block.image?.url, - }; - } - - default: - return assertNever(block); - } - }) || []; - switch (sezioni._template) { - case "heroSection": { - return { - id: section.id, - title: section.title, - subtitle: section.subtitle, - blocks: filterListNullableItems(blocks), - }; - } - case "featureSection": { - return { - id: section.id, - title: section.title, - subtitle: section.subtitle, - blocks: filterListNullableItems(blocks), - }; - } - } - }) || []; - return { - id: sezioni.id, - title: sezioni.title, - sections: filterListNullableItems(sezioni), - }; -} -*/ From c4f02944b8d6f8bc527da8f65cef720b49668e04 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Fri, 25 Jun 2021 16:48:40 +0200 Subject: [PATCH 08/15] Fixed sections and added styles. TODO: Fix blocks overlapsing and textarea dimensions while editing --- frontend/features/pageBlocks/FeatureBlock.tsx | 88 +++++++++++-------- frontend/features/pageBlocks/HeroBlock.tsx | 47 +++++----- frontend/theme/index.ts | 7 +- 3 files changed, 78 insertions(+), 64 deletions(-) diff --git a/frontend/features/pageBlocks/FeatureBlock.tsx b/frontend/features/pageBlocks/FeatureBlock.tsx index 5426bad1..6215c769 100644 --- a/frontend/features/pageBlocks/FeatureBlock.tsx +++ b/frontend/features/pageBlocks/FeatureBlock.tsx @@ -1,10 +1,11 @@ -import { Box, chakra, Flex, Link } from "@chakra-ui/react"; +import { Box, chakra, Container, Flex, Link } from "@chakra-ui/react"; import React from "react"; import { Block, BlocksControls, InlineImage, InlineText, + InlineTextarea, } from "react-tinacms-inline"; import { BlockTemplateData } from "./types"; @@ -26,49 +27,66 @@ interface FeatureBlockProps { serviceLink?: string; } -export function FeatureBlock({ imageUrl }: FeatureBlockProps) { - const StyledInlineText = chakra(InlineText); +export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { + const StyledInlineTextarea = chakra(InlineTextarea); return ( - - - "http://localhost:1337"} - name={"imageUrl"} - parse={(media) => media.filename} - /> - + + - - - - - - - - - - + {/* "http://localhost:1337"} + name={"imageUrl"} + parse={(media) => media.filename} + /> */} + + + + + + + + + + + + + ); } export const featureBlock: Block = { Component: ({ index, data, name, ...other }) => { + const StyledBlocksControls = chakra(BlocksControls); return ( - + - + ); }, template: { diff --git a/frontend/features/pageBlocks/HeroBlock.tsx b/frontend/features/pageBlocks/HeroBlock.tsx index 1db2a296..83f5ba5c 100644 --- a/frontend/features/pageBlocks/HeroBlock.tsx +++ b/frontend/features/pageBlocks/HeroBlock.tsx @@ -1,12 +1,7 @@ -import { Flex, Box, chakra, useMediaQuery } from "@chakra-ui/react"; +import { Flex, Box, chakra } from "@chakra-ui/react"; import React from "react"; -import { - Block, - BlocksControls, - InlineText, - InlineTextarea, -} from "react-tinacms-inline"; +import { Block, BlocksControls, InlineTextarea } from "react-tinacms-inline"; import { BlockTemplateData } from "./types"; export type HeroBlockData = BlockTemplateData< @@ -26,37 +21,37 @@ interface HeroBlockProps { } export function HeroBlock({}: HeroBlockProps) { - const [isSmallerThan900] = useMediaQuery("(max-width: 900px)"); - const [isSmallerThan600] = useMediaQuery("(max-width: 600px)"); - const [isSmallerThan1260] = useMediaQuery("(max-width: 1260px)"); - const [isSmallerThan700] = useMediaQuery("(max-width: 700)"); - const [isSmallerThan1020] = useMediaQuery("(max-width: 1020)"); return ( - + { + Component: ({ index, data, name }) => { return ( diff --git a/frontend/theme/index.ts b/frontend/theme/index.ts index b18b7d2f..55b65270 100644 --- a/frontend/theme/index.ts +++ b/frontend/theme/index.ts @@ -9,10 +9,11 @@ const fonts = { }; const breakpoints = createBreakpoints({ - sm: "40em", - md: "52em", - lg: "64em", + sm: "30em", + md: "48em", + lg: "62em", xl: "80em", + "2xl": "96em", }); const config: ThemeOverride["config"] = { From 13535d5fb8859a3897daa19c19f7144306cea540 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Fri, 25 Jun 2021 16:57:19 +0200 Subject: [PATCH 09/15] Fixed sections and added styles. TODO: Fix blocks overlapsing and textarea dimensions while editing --- backend/components/section/card-section.json | 22 +++ backend/components/section/hero-section.json | 22 +++ .../section/single-feature-section.json | 22 +++ .../sectionBlocks/cardSectionBlock.tsx | 47 +++++++ .../sectionBlocks/featureSectionBlock.tsx | 131 ++++++++++++++++++ .../sectionBlocks/heroSectionBlock.tsx | 92 ++++++++++++ frontend/features/sectionBlocks/index.ts | 19 +++ frontend/features/sectionBlocks/types.ts | 7 + frontend/utils/index.ts | 3 + 9 files changed, 365 insertions(+) create mode 100644 backend/components/section/card-section.json create mode 100644 backend/components/section/hero-section.json create mode 100644 backend/components/section/single-feature-section.json create mode 100644 frontend/features/sectionBlocks/cardSectionBlock.tsx create mode 100644 frontend/features/sectionBlocks/featureSectionBlock.tsx create mode 100644 frontend/features/sectionBlocks/heroSectionBlock.tsx create mode 100644 frontend/features/sectionBlocks/index.ts create mode 100644 frontend/features/sectionBlocks/types.ts create mode 100644 frontend/utils/index.ts diff --git a/backend/components/section/card-section.json b/backend/components/section/card-section.json new file mode 100644 index 00000000..11250353 --- /dev/null +++ b/backend/components/section/card-section.json @@ -0,0 +1,22 @@ +{ + "collectionName": "components_section_card_sections", + "info": { + "name": "cardSection", + "icon": "align-left", + "description": "" + }, + "options": {}, + "attributes": { + "title": { + "type": "string" + }, + "subtitle": { + "type": "text" + }, + "sections": { + "type": "component", + "repeatable": true, + "component": "blocks.card" + } + } +} diff --git a/backend/components/section/hero-section.json b/backend/components/section/hero-section.json new file mode 100644 index 00000000..087742b8 --- /dev/null +++ b/backend/components/section/hero-section.json @@ -0,0 +1,22 @@ +{ + "collectionName": "components_section_hero_sections", + "info": { + "name": "heroSection", + "icon": "arrow-alt-circle-up", + "description": "" + }, + "options": {}, + "attributes": { + "sections": { + "type": "component", + "repeatable": true, + "component": "blocks.hero" + }, + "title": { + "type": "string" + }, + "subtitle": { + "type": "text" + } + } +} diff --git a/backend/components/section/single-feature-section.json b/backend/components/section/single-feature-section.json new file mode 100644 index 00000000..26c2cc02 --- /dev/null +++ b/backend/components/section/single-feature-section.json @@ -0,0 +1,22 @@ +{ + "collectionName": "components_section_single_feature_sections", + "info": { + "name": "singleFeatureSection", + "icon": "anchor", + "description": "" + }, + "options": {}, + "attributes": { + "title": { + "type": "string" + }, + "subtitle": { + "type": "text" + }, + "sections": { + "type": "component", + "repeatable": true, + "component": "blocks.single-feature" + } + } +} diff --git a/frontend/features/sectionBlocks/cardSectionBlock.tsx b/frontend/features/sectionBlocks/cardSectionBlock.tsx new file mode 100644 index 00000000..87491b82 --- /dev/null +++ b/frontend/features/sectionBlocks/cardSectionBlock.tsx @@ -0,0 +1,47 @@ +import { Box } from "@chakra-ui/react"; +import { CARD_BLOCK } from "@features/pageBlocks"; +import { CardBlockData } from "@features/pageBlocks/CardBlock"; +import React from "react"; +import { Block, BlocksControls, InlineBlocks } from "react-tinacms-inline"; +import { SectionBlockTemplateData } from "./types"; + +export type CardSectionBlockData = SectionBlockTemplateData< + "cardSection", + { + id: string; + title?: string; + subtitle?: string; + blocks?: CardBlockData[]; + } +>; + +export function CardSectionBlock() { + return ( + + + + ); +} + +export const cardSectionBlock: Block = { + Component: ({ index, data, name, ...other }) => { + return ( + + + + ); + }, + template: { + label: "cardSection", + defaultItem: { + title: "Default title", + subtitle: "Default subtitle", + blocks: [], + }, + fields: [], + }, +}; diff --git a/frontend/features/sectionBlocks/featureSectionBlock.tsx b/frontend/features/sectionBlocks/featureSectionBlock.tsx new file mode 100644 index 00000000..ef5751b4 --- /dev/null +++ b/frontend/features/sectionBlocks/featureSectionBlock.tsx @@ -0,0 +1,131 @@ +import { Box, chakra, Flex } from "@chakra-ui/react"; +import { FEAT_BLOCK } from "@features/pageBlocks"; +import { FeatureBlockData } from "@features/pageBlocks/FeatureBlock"; +import React from "react"; +import { + Block, + BlocksControls, + InlineBlocks, + InlineText, + InlineTextarea, +} from "react-tinacms-inline"; +import { SectionBlockTemplateData } from "./types"; + +export type FeatureSectionBlockData = SectionBlockTemplateData< + "featureSection", + { + id: string; + title?: string; + subtitle?: string; + blocks?: FeatureBlockData[]; + } +>; + +export function FeatureSectionBlock() { + const StyledInlineTextarea = chakra(InlineTextarea); + const StyledInlineBlocks = chakra(InlineBlocks); + return ( + + + + + + + + + + + + ); +} + +export const featureSectionBlock: Block = { + Component: ({ index, data }) => { + return ( + + + + ); + }, + template: { + label: "featureSection", + defaultItem: { + title: "Default title", + subtitle: "Default subtitle", + blocks: [], + }, + fields: [], + }, +}; diff --git a/frontend/features/sectionBlocks/heroSectionBlock.tsx b/frontend/features/sectionBlocks/heroSectionBlock.tsx new file mode 100644 index 00000000..b2b306e2 --- /dev/null +++ b/frontend/features/sectionBlocks/heroSectionBlock.tsx @@ -0,0 +1,92 @@ +import { Box, Flex } from "@chakra-ui/react"; +import { HERO_BLOCK } from "@features/pageBlocks"; +import { HeroBlockData } from "@features/pageBlocks/HeroBlock"; +import React from "react"; +import { + Block, + BlocksControls, + InlineBlocks, + InlineText, +} from "react-tinacms-inline"; +import { SectionBlockTemplateData } from "./types"; + +export type HeroSectionBlockData = SectionBlockTemplateData< + "heroSection", + { + id: string; + title: string; + subtitle: string; + blocks: HeroBlockData[]; + } +>; + +export function HeroSectionBlock() { + return ( + + + + + + + + + + + + + + ); +} + +export const heroSectionBlock: Block = { + Component: ({ index, data, name, ...other }) => { + return ( + + + + ); + }, + template: { + label: "heroSection", + defaultItem: { + title: " ", + subtitle: " ", + blocks: [], + }, + fields: [], + }, +}; diff --git a/frontend/features/sectionBlocks/index.ts b/frontend/features/sectionBlocks/index.ts new file mode 100644 index 00000000..08712b04 --- /dev/null +++ b/frontend/features/sectionBlocks/index.ts @@ -0,0 +1,19 @@ +export * from "./types"; +import { heroSectionBlock, HeroSectionBlockData } from "./heroSectionBlock"; +import { + featureSectionBlock, + FeatureSectionBlockData, +} from "./featureSectionBlock"; +import { cardSectionBlock, CardSectionBlockData } from "./cardSectionBlock"; + +export const SECTION_PAGE_BLOCKS = { + /** We will define blocks here later */ + heroSection: heroSectionBlock, + featureSection: featureSectionBlock, + cardSection: cardSectionBlock, +}; + +export type SectionBlockData = + | HeroSectionBlockData + | FeatureSectionBlockData + | CardSectionBlockData; diff --git a/frontend/features/sectionBlocks/types.ts b/frontend/features/sectionBlocks/types.ts new file mode 100644 index 00000000..37bdefb0 --- /dev/null +++ b/frontend/features/sectionBlocks/types.ts @@ -0,0 +1,7 @@ +export type SectionBlockTemplateData = { + _template: TemplateName; +} & Type; + +export interface BlockItemProps { + isPreview: boolean; +} diff --git a/frontend/utils/index.ts b/frontend/utils/index.ts new file mode 100644 index 00000000..c845c0ff --- /dev/null +++ b/frontend/utils/index.ts @@ -0,0 +1,3 @@ +export function assertNever(x: never): never { + throw new Error("Unexpected object: " + x); +} From 9ba26432a7bcee379579af8b0dfc8024dfb46ebc Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Mon, 28 Jun 2021 10:38:45 +0200 Subject: [PATCH 10/15] Fixed blocks overlapsing. Added more styles --- frontend/features/pageBlocks/FeatureBlock.tsx | 47 ++-- frontend/features/pageBlocks/HeroBlock.tsx | 30 +- .../sectionBlocks/featureSectionBlock.tsx | 26 +- .../sectionBlocks/heroSectionBlock.tsx | 30 +- frontend/package-lock.json | 259 +++++++++++++++--- frontend/package.json | 9 +- frontend/pages/_document.tsx | 15 +- frontend/theme/index.ts | 3 +- package-lock.json | 2 +- 9 files changed, 315 insertions(+), 106 deletions(-) diff --git a/frontend/features/pageBlocks/FeatureBlock.tsx b/frontend/features/pageBlocks/FeatureBlock.tsx index 6215c769..61182888 100644 --- a/frontend/features/pageBlocks/FeatureBlock.tsx +++ b/frontend/features/pageBlocks/FeatureBlock.tsx @@ -1,12 +1,7 @@ import { Box, chakra, Container, Flex, Link } from "@chakra-ui/react"; +import { STRAPI_URL } from "@config/env"; import React from "react"; -import { - Block, - BlocksControls, - InlineImage, - InlineText, - InlineTextarea, -} from "react-tinacms-inline"; +import { Block, BlocksControls, InlineTextarea } from "react-tinacms-inline"; import { BlockTemplateData } from "./types"; export type FeatureBlockData = BlockTemplateData< @@ -22,8 +17,6 @@ export type FeatureBlockData = BlockTemplateData< interface FeatureBlockProps { imageUrl?: string; - title?: string; - description?: string; serviceLink?: string; } @@ -38,20 +31,16 @@ export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { m={2.5} boxSizing={"border-box"} > - {/* "http://localhost:1337"} name={"imageUrl"} parse={(media) => media.filename} /> */} - + @@ -61,13 +50,18 @@ export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { fontSize={"sm"} fontWeight={"subtitle"} lineHeight={"subtitle"} - fontFamily={"Monospace"} letterSpacing={"0.02em"} + color={"description"} > - + - + Learn more → @@ -76,16 +70,17 @@ export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { } export const featureBlock: Block = { - Component: ({ index, data, name, ...other }) => { + Component: ({ index, data }) => { const StyledBlocksControls = chakra(BlocksControls); + console.log("DATA", JSON.stringify(data, null, " ")); + return ( - - + + ); }, diff --git a/frontend/features/pageBlocks/HeroBlock.tsx b/frontend/features/pageBlocks/HeroBlock.tsx index 83f5ba5c..737019a7 100644 --- a/frontend/features/pageBlocks/HeroBlock.tsx +++ b/frontend/features/pageBlocks/HeroBlock.tsx @@ -21,27 +21,19 @@ interface HeroBlockProps { } export function HeroBlock({}: HeroBlockProps) { + const StyledInlineTextarea = chakra(InlineTextarea); return ( - + - + - + @@ -69,7 +69,7 @@ export function HeroBlock({}: HeroBlockProps) { const HeroBox = chakra(Box); export const heroBlock: Block = { - Component: ({ index, data, name }) => { + Component: ({ index, data }) => { return ( diff --git a/frontend/features/sectionBlocks/featureSectionBlock.tsx b/frontend/features/sectionBlocks/featureSectionBlock.tsx index ef5751b4..54bfc483 100644 --- a/frontend/features/sectionBlocks/featureSectionBlock.tsx +++ b/frontend/features/sectionBlocks/featureSectionBlock.tsx @@ -6,7 +6,6 @@ import { Block, BlocksControls, InlineBlocks, - InlineText, InlineTextarea, } from "react-tinacms-inline"; import { SectionBlockTemplateData } from "./types"; @@ -24,6 +23,7 @@ export type FeatureSectionBlockData = SectionBlockTemplateData< export function FeatureSectionBlock() { const StyledInlineTextarea = chakra(InlineTextarea); const StyledInlineBlocks = chakra(InlineBlocks); + return ( - + ); } diff --git a/frontend/features/sectionBlocks/heroSectionBlock.tsx b/frontend/features/sectionBlocks/heroSectionBlock.tsx index b2b306e2..21d1e8bc 100644 --- a/frontend/features/sectionBlocks/heroSectionBlock.tsx +++ b/frontend/features/sectionBlocks/heroSectionBlock.tsx @@ -1,4 +1,4 @@ -import { Box, Flex } from "@chakra-ui/react"; +import { Box, chakra, Flex } from "@chakra-ui/react"; import { HERO_BLOCK } from "@features/pageBlocks"; import { HeroBlockData } from "@features/pageBlocks/HeroBlock"; import React from "react"; @@ -7,6 +7,7 @@ import { BlocksControls, InlineBlocks, InlineText, + InlineTextarea, } from "react-tinacms-inline"; import { SectionBlockTemplateData } from "./types"; @@ -21,6 +22,7 @@ export type HeroSectionBlockData = SectionBlockTemplateData< >; export function HeroSectionBlock() { + const StyledInlineBlocks = chakra(InlineBlocks); return ( - + - + - - + + ); } export const heroSectionBlock: Block = { - Component: ({ index, data, name, ...other }) => { + Component: ({ index, data }) => { return ( diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5c8876c8..53d1ed46 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1535,18 +1535,6 @@ } } }, - "@graphql-codegen/typescript": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript/-/typescript-1.22.2.tgz", - "integrity": "sha512-M+gJVHnpWanCTrSqzh+jNyJ6HhDICFzWV3SVcns5LX1X4NC/7N+TvYLk9ZzRSpBYCkWWGmTPrZNd0zjwhroRTg==", - "dev": true, - "requires": { - "@graphql-codegen/plugin-helpers": "^1.18.7", - "@graphql-codegen/visitor-plugin-common": "1.21.1", - "auto-bind": "~4.0.0", - "tslib": "~2.3.0" - } - }, "@graphql-codegen/typescript-document-nodes": { "version": "1.17.13", "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-document-nodes/-/typescript-document-nodes-1.17.13.tgz", @@ -1558,32 +1546,6 @@ "tslib": "~2.3.0" } }, - "@graphql-codegen/typescript-operations": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-operations/-/typescript-operations-1.18.1.tgz", - "integrity": "sha512-6w67j9Y8ZqSMc5a7bxkbNp0Yv1NWUMnCZt30nqXyOlvqlbmPogWWxJGccxSDfhZ8+uSFjQp5kUM07w8/uPMIZQ==", - "dev": true, - "requires": { - "@graphql-codegen/plugin-helpers": "^1.18.7", - "@graphql-codegen/typescript": "^1.22.2", - "@graphql-codegen/visitor-plugin-common": "1.21.1", - "auto-bind": "~4.0.0", - "tslib": "~2.3.0" - } - }, - "@graphql-codegen/typescript-react-apollo": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/@graphql-codegen/typescript-react-apollo/-/typescript-react-apollo-2.2.6.tgz", - "integrity": "sha512-aG/0CJPu4YjprC6QTOeaOxKCGg8c0m8Ja+WI5por8/hOqpndieSUYBxLZJ1ZxbXdgLpCkmUIGS9QZsVr7xtVQw==", - "dev": true, - "requires": { - "@graphql-codegen/plugin-helpers": "^1.18.7", - "@graphql-codegen/visitor-plugin-common": "1.21.1", - "auto-bind": "~4.0.0", - "change-case-all": "1.0.14", - "tslib": "~2.3.0" - } - }, "@graphql-codegen/visitor-plugin-common": { "version": "1.21.1", "resolved": "https://registry.npmjs.org/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-1.21.1.tgz", @@ -3501,6 +3463,11 @@ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, + "codemirror": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.0.tgz", + "integrity": "sha512-Xnl3304iCc8nyVZuRkzDVVwc794uc9QNX0UcPGeNic1fbzkSrO4l4GVXho9tRNKBgPYZXgocUqXyfIv3BILhCQ==" + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -4054,6 +4021,11 @@ "ansi-colors": "^4.1.1" } }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -6384,6 +6356,14 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "listr": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz", @@ -6632,11 +6612,15 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, "lodash.includes": { "version": "4.3.0", @@ -6915,6 +6899,28 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + } + } + }, "material-colors": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz", @@ -6935,6 +6941,11 @@ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, "memoize-one": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", @@ -7493,6 +7504,11 @@ "word-wrap": "^1.2.3" } }, + "orderedmap": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-1.1.1.tgz", + "integrity": "sha512-3Ux8um0zXbVacKUkcytc0u3HgC0b0bBLT+I60r2J/En72cI0nZffqrA7Xtf2Hqs27j1g82llR5Mhbd0Z1XW4AQ==" + }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -7869,6 +7885,126 @@ "react-is": "^16.8.1" } }, + "prosemirror-commands": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.1.9.tgz", + "integrity": "sha512-zedlbQ+8QK0tIeibb6vbnAX5FO/S5x67xHgF57Fned+3G6RZY3JAGma9kC1jSCmLF/XC7MCZ90oekb0qo2b+Pw==", + "requires": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "prosemirror-dropcursor": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.3.5.tgz", + "integrity": "sha512-tNUwcF2lPAkwKBZPZRtbxpwljnODRNZ3eiYloN1DSUqDjMT1nBZm0nejaEMS1TvNQ+3amibUSAiV4hX+jpASFA==", + "requires": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0", + "prosemirror-view": "^1.1.0" + } + }, + "prosemirror-gapcursor": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.1.5.tgz", + "integrity": "sha512-SjbUZq5pgsBDuV3hu8GqgIpZR5eZvGLM+gPQTqjVVYSMUCfKW3EGXTEYaLHEl1bGduwqNC95O3bZflgtAb4L6w==", + "requires": { + "prosemirror-keymap": "^1.0.0", + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-view": "^1.0.0" + } + }, + "prosemirror-history": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.1.3.tgz", + "integrity": "sha512-zGDotijea+vnfnyyUGyiy1wfOQhf0B/b6zYcCouBV8yo6JmrE9X23M5q7Nf/nATywEZbgRLG70R4DmfSTC+gfg==", + "requires": { + "prosemirror-state": "^1.2.2", + "prosemirror-transform": "^1.0.0", + "rope-sequence": "^1.3.0" + } + }, + "prosemirror-inputrules": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.1.3.tgz", + "integrity": "sha512-ZaHCLyBtvbyIHv0f5p6boQTIJjlD6o2NPZiEaZWT2DA+j591zS29QQEMT4lBqwcLW3qRSf7ZvoKNbf05YrsStw==", + "requires": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "prosemirror-keymap": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.1.4.tgz", + "integrity": "sha512-Al8cVUOnDFL4gcI5IDlG6xbZ0aOD/i3B17VT+1JbHWDguCgt/lBHVTHUBcKvvbSg6+q/W4Nj1Fu6bwZSca3xjg==", + "requires": { + "prosemirror-state": "^1.0.0", + "w3c-keyname": "^2.2.0" + } + }, + "prosemirror-model": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.14.2.tgz", + "integrity": "sha512-TwkACyEiSi8FJiRhg2ffbzmQRy5DR+aTwAr7trNQNZL24HJR8ouxy4qCkG99PnWK0xZ0AjSMtPXSU6hnxAiP7Q==", + "requires": { + "orderedmap": "^1.1.0" + } + }, + "prosemirror-schema-list": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.1.4.tgz", + "integrity": "sha512-pNTuZflacFOBlxrTcWSdWhjoB8BaucwfJVp/gJNxztOwaN3wQiC65axclXyplf6TKgXD/EkWfS/QAov3/Znadw==", + "requires": { + "prosemirror-model": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "prosemirror-state": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.3.4.tgz", + "integrity": "sha512-Xkkrpd1y/TQ6HKzN3agsQIGRcLckUMA9u3j207L04mt8ToRgpGeyhbVv0HI7omDORIBHjR29b7AwlATFFf2GLA==", + "requires": { + "prosemirror-model": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "prosemirror-tables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.0.0.tgz", + "integrity": "sha512-zFw5Us4G5Vdq0yIj8GiqZOGA6ud5UKpMKElux9O0HrfmhkuGa1jf1PCpz2R5pmIQJv+tIM24H1mox/ODBAX37Q==", + "requires": { + "prosemirror-keymap": "^1.1.2", + "prosemirror-model": "^1.8.1", + "prosemirror-state": "^1.3.1", + "prosemirror-transform": "^1.2.1", + "prosemirror-view": "^1.13.3" + } + }, + "prosemirror-transform": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.3.2.tgz", + "integrity": "sha512-/G6d/u9Mf6Bv3H1XR8VxhpjmUO75LYmnvj+s3ZfZpakU1hnQbsvCEybml1B3f2IWUAAQRFkbO1PnsbFhLZsYsw==", + "requires": { + "prosemirror-model": "^1.0.0" + } + }, + "prosemirror-utils": { + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/prosemirror-utils/-/prosemirror-utils-0.9.6.tgz", + "integrity": "sha512-UC+j9hQQ1POYfMc5p7UFxBTptRiGPR7Kkmbl3jVvU8VgQbkI89tR/GK+3QYC8n+VvBZrtAoCrJItNhWSxX3slA==" + }, + "prosemirror-view": { + "version": "1.18.8", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.18.8.tgz", + "integrity": "sha512-iLNonsRUM+ByIxJZP+tRuE8jUy56jfgf8oxnc4InWYTYdPibARs4FL6DQ6D56GdPMlXyTjXjSdfDp/x8mwHhtw==", + "requires": { + "prosemirror-model": "^1.1.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0" + } + }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -8203,6 +8339,31 @@ "use-latest": "^1.0.0" } }, + "react-tinacms-editor": { + "version": "0.41.1", + "resolved": "https://registry.npmjs.org/react-tinacms-editor/-/react-tinacms-editor-0.41.1.tgz", + "integrity": "sha512-HEN9shMpnt9xRgAfoNebKvBAAeYYMBFO3kX5p9SbzeRslrQ7xCH/qM+iI+CvOAFunKHNiwHWvChEAJx9G/lweA==", + "requires": { + "codemirror": "^5.42.2", + "lodash.debounce": "^4.0.8", + "lodash.get": "^4.4.2", + "markdown-it": "^8.3.1", + "prosemirror-commands": "^1.0.8", + "prosemirror-dropcursor": "^1.1.2", + "prosemirror-gapcursor": "^1.0.4", + "prosemirror-history": "^1.0.4", + "prosemirror-inputrules": "^1.0.4", + "prosemirror-keymap": "^1.0.1", + "prosemirror-model": "^1.0.0", + "prosemirror-schema-list": "^1.0.3", + "prosemirror-state": "^1.2.4", + "prosemirror-tables": "1.0.0", + "prosemirror-transform": "^1.0.0", + "prosemirror-utils": "^0.9.6", + "prosemirror-view": "^1.11.3", + "react-dismissible": "^1.3.0" + } + }, "react-tinacms-inline": { "version": "0.41.1", "resolved": "https://registry.npmjs.org/react-tinacms-inline/-/react-tinacms-inline-0.41.1.tgz", @@ -8551,6 +8712,11 @@ "inherits": "^2.0.1" } }, + "rope-sequence": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.2.tgz", + "integrity": "sha512-ku6MFrwEVSVmXLvy3dYph3LAMNS0890K7fabn+0YIRQ2T96T9F4gkFf0vf0WW0JUraNWwGRtInEpH7yO4tbQZg==" + }, "rtl-css-js": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.14.1.tgz", @@ -8815,8 +8981,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "stack-generator": { "version": "2.0.5", @@ -9467,6 +9632,11 @@ "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.28.tgz", "integrity": "sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==" }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", @@ -9668,6 +9838,11 @@ "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, + "w3c-keyname": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz", + "integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw==" + }, "warning": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 044ea756..9d23efb6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,11 +16,12 @@ "@emotion/styled": "11.3.0", "@graphql-codegen/typescript-document-nodes": "1.17.13", "framer-motion": "4.1.17", - "graphql": "^15.5.1", - "graphql-codegen": "^0.4.0", - "next": "^11.0.0", + "graphql": "15.5.1", + "graphql-codegen": "0.4.0", + "next": "11.0.0", "react": "17.0.2", "react-dom": "17.0.2", + "react-tinacms-editor": "0.41.1", "react-tinacms-inline": "0.41.1", "react-tinacms-strapi": "0.41.1", "tinacms": "0.41.1" @@ -36,4 +37,4 @@ "eslint-config-next": "11.0.0", "typescript": "4.3.4" } -} \ No newline at end of file +} diff --git a/frontend/pages/_document.tsx b/frontend/pages/_document.tsx index f17228cf..d20215ce 100644 --- a/frontend/pages/_document.tsx +++ b/frontend/pages/_document.tsx @@ -6,8 +6,19 @@ export default class Document extends NextDocument { render() { return ( - - + + + + + +
diff --git a/frontend/theme/index.ts b/frontend/theme/index.ts index 55b65270..9f801144 100644 --- a/frontend/theme/index.ts +++ b/frontend/theme/index.ts @@ -4,7 +4,7 @@ import { createBreakpoints } from "@chakra-ui/theme-tools"; const fonts = { ...chakraTheme.fonts, - body: `"Roboto Mono", monospace`, + body: `"Europa","Roboto Mono", monospace`, heading: `Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"`, }; @@ -50,6 +50,7 @@ const overrides: ThemeOverride = { }, colors: { dark: "rgb(22,19,56)", + description: "rgb(92,92,92)", }, components: { /* diff --git a/package-lock.json b/package-lock.json index 1d69586e..8e5f0ce5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ }, "@sideway/formula": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.f0.tgz", "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", "dev": true }, From 79004ae3f18ee33f265bb85c5c9cf8b546ce835b Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Mon, 28 Jun 2021 11:39:29 +0200 Subject: [PATCH 11/15] Added feature link url changer. Fixed some bugs --- frontend/features/pageBlocks/FeatureBlock.tsx | 17 ++++++++++---- frontend/features/pageBlocks/HeroBlock.tsx | 3 ++- .../sectionBlocks/featureSectionBlock.tsx | 15 ++++++++---- .../sectionBlocks/heroSectionBlock.tsx | 15 ++++++++---- frontend/pages/[...slug].tsx | 23 ++++++++++++------- 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/frontend/features/pageBlocks/FeatureBlock.tsx b/frontend/features/pageBlocks/FeatureBlock.tsx index 61182888..73c23ce0 100644 --- a/frontend/features/pageBlocks/FeatureBlock.tsx +++ b/frontend/features/pageBlocks/FeatureBlock.tsx @@ -20,8 +20,9 @@ interface FeatureBlockProps { serviceLink?: string; } +export const StyledInlineTextarea = chakra(InlineTextarea); + export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { - const StyledInlineTextarea = chakra(InlineTextarea); return ( @@ -69,14 +70,14 @@ export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { ); } +export const StyledBlocksControls = chakra(BlocksControls); + export const featureBlock: Block = { Component: ({ index, data }) => { - const StyledBlocksControls = chakra(BlocksControls); - console.log("DATA", JSON.stringify(data, null, " ")); - return ( diff --git a/frontend/features/sectionBlocks/featureSectionBlock.tsx b/frontend/features/sectionBlocks/featureSectionBlock.tsx index 54bfc483..e3ee2cd6 100644 --- a/frontend/features/sectionBlocks/featureSectionBlock.tsx +++ b/frontend/features/sectionBlocks/featureSectionBlock.tsx @@ -1,5 +1,5 @@ import { Box, chakra, Flex } from "@chakra-ui/react"; -import { FEAT_BLOCK } from "@features/pageBlocks"; +import { BlockItemProps, FEAT_BLOCK } from "@features/pageBlocks"; import { FeatureBlockData } from "@features/pageBlocks/FeatureBlock"; import React from "react"; import { @@ -20,9 +20,15 @@ export type FeatureSectionBlockData = SectionBlockTemplateData< } >; -export function FeatureSectionBlock() { - const StyledInlineTextarea = chakra(InlineTextarea); - const StyledInlineBlocks = chakra(InlineBlocks); +export const StyledInlineTextarea = chakra(InlineTextarea); +export const StyledInlineBlocks = chakra(InlineBlocks); + +export function FeatureSectionBlock(preview: boolean) { + const itemProps = React.useMemo(() => { + return { + isPreview: preview, + }; + }, [preview]); return ( ); diff --git a/frontend/features/sectionBlocks/heroSectionBlock.tsx b/frontend/features/sectionBlocks/heroSectionBlock.tsx index 21d1e8bc..14eca9c3 100644 --- a/frontend/features/sectionBlocks/heroSectionBlock.tsx +++ b/frontend/features/sectionBlocks/heroSectionBlock.tsx @@ -6,10 +6,9 @@ import { Block, BlocksControls, InlineBlocks, - InlineText, InlineTextarea, } from "react-tinacms-inline"; -import { SectionBlockTemplateData } from "./types"; +import { BlockItemProps, SectionBlockTemplateData } from "./types"; export type HeroSectionBlockData = SectionBlockTemplateData< "heroSection", @@ -21,8 +20,15 @@ export type HeroSectionBlockData = SectionBlockTemplateData< } >; -export function HeroSectionBlock() { - const StyledInlineBlocks = chakra(InlineBlocks); +export const StyledInlineBlocks = chakra(InlineBlocks); + +export function HeroSectionBlock(preview: boolean) { + const itemProps = React.useMemo(() => { + return { + isPreview: preview, + }; + }, [preview]); + return ( diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index 722e45bf..c4425571 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -7,12 +7,18 @@ import { GetPagesQuery, GetPagesQueryVariables, } from "@graphql/generated"; -import { BlockData } from "@features/pageBlocks"; import { PageData, usePagePlugin } from "@features/plugins/usePagePlugin"; import { DefaultLayout } from "@layouts/defaultLayout"; import { chakra, useColorMode } from "@chakra-ui/react"; -import { SectionBlockData, SECTION_PAGE_BLOCKS } from "@features/sectionBlocks"; +import { + BlockItemProps, + SectionBlockData, + SECTION_PAGE_BLOCKS, +} from "@features/sectionBlocks"; import { assertNever } from "utils"; +import { HeroBlockData } from "@features/pageBlocks/HeroBlock"; +import { FeatureBlockData } from "@features/pageBlocks/FeatureBlock"; +import { CardBlockData } from "@features/pageBlocks/CardBlock"; interface DynamicPageProps { path: string[]; @@ -22,7 +28,7 @@ interface DynamicPageProps { pageData: PageData; } -export default function DynamicPage({ pageData }: DynamicPageProps) { +export default function DynamicPage({ pageData, preview }: DynamicPageProps) { if (pageData == null) { return null; } @@ -31,11 +37,11 @@ export default function DynamicPage({ pageData }: DynamicPageProps) { const [_, form] = usePagePlugin(pageData); - /* const itemProps = React.useMemo(() => { + const itemProps = React.useMemo(() => { return { isPreview: preview, }; - }, [preview]);*/ + }, [preview]); return (
@@ -44,6 +50,7 @@ export default function DynamicPage({ pageData }: DynamicPageProps) { {/* */} @@ -180,7 +187,7 @@ function getPageData( id: section.id, title: section.title, subtitle: section.subtitle, - blocks: section.hero?.map((hero) => { + blocks: section.hero?.map((hero) => { if (hero != null) { return { id: hero.id, @@ -198,7 +205,7 @@ function getPageData( id: section.id, title: section.title, subtitle: section.subtitle, - blocks: section.singleFeature?.map( + blocks: section.singleFeature?.map( (feature) => { if (feature != null) { return { @@ -220,7 +227,7 @@ function getPageData( id: section.id, title: section.title, subtitle: section.subtitle, - blocks: section.card?.map((card) => { + blocks: section.card?.map((card) => { if (card != null) { return { id: card.id, From 5de7f8b001ba0b0e8df48329005850032142e662 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Mon, 28 Jun 2021 16:27:37 +0200 Subject: [PATCH 12/15] Added and styled Card block. I maybe have badly overrided '.StyledFocusRing-sc-191xkzj.kQMZpz' tina class. --- frontend/features/pageBlocks/CardBlock.tsx | 173 ++++++++++++------ .../sectionBlocks/cardSectionBlock.tsx | 84 ++++++++- frontend/pages/_app.tsx | 2 +- frontend/pages/_index.tsx | 1 + frontend/theme/index.ts | 2 + 5 files changed, 202 insertions(+), 60 deletions(-) diff --git a/frontend/features/pageBlocks/CardBlock.tsx b/frontend/features/pageBlocks/CardBlock.tsx index 751b9e36..6272e5e1 100644 --- a/frontend/features/pageBlocks/CardBlock.tsx +++ b/frontend/features/pageBlocks/CardBlock.tsx @@ -1,11 +1,8 @@ -import { AspectRatio, Box, Link, Stack, Text } from "@chakra-ui/react"; +import { Image, Box, chakra, Flex } from "@chakra-ui/react"; +import { STRAPI_URL } from "@config/env"; import React from "react"; -import { - Block, - BlocksControls, - InlineImage, - InlineText, -} from "react-tinacms-inline"; +import { Block, BlocksControls, InlineTextarea } from "react-tinacms-inline"; +import { useCMS } from "tinacms"; import { BlockTemplateData } from "./types"; export type CardBlockData = BlockTemplateData< @@ -26,58 +23,131 @@ interface CardBlockProps { projectLink?: string; } -export function CardBlock({ projectLink }: CardBlockProps) { +export const StyledImage = chakra(Image); +export const StyledInlineTextarea = chakra(InlineTextarea); + +export function CardBlock({ imageUrl, projectLink }: CardBlockProps) { + const cms = useCMS(); return ( - - - media.id} /> - - - - - - + + + + - - - - - Discover more - - - + + + + + + + + + + Discover more + + ); } export const cardBlock: Block = { - Component: ({ index, data, name, ...other }) => { + Component: ({ index, data }: any) => { return ( - + ); }, @@ -86,7 +156,8 @@ export const cardBlock: Block = { defaultItem: { title: "Default title", description: "Default description", - projectLink: "Default link", + projectLink: "Discover more", + imageUrl: "http://localhost:1337/uploads/80_c6692eb6f8", }, fields: [], }, diff --git a/frontend/features/sectionBlocks/cardSectionBlock.tsx b/frontend/features/sectionBlocks/cardSectionBlock.tsx index 87491b82..879de935 100644 --- a/frontend/features/sectionBlocks/cardSectionBlock.tsx +++ b/frontend/features/sectionBlocks/cardSectionBlock.tsx @@ -1,8 +1,15 @@ -import { Box } from "@chakra-ui/react"; +import { Box, chakra, Flex } from "@chakra-ui/react"; import { CARD_BLOCK } from "@features/pageBlocks"; import { CardBlockData } from "@features/pageBlocks/CardBlock"; import React from "react"; -import { Block, BlocksControls, InlineBlocks } from "react-tinacms-inline"; +import { + Block, + BlocksControls, + InlineBlock, + InlineBlocks, + InlineTextarea, +} from "react-tinacms-inline"; +import { useCMS } from "tinacms"; import { SectionBlockTemplateData } from "./types"; export type CardSectionBlockData = SectionBlockTemplateData< @@ -15,14 +22,75 @@ export type CardSectionBlockData = SectionBlockTemplateData< } >; +export const StyledInlineBlocks = chakra(InlineBlocks); +export const StyledInlineTextarea = chakra(InlineTextarea); + export function CardSectionBlock() { + const cms = useCMS(); return ( - - + + + + + + + ); } diff --git a/frontend/pages/_app.tsx b/frontend/pages/_app.tsx index dbcfd647..39dad875 100644 --- a/frontend/pages/_app.tsx +++ b/frontend/pages/_app.tsx @@ -1,7 +1,7 @@ import AppProviders from "@components/AppProviders"; import { AppProps } from "next/app"; import React from "react"; -import "../styles/globals.css"; +import "theme/index.css"; function MyApp({ Component, pageProps }: AppProps) { return ( diff --git a/frontend/pages/_index.tsx b/frontend/pages/_index.tsx index d6f0d94f..cc73beed 100644 --- a/frontend/pages/_index.tsx +++ b/frontend/pages/_index.tsx @@ -1,6 +1,7 @@ import { DefaultLayout } from "@layouts/defaultLayout"; import React from "react"; + export default function HomePage() { return
; } diff --git a/frontend/theme/index.ts b/frontend/theme/index.ts index 9f801144..4fea9121 100644 --- a/frontend/theme/index.ts +++ b/frontend/theme/index.ts @@ -51,6 +51,8 @@ const overrides: ThemeOverride = { colors: { dark: "rgb(22,19,56)", description: "rgb(92,92,92)", + cardSectionBg: "rgb(234, 247, 247)", + cardDescription: "rgb(92, 92, 92)", }, components: { /* From ca489b8af83a6f4b95fb817f63d59a80a3493180 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Mon, 28 Jun 2021 16:53:43 +0200 Subject: [PATCH 13/15] TODO: Fix some proportion when enabling Tina. --- frontend/features/pageBlocks/CardBlock.tsx | 2 +- frontend/features/pageBlocks/FeatureBlock.tsx | 2 ++ frontend/features/sectionBlocks/cardSectionBlock.tsx | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/features/pageBlocks/CardBlock.tsx b/frontend/features/pageBlocks/CardBlock.tsx index 6272e5e1..b4a6563f 100644 --- a/frontend/features/pageBlocks/CardBlock.tsx +++ b/frontend/features/pageBlocks/CardBlock.tsx @@ -36,7 +36,7 @@ export function CardBlock({ imageUrl, projectLink }: CardBlockProps) { boxSizing={"border-box"} justifyContent={"space-between"} h={cms.enabled ? "full" : "auto"} - width={cms.enabled ? "calc(100% - 30px)" : "calc(33.33% - 30px)"} + width={cms.enabled ? "calc(99% - 30px)" : "calc(33.33% - 30px)"} backgroundColor={"white"} href={projectLink} transition={"all 0.8s"} diff --git a/frontend/features/pageBlocks/FeatureBlock.tsx b/frontend/features/pageBlocks/FeatureBlock.tsx index 73c23ce0..390c5aae 100644 --- a/frontend/features/pageBlocks/FeatureBlock.tsx +++ b/frontend/features/pageBlocks/FeatureBlock.tsx @@ -53,11 +53,13 @@ export function FeatureBlock({ imageUrl, serviceLink }: FeatureBlockProps) { lineHeight={"subtitle"} letterSpacing={"0.02em"} color={"description"} + fontFamily={"Roboto Mono"} >
diff --git a/frontend/features/sectionBlocks/cardSectionBlock.tsx b/frontend/features/sectionBlocks/cardSectionBlock.tsx index 879de935..e0f8f8de 100644 --- a/frontend/features/sectionBlocks/cardSectionBlock.tsx +++ b/frontend/features/sectionBlocks/cardSectionBlock.tsx @@ -71,7 +71,8 @@ export function CardSectionBlock() { Date: Mon, 28 Jun 2021 20:56:20 +0200 Subject: [PATCH 14/15] Added status --- frontend/theme/index.css | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 frontend/theme/index.css diff --git a/frontend/theme/index.css b/frontend/theme/index.css new file mode 100644 index 00000000..659233f0 --- /dev/null +++ b/frontend/theme/index.css @@ -0,0 +1,23 @@ +@media (max-width: 1000px) { + .card-list a:nth-child(3) { + display: none; + } + .card-list a { + width: calc(50% - 30px); + margin: 15px; + } +} + +@media (max-width: 750px) { + .card-list a:nth-child(3) { + display: block; + } + .card-list a { + width: 100%; + margin: 15px; + } +} + +.StyledFocusRing-sc-191xkzj.kQMZpz { + height: auto; +} From 2fefacd0c7f15c9679d23fe452e57519ec9cd4b0 Mon Sep 17 00:00:00 2001 From: Giacomo Baggio Date: Tue, 29 Jun 2021 09:00:29 +0200 Subject: [PATCH 15/15] TODO: Fix cards when editing in enabled --- frontend/features/pageBlocks/CardBlock.tsx | 6 +++--- frontend/features/sectionBlocks/cardSectionBlock.tsx | 11 +++++------ frontend/pages/[...slug].tsx | 2 +- frontend/theme/index.css | 12 ++++-------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/frontend/features/pageBlocks/CardBlock.tsx b/frontend/features/pageBlocks/CardBlock.tsx index b4a6563f..2ed4b434 100644 --- a/frontend/features/pageBlocks/CardBlock.tsx +++ b/frontend/features/pageBlocks/CardBlock.tsx @@ -1,4 +1,4 @@ -import { Image, Box, chakra, Flex } from "@chakra-ui/react"; +import { Image, Box, chakra, Flex, calc } from "@chakra-ui/react"; import { STRAPI_URL } from "@config/env"; import React from "react"; import { Block, BlocksControls, InlineTextarea } from "react-tinacms-inline"; @@ -9,7 +9,7 @@ export type CardBlockData = BlockTemplateData< "ComponentBlocksCard", { id: string; - imageUrl?: string; + imageUrl?: Nullable; title: string; description: string; projectLink?: Nullable; @@ -36,7 +36,7 @@ export function CardBlock({ imageUrl, projectLink }: CardBlockProps) { boxSizing={"border-box"} justifyContent={"space-between"} h={cms.enabled ? "full" : "auto"} - width={cms.enabled ? "calc(99% - 30px)" : "calc(33.33% - 30px)"} + width={"calc(33.33% - 30px)"} backgroundColor={"white"} href={projectLink} transition={"all 0.8s"} diff --git a/frontend/features/sectionBlocks/cardSectionBlock.tsx b/frontend/features/sectionBlocks/cardSectionBlock.tsx index e0f8f8de..c8c8e82b 100644 --- a/frontend/features/sectionBlocks/cardSectionBlock.tsx +++ b/frontend/features/sectionBlocks/cardSectionBlock.tsx @@ -1,15 +1,13 @@ -import { Box, chakra, Flex } from "@chakra-ui/react"; +import { Box, chakra } from "@chakra-ui/react"; import { CARD_BLOCK } from "@features/pageBlocks"; import { CardBlockData } from "@features/pageBlocks/CardBlock"; import React from "react"; import { Block, BlocksControls, - InlineBlock, InlineBlocks, InlineTextarea, } from "react-tinacms-inline"; -import { useCMS } from "tinacms"; import { SectionBlockTemplateData } from "./types"; export type CardSectionBlockData = SectionBlockTemplateData< @@ -26,7 +24,6 @@ export const StyledInlineBlocks = chakra(InlineBlocks); export const StyledInlineTextarea = chakra(InlineTextarea); export function CardSectionBlock() { - const cms = useCMS(); return ( @@ -96,7 +95,7 @@ export function CardSectionBlock() { } export const cardSectionBlock: Block = { - Component: ({ index, data, name, ...other }) => { + Component: ({ index, data }) => { return ( diff --git a/frontend/pages/[...slug].tsx b/frontend/pages/[...slug].tsx index c4425571..f30df1ed 100644 --- a/frontend/pages/[...slug].tsx +++ b/frontend/pages/[...slug].tsx @@ -233,7 +233,7 @@ function getPageData( id: card.id, title: card.title, description: card.description, - imageUrl: card.image?.url, + imageUrl: card.image?.url ? card.image.url : null, projectLink: card.projectLink, _template: "ComponentBlocksCard", }; diff --git a/frontend/theme/index.css b/frontend/theme/index.css index 659233f0..68e24878 100644 --- a/frontend/theme/index.css +++ b/frontend/theme/index.css @@ -1,6 +1,6 @@ @media (max-width: 1000px) { .card-list a:nth-child(3) { - display: none; + display: block; } .card-list a { width: calc(50% - 30px); @@ -8,16 +8,12 @@ } } -@media (max-width: 750px) { +@media (max-width: 760px) { .card-list a:nth-child(3) { display: block; } .card-list a { - width: 100%; - margin: 15px; + width: 90%; + margin: 15px auto; } } - -.StyledFocusRing-sc-191xkzj.kQMZpz { - height: auto; -}