Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions apps/strapi/prettier.config.mjs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@
"originalPublishedAt": {
"type": "datetime"
},
"intro": {
"type": "dynamiczone",
"components": [
"sections.disclaimer",
"sections.richtext"
]
},
"content": {
"type": "richtext"
},
Expand Down
8 changes: 1 addition & 7 deletions apps/strapi/src/documentMiddlewares/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export const getComponentsToPopulate = async (
action: string
documentId: string | number
locale?: string
params?: Record<string, unknown>
}
): Promise<Record<string, string[]>> => {
const prefetchPopulate = buildDynamicZonePrefetchPopulate(
Expand All @@ -151,18 +150,13 @@ export const getComponentsToPopulate = async (
dynamicZonePopulate
)

// Pass filters/status/pagination from the real request so we don't
// prefetch the whole collection on every blog-post page.
const prefetchedData = await strapi
.documents(context.uid)
[context.action].call(this, {
documentId: context.documentId,
populate: prefetchPopulate,
fields: ["documentId"],
locale: context.params?.locale ?? context.locale,
filters: context.params?.filters,
status: context.params?.status,
pagination: context.params?.pagination,
locale: context.locale,
})

const entries = Array.isArray(prefetchedData)
Expand Down
4 changes: 0 additions & 4 deletions apps/strapi/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,6 @@ export interface ApiBlogPostBlogPost extends Struct.CollectionTypeSchema {
Schema.Attribute.Private
description: Schema.Attribute.Text
image: Schema.Attribute.Component<"media.image", false>
intro: Schema.Attribute.DynamicZone<
["sections.disclaimer", "sections.richtext"]
>
level: Schema.Attribute.Enumeration<
["beginner", "intermediate", "advanced"]
>
Expand Down Expand Up @@ -2189,7 +2186,6 @@ export interface PluginUsersPermissionsUser
description: Schema.Attribute.Text
email: Schema.Attribute.Email &
Schema.Attribute.Required &
Schema.Attribute.Private &
Schema.Attribute.SetMinMaxLength<{
minLength: 6
}>
Expand Down
12 changes: 0 additions & 12 deletions apps/ui/src/components/layouts/StrapiBlogPostView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export function StrapiBlogPostView({ params }: Props) {

const sections = post.sections
const author = post.author as BlogAuthor | null
const intro = post.intro
const content = post.content
const headings = content ? extractHeadings(content) : []
const hasManualRelated = (sections ?? []).some(
Expand Down Expand Up @@ -110,17 +109,6 @@ export function StrapiBlogPostView({ params }: Props) {

<div className="flex w-full flex-col">
<main className="flex w-full flex-col">
{intro && intro.length > 0 && (
<div className="pt-8 lg:pt-16">
<DynamicZoneRenderer
content={intro}
itemClassName="mb-8 md:mb-12 lg:mb-16 last:mb-0"
surface="page"
extraProps={{ currentSlug: slug, locale }}
/>
</div>
)}

{content && (
<section className="py-8 lg:py-16">
<div className="relative">
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/lib/strapi-api/content/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export async function fetchBlogPost(
seo: seoPopulate,
sidebar: { populate: ctaCardPopulate },
} as Record<string, unknown>,
populateDynamicZone: { intro: true, sections: true },
populateDynamicZone: { sections: true },
},
withCacheTags(dm.isEnabled, STRAPI_TAGS.blogPost, requestInit),
options
Expand Down
Loading