templates: bump for v3.7.0 (#10000)
🤖 Automated bump of templates for v3.7.0
Triggered by user: @paulpopus
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "20001806-b0fc-4802-9876-a09dc4c99242",
|
||||
"id": "7e088ab2-b3bd-4286-bf51-c78ce9ac732f",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as migration_20241213_192425_initial from './20241213_192425_initial'
|
||||
import * as migration_20241216_183241_initial from './20241216_183241_initial'
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20241213_192425_initial.up,
|
||||
down: migration_20241213_192425_initial.down,
|
||||
name: '20241213_192425_initial',
|
||||
up: migration_20241216_183241_initial.up,
|
||||
down: migration_20241216_183241_initial.down,
|
||||
name: '20241216_183241_initial',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "8f2699f4-cb17-4a86-b401-e9e83293c22a",
|
||||
"id": "62178519-5e26-4f24-a462-303f0ca4fb8c",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as migration_20241213_192401_initial from './20241213_192401_initial'
|
||||
import * as migration_20241216_183217_initial from './20241216_183217_initial'
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20241213_192401_initial.up,
|
||||
down: migration_20241213_192401_initial.down,
|
||||
name: '20241213_192401_initial',
|
||||
up: migration_20241216_183217_initial.up,
|
||||
down: migration_20241216_183217_initial.down,
|
||||
name: '20241216_183217_initial',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -36,8 +36,8 @@ export const RenderBlocks: React.FC<{
|
||||
if (Block) {
|
||||
return (
|
||||
<div className="my-16" key={index}>
|
||||
{/* @ts-expect-error */}
|
||||
<Block {...block} />
|
||||
{/* @ts-expect-error there may be some mismatch between the expected types here */}
|
||||
<Block {...block} disableInnerContainer />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -79,6 +79,11 @@ export const Posts: CollectionConfig<'posts'> = {
|
||||
tabs: [
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
name: 'heroImage',
|
||||
type: 'upload',
|
||||
relationTo: 'media',
|
||||
},
|
||||
{
|
||||
name: 'content',
|
||||
type: 'richText',
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable jsx-a11y/heading-has-content */
|
||||
import { cn } from 'src/utilities/cn'
|
||||
import * as React from 'react'
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable react/button-has-type */
|
||||
import type { ButtonProps } from '@/components/ui/button'
|
||||
|
||||
import { buttonVariants } from '@/components/ui/button'
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { Media } from '@/payload-types'
|
||||
|
||||
export const imageHero1: Omit<Media, 'createdAt' | 'id' | 'updatedAt'> = {
|
||||
alt: 'Straight metallic shapes with a blue gradient',
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { contact as contactPageData } from './contact-page'
|
||||
import { home } from './home'
|
||||
import { image1 } from './image-1'
|
||||
import { image2 } from './image-2'
|
||||
import { imageHero1 } from './image-hero-1'
|
||||
import { post1 } from './post-1'
|
||||
import { post2 } from './post-2'
|
||||
import { post3 } from './post-3'
|
||||
@@ -72,7 +73,7 @@ export const seed = async ({
|
||||
depth: 0,
|
||||
where: {
|
||||
email: {
|
||||
equals: 'demo-author@payloadcms.com',
|
||||
equals: 'demo-author@example.com',
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -111,7 +112,7 @@ export const seed = async ({
|
||||
collection: 'users',
|
||||
data: {
|
||||
name: 'Demo Author',
|
||||
email: 'demo-author@payloadcms.com',
|
||||
email: 'demo-author@example.com',
|
||||
password: 'password',
|
||||
},
|
||||
}),
|
||||
@@ -132,7 +133,7 @@ export const seed = async ({
|
||||
}),
|
||||
payload.create({
|
||||
collection: 'media',
|
||||
data: image2,
|
||||
data: imageHero1,
|
||||
file: hero1Buffer,
|
||||
}),
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Post } from '@/payload-types'
|
||||
export const post1: Partial<Post> = {
|
||||
slug: 'digital-horizons',
|
||||
_status: 'published',
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
authors: ['{{AUTHOR}}'],
|
||||
content: {
|
||||
@@ -291,10 +292,11 @@ export const post1: Partial<Post> = {
|
||||
version: 1,
|
||||
},
|
||||
},
|
||||
|
||||
heroImage: '{{IMAGE_1}}',
|
||||
meta: {
|
||||
description:
|
||||
'Dive into the marvels of modern innovation, where the only constant is change. A journey where pixels and data converge to craft the future.',
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
image: '{{IMAGE_1}}',
|
||||
title: 'Digital Horizons: A Glimpse into Tomorrow',
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Post } from '@/payload-types'
|
||||
export const post2: Partial<Post> = {
|
||||
slug: 'global-gaze',
|
||||
_status: 'published',
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
authors: ['{{AUTHOR}}'],
|
||||
content: {
|
||||
@@ -214,9 +215,11 @@ export const post2: Partial<Post> = {
|
||||
version: 1,
|
||||
},
|
||||
},
|
||||
heroImage: '{{IMAGE_1}}',
|
||||
meta: {
|
||||
description:
|
||||
'Explore the untold and overlooked. A magnified view into the corners of the world, where every story deserves its spotlight.',
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
image: '{{IMAGE_1}}',
|
||||
title: 'Global Gaze: Beyond the Headlines',
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Post } from '@/payload-types'
|
||||
export const post3: Partial<Post> = {
|
||||
slug: 'dollar-and-sense-the-financial-forecast',
|
||||
_status: 'published',
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
authors: ['{{AUTHOR}}'],
|
||||
content: {
|
||||
@@ -251,8 +252,10 @@ export const post3: Partial<Post> = {
|
||||
version: 1,
|
||||
},
|
||||
},
|
||||
heroImage: '{{IMAGE_1}}',
|
||||
meta: {
|
||||
description: `Money isn't just currency; it's a language. Dive deep into its nuances, where strategy meets intuition in the vast sea of finance.`,
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
image: '{{IMAGE_1}}',
|
||||
title: 'Dollar and Sense: The Financial Forecast',
|
||||
|
||||
@@ -9,7 +9,7 @@ import { formatAuthors } from '@/utilities/formatAuthors'
|
||||
export const PostHero: React.FC<{
|
||||
post: Post
|
||||
}> = ({ post }) => {
|
||||
const { categories, meta: { image: metaImage } = {}, populatedAuthors, publishedAt, title } = post
|
||||
const { categories, heroImage, populatedAuthors, publishedAt, title } = post
|
||||
|
||||
const hasAuthors =
|
||||
populatedAuthors && populatedAuthors.length > 0 && formatAuthors(populatedAuthors) !== ''
|
||||
@@ -43,15 +43,15 @@ export const PostHero: React.FC<{
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col md:flex-row gap-4 md:gap-16">
|
||||
<div className="flex flex-col gap-4">
|
||||
{populatedAuthors && (
|
||||
{hasAuthors && (
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Author</p>
|
||||
|
||||
<p>{formatAuthors(populatedAuthors)}</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{publishedAt && (
|
||||
<div className="flex flex-col gap-1">
|
||||
<p className="text-sm">Date Published</p>
|
||||
@@ -63,13 +63,13 @@ export const PostHero: React.FC<{
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-h-[80vh] select-none">
|
||||
{metaImage && typeof metaImage !== 'string' && (
|
||||
{heroImage && typeof heroImage !== 'string' && (
|
||||
<Media
|
||||
fill
|
||||
priority={false}
|
||||
loading="lazy"
|
||||
imgClassName="-z-10 object-cover"
|
||||
resource={metaImage}
|
||||
resource={heroImage}
|
||||
/>
|
||||
)}
|
||||
<div className="absolute pointer-events-none left-0 bottom-0 w-full h-1/2 bg-gradient-to-t from-black to-transparent" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "c89eccb3-f76a-45b8-9111-43eaa823a07e",
|
||||
"id": "ea96ca46-b715-43f9-8f77-7518afa91ecd",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -2934,6 +2934,12 @@
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"hero_image_id": {
|
||||
"name": "hero_image_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"content": {
|
||||
"name": "content",
|
||||
"type": "jsonb",
|
||||
@@ -3001,6 +3007,21 @@
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"posts_hero_image_idx": {
|
||||
"name": "posts_hero_image_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "hero_image_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
},
|
||||
"posts_meta_meta_image_idx": {
|
||||
"name": "posts_meta_meta_image_idx",
|
||||
"columns": [
|
||||
@@ -3078,6 +3099,15 @@
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"posts_hero_image_id_media_id_fk": {
|
||||
"name": "posts_hero_image_id_media_id_fk",
|
||||
"tableFrom": "posts",
|
||||
"tableTo": "media",
|
||||
"columnsFrom": ["hero_image_id"],
|
||||
"columnsTo": ["id"],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"posts_meta_image_id_media_id_fk": {
|
||||
"name": "posts_meta_image_id_media_id_fk",
|
||||
"tableFrom": "posts",
|
||||
@@ -3383,6 +3413,12 @@
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"version_hero_image_id": {
|
||||
"name": "version_hero_image_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"version_content": {
|
||||
"name": "version_content",
|
||||
"type": "jsonb",
|
||||
@@ -3489,6 +3525,21 @@
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
},
|
||||
"_posts_v_version_version_hero_image_idx": {
|
||||
"name": "_posts_v_version_version_hero_image_idx",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "version_hero_image_id",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": false,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
},
|
||||
"_posts_v_version_meta_version_meta_image_idx": {
|
||||
"name": "_posts_v_version_meta_version_meta_image_idx",
|
||||
"columns": [
|
||||
@@ -3635,6 +3686,15 @@
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"_posts_v_version_hero_image_id_media_id_fk": {
|
||||
"name": "_posts_v_version_hero_image_id_media_id_fk",
|
||||
"tableFrom": "_posts_v",
|
||||
"tableTo": "media",
|
||||
"columnsFrom": ["version_hero_image_id"],
|
||||
"columnsTo": ["id"],
|
||||
"onDelete": "set null",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"_posts_v_version_meta_image_id_media_id_fk": {
|
||||
"name": "_posts_v_version_meta_image_id_media_id_fk",
|
||||
"tableFrom": "_posts_v",
|
||||
@@ -277,6 +277,7 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||
CREATE TABLE IF NOT EXISTS "posts" (
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"title" varchar,
|
||||
"hero_image_id" integer,
|
||||
"content" jsonb,
|
||||
"meta_title" varchar,
|
||||
"meta_image_id" integer,
|
||||
@@ -311,6 +312,7 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||
"id" serial PRIMARY KEY NOT NULL,
|
||||
"parent_id" integer,
|
||||
"version_title" varchar,
|
||||
"version_hero_image_id" integer,
|
||||
"version_content" jsonb,
|
||||
"version_meta_title" varchar,
|
||||
"version_meta_image_id" integer,
|
||||
@@ -929,6 +931,12 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "posts" ADD CONSTRAINT "posts_hero_image_id_media_id_fk" FOREIGN KEY ("hero_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "posts" ADD CONSTRAINT "posts_meta_image_id_media_id_fk" FOREIGN KEY ("meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||
EXCEPTION
|
||||
@@ -971,6 +979,12 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "_posts_v" ADD CONSTRAINT "_posts_v_version_hero_image_id_media_id_fk" FOREIGN KEY ("version_hero_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
DO $$ BEGIN
|
||||
ALTER TABLE "_posts_v" ADD CONSTRAINT "_posts_v_version_meta_image_id_media_id_fk" FOREIGN KEY ("version_meta_image_id") REFERENCES "public"."media"("id") ON DELETE set null ON UPDATE no action;
|
||||
EXCEPTION
|
||||
@@ -1324,6 +1338,7 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||
CREATE INDEX IF NOT EXISTS "_pages_v_rels_posts_id_idx" ON "_pages_v_rels" USING btree ("posts_id");
|
||||
CREATE INDEX IF NOT EXISTS "posts_populated_authors_order_idx" ON "posts_populated_authors" USING btree ("_order");
|
||||
CREATE INDEX IF NOT EXISTS "posts_populated_authors_parent_id_idx" ON "posts_populated_authors" USING btree ("_parent_id");
|
||||
CREATE INDEX IF NOT EXISTS "posts_hero_image_idx" ON "posts" USING btree ("hero_image_id");
|
||||
CREATE INDEX IF NOT EXISTS "posts_meta_meta_image_idx" ON "posts" USING btree ("meta_image_id");
|
||||
CREATE INDEX IF NOT EXISTS "posts_slug_idx" ON "posts" USING btree ("slug");
|
||||
CREATE INDEX IF NOT EXISTS "posts_updated_at_idx" ON "posts" USING btree ("updated_at");
|
||||
@@ -1338,6 +1353,7 @@ export async function up({ db, payload, req }: MigrateUpArgs): Promise<void> {
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_version_populated_authors_order_idx" ON "_posts_v_version_populated_authors" USING btree ("_order");
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_version_populated_authors_parent_id_idx" ON "_posts_v_version_populated_authors" USING btree ("_parent_id");
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_parent_idx" ON "_posts_v" USING btree ("parent_id");
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_version_version_hero_image_idx" ON "_posts_v" USING btree ("version_hero_image_id");
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_version_meta_version_meta_image_idx" ON "_posts_v" USING btree ("version_meta_image_id");
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_version_version_slug_idx" ON "_posts_v" USING btree ("version_slug");
|
||||
CREATE INDEX IF NOT EXISTS "_posts_v_version_version_updated_at_idx" ON "_posts_v" USING btree ("version_updated_at");
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as migration_20241213_192414_initial from './20241213_192414_initial'
|
||||
import * as migration_20241216_183230_initial from './20241216_183230_initial'
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20241213_192414_initial.up,
|
||||
down: migration_20241213_192414_initial.down,
|
||||
name: '20241213_192414_initial',
|
||||
up: migration_20241216_183230_initial.up,
|
||||
down: migration_20241216_183230_initial.down,
|
||||
name: '20241216_183230_initial',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -376,6 +376,7 @@ export interface Category {
|
||||
export interface Post {
|
||||
id: number;
|
||||
title: string;
|
||||
heroImage?: (number | null) | Media;
|
||||
content: {
|
||||
root: {
|
||||
type: string;
|
||||
@@ -899,6 +900,7 @@ export interface PagesSelect<T extends boolean = true> {
|
||||
*/
|
||||
export interface PostsSelect<T extends boolean = true> {
|
||||
title?: T;
|
||||
heroImage?: T;
|
||||
content?: T;
|
||||
relatedPosts?: T;
|
||||
categories?: T;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export type Theme = 'dark' | 'light'
|
||||
|
||||
export interface ThemeContextType {
|
||||
setTheme: (theme: Theme | null) => void // eslint-disable-line no-unused-vars
|
||||
setTheme: (theme: Theme | null) => void
|
||||
theme?: Theme | null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user