diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05e0307..330ca82 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,8 @@ jobs: - name: Source environment variables run: | - sudo cp /srv/portfolio/.env ./ - sed -i 's/^PORT=.*/PORT=3300/' .env + sudo cp /srv/unforeseen-travels/.env ./ + sed -i 's/^PORT=.*/PORT=3400/' .env source .env - name: Install pnpm diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fba88b4..7364109 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,21 +27,21 @@ jobs: - name: Source environment variables run: | - sudo cp /srv/portfolio/.env ./ - sed -i 's/^PORT=.*/PORT=3300/' .env + sudo cp /srv/unforeseen-travels/.env ./ + sed -i 's/^PORT=.*/PORT=3400/' .env source .env - name: Install pnpm run: sudo npm install -g pnpm - name: Stop the production server - run: sudo systemctl stop portfolio || echo "Failed to stop the server, continuing..." + run: sudo systemctl stop unforeseen-travels || echo "Failed to stop the server, continuing..." - name: Steal ownership of production server directory - run: sudo chown -R gh-runner:gh-runner /srv/portfolio + run: sudo chown -R gh-runner:gh-runner /srv/unforeseen-travels - name: Link existing node modules - run: sudo ln -s /srv/portfolio/node_modules /home/gh-runner/actions-runner/_work/portfolio/portfolio/ + run: sudo ln -s /srv/unforeseen-travels/node_modules /home/gh-runner/actions-runner/_work/unforeseen-travels/unforeseen-travels/ - name: Install dependencies run: pnpm install @@ -52,21 +52,21 @@ jobs: - name: Publish Executable if: success() run: | - sudo find /srv/portfolio/ -mindepth 1 \ - ! -path '/srv/portfolio/media*' \ - ! -path '/srv/portfolio/node_modules*' \ - ! -name '/srv/portfolio/.git*' \ + sudo find /srv/unforeseen-travels/ -mindepth 1 \ + ! -path '/srv/unforeseen-travels/media*' \ + ! -path '/srv/unforeseen-travels/node_modules*' \ + ! -name '/srv/unforeseen-travels/.git*' \ ! -name '.env' \ ! -name 'log' \ ! -name 'tmp' -exec rm -rf {} + sudo rsync -av --exclude 'node_modules' --exclude 'media' --exclude '.env' --exclude '.git' \ - --exclude 'log' --exclude 'tmp' /home/gh-runner/actions-runner/_work/portfolio/portfolio/ /srv/portfolio/ + --exclude 'log' --exclude 'tmp' /home/gh-runner/actions-runner/_work/unforeseen-travels/unforeseen-travels/ /srv/unforeseen-travels/ - name: Install deps in prod after copy to be safe if: success() run: | - cd /srv/portfolio + cd /srv/unforeseen-travels pnpm install - name: Handle failure @@ -76,10 +76,10 @@ jobs: - name: Restore permissions in production directory if: always() run: | - sudo chown -R www-data:www-data /srv/portfolio/ - sudo chmod -R 755 /srv/portfolio/ + sudo chown -R www-data:www-data /srv/unforeseen-travels/ + sudo chmod -R 755 /srv/unforeseen-travels/ sudo chown -R gh-runner:gh-runner /home/gh-runner/ - name: Start production server if: always() - run: sudo systemctl start portfolio + run: sudo systemctl start unforeseen-travels diff --git a/README.md b/README.md index 2326233..0224c90 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,7 @@ -# Portfolio Site +# Unforeseen Travels -This is my personal portfolio site built with Payload CMS (version 2 via 'npx-create-payload-app@latest', updating to 3 beta soon). The site showcases my work and skills, featuring custom blocks for enhanced interactivity and visual appeal. +More info coming soon... ## Key Features - -- **Custom Babylon.js 3D Model Viewer Block**: A fully customizable 3D model viewer built using Babylon.js, allowing dynamic interaction with 3D models directly on the portfolio pages. - **IconRow Block**: A versatile block for displaying a row of icons, ideal for highlighting key technologies, tools, or skillsets in a visually appealing manner. - -## Technologies Used - -- **Payload CMS**: A headless CMS used to manage content efficiently, currently running on version 2 with plans to upgrade to version 3 beta. -- **Babylon.js**: A powerful 3D engine for creating the interactive 3D model viewer. -- **Custom Blocks**: Tailored blocks like the Babylon 3D Model Viewer and IconRow, designed to enhance the functionality and aesthetics of the site. diff --git a/csp.js b/csp.js index 49dcb5d..2a118e1 100644 --- a/csp.js +++ b/csp.js @@ -12,7 +12,7 @@ const policies = { ], 'font-src': ["'self'"], 'frame-src': ["'self'"], - 'connect-src': ["'self'", 'https://maps.googleapis.com', 'http://localhost:33000'], + 'connect-src': ["'self'", 'https://maps.googleapis.com', 'http://localhost:34000'], } module.exports = Object.entries(policies) diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03..40c3d68 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/package.json b/package.json index 5a55b05..ae6bff4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "portfolio", + "name": "unforeseentravels", "description": "Website template for Payload", "version": "1.0.0", "main": "dist/server.js", @@ -46,7 +46,8 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-hook-form": "7.45.4", - "react-router-dom": "5.3.4" + "react-router-dom": "5.3.4", + "react-simple-star-rating": "^5.1.7" }, "devDependencies": { "@next/eslint-plugin-next": "^14.2.5", diff --git a/src/admin/css/admin.css b/src/admin/css/admin.css index 3330f8e..6e3ae6b 100644 --- a/src/admin/css/admin.css +++ b/src/admin/css/admin.css @@ -5,3 +5,11 @@ body { .nav { background: rgba(0, 0, 0, 0.8); } + +.nav nav a { + color: white; +} + +.nav-group__toggle { + color: #c0c0c0 +} diff --git a/src/app/(pages)/references/[slug]/page.tsx b/src/app/(pages)/references/[slug]/page.tsx new file mode 100644 index 0000000..f5c3aa1 --- /dev/null +++ b/src/app/(pages)/references/[slug]/page.tsx @@ -0,0 +1,47 @@ +import React from 'react' +import { draftMode } from 'next/headers' +import { notFound } from 'next/navigation' + +import { Reference } from '../../../../payload/payload-types' +import { fetchDoc } from '../../../_api/fetchDoc' +import { fetchDocs } from '../../../_api/fetchDocs' +import { ReferenceHero } from '../../../_heros/ReferenceHero' + +// Force this page to be dynamic so that Next.js does not cache it +// See the note in '../../../[slug]/page.tsx' about this +export const dynamic = 'force-dynamic' + +export default async function Reference({ params: { slug } }) { + const { isEnabled: isDraftMode } = draftMode() + + let reference: Reference | null = null + + try { + reference = await fetchDoc({ + collection: 'references', + slug, + draft: isDraftMode, + }) + } catch (error) { + console.error(error) // eslint-disable-line no-console + } + + if (!reference) { + notFound() + } + + return ( + + + + ) +} + +export async function generateStaticParams() { + try { + const references = await fetchDocs('references') + return references?.map(({ slug }) => slug) + } catch (error) { + return [] + } +} diff --git a/src/app/(pages)/styleguide/content-block/page.tsx b/src/app/(pages)/styleguide/content-block/page.tsx index 105dd80..1336ded 100644 --- a/src/app/(pages)/styleguide/content-block/page.tsx +++ b/src/app/(pages)/styleguide/content-block/page.tsx @@ -29,6 +29,18 @@ export default async function ContentBlockPage() { text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', }, ], + useImage: false, + inlineMedia: { + imageScale: 100, + borderRadius: 50, + media: { + url: '/path/to/icon1.jpg', + alt: 'Icon 1', + id: 0, + createdAt: new Date().toDateString(), + updatedAt: new Date().toDateString(), + }, + }, }, ]} /> diff --git a/src/app/(pages)/styleguide/references-block/page.tsx b/src/app/(pages)/styleguide/references-block/page.tsx new file mode 100644 index 0000000..585f50d --- /dev/null +++ b/src/app/(pages)/styleguide/references-block/page.tsx @@ -0,0 +1,35 @@ +import React, { Fragment } from 'react' +import { Metadata } from 'next' +import Link from 'next/link' + +import { ReferencesBlock } from '../../../_blocks/References' +import { Gutter } from '../../../_components/Gutter' +import { VerticalPadding } from '../../../_components/VerticalPadding' +import { mergeOpenGraph } from '../../../_utilities/mergeOpenGraph' + +export default async function ReferencesBlockPage() { + return ( + + +

+ Styleguide + {' / '} + References Block +

+

References Block

+
+ + + +
+ ) +} + +export const metadata: Metadata = { + title: 'References Block', + description: 'Styleguide for the References Block', + openGraph: mergeOpenGraph({ + title: 'References Block', + url: '/styleguide/references-block', + }), +} diff --git a/src/app/_api/fetchDoc.ts b/src/app/_api/fetchDoc.ts index 8fc60e4..54a98d2 100644 --- a/src/app/_api/fetchDoc.ts +++ b/src/app/_api/fetchDoc.ts @@ -4,6 +4,7 @@ import type { Config } from '../../payload/payload-types' import { PAGE } from '../_graphql/pages' import { POST } from '../_graphql/posts' import { PROJECT } from '../_graphql/projects' +import { REFERENCE } from '../_graphql/references' import { GRAPHQL_API_URL } from './shared' import { payloadToken } from './token' @@ -20,6 +21,10 @@ const queryMap = { query: PROJECT, key: 'Projects', }, + references: { + query: REFERENCE, + key: 'References', + }, } export const fetchDoc = async (args: { diff --git a/src/app/_api/fetchDocs.ts b/src/app/_api/fetchDocs.ts index ce6435f..1d156ca 100644 --- a/src/app/_api/fetchDocs.ts +++ b/src/app/_api/fetchDocs.ts @@ -4,6 +4,7 @@ import type { Config } from '../../payload/payload-types' import { PAGES } from '../_graphql/pages' import { POSTS } from '../_graphql/posts' import { PROJECTS } from '../_graphql/projects' +import { REFERENCES } from '../_graphql/references' import { GRAPHQL_API_URL } from './shared' import { payloadToken } from './token' @@ -20,6 +21,10 @@ const queryMap = { query: PROJECTS, key: 'Projects', }, + references: { + query: REFERENCES, + key: 'References', + }, } export const fetchDocs = async ( diff --git a/src/app/_blocks/Content/index.module.scss b/src/app/_blocks/Content/index.module.scss index 63a93d9..61d2efe 100644 --- a/src/app/_blocks/Content/index.module.scss +++ b/src/app/_blocks/Content/index.module.scss @@ -37,6 +37,12 @@ } } +.columnImageContainer { + overflow: hidden; + margin: 0 auto; + image-rendering: optimizeQuality; +} + .link { margin-top: var(--base); } diff --git a/src/app/_blocks/Content/index.tsx b/src/app/_blocks/Content/index.tsx index da228b9..8ed8c85 100644 --- a/src/app/_blocks/Content/index.tsx +++ b/src/app/_blocks/Content/index.tsx @@ -3,6 +3,7 @@ import React from 'react' import { Page } from '../../../payload/payload-types' import { Gutter } from '../../_components/Gutter' import { CMSLink } from '../../_components/Link' +import { Media } from '../../_components/Media' import RichText from '../../_components/RichText' import classes from './index.module.scss' @@ -22,11 +23,28 @@ export const ContentBlock: React.FC< {columns && columns.length > 0 && columns.map((col, index) => { - const { enableLink, richText, link, size } = col + const { enableLink, richText, link, size, useImage, inlineMedia } = col + + if (useImage && !inlineMedia) return
Improper image config...
+ + const { imageScale, borderRadius, media } = inlineMedia return (
+ {useImage && ( + <> +
+ +
+ + )} {enableLink && }
) diff --git a/src/app/_blocks/References/index.module.scss b/src/app/_blocks/References/index.module.scss new file mode 100644 index 0000000..8cd8776 --- /dev/null +++ b/src/app/_blocks/References/index.module.scss @@ -0,0 +1,13 @@ +@import '../../_css/common'; + +.archiveBlock { + position: relative; +} + +.introContent { + margin-bottom: calc(var(--base) * 2); + + @include mid-break { + margin-bottom: calc(var(--base) * 2); + } +} diff --git a/src/app/_blocks/References/index.tsx b/src/app/_blocks/References/index.tsx new file mode 100644 index 0000000..8372b07 --- /dev/null +++ b/src/app/_blocks/References/index.tsx @@ -0,0 +1,55 @@ +'use client' + +import React, { useEffect, useState } from 'react' + +import { Reference } from '../../../payload/payload-types' +import { fetchDocs } from '../../_api/fetchDocs' +import { Gutter } from '../../_components/Gutter' +import { ReferenceHero } from '../../_heros/ReferenceHero' +import type { ReferenceBlockProps } from './types' + +import classes from './index.module.scss' + +export const ReferencesBlock: React.FC = props => { + const { id } = props + + const [references, setReferences] = useState([]) + const [isLoading, setIsLoading] = useState(true) + const [error, setError] = useState(null) + + // Fetch references on mount + useEffect(() => { + const fetchReferences = async () => { + try { + const fetchedReferences = await fetchDocs('references') + setReferences(fetchedReferences) + setIsLoading(false) + } catch (err) { + setError('Failed to load references.') + setIsLoading(false) + } + } + + fetchReferences() + }, []) + + if (isLoading) { + return Loading... + } + + if (error) { + return {error} + } + + return ( +
+ +
+ {references.map((reference, index) => ( + + ))} +
+
+
+ ) +} diff --git a/src/app/_blocks/References/types.ts b/src/app/_blocks/References/types.ts new file mode 100644 index 0000000..9dfb379 --- /dev/null +++ b/src/app/_blocks/References/types.ts @@ -0,0 +1,3 @@ +import type { Page } from '../../../payload/payload-types' + +export type ReferenceBlockProps = Extract diff --git a/src/app/_components/Blocks/index.tsx b/src/app/_components/Blocks/index.tsx index ecc9f87..e9e7d33 100644 --- a/src/app/_components/Blocks/index.tsx +++ b/src/app/_components/Blocks/index.tsx @@ -9,6 +9,8 @@ import { ContentBlock } from '../../_blocks/Content' import { IconRow, IconRowProps } from '../../_blocks/IconRow' import { IconRowContainer, IconRowContainerProps } from '../../_blocks/IconRowContainer' import { MediaBlock } from '../../_blocks/MediaBlock' +import { ReferencesBlock } from '../../_blocks/References' +import { ReferenceBlockProps } from '../../_blocks/References/types' import { RelatedPosts, type RelatedPostsProps } from '../../_blocks/RelatedPosts' import { toKebabCase } from '../../_utilities/toKebabCase' import { BackgroundColor } from '../BackgroundColor' @@ -24,6 +26,7 @@ const blockComponents = { archive: ArchiveBlock, relatedPosts: RelatedPosts, comments: CommentsBlock, + referencesBlock: ReferencesBlock, } export const Blocks: React.FC<{ @@ -34,6 +37,7 @@ export const Blocks: React.FC<{ | IconRowProps | IconRowContainerProps | BabylonBlockProps + | ReferenceBlockProps )[] disableTopPadding?: boolean }> = props => { @@ -79,7 +83,7 @@ export const Blocks: React.FC<{ return ( - {/* @ts-expect-error can't get it to accept id in BabylonBlock */} + {/* @ts-expect-error lots of issues with this */} diff --git a/src/app/_graphql/blocks.ts b/src/app/_graphql/blocks.ts index 0d673a9..d31498b 100644 --- a/src/app/_graphql/blocks.ts +++ b/src/app/_graphql/blocks.ts @@ -1,6 +1,6 @@ import { CATEGORIES } from './categories' import { LINK_FIELDS } from './link' -import { MEDIA } from './media' +import { INLINE_MEDIA, MEDIA } from './media' import { META } from './meta' export const CALL_TO_ACTION = ` @@ -20,6 +20,8 @@ export const CONTENT = ` invertBackground columns { size + useImage + ${INLINE_MEDIA} richText enableLink link ${LINK_FIELDS()} @@ -27,6 +29,13 @@ export const CONTENT = ` } ` +export const REFERENCES_BLOCK = ` +...on ReferencesBlock { + blockType + invertBackground +} +` + export const MEDIA_BLOCK = ` ...on MediaBlock { blockType diff --git a/src/app/_graphql/media.ts b/src/app/_graphql/media.ts index fbf8e52..ed7225b 100644 --- a/src/app/_graphql/media.ts +++ b/src/app/_graphql/media.ts @@ -10,3 +10,9 @@ caption export const MEDIA = `media { ${MEDIA_FIELDS} }` + +export const INLINE_MEDIA = `inlineMedia { +imageScale +borderRadius +${MEDIA} +}` diff --git a/src/app/_graphql/pages.ts b/src/app/_graphql/pages.ts index db03b96..f3b610a 100644 --- a/src/app/_graphql/pages.ts +++ b/src/app/_graphql/pages.ts @@ -6,6 +6,7 @@ import { ICON_ROW, ICON_ROW_CONTAINER, MEDIA_BLOCK, + REFERENCES_BLOCK, } from './blocks' import { LINK_FIELDS } from './link' import { MEDIA } from './media' @@ -44,6 +45,7 @@ export const PAGE = ` ${BABYLON_BLOCK} ${MEDIA_BLOCK} ${ARCHIVE_BLOCK} + ${REFERENCES_BLOCK} } ${META} } diff --git a/src/app/_graphql/references.ts b/src/app/_graphql/references.ts new file mode 100644 index 0000000..b43da9a --- /dev/null +++ b/src/app/_graphql/references.ts @@ -0,0 +1,32 @@ +import { MEDIA } from './media' + +export const REFERENCES = ` + query References { + References(limit: 500) { + docs { + slug + id + title + location + rating + ${MEDIA} + review + } + } + } +` + +export const REFERENCE = ` + query Reference($slug: String, $draft: Boolean) { + References(where: { slug: { equals: $slug }}, limit: 1, draft: $draft) { + docs { + id + title + location + rating + ${MEDIA} + review + } + } + } +` diff --git a/src/app/_heros/ReferenceHero/index.module.scss b/src/app/_heros/ReferenceHero/index.module.scss new file mode 100644 index 0000000..c863d5f --- /dev/null +++ b/src/app/_heros/ReferenceHero/index.module.scss @@ -0,0 +1,127 @@ +@use '../../_css/common.scss' as *; + +.referenceHero { + display: flex; + gap: calc(var(--base) * 2); + + @include mid-break { + flex-direction: column; + gap: var(--base); + } +} + +.content { + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + overflow-x: visible; + + @include mid-break { + width: 100%; + gap: calc(var(--base) / 2); + } +} + +.body { + display: flex; + max-height: 50vh; + background: #146a8e; + border-radius: 10px; +} + +.title { + margin: 0; + + @media (min-width: 1024px) { + font-size: 30px; + } + + @media (min-width: 1130px) { + font-size: 36px; + } + + @media (min-width: 1200px) { + font-size: 40px; + } +} + +.media { + width: 100%; + + @include mid-break { + width: 100%; + } +} + +.review { + max-width: 70%; + overflow-y: scroll; + padding-left: 15px; +} + +.mediaWrapper { + text-decoration: none; + display: block; + position: relative; + aspect-ratio: 5 / 4; + margin-bottom: calc(var(--base) / 2); + width: calc(100% + calc(var(--gutter-h) / 2)); + + @include mid-break { + margin-left: calc(var(--gutter-h) * -1); + width: calc(100% + var(--gutter-h) * 2); + } +} + +.infoBar { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 15px; +} + +.image { + object-fit: contain; +} + +.location { + margin: 0 20px 0 0; +} + +.rating { + position: relative; + top: -3px +} + +.caption { + color: var(--theme-elevation-500); +} + +.links { + position: relative; + list-style: none; + margin: 0; + padding: 0; + display: flex; + + li { + margin-right: 12px; + } + + @include mid-break { + display: block; + margin-top: var(--base); + + li { + margin-right: 0; + } + } +} + +.link { + @include mid-break { + width: 100%; + } +} diff --git a/src/app/_heros/ReferenceHero/index.tsx b/src/app/_heros/ReferenceHero/index.tsx new file mode 100644 index 0000000..fdf5dcb --- /dev/null +++ b/src/app/_heros/ReferenceHero/index.tsx @@ -0,0 +1,47 @@ +import React, { Fragment } from 'react' +import { Rating } from 'react-simple-star-rating' + +import { Reference } from '../../../payload/payload-types' +import { Gutter } from '../../_components/Gutter' +import { Media } from '../../_components/Media' +import RichText from '../../_components/RichText' + +import classes from './index.module.scss' + +export const ReferenceHero: React.FC<{ + reference: Reference +}> = ({ reference }) => { + const { id, title, location, review, media, rating } = reference + + return ( +
+

{title}

+
+
{location}
+ +
+
+

{review}

+
+
+ {!media &&
No image
} + {media && typeof media !== 'string' && ( + + )} +
+ {media && typeof media !== 'string' && typeof media !== 'number' && media?.caption && ( + + )} +
+
+
+ ) +} diff --git a/src/payload/blocks/Content/index.ts b/src/payload/blocks/Content/index.ts index 8568aa4..b229fe0 100644 --- a/src/payload/blocks/Content/index.ts +++ b/src/payload/blocks/Content/index.ts @@ -1,5 +1,6 @@ import type { Block, Field } from 'payload/types' +import { inlineMedia } from '../../fields/inlineMedia' import { invertBackground } from '../../fields/invertBackground' import link from '../../fields/link' import richText from '../../fields/richText' @@ -28,7 +29,24 @@ const columnFields: Field[] = [ }, ], }, - richText(), + { + name: 'useImage', + type: 'checkbox', + defaultValue: false, + }, + inlineMedia({ + overrides: { + admin: { + condition: (_, siblingData) => siblingData?.useImage === true, + }, + }, + }), + richText({ + admin: { + condition: (_, siblingData) => siblingData?.useImage === false, + }, + required: false, + }), { name: 'enableLink', type: 'checkbox', diff --git a/src/payload/blocks/ReferencesBlock/index.ts b/src/payload/blocks/ReferencesBlock/index.ts new file mode 100644 index 0000000..84d5c49 --- /dev/null +++ b/src/payload/blocks/ReferencesBlock/index.ts @@ -0,0 +1,8 @@ +import type { Block } from 'payload/types' + +import { invertBackground } from '../../fields/invertBackground' + +export const ReferencesBlock: Block = { + slug: 'referencesBlock', + fields: [invertBackground], +} diff --git a/src/payload/collections/Pages/index.ts b/src/payload/collections/Pages/index.ts index 7f60669..61c8f1f 100644 --- a/src/payload/collections/Pages/index.ts +++ b/src/payload/collections/Pages/index.ts @@ -9,6 +9,7 @@ import { Content } from '../../blocks/Content' import { IconRow } from '../../blocks/IconRow' import { IconRowContainer } from '../../blocks/IconRowContainer' import { MediaBlock } from '../../blocks/MediaBlock' +import { ReferencesBlock } from '../../blocks/ReferencesBlock' import { hero } from '../../fields/hero' import { slugField } from '../../fields/slug' import { populateArchiveBlock } from '../../hooks/populateArchiveBlock' @@ -75,6 +76,7 @@ export const Pages: CollectionConfig = { IconRow, IconRowContainer, BabylonBlock, + ReferencesBlock, ], }, ], diff --git a/src/payload/collections/References/hooks/revalidateReferences.ts b/src/payload/collections/References/hooks/revalidateReferences.ts new file mode 100644 index 0000000..6f41bd3 --- /dev/null +++ b/src/payload/collections/References/hooks/revalidateReferences.ts @@ -0,0 +1,15 @@ +import type { AfterChangeHook } from 'payload/dist/collections/config/types' + +import { revalidate } from '../../../utilities/revalidate' + +// Revalidate the project in the background, so the user doesn't have to wait +// Notice that the hook itself is not async and we are not awaiting `revalidate` +// Only revalidate existing docs that are published +// Don't scope to `operation` in order to purge static demo projects +export const revalidateReferences: AfterChangeHook = ({ doc, req: { payload } }) => { + if (doc._status === 'published') { + revalidate({ payload, collection: 'references', slug: doc.slug }) + } + + return doc +} diff --git a/src/payload/collections/References/index.ts b/src/payload/collections/References/index.ts new file mode 100644 index 0000000..ab43e40 --- /dev/null +++ b/src/payload/collections/References/index.ts @@ -0,0 +1,74 @@ +import type { CollectionConfig } from 'payload/types' + +import { admins } from '../../access/admins' +import { adminsOrPublished } from '../../access/adminsOrPublished' +import { rating } from '../../fields/rating' +import { slugField } from '../../fields/slug' +import { populatePublishedAt } from '../../hooks/populatePublishedAt' +import { revalidateReferences } from './hooks/revalidateReferences' + +export const References: CollectionConfig = { + slug: 'references', + admin: { + useAsTitle: 'title', + defaultColumns: ['title', 'location', 'rating', 'updatedAt', 'slug'], + preview: doc => { + return `${process.env.PAYLOAD_PUBLIC_SERVER_URL}/next/preview?url=${encodeURIComponent( + `${process.env.PAYLOAD_PUBLIC_SERVER_URL}/references/${doc?.slug}`, + )}&secret=${process.env.PAYLOAD_PUBLIC_DRAFT_SECRET}` + }, + }, + versions: { + drafts: true, + }, + access: { + read: adminsOrPublished, + update: admins, + create: admins, + delete: admins, + }, + hooks: { + beforeChange: [populatePublishedAt], + afterChange: [revalidateReferences], + }, + fields: [ + { + name: 'publishedAt', + type: 'date', + admin: { + position: 'sidebar', + }, + }, + { + type: 'row', + fields: [ + { + name: 'title', + type: 'text', + required: true, + }, + { + name: 'location', + type: 'text', + }, + ], + }, + { + type: 'row', + fields: [ + rating(), + { + name: 'media', + type: 'upload', + relationTo: 'media', + required: false, + }, + ], + }, + { + name: 'review', + type: 'textarea', + }, + slugField('title'), + ], +} diff --git a/src/payload/fields/inlineMedia.ts b/src/payload/fields/inlineMedia.ts new file mode 100644 index 0000000..b610481 --- /dev/null +++ b/src/payload/fields/inlineMedia.ts @@ -0,0 +1,36 @@ +import type { Field } from 'payload/types' + +import deepMerge from '../utilities/deepMerge' + +type InlineMediaType = (options?: { overrides?: Record }) => Field + +export const inlineMedia: InlineMediaType = ({ overrides = {} } = {}) => { + const defaultField: Field = { + name: 'inlineMedia', + type: 'group', + admin: { + condition: (_, siblingData) => siblingData?.useImage === true, + }, + fields: [ + { + name: 'imageScale', + type: 'number', + required: false, + }, + { + name: 'borderRadius', + type: 'number', + required: false, + }, + { + name: 'media', + type: 'upload', + relationTo: 'media', + required: false, + }, + ], + } + + // Merge the default field with any overrides + return deepMerge(defaultField, overrides) +} diff --git a/src/payload/fields/rating/component/index.tsx b/src/payload/fields/rating/component/index.tsx new file mode 100644 index 0000000..5112380 --- /dev/null +++ b/src/payload/fields/rating/component/index.tsx @@ -0,0 +1,38 @@ +import React from 'react' +import { Rating } from 'react-simple-star-rating' +import { useFieldType } from 'payload/components/forms' + +const StarRatingField: React.FC = (props: { path: string }) => { + const { + value = 0, + setValue, + showError, + errorMessage, + } = useFieldType({ + path: props.path, + }) + + // Handle rating click + const handleRating = (rate: number) => { + setValue(rate) + } + + return ( + typeof value === 'number' && ( +
+ + {value} / 5 + {showError &&
{errorMessage}
} +
+ ) + ) +} + +export default StarRatingField diff --git a/src/payload/fields/rating/index.ts b/src/payload/fields/rating/index.ts new file mode 100644 index 0000000..670b616 --- /dev/null +++ b/src/payload/fields/rating/index.ts @@ -0,0 +1,23 @@ +import type { Field } from 'payload/types' + +import deepMerge from '../../utilities/deepMerge' +import StarRatingField from './component' + +type InlineMediaType = (options?: { overrides?: Record }) => Field + +export const rating: InlineMediaType = ({ overrides = {} } = {}) => { + const defaultField: Field = { + name: 'rating', + type: 'number', + label: 'Rating', + required: true, + admin: { + components: { + Field: StarRatingField, + }, + }, + } + + // Merge the default field with any overrides + return deepMerge(defaultField, overrides) +} diff --git a/src/payload/generated-schema.graphql b/src/payload/generated-schema.graphql index 97f102c..7df6d44 100644 --- a/src/payload/generated-schema.graphql +++ b/src/payload/generated-schema.graphql @@ -17,6 +17,12 @@ type Query { docAccessProject(id: Int!): projectsDocAccess versionProject(id: Int): ProjectVersion versionsProjects(where: versionsProject_where, limit: Int, page: Int, sort: String): versionsProjects + Reference(id: Int!, draft: Boolean): Reference + References(draft: Boolean, where: Reference_where, limit: Int, page: Int, sort: String): References + countReferences(draft: Boolean, where: Reference_where): countReferences + docAccessReference(id: Int!): referencesDocAccess + versionReference(id: Int): ReferenceVersion + versionsReferences(where: versionsReference_where, limit: Int, page: Int, sort: String): versionsReferences Media(id: Int!): Media allMedia(where: Media_where, limit: Int, page: Int, sort: String): allMedia countallMedia(where: Media_where): countallMedia @@ -331,7 +337,7 @@ input Page_Hero_Media_where_or { OR: [Page_Hero_Media_where_or] } -union Page_Layout = Cta | Content | MediaBlock | Archive | IconRow | IconRowContainer | BabylonBlock +union Page_Layout = Cta | Content | MediaBlock | Archive | IconRow | IconRowContainer | BabylonBlock | ReferencesBlock type Cta { invertBackground: Boolean @@ -387,6 +393,8 @@ type Content { type Content_Columns { size: Content_Columns_size + useImage: Boolean + inlineMedia: Content_Columns_InlineMedia richText(depth: Int): JSON enableLink: Boolean link: Content_Columns_Link @@ -400,6 +408,200 @@ enum Content_Columns_size { full } +type Content_Columns_InlineMedia { + imageScale: Float + borderRadius: Float + media(where: Content_Columns_InlineMedia_Media_where): Media +} + +input Content_Columns_InlineMedia_Media_where { + alt: Content_Columns_InlineMedia_Media_alt_operator + caption: Content_Columns_InlineMedia_Media_caption_operator + updatedAt: Content_Columns_InlineMedia_Media_updatedAt_operator + createdAt: Content_Columns_InlineMedia_Media_createdAt_operator + url: Content_Columns_InlineMedia_Media_url_operator + filename: Content_Columns_InlineMedia_Media_filename_operator + mimeType: Content_Columns_InlineMedia_Media_mimeType_operator + filesize: Content_Columns_InlineMedia_Media_filesize_operator + width: Content_Columns_InlineMedia_Media_width_operator + height: Content_Columns_InlineMedia_Media_height_operator + focalX: Content_Columns_InlineMedia_Media_focalX_operator + focalY: Content_Columns_InlineMedia_Media_focalY_operator + id: Content_Columns_InlineMedia_Media_id_operator + AND: [Content_Columns_InlineMedia_Media_where_and] + OR: [Content_Columns_InlineMedia_Media_where_or] +} + +input Content_Columns_InlineMedia_Media_alt_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] +} + +input Content_Columns_InlineMedia_Media_caption_operator { + equals: JSON + not_equals: JSON + like: JSON + contains: JSON + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_updatedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_createdAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_url_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_filename_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_mimeType_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_filesize_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_width_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_height_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_focalX_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_focalY_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_id_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Content_Columns_InlineMedia_Media_where_and { + alt: Content_Columns_InlineMedia_Media_alt_operator + caption: Content_Columns_InlineMedia_Media_caption_operator + updatedAt: Content_Columns_InlineMedia_Media_updatedAt_operator + createdAt: Content_Columns_InlineMedia_Media_createdAt_operator + url: Content_Columns_InlineMedia_Media_url_operator + filename: Content_Columns_InlineMedia_Media_filename_operator + mimeType: Content_Columns_InlineMedia_Media_mimeType_operator + filesize: Content_Columns_InlineMedia_Media_filesize_operator + width: Content_Columns_InlineMedia_Media_width_operator + height: Content_Columns_InlineMedia_Media_height_operator + focalX: Content_Columns_InlineMedia_Media_focalX_operator + focalY: Content_Columns_InlineMedia_Media_focalY_operator + id: Content_Columns_InlineMedia_Media_id_operator + AND: [Content_Columns_InlineMedia_Media_where_and] + OR: [Content_Columns_InlineMedia_Media_where_or] +} + +input Content_Columns_InlineMedia_Media_where_or { + alt: Content_Columns_InlineMedia_Media_alt_operator + caption: Content_Columns_InlineMedia_Media_caption_operator + updatedAt: Content_Columns_InlineMedia_Media_updatedAt_operator + createdAt: Content_Columns_InlineMedia_Media_createdAt_operator + url: Content_Columns_InlineMedia_Media_url_operator + filename: Content_Columns_InlineMedia_Media_filename_operator + mimeType: Content_Columns_InlineMedia_Media_mimeType_operator + filesize: Content_Columns_InlineMedia_Media_filesize_operator + width: Content_Columns_InlineMedia_Media_width_operator + height: Content_Columns_InlineMedia_Media_height_operator + focalX: Content_Columns_InlineMedia_Media_focalX_operator + focalY: Content_Columns_InlineMedia_Media_focalY_operator + id: Content_Columns_InlineMedia_Media_id_operator + AND: [Content_Columns_InlineMedia_Media_where_and] + OR: [Content_Columns_InlineMedia_Media_where_or] +} + type Content_Columns_Link { type: Content_Columns_Link_type newTab: Boolean @@ -2057,6 +2259,13 @@ enum Archive_PopulatedDocs_RelationTo { union Archive_PopulatedDocs = Post | Project +type ReferencesBlock { + invertBackground: Boolean + id: String + blockName: String + blockType: String +} + type Page_Meta { title: String description: String @@ -3446,7 +3655,7 @@ input PageVersion_Version_Hero_Media_where_or { OR: [PageVersion_Version_Hero_Media_where_or] } -union PageVersion_Version_Layout = Cta | Content | MediaBlock | Archive | IconRow | IconRowContainer | BabylonBlock +union PageVersion_Version_Layout = Cta | Content | MediaBlock | Archive | IconRow | IconRowContainer | BabylonBlock | ReferencesBlock type PageVersion_Version_Meta { title: String @@ -7793,12 +8002,1136 @@ input versionsProject_version___status_operator { exists: Boolean } -enum versionsProject_version___status_Input { +enum versionsProject_version___status_Input { + draft + published +} + +input versionsProject_createdAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input versionsProject_updatedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input versionsProject_latest_operator { + equals: Boolean + not_equals: Boolean + exists: Boolean +} + +input versionsProject_id_operator { + equals: Int + not_equals: Int + greater_than_equal: Int + greater_than: Int + less_than_equal: Int + less_than: Int + exists: Boolean +} + +input versionsProject_where_and { + parent: versionsProject_parent_operator + version__title: versionsProject_version__title_operator + version__categories: versionsProject_version__categories_operator + version__publishedAt: versionsProject_version__publishedAt_operator + version__hero__type: versionsProject_version__hero__type_operator + version__hero__richText: versionsProject_version__hero__richText_operator + version__hero__links__link__type: versionsProject_version__hero__links__link__type_operator + version__hero__links__link__newTab: versionsProject_version__hero__links__link__newTab_operator + version__hero__links__link__reference: versionsProject_version__hero__links__link__reference_Relation + version__hero__links__link__url: versionsProject_version__hero__links__link__url_operator + version__hero__links__link__label: versionsProject_version__hero__links__link__label_operator + version__hero__links__link__appearance: versionsProject_version__hero__links__link__appearance_operator + version__hero__links__id: versionsProject_version__hero__links__id_operator + version__hero__media: versionsProject_version__hero__media_operator + version__relatedProjects: versionsProject_version__relatedProjects_operator + version__slug: versionsProject_version__slug_operator + version__meta__title: versionsProject_version__meta__title_operator + version__meta__description: versionsProject_version__meta__description_operator + version__meta__image: versionsProject_version__meta__image_operator + version__updatedAt: versionsProject_version__updatedAt_operator + version__createdAt: versionsProject_version__createdAt_operator + version___status: versionsProject_version___status_operator + createdAt: versionsProject_createdAt_operator + updatedAt: versionsProject_updatedAt_operator + latest: versionsProject_latest_operator + id: versionsProject_id_operator + AND: [versionsProject_where_and] + OR: [versionsProject_where_or] +} + +input versionsProject_where_or { + parent: versionsProject_parent_operator + version__title: versionsProject_version__title_operator + version__categories: versionsProject_version__categories_operator + version__publishedAt: versionsProject_version__publishedAt_operator + version__hero__type: versionsProject_version__hero__type_operator + version__hero__richText: versionsProject_version__hero__richText_operator + version__hero__links__link__type: versionsProject_version__hero__links__link__type_operator + version__hero__links__link__newTab: versionsProject_version__hero__links__link__newTab_operator + version__hero__links__link__reference: versionsProject_version__hero__links__link__reference_Relation + version__hero__links__link__url: versionsProject_version__hero__links__link__url_operator + version__hero__links__link__label: versionsProject_version__hero__links__link__label_operator + version__hero__links__link__appearance: versionsProject_version__hero__links__link__appearance_operator + version__hero__links__id: versionsProject_version__hero__links__id_operator + version__hero__media: versionsProject_version__hero__media_operator + version__relatedProjects: versionsProject_version__relatedProjects_operator + version__slug: versionsProject_version__slug_operator + version__meta__title: versionsProject_version__meta__title_operator + version__meta__description: versionsProject_version__meta__description_operator + version__meta__image: versionsProject_version__meta__image_operator + version__updatedAt: versionsProject_version__updatedAt_operator + version__createdAt: versionsProject_version__createdAt_operator + version___status: versionsProject_version___status_operator + createdAt: versionsProject_createdAt_operator + updatedAt: versionsProject_updatedAt_operator + latest: versionsProject_latest_operator + id: versionsProject_id_operator + AND: [versionsProject_where_and] + OR: [versionsProject_where_or] +} + +type Reference { + id: Int + publishedAt: DateTime + title: String + location: String + rating: Float + media(where: Reference_Media_where): Media + review: String + slug: String + updatedAt: DateTime + createdAt: DateTime + _status: Reference__status +} + +input Reference_Media_where { + alt: Reference_Media_alt_operator + caption: Reference_Media_caption_operator + updatedAt: Reference_Media_updatedAt_operator + createdAt: Reference_Media_createdAt_operator + url: Reference_Media_url_operator + filename: Reference_Media_filename_operator + mimeType: Reference_Media_mimeType_operator + filesize: Reference_Media_filesize_operator + width: Reference_Media_width_operator + height: Reference_Media_height_operator + focalX: Reference_Media_focalX_operator + focalY: Reference_Media_focalY_operator + id: Reference_Media_id_operator + AND: [Reference_Media_where_and] + OR: [Reference_Media_where_or] +} + +input Reference_Media_alt_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] +} + +input Reference_Media_caption_operator { + equals: JSON + not_equals: JSON + like: JSON + contains: JSON + exists: Boolean +} + +input Reference_Media_updatedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Reference_Media_createdAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Reference_Media_url_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Reference_Media_filename_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Reference_Media_mimeType_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Reference_Media_filesize_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Reference_Media_width_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Reference_Media_height_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Reference_Media_focalX_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Reference_Media_focalY_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Reference_Media_id_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Reference_Media_where_and { + alt: Reference_Media_alt_operator + caption: Reference_Media_caption_operator + updatedAt: Reference_Media_updatedAt_operator + createdAt: Reference_Media_createdAt_operator + url: Reference_Media_url_operator + filename: Reference_Media_filename_operator + mimeType: Reference_Media_mimeType_operator + filesize: Reference_Media_filesize_operator + width: Reference_Media_width_operator + height: Reference_Media_height_operator + focalX: Reference_Media_focalX_operator + focalY: Reference_Media_focalY_operator + id: Reference_Media_id_operator + AND: [Reference_Media_where_and] + OR: [Reference_Media_where_or] +} + +input Reference_Media_where_or { + alt: Reference_Media_alt_operator + caption: Reference_Media_caption_operator + updatedAt: Reference_Media_updatedAt_operator + createdAt: Reference_Media_createdAt_operator + url: Reference_Media_url_operator + filename: Reference_Media_filename_operator + mimeType: Reference_Media_mimeType_operator + filesize: Reference_Media_filesize_operator + width: Reference_Media_width_operator + height: Reference_Media_height_operator + focalX: Reference_Media_focalX_operator + focalY: Reference_Media_focalY_operator + id: Reference_Media_id_operator + AND: [Reference_Media_where_and] + OR: [Reference_Media_where_or] +} + +enum Reference__status { + draft + published +} + +type References { + docs: [Reference] + hasNextPage: Boolean + hasPrevPage: Boolean + limit: Int + nextPage: Int + offset: Int + page: Int + pagingCounter: Int + prevPage: Int + totalDocs: Int + totalPages: Int +} + +input Reference_where { + publishedAt: Reference_publishedAt_operator + title: Reference_title_operator + location: Reference_location_operator + rating: Reference_rating_operator + media: Reference_media_operator + review: Reference_review_operator + slug: Reference_slug_operator + updatedAt: Reference_updatedAt_operator + createdAt: Reference_createdAt_operator + _status: Reference__status_operator + id: Reference_id_operator + AND: [Reference_where_and] + OR: [Reference_where_or] +} + +input Reference_publishedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Reference_title_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] +} + +input Reference_location_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Reference_rating_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input Reference_media_operator { + equals: String + not_equals: String + exists: Boolean +} + +input Reference_review_operator { + equals: String + not_equals: String + like: String + contains: String + exists: Boolean +} + +input Reference_slug_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input Reference_updatedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Reference_createdAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input Reference__status_operator { + equals: Reference__status_Input + not_equals: Reference__status_Input + in: [Reference__status_Input] + not_in: [Reference__status_Input] + all: [Reference__status_Input] + exists: Boolean +} + +enum Reference__status_Input { + draft + published +} + +input Reference_id_operator { + equals: Int + not_equals: Int + greater_than_equal: Int + greater_than: Int + less_than_equal: Int + less_than: Int + exists: Boolean +} + +input Reference_where_and { + publishedAt: Reference_publishedAt_operator + title: Reference_title_operator + location: Reference_location_operator + rating: Reference_rating_operator + media: Reference_media_operator + review: Reference_review_operator + slug: Reference_slug_operator + updatedAt: Reference_updatedAt_operator + createdAt: Reference_createdAt_operator + _status: Reference__status_operator + id: Reference_id_operator + AND: [Reference_where_and] + OR: [Reference_where_or] +} + +input Reference_where_or { + publishedAt: Reference_publishedAt_operator + title: Reference_title_operator + location: Reference_location_operator + rating: Reference_rating_operator + media: Reference_media_operator + review: Reference_review_operator + slug: Reference_slug_operator + updatedAt: Reference_updatedAt_operator + createdAt: Reference_createdAt_operator + _status: Reference__status_operator + id: Reference_id_operator + AND: [Reference_where_and] + OR: [Reference_where_or] +} + +type countReferences { + totalDocs: Int +} + +type referencesDocAccess { + fields: ReferencesDocAccessFields + create: ReferencesCreateDocAccess + read: ReferencesReadDocAccess + update: ReferencesUpdateDocAccess + delete: ReferencesDeleteDocAccess + readVersions: ReferencesReadVersionsDocAccess +} + +type ReferencesDocAccessFields { + publishedAt: ReferencesDocAccessFields_publishedAt + title: ReferencesDocAccessFields_title + location: ReferencesDocAccessFields_location + rating: ReferencesDocAccessFields_rating + media: ReferencesDocAccessFields_media + review: ReferencesDocAccessFields_review + slug: ReferencesDocAccessFields_slug + updatedAt: ReferencesDocAccessFields_updatedAt + createdAt: ReferencesDocAccessFields_createdAt + _status: ReferencesDocAccessFields__status +} + +type ReferencesDocAccessFields_publishedAt { + create: ReferencesDocAccessFields_publishedAt_Create + read: ReferencesDocAccessFields_publishedAt_Read + update: ReferencesDocAccessFields_publishedAt_Update + delete: ReferencesDocAccessFields_publishedAt_Delete +} + +type ReferencesDocAccessFields_publishedAt_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_publishedAt_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_publishedAt_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_publishedAt_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_title { + create: ReferencesDocAccessFields_title_Create + read: ReferencesDocAccessFields_title_Read + update: ReferencesDocAccessFields_title_Update + delete: ReferencesDocAccessFields_title_Delete +} + +type ReferencesDocAccessFields_title_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_title_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_title_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_title_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_location { + create: ReferencesDocAccessFields_location_Create + read: ReferencesDocAccessFields_location_Read + update: ReferencesDocAccessFields_location_Update + delete: ReferencesDocAccessFields_location_Delete +} + +type ReferencesDocAccessFields_location_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_location_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_location_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_location_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_rating { + create: ReferencesDocAccessFields_rating_Create + read: ReferencesDocAccessFields_rating_Read + update: ReferencesDocAccessFields_rating_Update + delete: ReferencesDocAccessFields_rating_Delete +} + +type ReferencesDocAccessFields_rating_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_rating_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_rating_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_rating_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_media { + create: ReferencesDocAccessFields_media_Create + read: ReferencesDocAccessFields_media_Read + update: ReferencesDocAccessFields_media_Update + delete: ReferencesDocAccessFields_media_Delete +} + +type ReferencesDocAccessFields_media_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_media_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_media_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_media_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_review { + create: ReferencesDocAccessFields_review_Create + read: ReferencesDocAccessFields_review_Read + update: ReferencesDocAccessFields_review_Update + delete: ReferencesDocAccessFields_review_Delete +} + +type ReferencesDocAccessFields_review_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_review_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_review_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_review_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_slug { + create: ReferencesDocAccessFields_slug_Create + read: ReferencesDocAccessFields_slug_Read + update: ReferencesDocAccessFields_slug_Update + delete: ReferencesDocAccessFields_slug_Delete +} + +type ReferencesDocAccessFields_slug_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_slug_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_slug_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_slug_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_updatedAt { + create: ReferencesDocAccessFields_updatedAt_Create + read: ReferencesDocAccessFields_updatedAt_Read + update: ReferencesDocAccessFields_updatedAt_Update + delete: ReferencesDocAccessFields_updatedAt_Delete +} + +type ReferencesDocAccessFields_updatedAt_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_updatedAt_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_updatedAt_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_updatedAt_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields_createdAt { + create: ReferencesDocAccessFields_createdAt_Create + read: ReferencesDocAccessFields_createdAt_Read + update: ReferencesDocAccessFields_createdAt_Update + delete: ReferencesDocAccessFields_createdAt_Delete +} + +type ReferencesDocAccessFields_createdAt_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields_createdAt_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields_createdAt_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields_createdAt_Delete { + permission: Boolean! +} + +type ReferencesDocAccessFields__status { + create: ReferencesDocAccessFields__status_Create + read: ReferencesDocAccessFields__status_Read + update: ReferencesDocAccessFields__status_Update + delete: ReferencesDocAccessFields__status_Delete +} + +type ReferencesDocAccessFields__status_Create { + permission: Boolean! +} + +type ReferencesDocAccessFields__status_Read { + permission: Boolean! +} + +type ReferencesDocAccessFields__status_Update { + permission: Boolean! +} + +type ReferencesDocAccessFields__status_Delete { + permission: Boolean! +} + +type ReferencesCreateDocAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesReadDocAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesUpdateDocAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesDeleteDocAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesReadVersionsDocAccess { + permission: Boolean! + where: JSONObject +} + +type ReferenceVersion { + parent(draft: Boolean): Reference + version: ReferenceVersion_Version + createdAt: DateTime + updatedAt: DateTime + latest: Boolean + id: Int +} + +type ReferenceVersion_Version { + publishedAt: DateTime + title: String + location: String + rating: Float + media(where: ReferenceVersion_Version_Media_where): Media + review: String + slug: String + updatedAt: DateTime + createdAt: DateTime + _status: ReferenceVersion_Version__status +} + +input ReferenceVersion_Version_Media_where { + alt: ReferenceVersion_Version_Media_alt_operator + caption: ReferenceVersion_Version_Media_caption_operator + updatedAt: ReferenceVersion_Version_Media_updatedAt_operator + createdAt: ReferenceVersion_Version_Media_createdAt_operator + url: ReferenceVersion_Version_Media_url_operator + filename: ReferenceVersion_Version_Media_filename_operator + mimeType: ReferenceVersion_Version_Media_mimeType_operator + filesize: ReferenceVersion_Version_Media_filesize_operator + width: ReferenceVersion_Version_Media_width_operator + height: ReferenceVersion_Version_Media_height_operator + focalX: ReferenceVersion_Version_Media_focalX_operator + focalY: ReferenceVersion_Version_Media_focalY_operator + id: ReferenceVersion_Version_Media_id_operator + AND: [ReferenceVersion_Version_Media_where_and] + OR: [ReferenceVersion_Version_Media_where_or] +} + +input ReferenceVersion_Version_Media_alt_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] +} + +input ReferenceVersion_Version_Media_caption_operator { + equals: JSON + not_equals: JSON + like: JSON + contains: JSON + exists: Boolean +} + +input ReferenceVersion_Version_Media_updatedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input ReferenceVersion_Version_Media_createdAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input ReferenceVersion_Version_Media_url_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input ReferenceVersion_Version_Media_filename_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input ReferenceVersion_Version_Media_mimeType_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input ReferenceVersion_Version_Media_filesize_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input ReferenceVersion_Version_Media_width_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input ReferenceVersion_Version_Media_height_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input ReferenceVersion_Version_Media_focalX_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input ReferenceVersion_Version_Media_focalY_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input ReferenceVersion_Version_Media_id_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input ReferenceVersion_Version_Media_where_and { + alt: ReferenceVersion_Version_Media_alt_operator + caption: ReferenceVersion_Version_Media_caption_operator + updatedAt: ReferenceVersion_Version_Media_updatedAt_operator + createdAt: ReferenceVersion_Version_Media_createdAt_operator + url: ReferenceVersion_Version_Media_url_operator + filename: ReferenceVersion_Version_Media_filename_operator + mimeType: ReferenceVersion_Version_Media_mimeType_operator + filesize: ReferenceVersion_Version_Media_filesize_operator + width: ReferenceVersion_Version_Media_width_operator + height: ReferenceVersion_Version_Media_height_operator + focalX: ReferenceVersion_Version_Media_focalX_operator + focalY: ReferenceVersion_Version_Media_focalY_operator + id: ReferenceVersion_Version_Media_id_operator + AND: [ReferenceVersion_Version_Media_where_and] + OR: [ReferenceVersion_Version_Media_where_or] +} + +input ReferenceVersion_Version_Media_where_or { + alt: ReferenceVersion_Version_Media_alt_operator + caption: ReferenceVersion_Version_Media_caption_operator + updatedAt: ReferenceVersion_Version_Media_updatedAt_operator + createdAt: ReferenceVersion_Version_Media_createdAt_operator + url: ReferenceVersion_Version_Media_url_operator + filename: ReferenceVersion_Version_Media_filename_operator + mimeType: ReferenceVersion_Version_Media_mimeType_operator + filesize: ReferenceVersion_Version_Media_filesize_operator + width: ReferenceVersion_Version_Media_width_operator + height: ReferenceVersion_Version_Media_height_operator + focalX: ReferenceVersion_Version_Media_focalX_operator + focalY: ReferenceVersion_Version_Media_focalY_operator + id: ReferenceVersion_Version_Media_id_operator + AND: [ReferenceVersion_Version_Media_where_and] + OR: [ReferenceVersion_Version_Media_where_or] +} + +enum ReferenceVersion_Version__status { + draft + published +} + +type versionsReferences { + docs: [ReferenceVersion] + hasNextPage: Boolean + hasPrevPage: Boolean + limit: Int + nextPage: Int + offset: Int + page: Int + pagingCounter: Int + prevPage: Int + totalDocs: Int + totalPages: Int +} + +input versionsReference_where { + parent: versionsReference_parent_operator + version__publishedAt: versionsReference_version__publishedAt_operator + version__title: versionsReference_version__title_operator + version__location: versionsReference_version__location_operator + version__rating: versionsReference_version__rating_operator + version__media: versionsReference_version__media_operator + version__review: versionsReference_version__review_operator + version__slug: versionsReference_version__slug_operator + version__updatedAt: versionsReference_version__updatedAt_operator + version__createdAt: versionsReference_version__createdAt_operator + version___status: versionsReference_version___status_operator + createdAt: versionsReference_createdAt_operator + updatedAt: versionsReference_updatedAt_operator + latest: versionsReference_latest_operator + id: versionsReference_id_operator + AND: [versionsReference_where_and] + OR: [versionsReference_where_or] +} + +input versionsReference_parent_operator { + equals: JSON + not_equals: JSON + in: [JSON] + not_in: [JSON] + all: [JSON] + exists: Boolean +} + +input versionsReference_version__publishedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input versionsReference_version__title_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] +} + +input versionsReference_version__location_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input versionsReference_version__rating_operator { + equals: Float + not_equals: Float + greater_than_equal: Float + greater_than: Float + less_than_equal: Float + less_than: Float + exists: Boolean +} + +input versionsReference_version__media_operator { + equals: String + not_equals: String + exists: Boolean +} + +input versionsReference_version__review_operator { + equals: String + not_equals: String + like: String + contains: String + exists: Boolean +} + +input versionsReference_version__slug_operator { + equals: String + not_equals: String + like: String + contains: String + in: [String] + not_in: [String] + all: [String] + exists: Boolean +} + +input versionsReference_version__updatedAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input versionsReference_version__createdAt_operator { + equals: DateTime + not_equals: DateTime + greater_than_equal: DateTime + greater_than: DateTime + less_than_equal: DateTime + less_than: DateTime + like: DateTime + exists: Boolean +} + +input versionsReference_version___status_operator { + equals: versionsReference_version___status_Input + not_equals: versionsReference_version___status_Input + in: [versionsReference_version___status_Input] + not_in: [versionsReference_version___status_Input] + all: [versionsReference_version___status_Input] + exists: Boolean +} + +enum versionsReference_version___status_Input { draft published } -input versionsProject_createdAt_operator { +input versionsReference_createdAt_operator { equals: DateTime not_equals: DateTime greater_than_equal: DateTime @@ -7809,7 +9142,7 @@ input versionsProject_createdAt_operator { exists: Boolean } -input versionsProject_updatedAt_operator { +input versionsReference_updatedAt_operator { equals: DateTime not_equals: DateTime greater_than_equal: DateTime @@ -7820,13 +9153,13 @@ input versionsProject_updatedAt_operator { exists: Boolean } -input versionsProject_latest_operator { +input versionsReference_latest_operator { equals: Boolean not_equals: Boolean exists: Boolean } -input versionsProject_id_operator { +input versionsReference_id_operator { equals: Int not_equals: Int greater_than_equal: Int @@ -7836,66 +9169,44 @@ input versionsProject_id_operator { exists: Boolean } -input versionsProject_where_and { - parent: versionsProject_parent_operator - version__title: versionsProject_version__title_operator - version__categories: versionsProject_version__categories_operator - version__publishedAt: versionsProject_version__publishedAt_operator - version__hero__type: versionsProject_version__hero__type_operator - version__hero__richText: versionsProject_version__hero__richText_operator - version__hero__links__link__type: versionsProject_version__hero__links__link__type_operator - version__hero__links__link__newTab: versionsProject_version__hero__links__link__newTab_operator - version__hero__links__link__reference: versionsProject_version__hero__links__link__reference_Relation - version__hero__links__link__url: versionsProject_version__hero__links__link__url_operator - version__hero__links__link__label: versionsProject_version__hero__links__link__label_operator - version__hero__links__link__appearance: versionsProject_version__hero__links__link__appearance_operator - version__hero__links__id: versionsProject_version__hero__links__id_operator - version__hero__media: versionsProject_version__hero__media_operator - version__relatedProjects: versionsProject_version__relatedProjects_operator - version__slug: versionsProject_version__slug_operator - version__meta__title: versionsProject_version__meta__title_operator - version__meta__description: versionsProject_version__meta__description_operator - version__meta__image: versionsProject_version__meta__image_operator - version__updatedAt: versionsProject_version__updatedAt_operator - version__createdAt: versionsProject_version__createdAt_operator - version___status: versionsProject_version___status_operator - createdAt: versionsProject_createdAt_operator - updatedAt: versionsProject_updatedAt_operator - latest: versionsProject_latest_operator - id: versionsProject_id_operator - AND: [versionsProject_where_and] - OR: [versionsProject_where_or] -} - -input versionsProject_where_or { - parent: versionsProject_parent_operator - version__title: versionsProject_version__title_operator - version__categories: versionsProject_version__categories_operator - version__publishedAt: versionsProject_version__publishedAt_operator - version__hero__type: versionsProject_version__hero__type_operator - version__hero__richText: versionsProject_version__hero__richText_operator - version__hero__links__link__type: versionsProject_version__hero__links__link__type_operator - version__hero__links__link__newTab: versionsProject_version__hero__links__link__newTab_operator - version__hero__links__link__reference: versionsProject_version__hero__links__link__reference_Relation - version__hero__links__link__url: versionsProject_version__hero__links__link__url_operator - version__hero__links__link__label: versionsProject_version__hero__links__link__label_operator - version__hero__links__link__appearance: versionsProject_version__hero__links__link__appearance_operator - version__hero__links__id: versionsProject_version__hero__links__id_operator - version__hero__media: versionsProject_version__hero__media_operator - version__relatedProjects: versionsProject_version__relatedProjects_operator - version__slug: versionsProject_version__slug_operator - version__meta__title: versionsProject_version__meta__title_operator - version__meta__description: versionsProject_version__meta__description_operator - version__meta__image: versionsProject_version__meta__image_operator - version__updatedAt: versionsProject_version__updatedAt_operator - version__createdAt: versionsProject_version__createdAt_operator - version___status: versionsProject_version___status_operator - createdAt: versionsProject_createdAt_operator - updatedAt: versionsProject_updatedAt_operator - latest: versionsProject_latest_operator - id: versionsProject_id_operator - AND: [versionsProject_where_and] - OR: [versionsProject_where_or] +input versionsReference_where_and { + parent: versionsReference_parent_operator + version__publishedAt: versionsReference_version__publishedAt_operator + version__title: versionsReference_version__title_operator + version__location: versionsReference_version__location_operator + version__rating: versionsReference_version__rating_operator + version__media: versionsReference_version__media_operator + version__review: versionsReference_version__review_operator + version__slug: versionsReference_version__slug_operator + version__updatedAt: versionsReference_version__updatedAt_operator + version__createdAt: versionsReference_version__createdAt_operator + version___status: versionsReference_version___status_operator + createdAt: versionsReference_createdAt_operator + updatedAt: versionsReference_updatedAt_operator + latest: versionsReference_latest_operator + id: versionsReference_id_operator + AND: [versionsReference_where_and] + OR: [versionsReference_where_or] +} + +input versionsReference_where_or { + parent: versionsReference_parent_operator + version__publishedAt: versionsReference_version__publishedAt_operator + version__title: versionsReference_version__title_operator + version__location: versionsReference_version__location_operator + version__rating: versionsReference_version__rating_operator + version__media: versionsReference_version__media_operator + version__review: versionsReference_version__review_operator + version__slug: versionsReference_version__slug_operator + version__updatedAt: versionsReference_version__updatedAt_operator + version__createdAt: versionsReference_version__createdAt_operator + version___status: versionsReference_version___status_operator + createdAt: versionsReference_createdAt_operator + updatedAt: versionsReference_updatedAt_operator + latest: versionsReference_latest_operator + id: versionsReference_id_operator + AND: [versionsReference_where_and] + OR: [versionsReference_where_or] } type allMedia { @@ -11431,6 +12742,7 @@ type Access { pages: pagesAccess posts: postsAccess projects: projectsAccess + references: referencesAccess media: mediaAccess categories: categoriesAccess users: usersAccess @@ -13573,6 +14885,283 @@ type ProjectsReadVersionsAccess { where: JSONObject } +type referencesAccess { + fields: ReferencesFields + create: ReferencesCreateAccess + read: ReferencesReadAccess + update: ReferencesUpdateAccess + delete: ReferencesDeleteAccess + readVersions: ReferencesReadVersionsAccess +} + +type ReferencesFields { + publishedAt: ReferencesFields_publishedAt + title: ReferencesFields_title + location: ReferencesFields_location + rating: ReferencesFields_rating + media: ReferencesFields_media + review: ReferencesFields_review + slug: ReferencesFields_slug + updatedAt: ReferencesFields_updatedAt + createdAt: ReferencesFields_createdAt + _status: ReferencesFields__status +} + +type ReferencesFields_publishedAt { + create: ReferencesFields_publishedAt_Create + read: ReferencesFields_publishedAt_Read + update: ReferencesFields_publishedAt_Update + delete: ReferencesFields_publishedAt_Delete +} + +type ReferencesFields_publishedAt_Create { + permission: Boolean! +} + +type ReferencesFields_publishedAt_Read { + permission: Boolean! +} + +type ReferencesFields_publishedAt_Update { + permission: Boolean! +} + +type ReferencesFields_publishedAt_Delete { + permission: Boolean! +} + +type ReferencesFields_title { + create: ReferencesFields_title_Create + read: ReferencesFields_title_Read + update: ReferencesFields_title_Update + delete: ReferencesFields_title_Delete +} + +type ReferencesFields_title_Create { + permission: Boolean! +} + +type ReferencesFields_title_Read { + permission: Boolean! +} + +type ReferencesFields_title_Update { + permission: Boolean! +} + +type ReferencesFields_title_Delete { + permission: Boolean! +} + +type ReferencesFields_location { + create: ReferencesFields_location_Create + read: ReferencesFields_location_Read + update: ReferencesFields_location_Update + delete: ReferencesFields_location_Delete +} + +type ReferencesFields_location_Create { + permission: Boolean! +} + +type ReferencesFields_location_Read { + permission: Boolean! +} + +type ReferencesFields_location_Update { + permission: Boolean! +} + +type ReferencesFields_location_Delete { + permission: Boolean! +} + +type ReferencesFields_rating { + create: ReferencesFields_rating_Create + read: ReferencesFields_rating_Read + update: ReferencesFields_rating_Update + delete: ReferencesFields_rating_Delete +} + +type ReferencesFields_rating_Create { + permission: Boolean! +} + +type ReferencesFields_rating_Read { + permission: Boolean! +} + +type ReferencesFields_rating_Update { + permission: Boolean! +} + +type ReferencesFields_rating_Delete { + permission: Boolean! +} + +type ReferencesFields_media { + create: ReferencesFields_media_Create + read: ReferencesFields_media_Read + update: ReferencesFields_media_Update + delete: ReferencesFields_media_Delete +} + +type ReferencesFields_media_Create { + permission: Boolean! +} + +type ReferencesFields_media_Read { + permission: Boolean! +} + +type ReferencesFields_media_Update { + permission: Boolean! +} + +type ReferencesFields_media_Delete { + permission: Boolean! +} + +type ReferencesFields_review { + create: ReferencesFields_review_Create + read: ReferencesFields_review_Read + update: ReferencesFields_review_Update + delete: ReferencesFields_review_Delete +} + +type ReferencesFields_review_Create { + permission: Boolean! +} + +type ReferencesFields_review_Read { + permission: Boolean! +} + +type ReferencesFields_review_Update { + permission: Boolean! +} + +type ReferencesFields_review_Delete { + permission: Boolean! +} + +type ReferencesFields_slug { + create: ReferencesFields_slug_Create + read: ReferencesFields_slug_Read + update: ReferencesFields_slug_Update + delete: ReferencesFields_slug_Delete +} + +type ReferencesFields_slug_Create { + permission: Boolean! +} + +type ReferencesFields_slug_Read { + permission: Boolean! +} + +type ReferencesFields_slug_Update { + permission: Boolean! +} + +type ReferencesFields_slug_Delete { + permission: Boolean! +} + +type ReferencesFields_updatedAt { + create: ReferencesFields_updatedAt_Create + read: ReferencesFields_updatedAt_Read + update: ReferencesFields_updatedAt_Update + delete: ReferencesFields_updatedAt_Delete +} + +type ReferencesFields_updatedAt_Create { + permission: Boolean! +} + +type ReferencesFields_updatedAt_Read { + permission: Boolean! +} + +type ReferencesFields_updatedAt_Update { + permission: Boolean! +} + +type ReferencesFields_updatedAt_Delete { + permission: Boolean! +} + +type ReferencesFields_createdAt { + create: ReferencesFields_createdAt_Create + read: ReferencesFields_createdAt_Read + update: ReferencesFields_createdAt_Update + delete: ReferencesFields_createdAt_Delete +} + +type ReferencesFields_createdAt_Create { + permission: Boolean! +} + +type ReferencesFields_createdAt_Read { + permission: Boolean! +} + +type ReferencesFields_createdAt_Update { + permission: Boolean! +} + +type ReferencesFields_createdAt_Delete { + permission: Boolean! +} + +type ReferencesFields__status { + create: ReferencesFields__status_Create + read: ReferencesFields__status_Read + update: ReferencesFields__status_Update + delete: ReferencesFields__status_Delete +} + +type ReferencesFields__status_Create { + permission: Boolean! +} + +type ReferencesFields__status_Read { + permission: Boolean! +} + +type ReferencesFields__status_Update { + permission: Boolean! +} + +type ReferencesFields__status_Delete { + permission: Boolean! +} + +type ReferencesCreateAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesReadAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesUpdateAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesDeleteAccess { + permission: Boolean! + where: JSONObject +} + +type ReferencesReadVersionsAccess { + permission: Boolean! + where: JSONObject +} + type mediaAccess { fields: MediaFields create: MediaCreateAccess @@ -15821,6 +17410,10 @@ type Mutation { updateProject(id: Int!, autosave: Boolean, data: mutationProjectUpdateInput!, draft: Boolean): Project deleteProject(id: Int!): Project restoreVersionProject(id: Int): Project + createReference(data: mutationReferenceInput!, draft: Boolean): Reference + updateReference(id: Int!, autosave: Boolean, data: mutationReferenceUpdateInput!, draft: Boolean): Reference + deleteReference(id: Int!): Reference + restoreVersionReference(id: Int): Reference createMedia(data: mutationMediaInput!): Media updateMedia(id: Int!, autosave: Boolean, data: mutationMediaUpdateInput!): Media deleteMedia(id: Int!): Media @@ -16274,6 +17867,42 @@ enum ProjectUpdate__status_MutationInput { published } +input mutationReferenceInput { + publishedAt: String + title: String! + location: String + rating: Float + media: String + review: String + slug: String + updatedAt: String + createdAt: String + _status: Reference__status_MutationInput +} + +enum Reference__status_MutationInput { + draft + published +} + +input mutationReferenceUpdateInput { + publishedAt: String + title: String + location: String + rating: Float + media: String + review: String + slug: String + updatedAt: String + createdAt: String + _status: ReferenceUpdate__status_MutationInput +} + +enum ReferenceUpdate__status_MutationInput { + draft + published +} + input mutationMediaInput { alt: String! caption: JSON diff --git a/src/payload/payload-types.ts b/src/payload/payload-types.ts index afcd0f1..d14c099 100644 --- a/src/payload/payload-types.ts +++ b/src/payload/payload-types.ts @@ -11,6 +11,7 @@ export interface Config { pages: Page; posts: Post; projects: Project; + references: Reference; media: Media; categories: Category; users: User; @@ -87,9 +88,17 @@ export interface Page { columns?: | { size?: ('oneThird' | 'half' | 'twoThirds' | 'full') | null; - richText: { - [k: string]: unknown; - }[]; + useImage?: boolean | null; + inlineMedia?: { + imageScale?: number | null; + borderRadius?: number | null; + media?: number | Media | null; + }; + richText?: + | { + [k: string]: unknown; + }[] + | null; enableLink?: boolean | null; link?: { type?: ('reference' | 'custom') | null; @@ -217,6 +226,12 @@ export interface Page { blockName?: string | null; blockType: 'babylonBlock'; } + | { + invertBackground?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'referencesBlock'; + } )[]; slug?: string | null; meta?: { @@ -340,9 +355,17 @@ export interface Post { columns?: | { size?: ('oneThird' | 'half' | 'twoThirds' | 'full') | null; - richText: { - [k: string]: unknown; - }[]; + useImage?: boolean | null; + inlineMedia?: { + imageScale?: number | null; + borderRadius?: number | null; + media?: number | Media | null; + }; + richText?: + | { + [k: string]: unknown; + }[] + | null; enableLink?: boolean | null; link?: { type?: ('reference' | 'custom') | null; @@ -504,9 +527,17 @@ export interface Post { columns?: | { size?: ('oneThird' | 'half' | 'twoThirds' | 'full') | null; - richText: { - [k: string]: unknown; - }[]; + useImage?: boolean | null; + inlineMedia?: { + imageScale?: number | null; + borderRadius?: number | null; + media?: number | Media | null; + }; + richText?: + | { + [k: string]: unknown; + }[] + | null; enableLink?: boolean | null; link?: { type?: ('reference' | 'custom') | null; @@ -715,9 +746,17 @@ export interface Project { columns?: | { size?: ('oneThird' | 'half' | 'twoThirds' | 'full') | null; - richText: { - [k: string]: unknown; - }[]; + useImage?: boolean | null; + inlineMedia?: { + imageScale?: number | null; + borderRadius?: number | null; + media?: number | Media | null; + }; + richText?: + | { + [k: string]: unknown; + }[] + | null; enableLink?: boolean | null; link?: { type?: ('reference' | 'custom') | null; @@ -857,6 +896,23 @@ export interface Project { createdAt: string; _status?: ('draft' | 'published') | null; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "references". + */ +export interface Reference { + id: number; + publishedAt?: string | null; + title: string; + location?: string | null; + rating: number; + media?: number | Media | null; + review?: string | null; + slug?: string | null; + updatedAt: string; + createdAt: string; + _status?: ('draft' | 'published') | null; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "comments". diff --git a/src/payload/payload.config.ts b/src/payload/payload.config.ts index 584bd40..0299cfe 100644 --- a/src/payload/payload.config.ts +++ b/src/payload/payload.config.ts @@ -16,6 +16,7 @@ import { Media } from './collections/Media' import { Pages } from './collections/Pages' import { Posts } from './collections/Posts' import { Projects } from './collections/Projects' +import { References } from './collections/References' import Users from './collections/Users' import BeforeDashboard from './components/BeforeDashboard' import BeforeLogin from './components/BeforeLogin' @@ -24,7 +25,7 @@ import { Header } from './globals/Header' import { Settings } from './globals/Settings' const generateTitle: GenerateTitle = () => { - return 'My Website' + return 'Unforeseen Travels' } dotenv.config({ @@ -62,7 +63,7 @@ export default buildConfig({ }, }), serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL, - collections: [Pages, Posts, Projects, Media, Categories, Users, Comments], + collections: [Pages, Posts, Projects, References, Media, Categories, Users, Comments], globals: [Settings, Header, Footer], typescript: { outputFile: path.resolve(__dirname, 'payload-types.ts'),