Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomezzavilla committed Nov 18, 2024
1 parent 8f4e10d commit 34e2fbb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ input CustomerStoryModelContentFieldFilter {
blocks: CustomerStoryModelContentFieldBlocksFilter
}

union CustomerStoryModelContentLinksField = BlogPostRecord | ChangelogEntryRecord | WebinarRecord
union CustomerStoryModelContentLinksField = BlogPostRecord | ChangelogEntryRecord

type CustomerStoryModelExcerptField {
blocks: [String!]!
Expand Down
8 changes: 4 additions & 4 deletions src/lib/datocms/graphql-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type introspection_types = {
'AcademyCourseModelOrderBy': { name: 'AcademyCourseModelOrderBy'; enumValues: '_createdAt_ASC' | '_createdAt_DESC' | 'createdAt_ASC' | 'createdAt_DESC' | 'id_ASC' | 'id_DESC' | '_firstPublishedAt_ASC' | '_firstPublishedAt_DESC' | 'position_ASC' | 'position_DESC' | '_publicationScheduledAt_ASC' | '_publicationScheduledAt_DESC' | '_unpublishingScheduledAt_ASC' | '_unpublishingScheduledAt_DESC' | '_publishedAt_ASC' | '_publishedAt_DESC' | '_status_ASC' | '_status_DESC' | '_updatedAt_ASC' | '_updatedAt_DESC' | 'updatedAt_ASC' | 'updatedAt_DESC' | '_isValid_ASC' | '_isValid_DESC' | 'illustration_ASC' | 'illustration_DESC' | 'name_ASC' | 'name_DESC'; };
'AcademyCourseRecord': { kind: 'OBJECT'; name: 'AcademyCourseRecord'; fields: { '_createdAt': { name: '_createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; '_editingUrl': { name: '_editingUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; '_firstPublishedAt': { name: '_firstPublishedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_isValid': { name: '_isValid'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; } }; '_modelApiKey': { name: '_modelApiKey'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; '_publicationScheduledAt': { name: '_publicationScheduledAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_publishedAt': { name: '_publishedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_seoMetaTags': { name: '_seoMetaTags'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Tag'; ofType: null; }; }; }; } }; '_status': { name: '_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ItemStatus'; ofType: null; }; } }; '_unpublishingScheduledAt': { name: '_unpublishingScheduledAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_updatedAt': { name: '_updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'chapters': { name: 'chapters'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AcademyChapterRecord'; ofType: null; }; }; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ItemId'; ofType: null; }; } }; 'illustration': { name: 'illustration'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'introduction': { name: 'introduction'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AcademyCourseModelIntroductionField'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'position': { name: 'position'; type: { kind: 'SCALAR'; name: 'IntType'; ofType: null; } }; 'slug': { name: 'slug'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
'AcademyPageRecord': { kind: 'OBJECT'; name: 'AcademyPageRecord'; fields: { '_createdAt': { name: '_createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; '_editingUrl': { name: '_editingUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; '_firstPublishedAt': { name: '_firstPublishedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_isValid': { name: '_isValid'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; } }; '_modelApiKey': { name: '_modelApiKey'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; '_publicationScheduledAt': { name: '_publicationScheduledAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_publishedAt': { name: '_publishedAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_seoMetaTags': { name: '_seoMetaTags'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Tag'; ofType: null; }; }; }; } }; '_status': { name: '_status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'ItemStatus'; ofType: null; }; } }; '_unpublishingScheduledAt': { name: '_unpublishingScheduledAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; '_updatedAt': { name: '_updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ItemId'; ofType: null; }; } }; 'seo': { name: 'seo'; type: { kind: 'OBJECT'; name: 'SeoField'; ofType: null; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
'AgencyProgramWorkflowStage': { name: 'AgencyProgramWorkflowStage'; enumValues: 'readyForPublication' | 'editMode' | 'reviewRequested'; };
'AgencyProgramWorkflowStage': { name: 'AgencyProgramWorkflowStage'; enumValues: 'editMode' | 'reviewRequested' | 'readyForPublication'; };
'AgencyProgramWorkflowStageFilter': { kind: 'INPUT_OBJECT'; name: 'AgencyProgramWorkflowStageFilter'; isOneOf: false; inputFields: [{ name: 'eq'; type: { kind: 'ENUM'; name: 'AgencyProgramWorkflowStage'; ofType: null; }; defaultValue: null }, { name: 'neq'; type: { kind: 'ENUM'; name: 'AgencyProgramWorkflowStage'; ofType: null; }; defaultValue: null }, { name: 'in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'AgencyProgramWorkflowStage'; ofType: null; }; }; }; defaultValue: null }, { name: 'notIn'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'AgencyProgramWorkflowStage'; ofType: null; }; }; }; defaultValue: null }]; };
'AuthorModelFilter': { kind: 'INPUT_OBJECT'; name: 'AuthorModelFilter'; isOneOf: false; inputFields: [{ name: '_createdAt'; type: { kind: 'INPUT_OBJECT'; name: 'CreatedAtFilter'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'INPUT_OBJECT'; name: 'CreatedAtFilter'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'ItemIdFilter'; ofType: null; }; defaultValue: null }, { name: '_firstPublishedAt'; type: { kind: 'INPUT_OBJECT'; name: 'PublishedAtFilter'; ofType: null; }; defaultValue: null }, { name: '_publicationScheduledAt'; type: { kind: 'INPUT_OBJECT'; name: 'PublishedAtFilter'; ofType: null; }; defaultValue: null }, { name: '_unpublishingScheduledAt'; type: { kind: 'INPUT_OBJECT'; name: 'PublishedAtFilter'; ofType: null; }; defaultValue: null }, { name: '_publishedAt'; type: { kind: 'INPUT_OBJECT'; name: 'PublishedAtFilter'; ofType: null; }; defaultValue: null }, { name: '_status'; type: { kind: 'INPUT_OBJECT'; name: 'StatusFilter'; ofType: null; }; defaultValue: null }, { name: '_updatedAt'; type: { kind: 'INPUT_OBJECT'; name: 'UpdatedAtFilter'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'INPUT_OBJECT'; name: 'UpdatedAtFilter'; ofType: null; }; defaultValue: null }, { name: '_isValid'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanFilter'; ofType: null; }; defaultValue: null }, { name: 'avatar'; type: { kind: 'INPUT_OBJECT'; name: 'FileFilter'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'StringFilter'; ofType: null; }; defaultValue: null }, { name: 'slug'; type: { kind: 'INPUT_OBJECT'; name: 'SlugFilter'; ofType: null; }; defaultValue: null }, { name: 'OR'; type: { kind: 'LIST'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AuthorModelFilter'; ofType: null; }; }; defaultValue: null }, { name: 'AND'; type: { kind: 'LIST'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'AuthorModelFilter'; ofType: null; }; }; defaultValue: null }]; };
'AuthorModelOrderBy': { name: 'AuthorModelOrderBy'; enumValues: '_createdAt_ASC' | '_createdAt_DESC' | 'createdAt_ASC' | 'createdAt_DESC' | 'id_ASC' | 'id_DESC' | '_firstPublishedAt_ASC' | '_firstPublishedAt_DESC' | '_publicationScheduledAt_ASC' | '_publicationScheduledAt_DESC' | '_unpublishingScheduledAt_ASC' | '_unpublishingScheduledAt_DESC' | '_publishedAt_ASC' | '_publishedAt_DESC' | '_status_ASC' | '_status_DESC' | '_updatedAt_ASC' | '_updatedAt_DESC' | 'updatedAt_ASC' | 'updatedAt_DESC' | '_isValid_ASC' | '_isValid_DESC' | 'name_ASC' | 'name_DESC'; };
Expand Down Expand Up @@ -81,7 +81,7 @@ export type introspection_types = {
'CustomerStoryModelContentFieldBlocksFilter': { kind: 'INPUT_OBJECT'; name: 'CustomerStoryModelContentFieldBlocksFilter'; isOneOf: false; inputFields: [{ name: 'any'; type: { kind: 'INPUT_OBJECT'; name: 'CustomerStoryModelContentFieldBlocksConditions'; ofType: null; }; defaultValue: null }, { name: 'exists'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'containsAny'; type: { kind: 'INPUT_OBJECT'; name: 'CustomerStoryModelContentFieldBlocksPresence'; ofType: null; }; defaultValue: null }]; };
'CustomerStoryModelContentFieldBlocksPresence': { kind: 'INPUT_OBJECT'; name: 'CustomerStoryModelContentFieldBlocksPresence'; isOneOf: false; inputFields: [{ name: 'demo'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'image'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'questionAnswer'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'multipleDemosBlock'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'internalVideo'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'video'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'codesandboxEmbedBlock'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'ctaButton'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'tutorialVideo'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'showcaseProjectBlock'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }, { name: 'table'; type: { kind: 'SCALAR'; name: 'BooleanType'; ofType: null; }; defaultValue: null }]; };
'CustomerStoryModelContentFieldFilter': { kind: 'INPUT_OBJECT'; name: 'CustomerStoryModelContentFieldFilter'; isOneOf: false; inputFields: [{ name: 'value'; type: { kind: 'INPUT_OBJECT'; name: 'StructuredTextFilter'; ofType: null; }; defaultValue: null }, { name: 'blocks'; type: { kind: 'INPUT_OBJECT'; name: 'CustomerStoryModelContentFieldBlocksFilter'; ofType: null; }; defaultValue: null }]; };
'CustomerStoryModelContentLinksField': { kind: 'UNION'; name: 'CustomerStoryModelContentLinksField'; fields: {}; possibleTypes: 'BlogPostRecord' | 'ChangelogEntryRecord' | 'WebinarRecord'; };
'CustomerStoryModelContentLinksField': { kind: 'UNION'; name: 'CustomerStoryModelContentLinksField'; fields: {}; possibleTypes: 'BlogPostRecord' | 'ChangelogEntryRecord'; };
'CustomerStoryModelExcerptField': { kind: 'OBJECT'; name: 'CustomerStoryModelExcerptField'; fields: { 'blocks': { name: 'blocks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'links': { name: 'links'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'value': { name: 'value'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JsonField'; ofType: null; }; } }; }; };
'CustomerStoryModelFieldsReferencingShowcaseProjectModel': { name: 'CustomerStoryModelFieldsReferencingShowcaseProjectModel'; enumValues: 'customerStory_content' | 'customerStory_content__showcaseProjectBlock_showcaseProjects'; };
'CustomerStoryModelFieldsReferencingUserGuidesVideoModel': { name: 'CustomerStoryModelFieldsReferencingUserGuidesVideoModel'; enumValues: 'customerStory_content' | 'customerStory_content__tutorialVideo_tutorials'; };
Expand Down Expand Up @@ -597,6 +597,6 @@ import * as gqlTada from 'gql.tada';

declare module 'gql.tada' {
interface setupSchema {
introspection: introspection;
introspection: introspection
}
}
}
28 changes: 22 additions & 6 deletions src/pages/customer-stories/[slug]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import {
render as toPlainText,
type StructuredTextDocument,
} from 'datocms-structured-text-to-plain-text';
import { BlogPostInline } from '~/components/inlineRecords/BlogPostInline';
import { BlogPostLink } from '~/components/linkToRecords/BlogPostLink';
import { ChangelogEntryInline } from '~/components/inlineRecords/ChangelogEntryInline';
import { ChangelogEntryLink } from '~/components/linkToRecords/ChangelogEntryLink';
import { CodesandboxEmbedBlock } from '~/components/blocks/CodesandboxEmbedBlock';
import { CtaButton } from '~/components/blocks/CtaButton';
import { Demo } from '~/components/blocks/Demo';
Expand All @@ -23,6 +27,7 @@ import { Wrapper } from '~/components/Wrapper';
import { avoidAstroTypeCheckBug, notFoundResponse } from '~/lib/notFoundResponse';
import { executeQuery } from '~/lib/datocms/executeQuery';
import { filterNodes } from '~/lib/datocms/filterNodes';
import { intersperse } from '~/lib/intersperse';
import { isHeading } from 'datocms-structured-text-utils';
import { query } from './_graphql';
import { slugify } from '~/lib/slugify';
Expand Down Expand Up @@ -78,12 +83,15 @@ const tocItems = filterNodes(
<p>
In conversation with
{
post.people.map((person, i) => (
<span>
{person.name} ({person.title})
{i < post.people.length - 2 ? ', ' : i === post.people.length - 2 ? ' and ' : ''}
</span>
))
intersperse(
post.people.map((person) => (
<span>
{person.name} ({person.title})
</span>
)),
', ',
' and ',
)
}
</p>
</div>
Expand All @@ -105,6 +113,14 @@ const tocItems = filterNodes(
CtaButtonRecord: CtaButton,
QuestionAnswerRecord: QuestionAnswer,
})}
inlineRecordComponents={withAllComponents(post.content.links, {
BlogPostRecord: BlogPostInline,
ChangelogEntryRecord: ChangelogEntryInline,
})}
linkToRecordComponents={withAllComponents(post.content.links, {
BlogPostRecord: BlogPostLink,
ChangelogEntryRecord: ChangelogEntryLink,
})}
/>
</Prose>
</div>
Expand Down
22 changes: 9 additions & 13 deletions src/pages/customer-stories/p/[pageIndex]/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Space } from '~/components/Space';
import { Wrapper } from '~/components/Wrapper';
import { buildUrlForCustomerStory } from '~/lib/datocms/gqlUrlBuilder/customerStory';
import { executeQuery } from '~/lib/datocms/executeQuery';
import { intersperse } from '~/lib/intersperse';
import { notFoundResponse, avoidAstroTypeCheckBug } from '~/lib/notFoundResponse';
import { perPage, query } from './_graphql';
import { render as toPlainText } from 'datocms-structured-text-to-plain-text';
Expand Down Expand Up @@ -42,8 +43,8 @@ if (!page || posts.length === 0) {
<Hero>
<Fragment slot="title"><mark>Customer Stories</mark></Fragment>
<Fragment slot="subtitle">
Conversations with customers working on some really cool use cases with DatoCMS</Fragment
>
Conversations with customers working on some really cool use cases with DatoCMS
</Fragment>
</Hero>

<Wrapper>
Expand Down Expand Up @@ -75,17 +76,12 @@ if (!page || posts.length === 0) {
</div>

<p>
With{' '}
{post.people.map((person, i) => (
<span>
{person.name}
{i < post.people.length - 2
? ', '
: i === post.people.length - 2
? ' and '
: ''}
</span>
))}
With
{intersperse(
post.people.map((person) => <span>{person.name}</span>),
', ',
' and ',
)}
</p>
</div>
</div>
Expand Down

0 comments on commit 34e2fbb

Please sign in to comment.